Skip to main content
. 2022 Jun 21;22(13):4677. doi: 10.3390/s22134677
Algorithm 1 Solution to daily activity analytics

     Input: Continuous signal data S from the wearable devices.

     Output: Daily activity analytic results AR.

  • 1:

    ▹ Firstly, according to the user-controlled policy, try DnD-applicable analysis and also accumulate the raw data.

  • 2:

    D                                                                                              ▹D represents the raw data set.

  • 3:

    for eachsSdo

  • 4:

        ▹ Decompose each signal s into a tuple of meaningful information pieces (d1,d2,d3).

  • 5:

        (d1,d2,d3)s

  • 6:

        if DnD-applicable then

  • 7:

            ▹ Applying DnD analytic methods (cf. Section 3.1) and continuously updating the analytic results AR.

  • 8:

            ARDnD(d1,d2,d3)

  • 9:

        end if

  • 10:

        ▹ Optional raw data accumulation (also depending on the predefined policy).

  • 11:

        DD(d1,d2,d3)

  • 12:

    end for

  • 13:

    ▹ Secondly, if the user-controlled policy does not indicate any DnD-applicable scenario, then the analytic results AR will be empty, which means the offline analytics will be expected based on the accumulated raw data D.

  • 14:

    ifAR is NULL then                                                                          ▹ Not in DnD-applicable scenarios.

  • 15:

        AROfflineAnalytics(D)

  • 16:

    end if

  • 17:

    ▹ Thirdly, the post-analysis activities will be triggered according to the predefined policy.

  • 18:

    switchpolicydo                                                                                 ▹ Given predefined policies.

  • 19:

        case Store nothing and transmit analytic result

  • 20:

            D                                                                                      ▹ Erase raw data locally.

  • 21:

            send(AR)

  • 22:

        case Store analytic result and transmit nothing

  • 23:

            D                                                                                      ▹ Erase raw data locally.

  • 24:

            save(AR)

  • 25:

        case Store raw data and transmit analytic result

  • 26:

            save(D)

  • 27:

            send(AR)

  • 28:

        case Store nothing and transmit raw data

  • 29:

            send(D)

  • 30:

            D                                                                                      ▹ Erase raw data locally.

  • 31:

        case Others

  • 32:

            ▹ More cases can be involved according to different policies.

  • 33:

    returnAR