Research Article

BTP: A Bedtime Predicting Algorithm via Smartphone Screen Status

Table 3

Pseudocode of detection.

SeriesProcedureDescription

1for in UndetectedDays = do
2.SSS = Filter(.SSS)Filter out screen status sequence that user is not at home
3 OffList = SelectLong (.SSS)Select continuous screen off sequences that last over 30 minutes
4 <sleep_time, wake_time> = JoinSeries(OffList)Merge periods and get wake time and bedtime
5 SWTimeList.add(<sleep_time, wake_time>)Record the results of consecutive days
6end for
7end