The construction of power internet of things promotes the data integration of all aspects of the power system, but puts forward higher requirements for the network security of the power grid system. Therefore , based on the security technology of power Internet of things , this paper proposes a random inspection based anomaly detection method for the security behavior of power Internet of things. Through the number management of network nodes , different random inspection frequencies are designed for nodes with different reputation values, and abnormal behaviors are detected by sink nodes.The performance of the proposed method in security and malicious node detection is analyzed by simulation. The results show that the proposed detection method can detect abnormal behavior and malicious nodes timely and effectively , reduce the network energy consumption, and meet the security requirements of power internet of things.