Location prediction has attracted wide attention in human mobility prediction because of the popularity of location-based social networks. Existing location prediction methods have achieved remarkable development in centrally stored datasets. However, these datasets contain privacy data about user behaviors and may cause privacy issues. A location prediction method is proposed in our work to predict human movement behavior using federated learning techniques in which the data is stored in different clients and different clients cooperate to train to extract useful users’ behavior information and prevent the disclosure of privacy. Firstly, we put forward an innovative spatial-temporal location prediction framework(STLPF) for location prediction by integrating spatial-temporal information in local and global views on each client, and propose a new loss function to optimize the model. Secondly, we design a new personalized federated learning framework in which clients can cooperatively train their personalized models in the absence of a global model. Finally, the numerous experimental results on check-in datasets further show that our privacy-protected method is superior and more effective than various baseline approaches.