In internet of vehicles (IoV), the Vehicle ad-hoc network(VANET) provides the location based service(LBS) when vehicles communicate with the dynamic environment. As an integration of satellite systems and terrestrial communications, the space-air-ground integrated network(SAGIN) provides a reliable and efficient way for LBS. But the privacy protection in SAGIN cannot meet LBS security requirements well, so we present a blockchain-based LBS security preserving trust model. K-anonymous location privacy protection algorithm is used to hide users’ real position, so that users can avoid personal privacy disclosure when requesting location-based services. We propose a trust management algorithm which can detect the malicious behaviors when constructing anonymous regions and clear the malicious users out of the system. Besides, we use blockchain to implement the transparency and conditional anonymity of the system. Missive experiments indicate that our scheme is feasible and outperforms part of state-of-the-art privacy protection approaches.