Adaptive bayesian online outage detection method based on meta-learning tcn driven

CN122986709APending Publication Date: 2026-10-27HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611475536.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,在实际运行中,一旦发生线路断线或上级停电,由于分布式光伏的反送电、孤岛效应或环网运行下的电气耦合,用户所处的智能电表处电压并不会瞬间降为0,而是会呈现出复杂的异常波动与缓慢漂移

Benefits of technology

[0014]第一,本发明提出了一种将深度元学习特征提取与贝叶斯在线检测相结合的变点识别方法,能够在含分布式光伏或环网运行的低压配电网中的电表端实现自适应的停电检测与预警。通过TCN网络提取稳态支撑集特征并映射至NIG分布的四个超参数,替代了传统变点检测模型中固化的人工经验参数设定方法。此方法赋予了算法极强的环境自适应能力,能够动态更新先验知识,有效屏蔽节点差异和冗余运行噪声的干扰,特别适合分布式光伏接入、负荷波动频繁、环网运行的复杂低压配电网环境。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986709A_ABST
    Figure CN122986709A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on meta-learning TCN drive's adaptive bayesian online outage detection method, including meta-learning TCN model offline training stage and bayesian online outage detection stage;Bayesian online outage detection stage includes the following steps: step 1, real-time acquisition of the voltage sequence of distribution network user side, based on sliding window standard deviation extraction fluctuation characteristics;Step 2, using CUSUM algorithm to eliminate abnormal interference, automatically intercept steady-state support set;Step 3, inputting steady-state support set into pre-training meta-learning TCN model, inferring the adaptive prior parameter of BOCD algorithm;Step 4, fusion adaptive prior parameter and real-time feature, based on BOCD model output final outage change point;Step 5, receive power signal, and return step 1 to realize continuous online detection.This method is suitable for the event detection of the voltage of electric meter not returning to zero after wire breakage and appearing continuous abnormal fluctuation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart grid and distribution network operation status monitoring technology, and relates to an adaptive Bayesian online power outage detection method based on meta-learning TCN-driven approach. The power outage event described in this invention refers to an event where the upstream power supply fails, the target branch line is disconnected, or the power supply topology is interrupted, but the user end still maintains a non-zero voltage due to local distributed power sources, alternative feeders, electrical coupling, or residual power supply. Background Technology

[0002] With the rapid construction of new power systems, the large-scale integration of distributed photovoltaic power, and the increasing prevalence of ring network operation modes in distribution networks, the accurate and rapid detection of power outages and voltage anomalies at smart meters plays a crucial role in distribution network fault assessment, emergency repair command, and power supply reliability evaluation. In these applications, overcoming voltage disturbances under complex power distribution structures and effectively identifying genuine power outage points and transient voltage anomalies from the massive and continuous measurement data of smart meters has become a core technical challenge for improving the efficiency of lean operation and maintenance and fault response in distribution networks.

[0003] Traditional power outage detection methods for smart meters have several shortcomings when dealing with complex power grid conditions involving a high proportion of distributed power sources and ring network operation. Traditional power outage identification typically relies on simple voltage threshold judgments or terminal hardware power failure reporting mechanisms. However, in actual operation, once a line break or upstream power outage occurs, due to backfeeding from distributed photovoltaic systems, islanding effects, or electrical coupling under ring network operation, the voltage at the user's smart meter does not instantly drop to zero, but rather exhibits complex abnormal fluctuations and slow drifts. This makes traditional power outage detection methods highly prone to serious false alarms. Furthermore, traditional time-series-based change-point detection algorithms often heavily rely on prior parameters set by human experience, lacking the ability to adapt to different noise environments and complex voltage fluctuation patterns. They are difficult to dynamically adjust in the face of localized minor fluctuations and transient interference, resulting in a high false alarm rate and poor robustness.

[0004] In actual transformer substation operation environments, the voltage fluctuations during normal steady-state voltage and power outages often exhibit high nonlinearity and time-varying characteristics. Accurately extracting the fluctuation features reflecting the intensity of local voltage changes and inferring prior parameters for change point detection through an adaptive mechanism to shield against redundant transient interference signals is a significant challenge in current power outage detection technology. Therefore, this study aims to develop a robust and accurate online power outage detection method that deeply integrates the deep temporal feature extraction and parameter inference capabilities of Meta-Learning Temporal Convolutional Networks (TCNs) with the dynamic run-length update mechanism of Bayesian Online Change Point Detection (BOCD). This allows for adaptive initialization and dynamic updating of prior parameters, providing an effective solution to the pain points of misjudgment of power outages and identification of abnormal fluctuations in smart meters within complex distribution network environments. Summary of the Invention

[0005] The purpose of this invention is to propose an adaptive Bayesian online power outage detection method based on meta-learning TCN, which can efficiently and accurately implement online power outage detection.

[0006] An adaptive Bayesian online power outage detection method based on meta-learning TCN is characterized by including an offline training phase of the meta-learning TCN model and an online Bayesian power outage detection phase. In the offline training phase of the meta-learning TCN model, the meta-learning TCN model is constructed and trained based on offline data to obtain a pre-trained meta-learning TCN model. The Bayesian online power outage detection phase includes the following steps: Step 1: Collect voltage sequences on the user side of the distribution network in real time, and extract fluctuation characteristics based on the sliding window standard deviation; Real-time acquisition of user-side voltage data; calculation of the sliding standard deviation of the voltage sequence within a preset time window; log smoothing; extraction of the fluctuation feature sequence characterizing the intensity of local voltage changes; and use as the algorithm input for subsequent change point detection. Step 2: Use the CUSUM algorithm to remove abnormal interference and automatically extract the steady-state support set; The discrimination criterion is constructed based on the median and absolute deviation. The cumulative deviation in both positive and negative directions is calculated using the cumulative sum (CUSUM) algorithm on the historical feature sequence. Abnormal drift intervals that exceed the set threshold or have excessive deviation are eliminated. If the sequence does not exceed the test threshold and the deviation meets the constraints, the feature sequence is truncated as the steady-state support set for the meta-learning TCN model. Step 3: Input the steady-state support set into the pre-trained meta-learning TCN model to infer the adaptive prior parameters of the BOCD algorithm; The extracted steady-state support set is input into the pre-trained meta-learning TCN model. After causal convolution and feature extraction, the network outputs four statistical hyperparameters used to construct the NIG distribution, replacing the traditional manual experience setting, and realizing the adaptive initialization of the prior parameters of the BOCD model. The purpose of this invention is to train a TCN to learn normal fluctuation patterns offline using normal voltage data, and to infer the adaptive prior parameters of the BOCD algorithm online using the TCN. The power outage state is identified by detecting the change points in the voltage sequence distribution through BOCD. Therefore, the training set does not need to include power outage samples. Step 4: Integrate adaptive prior parameters and real-time features, and output the final power outage change point based on the BOCD model; dynamically update the run length based on the BOCD model, filter instantaneous interference, and output the final power outage change point. Step 3 is used to extract real-time fluctuation features. These features are then input into the initialized BOCD model to calculate the predicted probabilities and dynamically update the run length posterior distribution. The run length posterior distribution is used to quantify the posterior probability of each possible run length at the current moment and the probability of a new change point. Candidate change points are identified by sudden increases in change point probabilities and the collapse of the maximum posterior run or the expected run, thereby filtering out transient interference. When the number of normal operation steps reaches a preset period and there are no anomalies within the historical window, the most recent steady-state features are automatically extracted and re-input into the TCN to dynamically update the prior parameters of BOCD. The probability mutation of the change point is combined with the run collapse feature to determine whether there is a candidate change point; the run collapse feature is used to characterize that the maximum a posteriori run or the expected run is significantly shortened within the verification window, and together with the probability mutation of the change point, it confirms that the run has been reset, so as to reduce false triggering caused by instantaneous probability fluctuations. When the probability of a change point reaches the absolute probability threshold, or the probability of a change point reaches the mutation low threshold and its relative ratio reaches the ratio threshold, and the recent change point probability quality is satisfied within the verification window, the probability quality is the sum of the posterior probabilities within the short run length interval corresponding to the recent change point in the run length posterior distribution output by the BOCD model. When the set threshold is exceeded or the collapse ratio of the maximum posterior run or the expected run is lower than the corresponding threshold, the corresponding moment is confirmed as a candidate point. A confirmation window is constructed after the candidate point. If the median drift of the features within the window, the proportion of overall and tail anomalies all exceed the benchmark threshold, the output is a suspected power outage change point that meets the persistence criterion; otherwise, it is determined as an instantaneous power outage or short-term abnormal fluctuation, and the candidate state is cleared and BOCD online updates continue. Step 5: Receive the power-on signal and return to Step 1 to achieve continuous online detection; After confirming the power outage, the system pauses detection and listens for power restoration signals. When a power restoration signal is received manually or by the system, the system enters the recovery period data collection state. When the steady-state support set after power restoration is captured using the CUSUM algorithm, the TCN prior parameter update mechanism is triggered and the BOCD model is reset to proceed to the next stage of online detection.

