In this paper, the security issue in cyber-physical system (CPS) is investigated. In order to maximize the attack effect and save the limited energy, the energy efficiency problem is investigated from the perspective of the jammer. This problem is established as a mixed-integer programming problem firstly, and then a necessary condition is presented to explore the optimal energy for a given attack number. Moreover, an energy efficiency optimization (EEO) algorithm is proposed to derive the optimal attack schedule. Lastly, some numerical results are shown to validate the effectiveness of the proposed algorithm.