With the application and development of new technologies such as the Internet of Things and big data in the energy field, smart grids have gradually become the main trend for the future development of the power system. However, frequent communication between various participants in the smart grid can lead to higher privacy leakage risks, and malicious attackers can cause economic losses and security accidents to the smart grid by injecting abnormal power data. To address the issues of data privacy protection and anomaly detection in smart grids, this study proposed a matrix completion based smart grid data privacy protection scheme and an unsupervised learning based smart grid anomaly data detection scheme. A matrix completion based smart grid data privacy protection scheme was proposed to address the issue of data privacy protection between different trust domains in the smart grid. This scheme repaired missing elements in the relevant matrix through matrix completion, and increased random perturbations by adding noise with the same statistical characteristics as the original data to achieve data privacy protection. To address the issue of missing power data labels and inaccurate principal component analysis caused by abnormal data, an improved K-means clustering algorithm was used to remove outliers and optimize the results, to achieve accurate detection of abnormal data. The experimental results showed that the proposed algorithm has an accuracy of 0.9, an F1 value of 0.7, and a Bayesian detection rate of 0.61, all of which are higher than other algorithms. The AUC value of the proposed method was 0.79, indicating that the scheme established in this chapter has certain advantages in detecting abnormal electricity consumption.