[0007] The steps to construct and train a pre-trained meta-learning TCN model based on offline data are as follows: Step a: Obtain the node voltage sequence during normal operation in history, select the voltage data of single-phase user nodes and perform data filtering; calculate the standard deviation of the voltage sequence using a sliding window, and extract the voltage fluctuation features after logarithmic smoothing; divide each fluctuation feature sequence along the time axis, extract the first fixed-length sequence as the support set, and extract the immediately following sequence as the query set. The support set and query set corresponding to each meter node together constitute an independent meta-learning task sequence pair. Step b: Construction and training of the meta-learning TCN model; A TCN (Temporal Convolutional Network) model with causal pruning and dilated convolution is constructed as a meta-learning feature extractor, and four parameter mapping branches are connected in parallel at its output. The support set data constructed in step a is input into the TCN model, and the four prior parameters of the Normal-Inverse-Gamma (NIG) distribution are predicted through four parallel parameter mapping branches: the prior mean, the prior mean, and the support set data constructed in step a. Prior confidence coefficient Prior shape parameters and prior scale parameters And use bounded activation functions to constrain the parameters to a reasonable mathematical range; During the training phase, based on the Bayesian conjugate parameter update rule, the predicted prior parameters are combined with the corresponding query set data to calculate the marginal likelihood distribution of the query set. The loss function is minimized by the negative log-marginal likelihood (NLL), and backpropagation is performed for iterative optimization until convergence. The resulting meta-learning TCN model is the pre-trained meta-learning TCN model. In step b, a TCN model is constructed as a feature extraction module for meta-learning. This network consists of multiple stacked temporal blocks. The support set sequence constructed in step a Input the TCN model for feature extraction; for each time step in the input sequence The elements are subjected to dilated convolution, and the calculation formula is: ; in, Represents a one-dimensional convolution kernel. This represents the feature sequence of the input support set. This indicates a dilated convolution operation. Represents the convolution kernel In the The weighting coefficient at each position This is the kernel position index. This indicates the kernel length, which is the number of weight coefficients contained in the kernel. It is a voiding factor, generally ; To ensure the causality of time series processing and prevent future information from leaking to the present moment, a causal pruning mechanism (Chomp1d) is introduced after each dilated convolution operation to truncate the excess output from the right side and remove redundant padding at the end of the sequence. Subsequently, after group normalization (GroupNorm), GELU activation function and Dropout regularization, combined with residual connections, the features of the current time series block are output. After processing through multiple layers of causal dilated convolutions, the output of the network at the last time step is extracted as the feature vector for this meta-learning task. The calculation formula is: ; in, This is the feature vector of the last layer of the network. and These are the weight matrix and bias vector of the fully connected layer, respectively; GELU is the activation function, and Dropout is the regularization process. Four independent linear fully connected branches are connected in parallel at the output of the TCN model to process the feature vectors. The four prior parameters mapped to a Normal-Inverse-Gamma (NIG) distribution are: the prior mean. Prior confidence coefficient Prior shape parameters and prior scale parameters To satisfy the strict mathematical definition and physical constraints of the NIG distribution parameters, nonlinear activation constraints are applied to the outputs of the four branches respectively: For the mean The Softplus activation function is used to constrain the number to always be positive. for A bounded activation mechanism based on the Sigmoid function is used to scale and constrain the predicted values ​​to a preset reasonable physical range. The calculation formula is as follows: ; in, Represents the prior parameters to be constrained. This is the original output of the fully connected branch. For the Sigmoid function, and These are the upper and lower bound thresholds for the corresponding parameters; During the training phase, the properties of Bayesian conjugate priors are utilized to incorporate the prior parameters predicted by TCN. With the corresponding query set sequence Combine and calculate the posterior parameters; let the length of the query set sequence be... First, calculate the sample mean of the query set data. With the centralized sum of squares The calculation formula is: ; in, For query set The first in One data point; Calculate the posterior parameters according to the conjugate parameter rule of the NIG distribution. The calculation formula is: ; in, For query set The marginal likelihood distribution of the query set is calculated based on the average value of all data points and the parameters before and after the update. A loss function is constructed with the objective function of minimizing the mean negative log-marginal likelihood (NLL). The formulas for calculating the log-marginal likelihood and mean negative log-marginal likelihood losses are as follows: ; in, For gamma function, For query set Given parameters The log-marginal likelihood is given below, where Loss represents the average negative log-likelihood loss. This represents the average of multiple query sets within a training batch. During training, the gradient is calculated based on the loss function mentioned above, and the weights of the temporal residual blocks and the linear mapping branches in the TCN model are backpropagated and iteratively optimized using an adaptive optimizer. The early stopping mechanism is triggered when the loss of the model on the validation set no longer decreases for 20 consecutive epochs, thus completing the training and deriving the meta-learning TCN model.

[0008] In step 1, the current sampling time of the system is set to... Real-time acquisition of voltage data from the user side; let the continuously sampled voltage time series be... ,in Indicates the first The effective value of voltage at each sampling time; Set the maximum number of samples for the sliding window to And the minimum number of samples required for calculation is At any time The effective local voltage subsequence extracted by the system Actual window length It will be adjusted according to the current time. Extract the local voltage subsequence within this window. ; Based on the extracted local voltage subsequence Determine the current effective window length Does it meet the set minimum sample size? : (1) When This directly sets the local sample standard deviation at the current moment. ; (2) When ,use Calculate the average voltage With sample variance ; use After taking the square root of the above variance, logarithmic smoothing is performed, and the variance at time step is extracted. log-standard deviation fluctuation characteristics Online traversal of the entire sequence The corresponding fluctuation characteristic sequence is obtained. This information will be used as a state feature input into subsequent steps 2 and 3. It should be noted that this method processes streaming time series data; the steps described above, such as sliding window truncation, standard deviation calculation, and logarithmic smoothing, all occur at sampling times. The process is being carried out in a step-by-step, online manner.

[0009] In step 2, the length of the observation history window is set to... The length of the truncation from the end of the historical fluctuation characteristic sequence is... The subsequence as candidate sequence If the length of the currently available feature sequence is less than If invalid values ​​exist, it is determined that there is no stable support set at present, and the process continues to wait for the rolling acquisition of streaming time data until the length of the feature sequence accumulated by the streaming rolling data reaches the length of the observation history window, and all feature values ​​in the extracted candidate sequence are valid values. To avoid potential outliers in the candidate sequences from biasing the decision criteria, the center position and absolute deviation of the sequence are calculated, and a minimum scale constraint is set to prevent overflow of division by zero due to the complete constancy of the sequence, thus obtaining the center position of the sequence. and standard deviation The calculation formula is: ; in, This is a function used to extract the median of a sequence. The coefficient 1.4826 is a correction factor that makes the absolute median error consistent with the standard deviation under an asymptotically normal distribution. The minimum scale threshold is set, typically 0.02; Initialize positive cumulative deviation and negative cumulative deviation Based on chronological order, traverse the candidate sequences one by one. Feature points in Perform the following calculation logic to update the bidirectional cumulative sum: (1) Calculate the standardized deviation of the current feature point : ; (2) Based on the set tolerance offset Update the positive cumulative deviation respectively and negative cumulative deviation : ; (3) In each traversal step The inspection will be carried out at the following location: If or If a significant mean shift or abnormal interference is found in the current candidate sequence, the test is interrupted and the candidate sequence is discarded. The set cumulative and control limit thresholds; If candidate sequence Having passed the cumulative deviation test described above, we further constrain the global fluctuation range by calculating the range of the candidate sequence and determining whether it meets the following conditions: ; in, The maximum range coefficient is typically set to 8. Indicates product operation; If the above constraints are met, then the candidate sequence is determined. When the system is in a stable operating state, this segment of feature sequence is extracted as a steady-state support set and used as subsequent input into the pre-trained meta-learning TCN model.

[0010] In step 3, the steady-state support set extracted in step 2 is fed into the meta-learning TCN network constructed in step 2, and the prior parameters of the BOCD algorithm are output. Set output parameter constraint intervals to ensure the stability of the Student-t distribution: for the mean To ensure that it is always a positive number; for the confidence parameter Set the limit as For shape parameters Set the limit as For scale parameters Set the limit as ; Through the above steps, the pre-trained TCN model realizes the statistical prior parameters of the BOCD algorithm from the steady-state voltage fluctuation sequence. The nonlinear mapping provides adaptive model initialization support for subsequent variable point probability inference.

