Step counting method, step counting device, and computer readable storage medium
Disclosed are a step counting method, a step counting device, and a computer readable storage medium. The step counting method includes: obtaining acceleration data, the acceleration data including effective peaks (S 100 ); determining a time interval between a current effective peak and an effective peak obtained last time; when the time interval is greater than a preset interval, obtaining a data area of the effective peaks until a next time interval is greater than the preset interval; when the number of effective peaks within the data area is less than a preset value, determining feature information of the effective peaks within the data area; and when the feature information of the effective peaks within the data area satisfies a preset condition, updating step counting data.
1 . A step counting method performed by a controller, the step counting method comprising:
obtaining acceleration data caused by a user's movement by an acceleration sensor of a step counting device, the acceleration data comprising a plurality of effective peaks;
the step counting device determining a time interval between a current effective peak and a last effective peak, for determining continuity of the acceleration data;
when the time interval is greater than a preset interval, the acceleration data is discontinuous data, obtaining the acceleration data as a data area of the effective peaks, and determining a number of the effective peaks within the data area, until a next time interval is greater than the preset interval by the step counting device;
when the time interval is less than the preset interval, the user is currently in a state of continuous motion, the number of the effective peaks within the data area is increased by one, and switching to a next effective peak by the step counting device;
when the number of the effective peaks within the data area is less than a preset value, determining feature information of the effective peaks within the data area by the step counting device,
wherein the number of the effective peaks comprises a number of steps of the user that has not reached a default step counting condition of the step counting device; and
when the feature information of the effective peaks within the data area satisfies a preset condition, updating step counting data by the step counting device.
2 . The step counting method of claim 1 , wherein when the feature information of the effective peaks within the data area satisfies the preset condition, the updating step counting data comprises:
when the feature information of the effective peaks within the data area satisfies the preset condition, determining a number of counted steps according to the effective peaks by the step counting device; and
resetting the number of the effective peaks in the data area to an initial value and switching to a next effective peak by the step counting device.
3 . The step counting method of claim 1 , wherein the determining the time interval between the current effective peak and the last effective peak comprises:
determining a characteristic value of the current effective peak and a characteristic time point corresponding to the characteristic value of the current effective peak by the step counting device; and
when the characteristic value satisfies a first preset condition and the characteristic time point satisfies a second preset condition, determining a time interval between the current effective peak and the last effective peak according to the characteristic time point by the step counting device.
4 . The step counting method of claim 1 , wherein when the number of the effective peaks within the data area is less than the preset value, the determining feature information of the effective peaks within the data area comprises:
when the number of the effective peaks within the data area is less than the preset value, determining an amplitude of each effective peak and a time interval between adjacent effective peaks by the step counting device;
determining a first variance based on the amplitude and a second variance based on the time interval by the step counting device;
assessing the first variance, and a first sub-preset range, and assessing the second variance and a second sub-preset range by the step counting device; and
when the first variance is within the first sub-preset range and the second variance is within the second sub-preset range, updating the step counting data according to a number of the effective peaks in the data area and switching to a next effective peak by the step counting device,
wherein the preset condition comprises that the first variance is within the first sub-preset range and the second variance is within the second sub-preset range.
5 . The step counting method of claim 4 , wherein when the effective peak is a first effective peak, the time interval is a time interval between a characteristic time point of the first effective peak and a reference time point.
6 . The step counting method of claim 1 , wherein after when the time interval is greater than the preset interval, obtaining the data area of the effective peaks until the next time interval is greater than the preset interval, the method further comprises:
when a number of the effective peaks in the data area is greater than the preset value, the step counting device is configured to continue to detect the acceleration data in a normal mode, and updating the step counting data according to the acceleration data in the data area by the step counting device.
7 . A step counting device, wherein the step counting device comprises a memory, a processor and a step counting program stored on the memory and executable on the processor, the step counting program, when executed by the processor, implementing the step counting method of claim 1 .
8 . A computer readable storage medium having a step counting program stored thereon, the step counting program, when executed by the processor, implementing the step counting method of claim 1 .