# Fault Diagnosis System of Power Grid Based on Multi-Data Sources
## 3 Realization of Fault Diagnosis Real-Time Processing System
Based on the characteristics of inheritance, encapsulation and polymorphism, a system structure with high cohesion and low coupling can be designed to reduce the complicated process of conversion and mapping from the actual grid fault to the diagnosis system model. From the perspective of graph theory mentioned in reference [7], the topological structure of a single grid can be represented by an undirected graph \(G=(V^{*},E)\). The vertex set \(V^{*}\) is composed of all electrical elements in the grid, and the physical connection between elements constitutes the arc set \(E\). In this article, electrical elements are divided into three categories, namely \(V^{*}~{}=~{}V^{*}_{e}\cup B^{*}\cup V^{*}_{gt}\). \(B^{*}\) denotes the circuit breaker set. \(V^{*}_{e}~{}=~{}\{V^{*}_{L},V^{*}_{B},V^{*}_{T},V^{*}_{G}\}\), where \(V^{*}_{L}\) is the line  
Figure 2: Definition of classes. set, \(V_{B}^{*}\) is the bus set, \(V_{T}^{*}\) is the transformer set, \(V_{G}^{*}\) is the generator set. \(V_{ot}^{*}\) denotes other elements (including load node, etc.). In Figure 2, \(V\_e\) class is the abstraction of concrete objects in \(V_{e}^{*}\). \(V\_L\) class is the abstraction of concrete objects in \(V_{L}^{*}\). \(V\_B\) class is the abstraction of concrete objects in \(V_{B}^{*}\). \(V\_T\) class is the abstraction of concrete objects in \(V_{T}^{*}\). \(V\_G\) class is the abstraction of concrete objects in \(V_{G}^{*}\). \(V\_ot\) class is the abstraction of concrete objects in \(V_{ot}^{*}\). \(B\) class is the abstraction of concrete objects in \(B^{*}\). \(G\) class represents the power grid network, whose topology relationship is defined in a nested way: \(G\) stores the set of \(V\_e\) class elements and the set of circuit breakers. The connection relationship between a \(V\_e\) class element and other \(V\_e\) class elements and the connected circuit breakers are stored in the attribute \(C\) (adjacency list) of the element. The connection relationship between a circuit breaker and \(V\_e\) class elements is stored in the attribute \(TV\) of the circuit breaker. The attribute \(n\) of a \(V\_e\) class element represents the number of other \(V\_e\) class elements directly connected to the \(V\_e\) class element. Regardless of whether a circuit breaker is controlled or passively closing and opening, the attribute \(S\) of the circuit breaker represents the opening and closing state of the circuit breaker (1 represents the opening state and 0 represents the closing state). Attribute \(PBF\) stores all protections related to the circuit breaker. Attribute \(PB\) stores action protections related to the circuit breaker. The set of action protections \(P^{*}\) is the main information source used in a real-time processing system for fault diagnosis. The protection class (\(P\) class) is divided into five subclasses, as shown in Figure 2 (other protections that do not relate to fault diagnosis are not considered in this article). The attribute \(p\) (namely correctness of the protection), which has a detailed calculation method in Section 3.3.1, indicates the probability of protection operating correctly according to its setting principle. The protection range is represented by attributes \(PV\) and \(N\): \(PV\) represents the nearest \(V\_e\) class element in the protection range, which determines the direction of the protection range. \(N\) denotes the number of \(V\_e\) class elements in the shortest path between the farthest \(V\_e\) class element in the protection range and PV of the protection (containing \(PV\) and the element itself). \(N\) determines the extension of the protection range. The attribute \(t\) (namely protective action time) indicates the sum of the action time of the protection relay and delay of the related circuit breaker. What needs to be noted is that the initialization of the real-time processing system should wait for the information of all action protections to be uploaded to the dispatching center before starting.