[0011] In step 4, the real-time collected fluctuation features are input into the Bayesian online change point detection model initialized using the adaptive prior parameters described in step 3. Let the current sampling time be The posterior probability of the run length at the previous sampling time is ,in This represents the run length at the previous sampling time, with a value of [value missing]. For each branch with an effective run length, maintain a set of NIG distribution parameters and calculate the current fluctuation characteristics. The Student-t predicted density for each run length branch is calculated using the following formula: ; in, This represents the fluctuation characteristics at the current sampling moment; The current fluctuation characteristics are at a run length of The corresponding Student-t prediction density under the branch; represents the degrees of freedom of the Student-t distribution; The length of the journey is The positional parameters corresponding to the branches; The lengths of the journeys are respectively The branches correspond to the prior confidence parameters, shape parameters, and scale parameters. The Student-t mechanism is a heavy-tailed distribution of the normal distribution, meaning that when the data variance is low or the sample size is small, it allows for a larger range of extreme fluctuations, preventing the model from misinterpreting grid noise as sudden power outages. When it is determined that a new change point exists at the current sampling time, i.e., the current run length is reset to 0, the Student-t prediction density corresponding to the initial NIG prior parameters is used, combined with the preset risk rate. Given the posterior probabilities of all runs at the previous sampling time, calculate the unnormalized weights of the zero-run branch using the following formula: ; in, The unnormalized weights of the variable branch whose run length is reset to 0 at the current sampling time; Initial normal-inverse gamma prior parameters , , and The calculated Student-t predicted density; The run length at the previous sampling time is The normalized posterior probability, The run length at the previous sampling time is The normalized posterior probability; initialized to at the start of detection. ;when hour, The normalized posterior probability of the run length calculated according to formula (15) at the previous sampling time; When it is determined that no new change point has occurred at the current sampling time, the run length is increased from that at the previous sampling time. Growth to the current sampling time For each run-length growth branch, the unnormalized weight of the run-length growth branch is calculated based on the corresponding Student-t prediction density, the posterior probability of the run at the previous sampling time, and the probability that the change point has not occurred. Then, the zero-run branch and all run-length growth branches are uniformly normalized to obtain the posterior probability of the run length at the current sampling time. The calculation formula is as follows: ; in, The run length at the current sampling time is determined by... growth to The unnormalized weights corresponding to the branches; The current fluctuation characteristic is based on the previous run length of... The corresponding Student-t prediction density under the branch; The normalization coefficients for all valid run branches at the current sampling time; This is the normalized run length at the current sampling time; The normalized posterior probability of the run length at the current sampling time; This represents the zero-run posterior probability at the current sampling time. After updating the posterior probability of the run length, for each run growth branch, based on the current fluctuation characteristics... Update the NIG parameters corresponding to this branch; for branches with run lengths reset to 0, reset them as the initial prior parameters for meta-learning TCN inference, calculated using the following formula: ; in, , , and The length of the trip increased to The posterior mean parameter, posterior confidence parameter, posterior shape parameter, and posterior scale parameter corresponding to the branch; , , and The run lengths at the previous sampling time are respectively: The NIG parameters corresponding to the branch; , , and These are the initial prior mean parameter, initial prior confidence parameter, initial prior shape parameter, and initial prior scale parameter inferred by the meta-learning TCN based on the steady-state support set, respectively; branches with a run length of 0 do not inherit the posterior parameters of the previous run branch, but instead re-set them using the initial prior parameters inferred by the meta-learning TCN; During online detection, a periodic parameter update mechanism is set up; when the number of consecutive runs of the BOCD algorithm and the number of normal runs since the last update are both greater than the preset period... When the historical window indicates a state free of abnormal interference, the prior parameters are updated. The system automatically extracts a certain length of steady-state feature data prior to the current moment, re-inputs it into the pre-trained TCN model described in step 3, and infers the prior parameters. This resets the prior parameters of the BOCD model.

[0012] Constructing a candidate change point mechanism for joint probabilistic mutation and run-collapse characteristics: Definition The probability of the change point at time t is The relative probability ratio is An alarm will be triggered when any of the following conditions are met: Condition 1: Absolute probability of a change point Greater than or equal to the absolute probability threshold ,Right now ; Condition 2: Absolute probability of a change point Greater than or equal to the low threshold of mutation and the relative probability ratio Greater than or equal to the ratio threshold ,Right now and ; Upon triggering, the run evolution state is continuously evaluated within a set verification window. When the recent change point probability quality exceeds a set threshold, and the maximum a posteriori run or expected run undergoes significant collapse (i.e., the ratio of the current run length to the previous time step is lower than the corresponding collapse ratio threshold), it is identified as a candidate power outage change point. The run length... This represents the number of sampling points that have not changed since the most recent change point. BOCD calculates the branch where the run is reset to 0 using formula (14), and uses formula (15) to convert the run that has not changed from... Recursion to Post-normalization yields the posterior distribution of run lengths; relevant thresholds include absolute change point probability thresholds. Low threshold for mutation Probability relative ratio threshold The recent change point probability quality threshold is 0.5, and the maximum posterior run collapse ratio threshold is 0.1. After obtaining candidate power outage points, steady-state estimation is performed based on the absolute median difference, and a backward construction is performed with a length of [missing information]. Feature confirmation window. Before extracting candidate points. Length features as a reference sequence Calculate the dynamic baseline threshold for this stage. The calculation formula is: ; in, Represents a sequence The median of Robust standard deviation, used to measure the benchmark series The degree of data fluctuation under normal conditions The confidence coefficient is... This is the rate-of-change limiting factor. The minimum characteristic change constraint coefficient; make The sequence within the window is The tail feature subsequence is The following criteria must be met simultaneously: (1) Horizontal drift criterion: the median of ; (2) Overall residence criteria: Medium to large outlier percentage ,in This is the overall abnormality ratio requirement coefficient; (3) Tail continuation criterion: the median of And the proportion of tail anomalies in This is the required coefficient for the proportion of tail anomalies; If all three criteria are met, the candidate point is determined to be a suspected power outage change point that meets the persistence criterion, and the power outage start time, voltage drop amplitude, and posterior probability of the change point are recorded. If any condition is not met, the current fluctuation is determined to be an instantaneous power outage or a short-term abnormal fluctuation, and the BOCD detection algorithm reverts to the stable state before the candidate point and continues to run.

[0013] In step 5, after the final power outage point is output and the power outage event is confirmed in step 4, the system enters a power outage suspension state. In this state, the system pauses BOCD posterior probability updates to avoid prolonged abnormal zero-value data contaminating the model state and monitors externally input power restoration signals in real time. When a power restoration signal trigger flag is detected, the system exits the power outage suspension state, records the current time step as the recovery starting point, and enters the recovery period data collection state. After acquiring each new sampling point, the CUSUM algorithm described in step 4 is called to evaluate the collected feature sequences. After acquiring the post-power restoration steady-state support set, the system inputs it into the pre-trained meta-learning TCN network described in step 5 to infer the NIG distribution prior hyperparameters adapted to the current post-power restoration feature sequences. After reinitializing BOCD and resetting the BOCD model, the system exits the recovery data collection state, resets all counters, and switches back to normal real-time monitoring state. Beneficial effects

[0014] First, this invention proposes a change point identification method that combines deep meta-learning feature extraction with Bayesian online detection, enabling adaptive power outage detection and early warning at the meter terminals in low-voltage distribution networks containing distributed photovoltaic (PV) or ring network operation. By extracting steady-state support set features through a TCN network and mapping them to four hyperparameters of the NIG distribution, this method replaces the fixed, manually experienced parameter setting method in traditional change point detection models. This approach endows the algorithm with strong environmental adaptability, dynamically updating prior knowledge and effectively shielding against interference from node differences and redundant operational noise. It is particularly suitable for complex low-voltage distribution network environments with distributed PV integration, frequent load fluctuations, and ring network operation.

[0015] Secondly, this invention constructs a CUSUM steady-state feature dynamic extraction and multi-level change point confirmation mechanism, which can identify real-time abnormal fluctuation characteristics and effectively reduce the false alarm rate and missed alarm rate of single-phase node power outage identification. By using the CUSUM algorithm combined with absolute deviation to eliminate instantaneous drift intervals and extract a pure support set, and after the BOCD model triggers candidate change points, a persistence criterion is introduced for steady-state confirmation. This dual filtering mechanism enables the algorithm to accurately distinguish between short-term fluctuations caused by load switching, instantaneous voltage dips, and actual line disconnection faults, greatly reducing the false alarm rate of power outages and ensuring accurate reporting of the real power outage status in smart grid terminals with distributed photovoltaic access and ring network operation. Attached Figure Description

[0016] Figure 1 This is a schematic diagram illustrating the implementation process of the present invention.

[0017] Figure 2 This is a schematic diagram of the meta-learning temporal network model architecture of the present invention.

[0018] Figure 3 This is a diagram of the training architecture of the meta-learning temporal network model of the present invention.

[0019] Figure 4 The diagram shows the training effect of the meta-learning temporal network model of the present invention, where (a) is the convergence curve of the loss and error of the model on the training set, and (b) is the convergence curve of the loss and error of the model on the validation set.

[0020] Figure 5 This is a flowchart of the adaptive Bayesian online power outage detection method of the present invention.

[0021] Figure 6 This is a schematic diagram of a single-user power outage detection method using the adaptive Bayesian online power outage detection method of the present invention.

[0022] Figure 7 This is a comparison chart showing the performance of the traditional power outage detection method (LastGasp), CUSUM, fixed prior BOCD, and the complete model of the present invention in power outage identification in the embodiments of the present invention. Detailed Implementation

[0023] The following will combine Figures 1-7 The technical solution of the present invention will be further described in detail below.

