Research Article

A Blockchain-Based Location Privacy-Preserving Scheme in Location-Based Service

Algorithm 2

Construct personal semantic tree.
Input:
 DSetloc (The Personal Request Location Set), ε (The threshol);
Output:
 The Personal semantic tree, T;
1: Initializes the hierarchical trees T={E,V} and V.layer [0]=Root;
2: Extract the semantic features of the location, including TSF,GSF;
3: Initializes Group={Groupi} (i=1,2,…n) based on its GSF similarity, j=1;
4: for Each i in Len (DSetloc) do
5: if loci.GSF == loci+1.GSF then
6:  Group [j].add (loci);
7:  j + +;
8: end if
9: end for
10: V.layer [1].append (Group.GSF);
11:
12: for Each group in Group do
13: centerm=clusterEM (N, locj.TSF, ε),locj.TSF ∈group; //EMcluster cluster method
14: Caculating the distance Dis (centerm, locj.TSF) between center i and locj;
15: Choose locj which meet Dis (centerm, locj.TSF)<ε to put into Cm;
16: Put Cm into C;
17: end for
18: V.layer [2].append (C);
19: Put locs into corresponding cluster Cm as its V.leafnode;
20: Put V into T;
21: return T;