At present, most position anonymity algorithms exist larger anonymous region, longer anonymity time and higher possibility of unsuccessful anonymity, and inquiry details which may include more privacy information are not protected better. To solve these problems, this paper proposes an anonymous model called LBS(P,L,K),which is based on k-anonymous model .This model sets parameters P and L by sensitivity of the queries in order to protect privacy of user queries and personalized needs of users. At the same time, this paper proposes algorithm called grid-fake users anonymity algorithm, which can not only protect the location privacy, but also to protect the query privacy. The algorithm’s idea is as follows: first the space is mapped to mxn grid, then iteration search neighborhood space of the grid of the user lies in until finds the Minimum contain space, then stripping the edges with smallest user distribution density one by one according to the density matrix, on purpose of finding the anonymous user set meeting the anonymity condition in a minimum range, and achieving a better balance between privacy and quality of service. By contrast experiment, the algorithm has a higher success rate of anonymity, a smaller anonymous area and a higher relative anonymity under meeting the requirements of individual users, so it increases the quality of the user's query service.