## 5 Simulations and Analysis
### Reliability of the Proposed Attack Detection Scheme  
In this subsection, we evaluate the reliability of the proposed attack detection scheme by considering four safe factors: safe SNR, safe delay, safe number of training samples, and safe margin difference. To quantify reasonable safe levels which could guarantee certain detection performance, we establish the relationship between the minimum of the safe factors and threshold for detection performance. \(S_{r}\) is used to represent the threshold for detection performance, which can be expressed as:  
\[S_{r}=\min\{TP,TN\} \tag{38}\]  
Safe SNR considering different \(S_{r}\) and different attack templates are In Table 1. It can be learned that the safe SNR increases with the increase of \(S_{r}\). The impact of attack type on safe SNR is less than that of \(S_{r}\). When \(S_{r}\) is at a high level, the safe SNR is basically the same. When \(S_{r}\) is at a low level, the safe SNR under different attacks begin to differ.  
Figure 8: TN rate of the attack detection scheme.  
Figure 7: TP rate of the attack detection scheme.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & \(S_{r}=80\%\) & \(S_{r}=85\%\) & \(S_{r}=90\%\) \\ \hline Exogenous attack & 0.6 & 0.8 & 0.9 \\ Scaling attack & 0.6 & 0.8 & 0.9 \\ Flexible attack & 0.6 & 0.8 & 0.9 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Safe margin difference considering different \(S_{r}\) and different attack templates.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & \(S_{r}=80\%\) & \(S_{r}=85\%\) & \(S_{r}=90\%\) \\ \hline Exogenous attack & 6.7 s & 5.1 s & 3.2 s \\ Scaling attack & 7.0 s & 4.9 s & 3.2 s \\ Flexible attack & 6.9 s & 5.0 s & 3.1 s \\ \hline \hline \end{tabular}
\end{table}
Table 2: Safe delay considering different \(S_{r}\) and different attack templates.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & \(S_{r}=80\%\) & \(S_{r}=85\%\) & \(S_{r}=90\%\) \\ \hline Exogenous attack & 0.6 & 0.8 & 0.9 \\ Scaling attack & 0.6 & 0.8 & 0.9 \\ Flexible attack & 0.6 & 0.8 & 0.9 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Safe number of training samples considering different \(S_{r}\) and different attack templates.  
**Author Contributions:** Conceptualization: [PERSON] and K.Z.; data curation: [PERSON]; formal analysis: [PERSON] and C.C.; methodology: [PERSON]; project administration: [PERSON]; resources: [PERSON]; software: [PERSON] and C.C.; supervision: [PERSON]; validation: [PERSON]; writing--original draft: [PERSON]; writing--review and editing: [PERSON] and C.C. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research was funded by the National Natural Science Foundation of China (No. 51977033) and the Research Program of State Grid Corporation of China (Research and Application of Distributed Renewable Energy Monitoring and Statistical Analysis Technology).  
**Data Availability Statement:** Publicly available datasets were analyzed in this study. This data can be found here: [27; 28].  
**Acknowledgments:** This work was partially supported by the Key Laboratory of Measurement and Control of CSE.  
**Conflicts of Interest:** The authors declare no conflict of interest.The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.