[0024] Example 1

[0025] This invention addresses the challenge of detecting power outage events at smart meters in complex power distribution environments with high proportions of distributed photovoltaic power and ring network operation. Traditional zero-voltage threshold or power outage reporting methods are prone to high false negative rates when faced with complex voltage anomalies and environmental noise interference after a line break, which do not return to zero instantaneously. By introducing sliding window logarithmic standard deviation feature extraction and meta-learning TCN inference technology, this invention effectively extracts deep temporal patterns from normal operating voltages and automatically derives the statistical hyperparameters of the normal-inverse gamma (NIG) distribution. This replaces the limitations of manual experience-based settings in traditional change point detection, improving the sensitivity and adaptability of fitting complex fluctuations. By combining the dynamic run-length update mechanism of Bayesian online change point detection (BOCD) with multi-level verification mechanisms such as CUSUM steady-state truncation, this invention achieves dynamic updating of adaptive prior parameters and multiple verifications of candidate change points. This effectively shields against interference from instantaneous power outages and load switching, significantly improving the overall accuracy and robustness of the online power outage identification model. It is widely applicable to fields such as lean operation and maintenance of smart distribution networks, proactive fault repair, power supply reliability assessment, and event monitoring of distribution terminals. Furthermore, an adaptive Bayesian online power outage detection method based on meta-learning TCN is proposed, effectively addressing the problems in existing technologies.

[0026] An adaptive Bayesian online power outage detection method driven by meta-learning TCN, such as... Figure 1As shown, firstly, historical voltage fluctuation features are extracted to construct a meta-learning task sequence. A TCN model with causal dilated convolution is designed to predict four prior hyperparameters of the normal-inverse gamma (NIG) distribution. The model is then optimized by minimizing the negative log-marginal likelihood, deriving the meta-learning TCN model. Secondly, voltage features are extracted in real-time. The steady-state interval is dynamically truncated as a support set using the CUSUM algorithm and robust statistics. This support set is input into the pre-trained TCN model to automatically generate NIG hyperparameters, replacing manual experience and enabling adaptive initialization and periodic dynamic updates of the BOCD model. Finally, the BOCD is used to update the run posterior, and probabilistic mutations and run collapse trigger candidate change points are fused. Real power outages are confirmed through joint discrimination using multi-dimensional feature windows. After power restoration, a new steady-state sequence is automatically truncated to trigger a reset mechanism, achieving online continuous power outage detection.

[0027] The specific implementation steps of the adaptive Bayesian online power outage detection method driven by meta-learning TCN are as follows: Offline training phase: Step a, obtain the node voltage sequence during normal operation in history, select the voltage data of single-phase user nodes and perform data filtering; calculate the standard deviation of the voltage sequence using a sliding window, and extract the voltage fluctuation features after logarithmic smoothing; divide each fluctuation feature sequence along the time axis, extract the first fixed-length sequence as the support set, and extract the immediately following sequence as the query set. The support set and query set corresponding to each node together constitute an independent meta-learning task sequence pair. Step b: Construct a Temporal Convolutional Network (TCN) with causal pruning and dilated convolution as a meta-learning feature extractor, and connect four parameter mapping branches in parallel at its output. Input the support set data constructed in step 1 into the TCN model to predict four prior parameters of the Normal-Inverse-Gamma (NIG) distribution, and use bounded activation functions to constrain the parameters to a reasonable mathematical range. During the training phase, based on the Bayesian conjugate parameter update rule, combine the predicted prior parameters with the corresponding query set data to calculate the marginal likelihood distribution of the query set. Use the minimum negative log marginal likelihood (NLL) as the loss function, perform backpropagation iterative optimization until convergence, and finally derive the meta-learning TCN model. Bayesian online power outage detection stage: Step 1, real-time acquisition of user-side voltage data, calculation of the sliding standard deviation of the voltage sequence within a preset time window, and log smoothing to extract the fluctuation feature sequence characterizing the intensity of local voltage changes, which serves as the algorithm input for subsequent change point detection; Step 2: Construct a discrimination criterion based on the median and absolute deviation. Use the cumulative sum (CUSUM) algorithm to calculate the cumulative deviation in both positive and negative directions for the historical feature sequence, and remove abnormal drift intervals that exceed the set threshold or have excessive deviation. If the sequence does not exceed the test threshold and the deviation meets the constraints, then the feature sequence segment is truncated as the steady-state support set for the meta-learning TCN model. Step 3: Input the extracted steady-state support set into the pre-trained TCN model. After causal convolution and feature extraction, the network outputs four statistical hyperparameters used to construct the NIG distribution, replacing the traditional manual experience setting, and realizing the adaptive initialization of the prior parameters of the BOCD model. Step 4: Input the real-time fluctuation features into the initialized BOCD model, calculate the predicted probability and dynamically update the posterior distribution of the run length; when the number of normal operation steps reaches the preset period and there are no anomalies in the historical window, automatically extract the most recent steady-state features and re-input them into the TCN to dynamically update the prior parameters of BOCD; combine the change point probability mutation and run collapse features for fusion judgment to trigger candidate change points; construct a confirmation window after the candidate point. If the median drift of the features in the window and the proportion of anomalies in the whole and tail both exceed the benchmark threshold, output a suspected power outage change point that meets the persistence criterion; otherwise, determine it as an instantaneous power outage or short-term abnormal fluctuation, clear the candidate state and continue to update BOCD online. Step 5: After confirming the power outage, the system pauses detection and listens for power restoration signals. When a power restoration signal is received manually or by the system, the system enters the recovery period data collection state. When the steady-state support set after power restoration is captured using the CUSUM algorithm, the TCN prior parameter update mechanism is triggered and the BOCD model is reset to proceed with the next stage of online detection.

[0028] In step a, the data collected by the smart meters on the user side of the low-voltage distribution area is the node voltage sequence under historical normal operating conditions. The sampling interval is 1 minute, that is, a total of 1440 sampling points per day, and the voltage data belonging to single-phase user nodes are filtered out. The acquired initial voltage data undergoes anomaly screening and cleaning. The voltage sequences of each node are traversed; if missing values, invalid values, or distorted data exceeding normal physical and electrical limits are detected, the entire voltage sequence corresponding to that node is directly discarded. After screening, valid and continuous single-phase user node voltage sequences are retained, denoted as... ,in The total length of the sequence is given in this embodiment. .

[0029] To capture voltage fluctuations over short periods while maintaining a constant time series length, a sliding window is used to analyze the voltage series. Extract local fluctuation features. Let the length of the sliding window be... In this embodiment, For time steps Calculate its actual window starting position The actual number of samples used in the calculation was First, calculate the average voltage within this window. With local sample variance The calculation formula is: (Formula 1); To smooth out numerical disturbances caused by sudden spikes and compress the extreme value range, the variance is squared and then logarithmically smoothed to extract the values ​​at time step. log-standard deviation fluctuation characteristics The calculation formula is: (Formula 2); Traverse the entire sequence The corresponding fluctuation characteristic sequence is obtained. Each smoothed fluctuation feature sequence Divide the model into segments of fixed length along the time axis. Let the required support set length for the model be... The query set length is (must meet) In this example, , Extracting the first segment of the feature sequence A series of consecutive time steps form a support set, from which the next set is extracted. The query set consists of several consecutive time steps, represented as follows: , Support set generated by a single user node With query set Together they form an independent meta-learning task sequence pair All filtered user nodes are processed in this way to construct a complete meta-learning task set.

[0030] In step b, a temporal convolutional network (TCN) is constructed as a feature extraction module for meta-learning. This network consists of multiple stacked temporal residual blocks. The support set sequence constructed in step a Input this TCN model for feature extraction. For each time step in the input sequence... The elements are subjected to dilated convolution, and the calculation formula is: (Formula 3); in, This indicates a dilated convolution operation. For size The convolution kernel weights, In this embodiment, the void factor is used. .

[0031] To ensure the causality of time series processing and prevent future information from leaking to the present moment, a causal pruning mechanism (Chomp1d) is introduced after each dilated convolution operation to truncate the excess output from the right side and remove redundant padding at the end of the sequence. Subsequently, after group normalization, GELU activation function and Dropout regularization, combined with residual connections, the features of the current time series block are output.

[0032] After processing through multiple layers of causal dilated convolutions, the output of the network at the last time step is extracted as the feature vector for this meta-learning task. The calculation formula is: (Formula 4); in, This is the feature vector of the last layer of the network. and These are the weight matrix and bias vector of the fully connected layer, respectively. They are randomly initialized using the Kaiming uniform distribution, and in the subsequent model training phase, they are iteratively updated to obtain the optimal weights based on the error gradient of the loss function through the backpropagation algorithm.

