# Fault Diagnosis System of Power Grid Based on Multi-Data Sources
## 4 Fault Tracking Quasi-Real-Time Processing System and Fault Diagnosis Batch Processing System
### Implementation of Fault Tracking Quasi-Real-Time Processing System
#### 4.1.2 Fault Reason Tracking Considering Partial Information Loss
Step (3): Repeat the following work: call the fault feature adjacency list of every reason in a set of fault reasons, supplement the set (_F_) of fault features, and then call the fault reason adjacency list of every element in \(F\), supplement the set (_R_) of fault reasons, until \(R\) and \(F\) reaches complete mapping. Step (4): Calculate the conditional probability of each reason in \(R\) under the premise of occurrence of each feature in \(F\) one by one according to Equation (13). \[p(rx|fy)\ =\ \frac{p_{rx}\ p(fy|rx)}{\sum_{i\in R_{-}}p_{ri}\ p(fy|ri)} \tag{13}\]  
In Equation (13), \(p_{rx}\) denotes the prior probability of the fault reason _rx_, \(p(fy|rx)\) represents the probability of the fault feature _fy_ caused by _rx_, and \(p(rx|fy)\) represents the conditional probability of _rx_ when _fy_ occurs. Step (5): First, calculate the Bayesian suspected degree of each reason in \(R\) according to Equation (14). \[B(rx)\ =\ \frac{\sum_{f\in F_{-}1}p(rx|fi)}{\sum_{r\in R_{-}}\sum_{f\in F_{-}1}p( rt|fi)} \tag{14}\]  
In Equation (14), _B(rx)_ denotes the Bayesian suspected degree of the fault reason _rx_. When the relevant data of partial warning-level information is known, the conditional probability \(H_{\beta}\) of fault feature _fi_ is set to consider partial information loss. The Bayesian suspected degree is corrected to avoid a large deviation of the fault trace results. The calculation formula of \(H_{\beta}\) is as follows:  
\[H_{fi}\ =\ \left\{ \begin{array}{c}1\ fi\in F\_1\\ 0\ Related\ data\ of\ fi\ are\ known\ and\ fi\
otin F\_1\\ \sum_{rt\in R_{-}}B(rt)p(fi|rt),\ Related\ data\ of\ fi\ are\ unknown\end{array} \right. \tag{15}\]  
According to Equation (16), the Bayesian suspected degree of each reason in \(R\) is calculated again and regarded as the revised suspected degree of each fault reason. \[p(rx)\ =\ \frac{\sum_{fi\in F_{-}}H_{fi}p(rx|fi)}{\sum_{rt\in R_{-}}\sum_{fi\in F _{-}}H_{fi}p(rt|fi)} \tag{16}\]  
Finally, the maintenance work can be rapidly carried out according to the order of the revised suspected degree of each fault correction. The following example of a simple grid fault shown in Figure 4 shows the fault tracking process. According to Section 3.3.1, the set of refuse-operation circuit breakers is [CB4]. The abnormal data and unknown data of CB4 obtained by the substation are shown in Table 6.  
From the data analysis, the initial set (_F_1_) of CB4 fault features is [_f3, f4_]. According to Steps (2) and (3), the set of fault reasons (_R_) is [_r1, r2, r3, r4, r5_], the set of fault features (_F_) is [_f1, f2, f3, f4, f5_]. According to Step (4), the conditional probability of each reason in \(R\) under the premise of occurrence of each feature in \(F\) is obtained as shown in Table 7.  
According to Equation (14), the Bayesian suspected degree of each fault reason is calculated. Then calculate the revised suspected degree of each fault reason according to Equations (15) and (16). The results are shown in Table 8.  
By comparing Bayesian suspected degree and revised suspected degree, it can be found that the fault reason tracking method based on Bayesian suspected degree does not consider _r1_. However, due to the loss of information, _r1_ may occur in practical engineering. The revised suspected degree can give _r1_, which plays a guiding role in the subsequent maintenance work. Staff can rapidly repair CB4 according to the order of _r4_, _r3_, _r5_, _r2_ and _r1_.