Research Article
Location Privacy Protection Scheme for LBS in IoT
Algorithm 2
The G-V anonymity algorithm.
Input: The user set to be anonymous , the Voronoi diagram of the road network, , | Output: The anonymous set AS | 1. ; //Sending anonymous request from users | 2. ; //The server received information from users | 3. ; //Sending data to the anonymous module | 4. ; //The anonymous module accepts users’ data | 5. int ; //Max represents the size of the character set | 6. int ; //count represents the number of times the character appears | 7. struct trieNode //The next array represents the type of each character | 8. for //Building the prefix tree | 9. { | 10. if | 11. ; //Initializing root node | 12. else | 13. ; //Insert the Geohash code into the prefix tree | 14. } | 15. while //Traverse the prefix tree | 16. { | 17. if | 18. { | 19. ; | 20. ; | 21. } | 22. if | 23. { | 24. ; //The node is none. Assigning a new node | 25. ; | 26. } | 27. } | 28. while //Querying strings with the same prefix | 29. { | 30. if | 31. return 0; | 32. else | 33. {; | 34. return ; //Number of users with the same prefix | 35. } | 36. } | 37. | 38. if | 39. ; | 40. else | 41. { | 42. ; //Generating dummy | 43. ; | 44. } | 45. return AS; //Anonymous success |
|