[0033] Four independent linear fully connected branches are connected in parallel at the output of the TCN model to process the feature vectors. The four prior parameters mapped to a Normal-Inverse-Gamma (NIG) distribution are: the prior mean. Prior confidence coefficient Prior shape parameters and prior scale parameters To satisfy the strict mathematical definition and physical constraints of the NIG distribution parameters, nonlinear activation constraints are applied to the outputs of the four branches respectively: For the mean The Softplus activation function is used to constrain the number to always be positive. for A bounded activation mechanism based on the Sigmoid function is used to scale and constrain the predicted values ​​to a preset reasonable physical range. The calculation formula is as follows: (Formula 5); in, Represents the prior parameters to be constrained. This is the original output of the fully connected branch. For the Sigmoid function, and These are the upper and lower bound thresholds for the corresponding parameters.

[0034] Model structure as follows Figure 2 As shown, the meta-learning TCN model in this embodiment is composed of multiple layers of causal dilated convolutional blocks stacked together. To clarify the training process of the above meta-learning TCN model, this embodiment sets a specific network architecture and tensor dimension transformation. The specific hyperparameter configuration and dimension mapping are shown in Table 1, where B=64.

[0035] Table 1 shows the mapping between the network structure and tensor dimensions of the proposed meta-learning TCN model. .

[0036] During the training phase, the properties of Bayesian conjugate priors are utilized to incorporate the prior parameters predicted by TCN. With the corresponding query set sequence Combine these steps to calculate the posterior parameters. Let the length of the query set sequence be... In this embodiment, First, calculate the sample mean of the query set data. With the centralized sum of squares The calculation formula is: (Formula 6); in, For query set The first in Data points.

[0037] Calculate the posterior parameters according to the conjugate parameter rule of the NIG distribution. The calculation formula is: (Formula 7).

[0038] Based on the parameters before and after the update, the marginal likelihood distribution of the query set is calculated. A loss function is constructed with the objective function of minimizing the mean negative log marginal likelihood (NLL). To ensure the comparability of the loss across query sets of different lengths, the loss is calculated according to the sequence length. The average is calculated using the following formula: (Formula 8) in, This is a gamma function.

[0039] To ensure the convergence and generalization ability of the model in practical applications, this embodiment adopts the training hyperparameter configuration shown in Table 2.

[0040] Table 2 Model Training Hyperparameter Configuration Table .

[0041] Model training architecture such as Figure 3 As shown in Table 3, the parameters of the meta-learning TCN model are iteratively updated by setting an early stopping mechanism and a learning rate decay strategy. The loss value and MAE index during training, as well as the loss value and MAE index on the validation set, are shown in Table 3. The training log curves are shown in Table 4. Figure 4 As shown.

[0042] Table 3 Summary of Model Training Process Logs .

[0043] During training, gradients are calculated based on the aforementioned loss function, and an adaptive optimizer is used to perform backpropagation iterative optimization of the weights of the temporal residual blocks and the linear mapping branches in the TCN model. This continues until the model's loss on the validation set no longer decreases and an early stopping mechanism is triggered, completing the training and deriving the meta-learning TCN model.

[0044] In step 1, the current sampling time of the system is set to... Real-time acquisition of voltage data from the user side. Let the sampled voltage time series be... ,in Indicates the first The effective value of voltage at each sampling time; Set the maximum number of samples for the sliding window to And the minimum number of samples required for calculation is In this embodiment, , At any given time The effective local voltage subsequence extracted by the system Actual window length It will be adjusted according to the current time. Extract the local voltage subsequence within this window. ; Based on the extracted local voltage subsequence Determine the current effective window length Does it meet the set minimum sample size? : (1) When This directly sets the local sample standard deviation at the current moment. ; (2) When The average voltage is calculated using Formula 1 from step 1 above. With sample variance ; After taking the square root of the variance using Formula 2 from step 1 above, perform logarithmic smoothing to extract the variance at the time step. log-standard deviation fluctuation characteristics Online traversal of the entire sequence The corresponding fluctuation characteristic sequence is obtained. This information will be used as a state feature input into subsequent steps 4 and 5. It should be noted that this method processes streaming time series data; the steps described above, such as sliding window truncation, standard deviation calculation, and logarithmic smoothing, all occur at sampling times. The process is being carried out in a step-by-step, online manner.

