# Fault Diagnosis System of Power Grid Based on Multi-Data Sources
## 3 Realization of Fault Diagnosis Real-Time Processing System
### Fault Pre-Diagnosis  
In this section, this article first uses an algorithm to process accident-level information received by the dispatching center and then uses the reverse reasoning Petri net proposed in reference [7] for fault diagnosis inference and calculation.  
In practical engineering, there may be complex topology and excessive elements. The traversal of each V_e class element in the diagnosis process is time-consuming and labor-intensive, which cannot meet the needs of practical engineering. Therefore, the algorithm searches the topology of the power grid through the set of action protections (\(P^{*}\)), and gets all elements within the protection range of each protection in \(P^{*}\) to form the initial set of suspicious faulty V_e class elements.  
The sufficient and necessary condition for the existence of a token in the final place of a Petri net is that all the second layer places of the net can obtain tokens after iterative calculations. According to the mapping relationship between tree structure and reverse reasoning Petri net, for a V_e class element, only when the number of tripping circuit breakers (and the element is within the protection range of the action protection related to the circuit breaker) exceeds the number of adjacent list edges (\(n\)) of the element in the protection information connection tree of it, all the second layer places of the Petri net may obtain tokens after iterative calculations. Through the screening of this condition, the range of suspicious faulty elements can be further reduced to form the set of suspicious faulty V_e class elements.  
**Definition 2**.: _Eigenvalue: k. k is an attribute of V_e class. The k value of a V_e class element represents the number of tripping circuit breakers in the protection information connection tree of the element (and the element is within the protection range of the action protection related to the circuit breaker)._  
The flow chart of Algorithm 2 is shown in Figure 5.  
Figure 4: Protection information connection tree of L1, L2 and B1.  
_After V_e2_ having been obtained, the protection information connection tree is constructed for each element in _V_e2_. Map the protection information connection trees to reverse reasoning Petri nets and perform iterative calculations. Then place the _V_e_ class elements with a token in the final place into the initial set of faulty _V_e_ class elements (_V_e3_).  
Demonstrate the process with a simple grid shown in Figure 4 of Section 3.1.  
Initialize \(G\) and input _P_\({}^{*}\) = [BP_B1, RBP_L2_B3]. Then complete Algorithm 2, get _V_e1_ = [L1, L2, B1], _V_e2_ = [B1].  
In Step (3) of Algorithm 2, the process of doing Algorithm 1 for RBP_L2_B3 is shown in Figure 5(a).  
Map the protection information connection tree of B1 to a reverse reasoning Petri net, and then perform iterative calculations, as shown in Figure 5(b).  
The final place of B1 Petri net is placed in a token, so B1 is placed in _V_e3_.  
Finally, _V_e3_ = [B1] is obtained.  
Figure 5: Algorithm 2 flow chart.  
Figure 6: (**a**) Doing Algorithm 1 for RBP_L2_B3; (**b**) mapping and iterative calculations of B1.