Location-based service (LBS) is one of the most popular applications in 5G environment. Users can enjoy plenty of intelligent services, but serious threats will be caused in LBS at the same time. In order to protect privacy while ensuring efficiency, an efficient privacy-preserving framework based on the dimension-aware under spatiotemporal constraints (DSC-EPPF) is proposed. Initially, a novel dimension-aware data preprocessing algorithm under spatiotemporal constraints (DDPA-SC) is designed, which can not only construct the dimension-aware anonymity set, but also lighten the complexity of time. Secondly, a novel candidate anonymity set constructing algorithm with ameliorated peak density clustering (CASA-PDC) is designed, which can resist the background knowledge attack by filtering out redundant anonymity set. Thirdly, the (k, l)-privacy protection algorithm ((k, l)-PPA) is designed for anonymity set construction. At last, three metrics, dimension-aware, CPU time as well as security with entropy are formalized. The comparison of the proposed method has also been done with other classification models viz., GIA, GITA, SCA, RS and RSABPP that revealed the superiority of the proposed method.