## 3 Proposed Method
### SSUPS Based Digital Twin Framework
#### 3.1.1 Virtual and Reality Mapping Based on SPN  
Based on the knowledge graph's classification of the different components and their relationships, the digital twin (DT) are divided into three classes: entity DT, attribute DT and relationship DT. Therefore, the digital twin mapping of an oil and gas station can be represented as a mapping of the various types of TE, we have:  
\[M_{DT}=M_{EDT}\cup M_{ADT}\cup M_{RDT} \tag{2}\]  
The mapping between entities is a topology connection relationship. Entities include equipment, pipeline components, buildings, as well as sensor data collections and business processes, etc. All digital twins after entity mapping form a finite set. This finite set can be expressed as:  
\[EDT=\{TE|M_{EDT}[n]\in Set_{EDT}=\{s_{1},s_{2},\cdots,s_{n_{EDT}}\},\forall n \in[0,N_{EDT}]\}. \tag{3}\]  
where \(N\) is the number of entities class, \(TE\) is the twinning entity, \(EDT\) is the entity digital twin, \(Set_{EDT}\) is the entity mapping set. The mapping function of the entity digital twin can be expressed as:  
\[\begin{array}{l}M_{EDT}=\{f_{TE1},f_{TE2},f_{TE_{engine}}|f_{TE_{i}}:D_{E_{i} }^{\mathbb{R}}\mapsto D_{TE_{i}}^{\mathbb{DT}},\\ s.t.\Big{|}D_{E_{i}}^{R}\Big{|}=\Big{|}D_{TE_{i}}^{\mathbb{DT}}\Big{|}\in Set _{EDT},\\ \forall i=1,2,\cdots,n_{EDT}\}.\end{array} \tag{4}\]where \(M_{EDT}\) is the mapping entity digital twin, \(f\) is the mapping function, \(|D|\) is a value operation that ignores data structures, formats, timestamps, etc.  
The attribute mapping in the knowledge graph triplet has a unique identifier of the device with device information and status, which is represented as follows:  
\[ADT=\{TA|M_{ADT}\in Set_{ADT}=\{ID,State,\cdots,AD_{DT}\}\}. \tag{5}\]  
where \(N\) is the number of attribute class, \(TA\) is the twinning attribute, \(ADT\) is the attribute digital twin, \(Set_{EADT}\) is the attribute mapping set. The mapping function of the attribute digital twin can be expressed as:  
\[\begin{array}{l}M_{ADT}=\{f_{TA1},f_{TA2},f_{TE_{n_{BDT}}}|f_{TE_{i}}:D_{TE_{ i}}^{R}\mapsto D_{TE_{i}}^{DT},\\ s.t.\big{|}D_{TE_{i}}^{R}\big{|}=\big{|}D_{TE_{i}}^{DT}\big{|}\in Set_{ADT}, \\ \forall i=1,2,\cdots,n_{ADT}\}.\end{array} \tag{6}\]  
where \(M_{ADT}\) is the mapping entity digital twin, \(f\) is the mapping function.  
Relationships are the bridges for connecting entities in knowledge graph, which can be expressed as:  
\[\begin{array}{l}M_{RDT}=\{f_{TR1},f_{TR2},f_{TR_{n_{RDT}}}|f_{TE_{i}}:D_{TE_{ i}}^{R}\mapsto D_{TR_{i}}^{DT},\\ s.t.\big{|}D_{TR_{i}}^{R}\big{|}=\big{|}D_{TR_{i}}^{DT}\big{|}_{r}\\ \forall i=1,2,\cdots,n_{RDT}\}.\end{array} \tag{7}\]  
where \(N\) is the number of Relationship classes, \(TA\) is the twinning attribute, and \(ADT\) is the attribute digital twin.  
The division of the above three types for TE conducts to the integration of twin body data processing, and facilitates the design of simulation behaviors in the digital twin platform according to the digital twin representation methods of different TEs. In order to enhance virtual and reality interaction performace, our digital twin framework integrates SPN and evolution rules to improve better generalization on anomaly detection task. The SPN is defined as a seven-tuple \(N=(P,T,F,K,W,M_{0},L)\). Based on the recursive combination of elements such as places and transitions, a logical network model of virtual-real interaction is constructed, as shown in Figure 2. The meanings of all places and transitions in the logical Petri net model are shown in Table 3.  
Figure 2: The virtual-real interactive Petri net model of oil and gas station.