Abstract:The existing replay attack detection methods of Cyber-physical system based on control signal coding mainly realize the detection by judging whether the value of the detection function exceeds a predetermined threshold. That results in a conflict between the detection rate and the loss of system control performance. In this paper, we propose a detection method based on pseudo periodic control signal coding. Firstly, the pre-designed pseudo periodic random coding signal is added to the control signal, and the corresponding pseudo periodic measurement compensation signal is constructed. The periodicity of the compensation signal is proved when the system matrix is stable. Then, the received measurement is compensated by different compensation signals to obtain the position of the compensation signal corresponding to the minimum value of the detection function in the period. By comparing the position of the compensation signal and the actual watermark signal in the time, the replay attack is detected. The simulation results show that the proposed method only needs to compare the relative values of the detection function under different compensation signals, so as to effectively detect the replay attack, decrease the variance of the control coding signal and reduce the performance loss of the system control.