The communication networks used to smart power grid include wired and wireless networks in terms of data transmission mode, and wireless networks mainly refer to wireless sensor networks (WSN). Accordingly, the data security in smart power grid involves the data transmission security in both cable networks and WSN. WSN is an application-specific network, and a promising research in smart power grid field. In this paper, we use the digital watermarking technology to solve WSN security in smart power grid. Firstly we propose a watermark mechanism based on alternating current, including watermark generation, embedding and detection algorithms. And then we use simulation results to demonstrate its feasibility and efficiency.