[0045] In step 2, the length of the observation history window is set to... In this embodiment, The length of the truncation from the end of the historical fluctuation characteristic sequence is... The subsequence as candidate sequence If the length of the currently available feature sequence is less than... If invalid values ​​exist, it is determined that there is no stable support set at present, and the process continues to wait for the rolling acquisition of streaming time data until the length of the feature sequence accumulated by the streaming rolling data reaches the length of the observation history window, and all feature values ​​in the extracted candidate sequence are valid values. To avoid potential outliers in the candidate sequences from biasing the decision criteria, the center position and absolute deviation of the sequence are calculated, and a minimum scale constraint is set to prevent overflow of division by zero due to the complete constancy of the sequence, thus obtaining the center position of the sequence. and standard deviation The calculation formula is: (Formula 9); in, This is a function used to extract the median of a sequence. The coefficient 1.4826 is a correction factor that makes the absolute median error consistent with the standard deviation under an asymptotically normal distribution. In this embodiment, the minimum scale threshold is set. ; Initialize positive cumulative deviation and negative cumulative deviation Candidate sequences are traversed one by one according to chronological order. Feature points in Perform the following calculation logic to update the bidirectional cumulative sum: (1) Calculate the standardized deviation of the current feature point : (Formula 10); (2) Based on the set tolerance offset In this embodiment, Update the positive cumulative deviation respectively and negative cumulative deviation : (Formula 11); (3) In each traversal step The inspection will be carried out at the following location: If or (in In this embodiment, the set cumulative and control limit thresholds are used. If the current candidate sequence has a significant mean shift or abnormal interference, the test is interrupted and the candidate sequence is discarded. If candidate sequence Having passed the cumulative deviation test described above, we further constrain the global fluctuation range by calculating the range of the candidate sequence and determining whether it meets the following conditions: (Formula 12); in, In this embodiment, the maximum range coefficient is set. ; If the above constraints are met, then the candidate sequence is determined. When the system is in a stable operating state, this segment of feature sequence is extracted as a steady-state support set and used as subsequent input into the pre-trained meta-learning TCN model.

[0046] In step 3, the steady-state support set extracted in step 2 is fed into the meta-learning TCN network constructed in step b, and the prior parameters of the BOCD algorithm are output. In this embodiment, an output parameter constraint interval is set to ensure the stability of the Student-t distribution: for the mean... To ensure that it is always a positive number; for the confidence parameter Set the limit as For shape parameters Set the limit as For scale parameters Set the limit as .

[0047] Through the above steps, the pre-trained TCN model realizes the statistical prior parameters of the BOCD algorithm from the steady-state voltage fluctuation sequence. The nonlinear mapping provides adaptive model initialization support for subsequent variable point probability inference.

[0048] In step 3, the real-time collected fluctuation features are input into the Bayesian online change point detection model initialized using the adaptive prior parameters described in step 5. Let the current sampling time be... The posterior probability of the run length at the previous sampling time is , This represents the run length at the previous sampling time, with a value of [value missing]. For each branch with an effective run length, maintain a set of NIG distribution parameters and calculate the current fluctuation characteristics. The Student-t predicted density for each run length branch is calculated using the following formula: (Formula 13); in, This represents the fluctuation characteristics at the current sampling moment; The current fluctuation characteristics are at a run length of The corresponding Student-t prediction density under the branch; represents the degrees of freedom of the Student-t distribution; The length of the journey is The positional parameters corresponding to the branches; The lengths of the journeys are respectively The branches correspond to the prior confidence parameters, shape parameters, and scale parameters.

[0049] Travel length This represents the number of sampling points that have not changed since the most recent change point. BOCD calculates the branch where the run is reset to 0 using formula (14), and uses formula (15) to convert the run that has not changed from... Recursion to After normalization, the posterior distribution of the run length is obtained.

[0050] When it is determined that a new change point exists at the current sampling time, i.e., the current run length is reset to 0, the Student-t prediction density corresponding to the initial NIG prior parameters is used, combined with the preset risk rate. In this embodiment, along with the posterior probabilities of all runs at the previous sampling time, The unnormalized weights of the zero-run branch are calculated using the following formula: (Formula 14); in, The unnormalized weights of the variable branch whose run length is reset to 0 at the current sampling time; Initial normal-inverse gamma prior parameters , , and The calculated Student-t predicted density; The run length at the previous sampling time is The normalized posterior probability.

[0051] When it is determined that no new change point has occurred at the current sampling time, the run length is increased from that at the previous sampling time. Growth to the current sampling time For each run-length growth branch, the unnormalized weight of the run-length growth branch is calculated based on the corresponding Student-t prediction density, the posterior probability of the run at the previous sampling time, and the probability that the change point has not occurred. Then, the zero-run branch and all run-length growth branches are uniformly normalized to obtain the posterior probability of the run length at the current sampling time. The calculation formula is as follows: (Formula 15); in, The run length at the current sampling time is determined by... growth to The unnormalized weights corresponding to the branches; The current fluctuation characteristic is based on the previous run length of... The corresponding Student-t prediction density under the branch; The normalization coefficients for all valid run branches at the current sampling time; This is the normalized run length at the current sampling time; The normalized posterior probability of the run length at the current sampling time; This represents the zero-run posterior probability at the current sampling time.

[0052] After updating the posterior probability of the run length, for each run growth branch, based on the current fluctuation characteristics... Update the NIG parameters corresponding to this branch; for branches with run lengths reset to 0, reset them as the initial prior parameters for meta-learning TCN inference, calculated using the following formula: (Formula 16); in, , , and The length of the trip increased to The posterior mean parameter, posterior confidence parameter, posterior shape parameter, and posterior scale parameter corresponding to the branch; , , and The run lengths at the previous sampling time are respectively: The NIG parameters corresponding to the branch; , , and These are the initial prior mean parameter, initial prior confidence parameter, initial prior shape parameter, and initial prior scale parameter inferred by the meta-learning TCN based on the steady-state support set, respectively. Branches with a run length of 0 do not inherit the posterior parameters of the previous run branch, but instead re-set them using the initial prior parameters inferred by the meta-learning TCN.

[0053] During online detection, a periodic parameter update mechanism is implemented. This mechanism is activated when both the number of consecutive steps the BOCD algorithm has run and the number of normal running steps since the last update are greater than a preset period. In this embodiment, When the historical window indicates a state free of abnormal interference, the prior parameters are updated. The system automatically extracts a certain length of steady-state feature data prior to the current moment, re-inputs it into the pre-trained TCN model described in step 5, and infers the prior parameters. This resets the prior parameters of the BOCD model.

[0054] This invention constructs a candidate change point mechanism that combines probabilistic mutation and run-length collapse characteristics. Definition The probability of the change point at time t is The relative probability ratio is An alarm will be triggered when any of the following conditions are met: Condition 1: The absolute probability of a change point exceeds the absolute probability threshold ( ); Condition 2: The absolute probability of a change point is greater than or equal to the low threshold of the mutation, and the relative probability ratio is greater than or equal to the ratio threshold. and In this embodiment, , , ; Upon triggering, the run evolution status is continuously evaluated within a set verification window. When the recent change point probability quality exceeds a set threshold, and the maximum a posteriori run or expected run significantly collapses (in this embodiment, the verification window is set to 3, the recent change point probability quality threshold is 0.5, the maximum a posteriori run collapse ratio threshold is 0.1, and the expected run collapse ratio threshold is 0.5), then the run length is determined to be a candidate power outage change point if the ratio of the current run length to the previous run is lower than the corresponding collapse ratio threshold.

[0055] After obtaining candidate power outage points, steady-state estimation is performed based on the absolute median difference, and a backward construction is performed with a length of [missing information]. Feature confirmation window. Before extracting candidate points. Length features as a reference sequence In this embodiment, , Calculate the dynamic baseline threshold for this stage. The calculation formula is: (Formula 17); in, The confidence coefficient is... This is the rate-of-change limiting factor. In this embodiment, the minimum feature change constraint coefficient is used. , , .

[0056] make The sequence within the window is The tail feature subsequence is The following criteria must be met simultaneously: (1) Horizontal drift criterion: the median of ; (2) Overall residence criteria: Medium to large outlier percentage (Overall abnormality ratio requirement coefficient); (3) Tail continuation criterion: the median of And the proportion of tail anomalies (Required coefficient for tail anomaly ratio); In this embodiment, , ; If all three criteria are met, the candidate point is determined to be a suspected power outage change point that meets the persistence criterion, and the power outage start time, voltage drop amplitude, and posterior probability of the change point are recorded. If any condition is not met, the current fluctuation is determined to be an instantaneous power outage or a short-term abnormal fluctuation, and the BOCD detection algorithm reverts to the stable state before the candidate point and continues to run.

[0057] In step 7, after step 6 outputs the final power outage point and confirms the power outage event, the system enters a power outage suspension state. In this state, the system pauses BOCD posterior probability updates to avoid prolonged abnormal zero-value data contaminating the model state and monitors externally input power restoration signals in real time. When a power restoration signal trigger flag is detected, the system exits the power outage suspension state, records the current time step as the recovery starting point, and enters the recovery period data collection state. After acquiring each new sampling point, the CUSUM algorithm described in step 4 is called to evaluate the collected feature sequences. After acquiring the post-power restoration steady-state support set, the system inputs it into the pre-trained meta-learning TCN network described in step 5 to infer the NIG distribution prior hyperparameters adapted to the current post-power restoration feature sequences. After reinitializing BOCD and resetting the BOCD model, the system exits the recovery data collection state, resets all counters, and switches back to normal real-time monitoring state.

[0058] The performance of the proposed adaptive Bayesian online power outage detection method based on meta-learning TCN is evaluated.

[0059] Database and Experiment Setup

[0060] The experimental hardware consisted of an Intel(R) Core(TM) i9-7920X CPU @ 2.90GHz, an NVIDIA GeForce RTX 2080 Ti graphics card, and 64GB of RAM. The program was written in Python 3.9. In this embodiment, simulations were performed on a 123-node network and a European low-voltage distribution network on an IEEE PES distribution network.

[0061] To objectively and comprehensively evaluate the effectiveness of the method described in this invention in power outage identification tasks for distribution networks containing distributed photovoltaic systems and ring network operations, this embodiment uniformly adopts accuracy, precision, recall, and... Fraction( As quantitative evaluation metrics, accuracy represents the reliability of the model's global classification, i.e., the empirical probability that the model makes correct joint inferences across the entire data distribution; precision represents the confidence level of the model's positive predictions; recall represents the model's ability to capture features and its sensitivity in identifying true positive samples; and the F1 score is a comprehensive evaluation metric representing both the confidence level of positive predictions and global sensitivity. The calculation formulas are as follows: ; ; ; .

[0062] Among them, TP (True Positives): True positives, which are predicted to be positive and are actually positive; FP (False Positives): False positives, which are predicted to be positive but are actually negative; FN (False Negatives): False negatives, which are predicted to be negative but are actually positive; and TN (True Negatives): True negatives, which are predicted to be negative and are actually negative.

[0063] In a European low-voltage distribution network simulation experiment, rooftop photovoltaic (PV) systems were randomly selected for user nodes, and a typical sunny-day irradiance curve was used as the PV output curve. In the IEEE 123 node system, a ring network operation mode was configured. To cover scenarios involving continuous distributed PV power supply and voltage fluctuations due to ring network feeder disconnections, time-domain simulations were performed on both systems under line disconnection faults. Voltage sequences before and after the fault were extracted from the target smart meter nodes, generating a total of 10,000 voltage time sequences including the outage point. Simultaneously, 10,000 voltage curves without outages collected from actual distribution networks were introduced as normal samples. All sequences were uniformly resampled to 1-minute intervals and randomly mixed to form the test set. Regarding the evaluation results, the allowable time tolerance for power outage transformer point detection is set at 10 time steps. Only when the predicted power outage transformer point differs from the actual power outage record transformer point by less than 10 time steps is it considered a correct power outage transformer point detection. In other cases, over-reporting, under-reporting, and power outage transformer point detection of multiple events in the same sequence are all considered incorrect power outage transformer point detection.

[0064] Experimental performance evaluation

[0065] like Figure 6 As shown, this is a voltage outage analysis curve for a randomly selected user in a European low-voltage distribution network containing distributed photovoltaic (PV) systems. This method takes continuously arriving user voltage sequences as input, extracts temporal features through a temporal convolutional network, and combines this with Bayesian online change point detection to recursively analyze the operating status. It can achieve continuous online outage detection without waiting for complete data. The detection results output the time point of the outage and the corresponding outage probability, and continuously track the outage status and power restoration process. After restoration, the algorithm can continue to monitor subsequent data and identify recurring outage events. The actual outage intervals in the figure show good consistency with the detection results, and short-term transient disturbances are not misjudged as outages, indicating that this method has good online detection and continuous monitoring capabilities in low-voltage distribution networks with distributed PV and ring network operation.

[0066] like Figure 7 As shown, in low-voltage distribution networks with distributed photovoltaic (PV) grids and ring network operation, the voltage after a line break does not drop below a threshold, resulting in poor performance of the traditional LastGasp (power outage detection) method in detecting user power outages, with an F1 score close to 0. The adaptive Bayesian online power outage detection method based on meta-learning TCN proposed in this invention significantly improves performance compared to CUSUM sliding window detection and fixed-threshold Bayesian online change-point detection methods, with F1 scores improved by 0.44 and 0.22 respectively. This fully demonstrates the effectiveness of the proposed method in power outage identification in low-voltage distribution networks containing distributed PV and ring network operation.

[0067] The above results demonstrate that the proposed adaptive Bayesian online power outage detection method based on meta-learning TCN is reasonable and effective. Compared with other methods and variant models, the method in this embodiment improves upon all four measurement metrics and can overcome the high false negative rate of ordinary methods in low-voltage distribution networks with distributed photovoltaic and ring network operation. It has significant reference value for practical application in distribution network topology management.

[0068] This invention proposes an adaptive Bayesian online power outage detection method based on meta-learning TCN, with each step based on solid theoretical foundations and scientific rationality. It extracts local fluctuation features reflecting line breaks or abnormal states by calculating the logarithmic standard deviation using a voltage sliding window. A TCN model with causal pruning and dilated convolution is used as the meta-learning feature extractor to extract temporal features from the steady-state voltage sequence. A Bayesian conjugate parameter update rule is introduced, mapping the meta-learning task of the support set and query set to the prediction of four prior hyperparameters of a normal-inverse gamma (NIG) distribution, ensuring accurate prediction of prior knowledge for change point detection from both data-driven and statistical inference perspectives. Simultaneously, the Cumulative Summation (CUSUM) algorithm is applied to eliminate abnormal drift, and combined with BOCD dynamic run-length update and change point confirmation window mechanisms, effectively avoiding false alarms caused by transient disturbances and short-term drops, thus improving the system's generalization ability and detection accuracy. These steps are based on the theoretical foundation of multiple disciplines such as time series analysis, deep learning, and Bayesian probability statistics. They are scientific methods that have been rigorously deduced mathematically and verified by engineering logic. This invention integrates meta-learning mechanisms into online change point detection and uses meta-learning TCN to infer adaptive prior parameters. It can effectively solve the problem of missed detection caused by the non-instantaneous return of voltage to zero after power outages in distributed photovoltaic and ring network access systems. It has high robustness and practical engineering application value.

[0069] The foregoing has shown and described the basic principles, main features, and advantages of this embodiment. Those skilled in the art should understand that this embodiment is not limited to the specific embodiments described above. The specific embodiments and descriptions in the specification are merely for further illustrating the principles of this embodiment. Various changes and modifications can be made to this embodiment without departing from the spirit and scope of this embodiment, and all such changes and modifications fall within the scope of this embodiment as claimed. The scope of protection of this embodiment is defined by the claims and their equivalents.

Claims

1. An adaptive Bayesian online power outage detection method based on meta-learning TCN, characterized in that, This includes the offline training phase of the meta-learning TCN model and the online Bayesian power outage detection phase; In the offline training phase of the meta-learning TCN model, the meta-learning TCN model is constructed and trained based on offline data to obtain a pre-trained meta-learning TCN model. The Bayesian online power outage detection phase includes the following steps: Step 1: Collect voltage sequences on the user side of the distribution network in real time, and extract fluctuation characteristics based on the sliding window standard deviation; Step 2: Use the CUSUM algorithm to remove abnormal interference and automatically extract the steady-state support set; Step 3: Input the steady-state support set into the pre-trained meta-learning TCN model to infer the adaptive prior parameters of the BOCD algorithm; Step 4: Integrate adaptive prior parameters and real-time features, and output the final power outage change point based on the BOCD model; Step 3 is used to extract real-time fluctuation features. The fluctuation features are input into the initialized BOCD model to calculate the prediction probability and dynamically update the run length posterior distribution. The run length posterior distribution is used to quantify the posterior probability of each possible run length at the current moment and the probability of new change points. Candidate change points are identified by sudden increase in change point probability and collapse of the maximum posterior run or expected run, thereby filtering out instantaneous interference. The probability mutation of the combined change point and the run-length collapse feature are fused to determine whether there are candidate change points; When the probability of a change point reaches the absolute probability threshold, or the probability of a change point reaches the mutation low threshold and its relative ratio reaches the ratio threshold, and within the verification window, the recent change point probability quality exceeds the set threshold and the collapse ratio of the maximum posterior run or the expected run is lower than the corresponding threshold, the corresponding moment is confirmed as a candidate point. Step 5: Receive the power-on signal and return to Step 1 to achieve continuous online detection.

2. The adaptive Bayesian online power outage detection method based on meta-learning TCN driving according to claim 1, characterized in that, The steps to construct and train a pre-trained meta-learning TCN model based on offline data are as follows: Step a: Obtain the node voltage sequence during historical normal operation, select the voltage data of single-phase user nodes and perform data filtering; The standard deviation of the voltage series is calculated using a sliding window, and the voltage fluctuation characteristics are extracted after logarithmic smoothing. Each fluctuation feature sequence is divided along the time axis. The first fixed-length sequence is extracted as the support set, and the next sequence is extracted as the query set. The support set and query set corresponding to each meter node together constitute an independent meta-learning task sequence pair. Step b: Construction and training of the meta-learning TCN model; A TCN model with causal pruning and dilated convolution is constructed as a meta-learning feature extractor, and four parameter mapping branches are connected in parallel at its output. Input the support set data constructed in step a into the TCN model, and predict the four prior parameters of the normal-inverse gamma distribution through four parallel parameter mapping branches: prior mean. Prior confidence coefficient Prior shape parameters and prior scale parameters ; And use bounded activation functions to constrain the parameters to a reasonable mathematical range; During the training phase, based on the Bayesian conjugate parameter update rule, the predicted prior parameters are combined with the corresponding query set data to calculate the marginal likelihood distribution of the query set. The loss function is minimized by the mean negative log marginal likelihood. Backpropagation is performed for iterative optimization until convergence. The resulting meta-learning TCN model is the pre-trained meta-learning TCN model.

3. The adaptive Bayesian online power outage detection method based on meta-learning TCN-driven method according to claim 2, characterized in that, In step b, a TCN model is constructed as a feature extraction module for meta-learning. This network consists of multiple stacked temporal residual blocks. The support set sequence constructed in step a Input the TCN model for feature extraction; for each time step in the input sequence The elements are subjected to dilated convolution, and the calculation formula is: in, Represents a one-dimensional convolution kernel. This represents the feature sequence of the input support set. This indicates a dilated convolution operation. Represents the convolution kernel In the The weighting coefficient at each position This is the kernel position index. This indicates the kernel length, which is the number of weight coefficients contained in the kernel. Void factor; After processing through multiple layers of causal dilated convolutions, the output of the network at the last time step is extracted as the feature vector for this meta-learning task. The calculation formula is: in, This is the feature vector of the last layer of the network. and These are the weight matrix and bias vector of the fully connected layer, respectively; GELU is the activation function, and Dropout is the regularization process. Four independent linear fully connected branches are connected in parallel at the output of the TCN model to process the feature vectors. The four prior parameters mapped to a normal-inverse gamma distribution are: prior mean. Prior confidence coefficient Prior shape parameters and prior scale parameters To satisfy the strict mathematical definition and physical constraints of the NIG distribution parameters, nonlinear activation constraints are applied to the outputs of the four branches respectively: For the mean A smooth positive activation function is used to constrain it so that it is always positive; for A bounded activation mechanism based on the Sigmoid function is used to scale and constrain the predicted values ​​to a preset reasonable physical range. The calculation formula is as follows: in, Represents the prior parameters to be constrained. This is the original output of the fully connected branch. For the Sigmoid function, and These are the upper and lower bound thresholds for the corresponding parameters; During the training phase, the properties of Bayesian conjugate priors are utilized to incorporate the prior parameters predicted by TCN. With the corresponding query set sequence Combine and calculate the posterior parameters; let the length of the query set sequence be... First, calculate the sample mean of the query set data. With the centralized sum of squares The calculation formula is: in, For query set The first in One data point; Calculate the posterior parameters according to the conjugate parameter rule of the NIG distribution. The calculation formula is: in, For query set The marginal likelihood distribution of the query set is calculated based on the average value of all data points and the parameters before and after the update. A loss function is constructed with the objective function of minimizing the mean negative log-likelihood. The formulas for calculating the log-marginal likelihood and the mean negative log-likelihood loss are as follows: in, For gamma function, For query set Given parameters The log-marginal likelihood is given below, where Loss represents the average negative log-likelihood loss. This represents the average of multiple query sets within a training batch. During training, the gradient is calculated based on the loss function mentioned above, and the weights of the temporal residual blocks and the linear mapping branches in the TCN model are backpropagated and iteratively optimized using an adaptive optimizer. The early stopping mechanism is triggered when the loss of the model on the validation set no longer decreases for 20 consecutive epochs, thus completing the training and deriving the meta-learning TCN model.

4. The adaptive Bayesian online power outage detection method based on meta-learning TCN driving according to claim 1, characterized in that, In step 1, the current sampling time of the system is set to... To acquire voltage data from the user side in real time; Let the continuously sampled voltage time series be ,in Indicates the first The effective value of voltage at each sampling time; Set the maximum number of samples for the sliding window to And the minimum number of samples required for calculation is At any time The effective local voltage subsequence extracted by the system Actual window length It will be adjusted according to the current time. Extract the local voltage subsequence within this window. ; Based on the extracted local voltage subsequence Determine the current effective window length Does it meet the set minimum sample size? : (1) When This directly sets the local sample standard deviation at the current moment. ; (2) When ,use Calculate the average voltage With sample variance ; use After taking the square root of the above variance, logarithmic smoothing is performed, and the variance at time step is extracted. log-standard deviation fluctuation characteristics Online traversal of the entire sequence The corresponding fluctuation characteristic sequence is obtained. This will be used as a state feature input into subsequent steps 2 and 3.

5. The adaptive Bayesian online power outage detection method based on meta-learning TCN driving according to claim 1, characterized in that, In step 2, the length of the observation history window is set to... The length of the truncation from the end of the historical fluctuation characteristic sequence is... The subsequence as candidate sequence ; If the length of the currently available feature sequence is less than If invalid values ​​exist, it is determined that there is no stable support set at present, and the process continues to wait for the rolling acquisition of streaming time data until the length of the feature sequence accumulated by the streaming rolling data reaches the length of the observation history window, and all feature values ​​in the extracted candidate sequence are valid values. To avoid potential outliers in the candidate sequences from biasing the decision criteria, the center position and absolute deviation of the sequence are calculated, and a minimum scale constraint is set to prevent overflow of division by zero due to the complete constancy of the sequence, thus obtaining the center position of the sequence. and standard deviation The calculation formula is: in, This is a function used to extract the median of a sequence. The coefficient 1.4826 is a correction factor that makes the absolute median error consistent with the standard deviation under an asymptotically normal distribution. The minimum scale threshold is set. Initialize positive cumulative deviation and negative cumulative deviation Based on chronological order, traverse the candidate sequences one by one. Feature points in Perform the following calculation logic to update the bidirectional cumulative sum: (1) Calculate the standardized deviation of the current feature point : (2) Based on the set tolerance offset Update the positive cumulative deviation respectively and negative cumulative deviation : (3) In each traversal step The inspection will be carried out at the following location: If or If a significant mean shift or abnormal interference is found in the current candidate sequence, the test is interrupted and the candidate sequence is discarded. The set cumulative and control limit thresholds; If candidate sequence Having passed the cumulative deviation test described above, we further constrain the global fluctuation range by calculating the range of the candidate sequence and determining whether it meets the following conditions: in, The maximum range coefficient is set. Indicates product operation; If the above constraints are met, then the candidate sequence is determined. When the system is in a stable operating state, this segment of feature sequence is extracted as a steady-state support set and used as subsequent input into the pre-trained meta-learning TCN model.

6. The adaptive Bayesian online power outage detection method based on meta-learning TCN-driven method according to claim 1, characterized in that, In step 3, the steady-state support set extracted in step 2 is fed into the meta-learning TCN network constructed in step 2, and the prior parameters of the BOCD algorithm are output. ; Set output parameter constraint intervals to ensure the stability of the Student-t distribution: for the mean To ensure that it is always a positive number; for the confidence parameter Set the limit as For shape parameters Set the limit as For scale parameters Set the limit as ; Through the above steps, the pre-trained TCN model realizes the statistical prior parameters of the BOCD algorithm from the steady-state voltage fluctuation sequence. The nonlinear mapping provides adaptive model initialization support for subsequent variable point probability inference.

7. The adaptive Bayesian online power outage detection method based on meta-learning TCN driving according to claim 1, characterized in that, In step 4, the real-time collected fluctuation features are input into the Bayesian online change point detection model initialized using the adaptive prior parameters described in step 3. Let the current sampling time be The posterior probability of the run length at the previous sampling time is ,in This represents the run length at the previous sampling time, with a value of [value missing]. For each branch with an effective run length, maintain a set of NIG distribution parameters and calculate the current fluctuation characteristics. The Student-t predicted density for each run length branch is calculated using the following formula: in, This represents the fluctuation characteristics at the current sampling moment; The current fluctuation characteristics are at a run length of The corresponding Student-t prediction density under the branch; represents the degrees of freedom of the Student-t distribution; The length of the journey is The positional parameters corresponding to the branches; The lengths of the journeys are respectively The prior confidence parameters, shape parameters, and scale parameters corresponding to the branches; When it is determined that a new change point exists at the current sampling time, i.e., the current run length is reset to 0, the Student-t prediction density corresponding to the initial NIG prior parameters is used, combined with the preset risk rate. Given the posterior probabilities of all runs at the previous sampling time, calculate the unnormalized weights of the zero-run branch using the following formula: in, The unnormalized weights of the variable branch whose run length is reset to 0 at the current sampling time; Initial normal-inverse gamma prior parameters , , and The calculated Student-t predicted density; The run length at the previous sampling time is The normalized posterior probability; When it is determined that no new change point has occurred at the current sampling time, the run length is increased from that at the previous sampling time. Growth to the current sampling time For each run-length growth branch, the unnormalized weight of the run-length growth branch is calculated based on the corresponding Student-t prediction density, the posterior probability of the run at the previous sampling time, and the probability that the change point has not occurred. Then, the zero-run branch and all run-length growth branches are uniformly normalized to obtain the posterior probability of the run length at the current sampling time. The calculation formula is as follows: in, The run length at the current sampling time is determined by... growth to The unnormalized weights corresponding to the branches; The current fluctuation characteristic is based on the previous run length of... The corresponding Student-t prediction density under the branch; The normalization coefficients for all valid run branches at the current sampling time; This is the normalized run length at the current sampling time; The normalized posterior probability of the run length at the current sampling time; This represents the zero-run posterior probability at the current sampling time. After updating the posterior probability of the run length, for each run growth branch, based on the current fluctuation characteristics... Update the NIG parameters corresponding to this branch; for branches with run lengths reset to 0, reset them as the initial prior parameters for meta-learning TCN inference, calculated using the following formula: in, , , and The length of the trip increased to The posterior mean parameter, posterior confidence parameter, posterior shape parameter, and posterior scale parameter corresponding to the branch; , , and The run lengths at the previous sampling time are respectively: The NIG parameters corresponding to the branch; , , and These are the initial prior mean parameter, initial prior confidence parameter, initial prior shape parameter, and initial prior scale parameter inferred by the meta-learning TCN based on the steady-state support set, respectively; branches with a run length of 0 do not inherit the posterior parameters of the previous run branch, but instead re-set them using the initial prior parameters inferred by the meta-learning TCN; During online detection, a periodic parameter update mechanism is set up; when the number of consecutive runs of the BOCD algorithm and the number of normal runs since the last update are both greater than the preset period... When the historical window indicates a state free of abnormal interference, the prior parameters are updated. The system automatically extracts a certain length of steady-state feature data prior to the current moment, re-inputs it into the pre-trained TCN model described in step 3, and infers the prior parameters. This resets the prior parameters of the BOCD model. Constructing a candidate change point mechanism for joint probabilistic mutation and run-collapse characteristics: Definition The probability of the change point at time t is The relative probability ratio is An alarm will be triggered when any of the following conditions are met: Condition 1: Absolute probability of a change point Greater than or equal to the absolute probability threshold ,Right now ; Condition 2: Absolute probability of a change point Greater than or equal to the low threshold of mutation and the relative probability ratio Greater than or equal to the ratio threshold ,Right now and ; After triggering, the run evolution status is continuously evaluated within the set verification window; when the probability quality of the recent change point exceeds the set threshold, and the maximum posterior run or the expected run collapses significantly, that is, the ratio of the current run length to the previous time step is lower than the corresponding collapse ratio threshold, it is determined as a candidate power outage change point. After obtaining candidate power outage points, steady-state estimation is performed based on the absolute median difference, and a backward construction is performed with a length of [missing information]. Feature confirmation window; before extracting candidate points Length features as a reference sequence Calculate the dynamic baseline threshold for this stage. The calculation formula is: in, Represents a sequence The median of Robust standard deviation, used to measure the benchmark series The degree of data fluctuation under normal conditions The confidence coefficient is... This is the rate-of-change limiting factor. The minimum characteristic change constraint coefficient; make The sequence within the window is The tail feature subsequence is The following criteria must be met simultaneously: (1) Horizontal drift criterion: the median of ; (2) Overall residence criteria: Medium to large outlier percentage ,in This is the overall abnormality ratio requirement coefficient; (3) Tail continuation criterion: the median of And the proportion of tail anomalies ,in Tail anomaly ratio requirement coefficient; If all three criteria are met, the candidate point is determined to be a suspected power outage change point that meets the persistence criterion, and the power outage start time, voltage drop amplitude, and posterior probability of the change point are recorded. If any condition is not met, the current fluctuation is determined to be an instantaneous power outage or a short-term abnormal fluctuation, and the BOCD detection algorithm reverts to the stable state before the candidate point and continues to run.

8. The adaptive Bayesian online power outage detection method based on meta-learning TCN-driven method according to claim 1, characterized in that, In step 5, after the final power outage point is output in step 4 and the power outage event is confirmed, the system enters the power outage suspension state. In this state, the system suspends the posterior probability update of BOCD to avoid long-term abnormal zero-value data polluting the model state, and monitors the externally input power restoration signal in real time. When the trigger flag of the power restoration signal is detected, the system exits the power outage suspension state, records the current time step as the recovery starting point, and switches to the recovery period data collection state. After each acquisition of a new sampling point, the CUSUM algorithm described in step 4 is called to evaluate the collected feature sequences. After obtaining the steady-state support set after power restoration, the system inputs it into the pre-trained meta-learning TCN network described in step 5 to infer the NIG distribution prior hyperparameters that adapt to the current post-power restoration feature sequence. After reinitializing BOCD and resetting the BOCD model, the system exits the recovery period data collection state, resets all types of counters, and switches back to the normal real-time monitoring state.