The frequent use of location query services in location-based services will come out a large amount of space-time data related to users. Attackers infer information of location or track based on these rich background knowledge. Therefore, aiming at the problem of trajectory privacy, the context adds instant traffic monitoring based on user behavior patterns, trajectory similarity and other background information. According to the idea of k anonymity, proposed a method combined with traffic condition to protect the trajectory privacy. First, the user randomly selects a time point of the real trajectory to rotate to generate dummy trajectory, and then repeat the above process on the real trajectory and dummy trajectory. Up to the generation of k −1 dummy trajectory, and according to the actual road conditions and trajectory leakage probability, traversing dummy trajectory to adjust. Finally, it is further proved through experiments that the method will be more efficient and protect privacy well.