Research Article

A Novel User Selection Strategy with Incentive Mechanism Based on Time Window in Mobile Crowdsensing

Algorithm 2

PS-TWDT participant selection algorithm.
Input: set of participants U, set of initial mobile phone battery E, set of initial credit value R, task duration T
Output: Selected participants S, Data benefit V
(1)for i = 1 to N do
(2) ← Calculate the amount of sensing data
(3) ← Calculate sensing data reliability
(4)end for
(5)Sort participants by end time incrementally
(6)for i = 1 to N do
(7) if  [, ] then
(8)  pre(i) ← (−1), P(i) = , B(i) = ;
(9) else
(10)  pre(i) ← arg max ≥ , j < i (P(j) + pi/B(j) + )
(11)  P(i) ← P(pre(i)) + , B(i) ← B(pre(i)) + 
(12) end if
(13)end for
(14)i ← arg max  [,], jU (P(j) + /B(j) + )
(15)V ← P(i)/B(i)
(16)while i ≠ −1
(17)S ← S{i}, i ← pre(i)
(18)for all iU do
(19) ← 0
(20)end for
(21)for all iS do
(22) ← 
(23)end for
(24)Return(S, V)
(25)for all iS do
(26) Calculate the degree of willingness to participate
(27) Calculated data quality
(28) Calculate the trust state feedback value
(29) ← Update participant credit value
(30)end for