# Personalized Privacy Protection Based on Space Grid in Mobile Crowdsensing
## 4 Personalized Privacy Protection
### Task Allocation Algorithm Based on Worker Compensation  
When facing the task allocation mechanism based on a dynamic grid, there are different task allocation methods according to different considerations of the decision-making mechanism. For example, the task is assigned to the workers who accept the task first (time first), the  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Symbols** & **Definition** \\ \hline \(t\) & task \\ \hline \(GR\) & broadcast area \\ \hline \(Q\) & maximum heap of the second-level cells covering \(t\) \\ \hline \(c_{i}\) & the second-level grid node \\ \hline _neighbours_ & space inner grid \(c_{i}^{\prime}s\) neighbor \\ \hline \hline \end{tabular}
\end{table}
Table 2: Symbols required for Algorithm 2.  
task is assigned to the workers closest to the task (location first), and the task proposed in this paper is assigned to the workers with the lowest salary (salary first). In order to improve the speed of task acceptance, the first accept first assign model is used to assign the task to the staff with the earliest response time among all response staff. In order to reduce the travel distance of the staff, the nearest first assignment model is used to assign the task to the staff member closest to the task among all the responding staff. This paper chooses to assign tasks to the workers with the lowest salary in the unit cost, that is, the lowest reward-first allocation algorithm.  
```
0:Task \(t\), utility threshold \(EU\), maximum travel area \(MTD\)
0:Broadcast area \(GR\)
1:Initialization \(GR\) is null, u = 0
2:Initialize the maximum heap \(Q\), where \(q\) is the second-level grid covering \(t\)
3:Pop \(\{\)\(c_{i},U_{c_{i}}\)\(\}\) from stack \(Q\)
4:If \(c_{i}\) = null then output broadcast area \(GR\), where \(GR\) is greater than \(MTD\). Otherwise \(GR=GR\cup c_{i}\)
5:If \(U_{c_{i}}\geq 0\) then \(U=1-(1-U)(1-U_{c_{i}})\)
6:If \(U\geq EU\) then output broadcast area \(GR\). Otherwise look for neighbors of \(C\) not in \(GR\)\(\cap\)\(MTD\)
7:Add neighbors to \(Q\) and execute step 3
```  
**Algorithm 2** GDY  
When designing the remuneration, the worker \(w^{\prime}_{i}\)s privacy budget and the distance between \(w_{i}\) and task \(t\)\(d(w_{i},t)\) are taken into account. Reward \(cost[i,0]\) is a linear combination of privacy budget and distance. The calculation formula is shown in Equation (13):  
\[cost[i,0]=50\times\frac{\epsilon_{2}}{\epsilon}+50\times d(w_{i},t) \tag{13}\]  
For personal reasons (such as completing a task), even if some workers have a high probability, they may not complete the task. Therefore, it is necessary to simulate whether workers complete the task by using a random function. The greedy algorithm is used to find the current lowest paid worker, and Formula (11) is used to calculate the probability \(AR\) that the worker accepts the task, and the random function is called to simulate the probability that the worker actually accepts the task. If the random number is greater than \(AR\), the task is accepted and the assignment ends. Otherwise, continue to find the next worker until there is a worker to accept or no workers.  
**5. Experiments and Analyses**  
The personalized differential privacy protection strategy proposed in this paper adds complexity to task assignment. Introducing random Laplace mechanism noise can affect the efficiency and accuracy of task assignment to workers within the task assignment model. Hence, we aim to assess the effectiveness of the personalized privacy policy (PAG) proposed in this paper in safeguarding data against discrepancies between noisy and real data.