Step counting method and device
By obtaining the acceleration of the three axes of the acceleration sensor in the terminal device, determining the amount of motion changes and calculating the number of steps, the existing step counting methods are solved, and the existing step counting methods are low accuracy and high energy consumption in complex environments, achieving more accurate step counting and power consumption reduction.
Patent Information
- Application Number
- CN202210329620.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing step counting methods are low in the accuracy of calculating steps and high energy consumption in scenes such as mountain climbing, uneven road walking, or wilderness hiking with weak signals.
By obtaining the acceleration of the three axes of the acceleration sensor in the terminal device, the user's movement change amount is determined, and when the movement change amount is large, the steps are calculated based on the combined acceleration and gravity acceleration, avoiding positioning identification with the help of the GPS module to reduce power consumption.
Improve the accuracy of step calculation in complex environments and reduce unnecessary power consumption.
Smart Images

Figure CN114719883B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of terminals, and particularly relates to a step counting method and device. Background Art
[0002] Existing step counting algorithms usually use an acceleration sensor to collect acceleration data when a user walks, and calculate the number of steps the user walks based on the collected acceleration data. When the user walks or runs on a flat road surface, since the period similarity of adjacent steps is relatively good, the similarity of the four adjacent step periods in the acceleration data can be combined to calculate the number of steps the user walks. Moreover, the impulses of the three axes of acceleration in the collected acceleration data are relatively stable and do not frequently change direction or turn. In such scenarios, the number of steps calculated by existing step counting algorithms is relatively accurate.
[0003] However, in some special scenarios, such as mountain climbing, rock climbing, walking on an uneven road surface, or hiking in the wilderness with very weak signals, since the period similarity of the user's front and rear steps is very disordered, the accuracy of the number of steps calculated by existing step counting algorithms is relatively low.
[0004] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art: existing step counting methods have defects such as relatively low accuracy of the calculated number of steps and relatively high energy consumption in scenarios such as mountain climbing, rock climbing, walking on an uneven road surface, or hiking in the wilderness with very weak signals. Summary of the Invention
[0005] Embodiments of this application provide a step counting method and device to solve the problems of relatively low accuracy of the calculated number of steps and relatively high energy consumption in scenarios such as mountain climbing, rock climbing, walking on an uneven road surface, or hiking in the wilderness with very weak signals in existing step counting methods.
[0006] To solve the above technical problems, this application is implemented as follows:
[0007] In a first aspect, embodiments of this application provide a step counting method, including:
[0008] Obtain a first acceleration, a second acceleration, and a third acceleration of three axes of an acceleration sensor in a terminal device within a preset time period, where the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other in the acceleration direction;
[0009] Determine a motion change amount of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period;
[0010] When the amount of change in the user's movement within the preset time period is greater than or equal to a preset variance threshold, determine the number of steps taken by the user within the preset time period based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the acceleration due to gravity.
[0011] In a second aspect, an embodiment of the present application further provides a step counting device, including:
[0012] An acquisition unit, configured to acquire the first acceleration, the second acceleration, and the third acceleration of three axes of an acceleration sensor in a terminal device within a preset time period, where the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other in the acceleration direction;
[0013] A first determination unit, configured to determine the amount of change in the user's movement within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period;
[0014] A second determination unit, configured to, when the amount of change in the user's movement within the preset time period is greater than or equal to a preset variance threshold, determine the number of steps taken by the user within the preset time period based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the acceleration due to gravity.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the step counting method described in the first aspect are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the step counting method described in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the step counting method described in the first aspect.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the step counting method described in the first aspect.
[0019] In the embodiments of the present application, since the change amount of the user's movement can be determined based on the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device carried by the user, and when the change amount of the movement is relatively large, for example, when the user is hiking in the wilderness with very weak signals or performing some movements with poor movement smoothness, such as the periodic similarity of the front and rear steps being disordered, such as mountain climbing or walking on an uneven road surface, the actual number of steps of the user within a preset time period can be directly determined based on the resultant acceleration of the three axes of the acceleration of the terminal device carried by the user and the gravitational acceleration within the preset time period. At the same time, using this step counting method can also avoid the need to use the GPS module to locate and identify the user when the signal is weak, reducing unnecessary power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 Schematic diagram of the implementation process of a step counting method provided by an embodiment of the present application;
[0022] Figure 2 Schematic diagram of the curves of the accelerations of the three axes of the acceleration sensor and their resultant acceleration when the user has a jumping action in the step counting method provided by an embodiment of the present application;
[0023] Figure 3 Schematic diagram of the curves of the accelerations of the three axes of the acceleration sensor and their resultant acceleration when the movement smoothness changes in the step counting method provided by an embodiment of the present application;
[0024] Figure 4 Schematic diagram of the structure of a step counting device provided by an embodiment of the present application;
[0025] Figure 5 Schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
[0026] Figure 6 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. According to the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0028] The terms "first", "second", etc. in the description and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.
[0029] Next, in conjunction with the accompanying drawings, the step counting method provided in the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0030] To solve the problems that the existing step counting methods have low accuracy in calculating the number of steps and high energy consumption in some scenarios such as mountain climbing, walking on uneven roads, or hiking in the wild with very weak signals, the present application provides a step counting method. The execution subject of this method can be, but is not limited to, at least one of wearable devices such as smart bracelets and smart watches, or user terminals such as mobile phones and tablet computers that can be configured to execute the method provided in the embodiments of the present application.
[0031] For the convenience of description, in the following, the execution subject of this method is taken as a terminal device capable of executing this method as an example to introduce the implementation manner of this method. It can be understood that taking the execution subject of this method as a terminal device is only an exemplary description and should not be construed as a limitation to this method.
[0032] Specifically, the step counting method provided in the present application includes: First, obtain the first acceleration, second acceleration, and third acceleration of the three axes of the acceleration sensor in the terminal device within a preset time period, where the first acceleration, second acceleration, and third acceleration are perpendicular to each other in the acceleration direction; then, based on the first acceleration, second acceleration, and third acceleration within the preset time period, determine the amount of motion change of the user within the preset time period; finally, when the amount of motion change of the user within the preset time period is greater than or equal to a preset variance threshold, based on the resultant acceleration of the first acceleration, second acceleration, and third acceleration and the gravitational acceleration within the preset time period, determine the number of steps of the user within the preset time period.
[0033] In the embodiments of the present application, since the change amount of the user's movement can be determined based on the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device carried by the user, and when the change amount of the movement is relatively large, for example, when the user is hiking in the wilderness with very weak signals or performing some movements with poor movement smoothness, such as climbing mountains or walking on uneven roads, where the periodic similarity of the front and back steps is disordered, the actual number of steps of the user in a preset time period can be directly determined based on the resultant acceleration of the three axes of the acceleration sensor in the terminal device carried by the user and the gravitational acceleration in the preset time period. At the same time, using this step counting method can also avoid the need to use the GPS module to locate and identify the user when the signal is weak, reducing unnecessary power consumption.
[0034] The following Figure 1 is a schematic diagram of the specific implementation process of the step counting method shown below, and the implementation process of this method will be introduced in detail, including:
[0035] S110. Obtain the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device within a preset time period, and the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other in the acceleration direction.
[0036] Specifically, the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor may be the accelerations of the x, y, and z axes of the acceleration sensor, respectively.
[0037] It should be understood that when the user is performing some movements with relatively disordered periodic similarity of the front and back steps, such as climbing mountains or walking on uneven roads, it is often difficult to accurately calculate the actual number of steps of the user by using the existing method of calculating the number of steps based on the periodic similarity of adjacent front and back steps. In order to solve this problem in the embodiments of the present application, the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device of the user within the most recent preset time period can be obtained. For example, the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor within the most recent 20 s are obtained to determine whether the user has a jumping action, and then to determine the movement smoothness of the user, so as to determine whether to calculate the number of steps by using the periodic similarity of adjacent front and back steps or to use the step counting method proposed in the embodiments of the present application to calculate the number of steps.
[0038] S120. Determine the change amount of the user's movement within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period.
[0039] It should be understood that when the user is performing exercises such as mountain climbing, rock climbing, or walking on uneven roads, where the periodic similarity of the front and back steps is relatively disordered, the exercise stability is often poor. Based on this, in the embodiments of the present application, the amount of exercise change of the user within a preset time period can be determined based on the first acceleration, second acceleration, and third acceleration of three axes within the preset time period, and then a step counting method can be determined to more accurately calculate the actual number of steps of the user.
[0040] Optionally, when the user performs some exercises with relatively disordered periodic similarity of the front and back steps, there are often some intermittent jumping actions. That is, when there are jumping actions, the possibility of poor exercise stability is also relatively high. Based on this, in the embodiments of the present application, it can first be determined whether there are some jumping actions of the user within a preset time period. On the basis of determining that the user may have some jumping actions, the exercise stability of the user within the preset time period can be further determined. Based on the first acceleration, second acceleration, and third acceleration within the preset time period, determining the amount of exercise change of the user within the preset time period includes:
[0041] Based on the first acceleration, second acceleration, and third acceleration within the preset time period, determine the combined acceleration of the first acceleration, second acceleration, and third acceleration of the specified sampling points within the preset time period;
[0042] Based on the combined acceleration of the specified sampling points within the preset time period, determine whether there are jumping actions of the user within the preset time period;
[0043] In the case where there are jumping actions of the user within the preset time period, based on the first acceleration, second acceleration, and third acceleration within the preset time period, determine the amount of exercise change of the user within the preset time period.
[0044] Among them, based on the first acceleration, second acceleration, and third acceleration x, y, z within the preset time period, determining the combined acceleration of the first acceleration, second acceleration, and third acceleration of the specified sampling points within the preset time period can be specifically obtained by taking the square root of the sum of the squares of the first acceleration, second acceleration, and third acceleration of the specified sampling points within the preset time period, that is, taking the combined acceleration of the first acceleration, second acceleration, and third acceleration of each sampling point of the specified sampling points within the preset time period as The specified sampling points within the preset time period can be selected according to actual needs. For example, the latest N sampling points within the preset time period can be selected (that is, the sampling points are sorted in the order of time occurrence, and the N sampling points that are later in time), where N is a positive integer.
[0045] Optionally, based on the combined acceleration of the specified sampling points within the preset time period, determining whether there are jumping actions of the user within the preset time period includes:
[0046] Determine the motion energy at a specified moment based on the combined acceleration of a specified number of specified sampling points, where the specified number of specified sampling points are the sampling points before the specified moment within a preset time period;
[0047] In the case where the motion energy at the specified moment is greater than or equal to a preset energy threshold and the second-order difference of the combined acceleration at the specified moment is not greater than a preset threshold, determine whether the user has a jumping action within the preset time period based on the motion energy of the sampling points within a preset time range before and after the specified moment.
[0048] It should be understood that when the terminal device is in a stationary state or a steady motion state, the value of the combined acceleration of the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor of the terminal device should be consistent with the value of the gravitational acceleration. To accurately determine the motion stability of the terminal device, the combined acceleration of the first acceleration, the second acceleration, and the third acceleration of the three axes can be subtracted by the gravitational acceleration to obtain the difference between the combined acceleration and the gravitational acceleration, and then further judgment can be made on this difference.
[0049] For example, the motion energy at a specified moment can be defined as the average value of the squares of the differences between the combined accelerations of the first acceleration, the second acceleration, and the third acceleration of the three axes of the first 8 sampling points adjacent to the specified moment and the gravitational acceleration. Specifically, the first acceleration, the second acceleration, and the third acceleration of the three axes of the first 8 sampling points are respectively represented as (x1, y1, z1), (x2, y2, z2), ……, (x8, y8, z8), then the combined acceleration of the first acceleration, the second acceleration, and the third acceleration of the three axes of the first 8 sampling points adjacent to the specified moment is The average value avg of the squares of the differences between the combined accelerations of the first acceleration, the second acceleration, and the third acceleration of the three axes of the first 8 sampling points adjacent to the specified moment and the gravitational acceleration can be expressed as avg = ((a1 - g) 2 +(a2 - g) 2 +…+(a8 - g) 2 ) / 8.
[0050] For example, if the motion energy at the specified moment is greater than or equal to the preset energy threshold and the second-order difference of the combined acceleration at the specified moment is not greater than the preset threshold, then determine the motion energy of the sampling points within the preset time range before and after the specified moment. Specifically, the preset energy threshold can be set to 20, and the preset threshold can be set to -10. Among them, the second-order difference of the combined acceleration at the specified moment is the first-order difference of the first-order difference of the combined acceleration at the specified moment, and the first-order difference of the combined acceleration at the specified moment is the combined acceleration at the previous moment of the specified moment minus the combined acceleration at the specified moment. The second-order difference of the combined acceleration at the specified moment is the first-order difference of the combined acceleration at the previous moment of the specified moment minus the first-order difference of the combined acceleration at the specified moment.
[0051] For example, to determine the motion energy of the sampling points within a preset time range before and after a specified moment, specifically, the motion energy of the sampling points within a preset range before and after the specified moment can be determined. For example, if the preset time range is 3 s and the sampling frequency is 25 Hz, then there are 25 sampling points per second. Thus, the motion energy of the sampling points within the preset time range before and after the specified moment is the motion energy of 75 sampling points within 3 seconds before and after the specified moment.
[0052] It should be understood that within the preset time range before and after the user performs a jumping action, the user is often in a static or slightly fluctuating state. Therefore, based on the fluctuation amplitude of the motion energy of the sampling points within the preset time range before and after the specified moment, it can be determined whether the user is in the state of performing a jumping action at the specified moment. For example, based on the number of sampling points whose motion energy within 3 seconds before and after the specified moment is less than 0.5, it can be determined whether the user is in the state of performing a jumping action at the specified moment. Specifically, it can be set that the number of sampling points whose motion energy within 75 sampling points within 3 seconds before and after the specified moment is less than 0.5 is greater than or equal to 15, that is, to determine whether the user is in the state of performing a jumping action at the specified moment. Figure 2 This is a schematic curve diagram of the first acceleration, the second acceleration, the third acceleration, and their combined acceleration of the three axes of the acceleration sensor in the step counting method provided by the embodiments of the present application when the user has a jumping action. Figure 2 As can be seen, within a period of time before and after the user has a jumping action, the acceleration value is relatively stable, that is, the amount of motion change is small.
[0053] Optionally, based on the first acceleration, the second acceleration, and the third acceleration within a preset time period, determining the amount of motion change of the user within the preset time period includes:
[0054] Determining the first acceleration, the second acceleration, and the third acceleration of multiple sampling points from the first acceleration, the second acceleration, and the third acceleration within the preset time period, and the multiple sampling points are evenly distributed within the preset time period;
[0055] Based on the first acceleration, the second acceleration, and the third acceleration of the multiple sampling points, determining the combined acceleration of the first acceleration, the second acceleration, and the third acceleration of the multiple sampling points;
[0056] Determining the variance of the first-order difference of the combined acceleration of the multiple sampling points;
[0057] Based on the variance of the first-order difference of the combined acceleration of the multiple sampling points, determining the amount of motion change of the user within the preset time period.
[0058] For example, from the first acceleration, second acceleration, and third acceleration of three axes within a preset time period, determine the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points. Specifically, from the first acceleration, second acceleration, and third acceleration of three axes within a preset time period, determine the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points (such as ten sampling points) within a recent period of time (such as within 20 s). For example, the accelerations of three axes every 2 s within the recent 20 s can be determined (Ax1, Ax2, ……, Ax10, Ay1, Ay2, ……, Ay10, Az1, Az2, ……, Az10). Among them, considering that it usually takes 2 s for a normal user to take a complete step, an interval of 2 s can be selected as a sampling point.
[0059] Then, based on the first acceleration, second acceleration, and third acceleration of three axes at the above 10 sampling points (Ax1, Ax2, ……, Ax10, Ay1, Ay2, ……, Ay10, Az1, Az2, ……, Az10), determine the resultant acceleration (Aa1, Aa2, ……, Aa10) of the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points. Among them, The first-order differences of the resultant accelerations of the first acceleration, second acceleration, and third acceleration of three axes at these 10 sampling points are (Aa2 - Aa1, Aa3 - Aa2, ……, Aa10 - Aa9), and its variance where A is the average value of Aa2 - Aa1, Aa3 - Aa2, ……, Aa10 - Aa9.
[0060] Among them, based on the variance of the first-order differences of the resultant accelerations of the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points, determine the amount of movement change of the user within the preset time period, including:
[0061] When the variance of the first-order differences of the resultant accelerations of the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points is greater than the preset variance threshold, it is determined that the amount of movement change of the user within the preset time period is large;
[0062] When the variance of the first-order differences of the resultant accelerations of the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points is less than the preset variance threshold, determine the relationship between the variance of the first-order differences of the first acceleration, second acceleration, and third acceleration of three axes at multiple sampling points and the corresponding preset variance thresholds of the three axes;
[0063] If the variance of the first-order difference of the acceleration in one or more axes among the variances of the first-order differences of the first acceleration, the second acceleration, and the third acceleration of three axes at multiple sampling points is greater than the corresponding preset variance threshold, it is determined that the amount of movement change of the user within the preset time period is large.
[0064] Among them, the preset variance thresholds for the corresponding three axes can set a variance threshold for each axis, that is, set the preset variance threshold for the x-axis, the preset variance threshold for the y-axis, and the preset variance threshold for the z-axis respectively, or can set a unified preset variance threshold, which can be specifically set according to the actual situation. Figure 3 It is a schematic curve diagram of the accelerations of the three axes of the acceleration sensor and their resultant acceleration in the step counting method provided by the embodiment of the present application when the motion smoothness changes. From Figure 3 It can be seen that the amount of movement change of the y-axis of the acceleration sensor is large.
[0065] S130. When the amount of movement change of the user within the preset time period is greater than or equal to the preset variance threshold, based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the gravitational acceleration, determine the number of steps of the user within the preset time period.
[0066] Specifically, if the amount of movement change of the user within the preset time period is greater than or equal to the preset variance threshold, it can be determined that the amount of movement change of the user within the preset time period is large. At this time, based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of the three axes within the preset time period, the number of steps of the user within the preset time period can be determined.
[0067] Optionally, based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the gravitational acceleration, determining the number of steps of the user within the preset time period includes:
[0068] Determine the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration at multiple sampling points within the preset time period;
[0069] Based on the cube of the difference between the resultant acceleration at multiple sampling points within the preset time period and the gravitational acceleration, determine the number of steps of the user within the preset time period.
[0070] For example, taking a sampling frequency of 25 Hz as an example, there are 25 sampling points per second. Considering that the time for a user to complete one step is usually within two seconds, the number of steps of the user within the last two seconds of a preset time period can be determined based on the cube of the difference between the resultant acceleration of 50 sampling points within the last two seconds of the preset time period and the gravitational acceleration. Suppose the cube of the difference between the resultant acceleration of 50 sampling points within the last two seconds of the preset time period, sorted in chronological order, is: 5, 25, 55, 90, 30, -20, -10, 8, 30, 70, -5, ……
[0071] Optionally, determining the number of steps of the user within the preset time period based on the cube of the difference between the resultant acceleration of multiple sampling points within the preset time period and the gravitational acceleration includes:
[0072] Determining multiple groups of values that are positive and temporally continuous from the cubes of the differences between the resultant accelerations of multiple sampling points within the preset time period and the gravitational acceleration;
[0073] Determining the target number of groups whose sum of values in each group is greater than a set threshold from the multiple groups of values;
[0074] Determining the number of steps of the user within the preset time period based on the target number.
[0075] After obtaining that the cube of the difference between the resultant acceleration of 50 sampling points within the last two seconds of the preset time period, sorted in chronological order, is: 5, 25, 55, 90, 30, -20, -10, 8, 30, 70, -5, ……, the sum of the first group of values that are positive and temporally continuous is 5 + 25 + 55 + 90 + 30 = 205, denoted as step1, the sum of the second group of values that are positive and temporally continuous is 8 + 30 + 70 = 108, denoted as step2, ……, the sum of the last group of values that are positive and temporally continuous is denoted as stepN. Assuming the set threshold is 125, the number of values greater than 125 among step1 to stepN can be used as the number of steps of the user within the preset time period.
[0076] Optionally, since the maximum number of steps for a human to walk or run is 4 steps per second, if it exceeds 8 steps within two seconds, it is output as 8 steps. That is, if the number of steps within the preset time period is greater than the value of the preset time period multiplied by 4, then the number of steps of the user within the preset time period is determined according to the number of steps of the preset time period multiplied by 4.
[0077] Optionally, if the amount of movement change of the user within a preset time period is greater than or equal to a preset variance threshold, or if the user does not have a jumping action within the preset time period, the actual number of steps of the user can be calculated according to the normal step counting method. Specifically, a low-pass filter can be used to filter the accelerations of the three axes of the acceleration sensor and their resultant acceleration (a total of four axes) to obtain the output result; then, features such as peaks, valleys, their height differences, and time differences are found for the accelerations of the four axes after filtering, and features such as the deviation degree of four adjacent peak-valley pairs are calculated.
[0078] Among them, the calculation process of the deviation degree is to respectively determine the maximum value points and minimum value points from the acceleration data of the four axes after filtering as possible peak-valley points, then calculate the height increment dy1 from the valley to the peak (i.e., the amplitude of the peak minus the amplitude of the valley) and the height increment dy2 from the next valley to the peak, and then calculate the deviation diff = the absolute value of (dy2 - dy1) / (dy2 + dy1). The larger the value of this deviation diff, the greater the deviation degree. For example, the preset deviation degree threshold can be 0.15. If diff is not greater than the preset deviation degree threshold, it can be determined that the actual number of steps of the user is calculated according to the normal step counting method.
[0079] In the step counting method provided in the embodiments of the present application, since the amount of movement change of the user can be determined based on the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device carried by the user, and when the amount of movement change is large, for example, when the user is hiking in the desolate wild with very weak signals or performing some movements with poor cycle similarity of front and back steps, that is, poor movement smoothness, such as mountain climbing and rock climbing, walking on uneven roads, the actual number of steps of the user within a preset time period can be directly determined based on the resultant acceleration of the three axes of the acceleration sensor and the gravitational acceleration of the terminal device carried by the user within the preset time period. At the same time, using this step counting method can also avoid the need to use the GPS module to locate and identify the user when the signal is weak, reducing unnecessary power consumption.
[0080] It should be noted that for the step counting method provided in the embodiments of the present application, the execution subject can be a step counting device. In the embodiments of the present application, taking the step counting device executing the step counting method as an example, the step counting device provided in the embodiments of the present application is described.
[0081] As Figure 4 shown, the structural schematic diagram of the step counting device 400 provided in the embodiments of the present application includes:
[0082] An acquisition unit 401, configured to acquire the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device within a preset time period, where the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other in the acceleration direction;
[0083] A first determination unit 402, configured to determine a motion change amount of a user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period;
[0084] A second determination unit 403, configured to determine the number of steps of the user within the preset time period based on a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration and a gravitational acceleration within the preset time period when the motion change amount of the user within the preset time period is greater than or equal to a preset variance threshold.
[0085] Optionally, in an implementation manner, the second determination unit 403 is configured to:
[0086] Determine a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration at multiple sampling points within the preset time period;
[0087] Determine the number of steps of the user within the preset time period based on a cube of a difference between the resultant acceleration at the multiple sampling points within the preset time period and the gravitational acceleration.
[0088] Optionally, in an implementation manner, the second determination unit 403 is configured to:
[0089] Determine multiple groups of numerically continuous values that are positive from cubes of differences between the resultant acceleration at the multiple sampling points within the preset time period and the gravitational acceleration;
[0090] Determine a target number of groups in which a sum of values of each group is greater than a set threshold from the multiple groups of values;
[0091] Determine the number of steps of the user within the preset time period based on the target number.
[0092] Optionally, in an implementation manner, the first determination unit 402 is configured to:
[0093] Determine a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration at a specified sampling point within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period;
[0094] Determine whether there is a jumping action of the user within the preset time period based on the resultant acceleration at the specified sampling point within the preset time period;
[0095] In the case that the user has a jumping motion within the preset time period, based on the first acceleration, the second acceleration, and the third acceleration within the preset time period, determine the amount of motion change of the user within the preset time period.
[0096] Optionally, in one implementation manner, the first determination unit 402 is configured to:
[0097] Determine the first acceleration, the second acceleration, and the third acceleration of a plurality of sampling points from the first acceleration, the second acceleration, and the third acceleration within the preset time period, and the plurality of sampling points are evenly distributed within the preset time period;
[0098] Based on the first acceleration, the second acceleration, and the third acceleration of the plurality of sampling points, determine the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of the plurality of sampling points;
[0099] Determine the variance of the first-order difference of the resultant acceleration of the plurality of sampling points;
[0100] Based on the variance of the first-order difference of the resultant acceleration of the plurality of sampling points, determine the amount of motion change of the user within the preset time period.
[0101] Optionally, in one implementation manner, the first determination unit 402 is configured to:
[0102] Based on the resultant acceleration of a specified number of specified sampling points, determine the motion energy at a specified moment, and the specified number of specified sampling points are the sampling points before the specified moment within the preset time period;
[0103] In the case that the motion energy at the specified moment is greater than or equal to a preset energy threshold and the second-order difference of the resultant acceleration at the specified moment is not greater than a preset threshold, based on the motion energy of the sampling points within a preset time range before and after the specified moment, determine whether the user has a jumping motion within the preset time period.
[0104] In the embodiment of the present application, the step counting device provided can determine the amount of change in the user's movement based on the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device carried by the user. When the amount of change in the movement is large, for example, when the user is hiking in the wilderness with very weak signals or performing some movements with poor cycle similarity of the front and back steps, that is, poor movement smoothness, such as mountain climbing, rock climbing, or walking on an uneven road surface, the actual number of steps of the user within a preset time period can be directly determined based on the resultant acceleration of the three axes of the terminal device carried by the user and the gravitational acceleration within the preset time period. At the same time, using this step counting method can also avoid the need to use the GPS module to locate and identify the user when the signal is weak, reducing unnecessary power consumption.
[0105] The step counting device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make specific limitations.
[0106] The step counting device in the embodiment of the present application can be a device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems. The embodiment of the present application does not make specific limitations.
[0107] The step counting device provided in the embodiment of the present application can implement Figures 1 to 3 each process implemented by the method embodiment. To avoid repetition, it will not be elaborated here.
[0108] Optionally, as Figure 5As shown in the figure, an embodiment of the present application further provides an electronic device M05, including a processor M51 and a memory M52. A program or instruction that can run on the processor M51 is stored on the memory M52. When the program or instruction is executed by the processor M51, each step of the above-mentioned embodiment of the step counting method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.
[0109] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0110] Figure 6 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0111] The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610 and other components.
[0112] Those skilled in the art can understand that the electronic device 600 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 610 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 6 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements, which will not be elaborated here.
[0113] Among them, the processor 610 obtains the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device within a preset time period. The first acceleration, the second acceleration, and the third acceleration are perpendicular to each other in the acceleration direction; based on the first acceleration, the second acceleration, and the third acceleration within the preset time period, determine the amount of movement change of the user within the preset time period; in the case where the amount of movement change of the user within the preset time period is greater than or equal to a preset variance threshold, based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the gravitational acceleration, determine the number of steps of the user within the preset time period.
[0114] Optionally, the processor 610 is further configured to determine the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of multiple sampling points within the preset time period; based on the cube of the difference between the resultant acceleration of the multiple sampling points within the preset time period and the gravitational acceleration, determine the number of steps of the user within the preset time period.
[0115] Optionally, the processor 610 is further configured to determine, from the cube of the difference between the combined acceleration and the gravitational acceleration of the plurality of sampling points within the preset time period, multiple groups of values that are positive and continuous in time; determine, from the multiple groups of values, the target number of groups of values whose sum is greater than a set threshold; and determine the number of steps of the user within the preset time period based on the target number.
[0116] Optionally, the processor 610 is further configured to determine the combined acceleration of the first acceleration, the second acceleration, and the third acceleration at a specified sampling point within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period; determine whether there is a jumping motion of the user within the preset time period based on the combined acceleration of the specified sampling point within the preset time period; and determine the amount of motion change of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period when there is a jumping motion of the user within the preset time period.
[0117] Optionally, the processor 610 is further configured to determine the first acceleration, the second acceleration, and the third acceleration of multiple sampling points from the first acceleration, the second acceleration, and the third acceleration within the preset time period, where the multiple sampling points are evenly distributed within the preset time period; determine the combined acceleration of the first acceleration, the second acceleration, and the third acceleration of the multiple sampling points based on the first acceleration, the second acceleration, and the third acceleration of the multiple sampling points; determine the variance of the first-order difference of the combined acceleration of the multiple sampling points; and determine the amount of motion change of the user within the preset time period based on the variance of the first-order difference of the combined acceleration of the multiple sampling points.
[0118] Optionally, the processor 610 is further configured to determine the motion energy at a specified moment based on the combined acceleration of a specified number of specified sampling points, where the specified number of specified sampling points are the sampling points before the specified moment within the preset time period; and determine whether there is a jumping motion of the user within the preset time period based on the motion energy of the sampling points within a preset time range before and after the specified moment when the motion energy at the specified moment is greater than or equal to a preset energy threshold and the second-order difference of the combined acceleration at the specified moment is not greater than a preset threshold.
[0119] When using the electronic device provided by the present application, since the change amount of the user's movement can be determined based on the first acceleration, the second acceleration, and the third acceleration of the three axes of the acceleration sensor in the terminal device carried by the user, and when the change amount of the movement is large, for example, when the user is hiking in the wilderness with very weak signals or performing some movements with poor movement smoothness, such as the periodic similarity of the front and back steps being disordered, such as mountain climbing, rock climbing, or walking on an uneven road surface, the actual number of steps of the user within a preset time period can be directly determined based on the resultant acceleration of the three axes of the acceleration of the terminal device carried by the user and the gravitational acceleration within the preset time period. At the same time, using this step counting method can also avoid the need to use the GPS module to locate and identify the user when the signal is weak, reducing unnecessary power consumption.
[0120] It should be understood that in the embodiments of the present application, the input unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes the image data of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also referred to as a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch processor. The other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0121] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 609 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0122] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 610 either.
[0123] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the step counting method embodiment described above and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0124] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disc, etc.
[0125] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above step-counting method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0126] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0127] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above step-counting method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0128] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0129] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0130] The embodiments of the present application have been described above with reference to the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A step counting method, characterized in that, Including: Obtaining a first acceleration, a second acceleration, and a third acceleration of three axes of an acceleration sensor in a terminal device within a preset time period, where the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other pairwise in the acceleration direction; Determining a motion change amount of a user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period; When the motion change amount of the user within the preset time period is greater than or equal to a preset variance threshold, determining the number of steps of the user within the preset time period based on a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and a gravitational acceleration; The determining the motion change amount of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period includes: Determining a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of a specified sampling point within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period; Determining a motion energy at a specified moment based on resultant accelerations of a specified number of specified sampling points, where the specified number of specified sampling points are sampling points before the specified moment within the preset time period; When the motion energy at the specified moment is greater than or equal to a preset energy threshold and a second-order difference of the resultant acceleration at the specified moment is not greater than a preset threshold, determining whether there is a jumping action of the user within the preset time period based on motion energies of sampling points within a preset time range before and after the specified moment; When there is a jumping action of the user within the preset time period, determining the motion change amount of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period.
2. The method according to claim 1, wherein The determining the number of steps of the user within the preset time period based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the gravitational acceleration includes: Determining resultant accelerations of the first acceleration, the second acceleration, and the third acceleration of multiple sampling points within the preset time period; Determining the number of steps of the user within the preset time period based on a cube of a difference between the resultant accelerations of the multiple sampling points within the preset time period and the gravitational acceleration.
3. The method according to claim 2, wherein The determining the number of steps of the user within the preset time period based on the cube of the difference between the resultant accelerations of the multiple sampling points within the preset time period and the gravitational acceleration includes: Determining multiple groups of values that are positive and continuous in time from cubes of differences between resultant accelerations of the multiple sampling points within the preset time period and the gravitational acceleration; Determining a target number of groups of values whose sum of each group of values is greater than a set threshold from the multiple groups of values; Determining the number of steps of the user within the preset time period based on the target number.
4. The method according to claim 1, wherein Determining a motion change amount of a user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period, includes: Determining the first acceleration, the second acceleration, and the third acceleration of a plurality of sampling points from the first acceleration, the second acceleration, and the third acceleration within the preset time period, where the plurality of sampling points are evenly distributed within the preset time period; Based on the first acceleration, the second acceleration, and the third acceleration of the plurality of sampling points, determining a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of the plurality of sampling points; Determining a variance of a first-order difference of the resultant acceleration of the plurality of sampling points; Based on the variance of the first-order difference of the resultant acceleration of the plurality of sampling points, determining the motion change amount of the user within the preset time period.
5. A step counting device, characterized in that, Includes: An acquisition unit, configured to acquire the first acceleration, the second acceleration, and the third acceleration of three axes of an acceleration sensor in a terminal device within a preset time period, where the first acceleration, the second acceleration, and the third acceleration are perpendicular to each other pairwise in the acceleration direction; A first determination unit, configured to determine a motion change amount of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period; A second determination unit, configured to, when the motion change amount of the user within the preset time period is greater than or equal to a preset variance threshold, determine the number of steps of the user within the preset time period based on the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration within the preset time period and the gravitational acceleration; The first determination unit, configured to determine a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of a specified sampling point within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period; Determining motion energy at a specified moment based on the resultant accelerations of a specified number of specified sampling points, where the specified number of specified sampling points are sampling points before the specified moment within the preset time period; When the motion energy at the specified moment is greater than or equal to a preset energy threshold and a second-order difference of the resultant acceleration at the specified moment is not greater than a preset threshold, determining whether there is a jumping action of the user within the preset time period based on the motion energy of sampling points within a preset time range before and after the specified moment; When there is a jumping action of the user within the preset time period, determining a motion change amount of the user within the preset time period based on the first acceleration, the second acceleration, and the third acceleration within the preset time period.
6. The device according to claim 5, characterized in that The second determination unit is configured to: Determine a resultant acceleration of the first acceleration, the second acceleration, and the third acceleration of a plurality of sampling points within the preset time period; Determine the number of steps the user takes within the preset time period based on the cube of the difference between the resultant acceleration and the gravitational acceleration at the multiple sampling points within the preset time period.
7. The device according to claim 6, characterized in that, The second determination unit is configured to: Determine multiple groups of numerically continuous positive values from the cubes of the differences between the resultant accelerations and the gravitational accelerations at the multiple sampling points within the preset time period; Determine the target number of groups whose sum of numerical values is greater than a set threshold from the multiple groups of numerical values; Determine the number of steps the user takes within the preset time period based on the target number.
8. The device according to claim 5, characterized in that, The first determination unit is configured to: Determine the first acceleration, the second acceleration, and the third acceleration at multiple sampling points from the first acceleration, the second acceleration, and the third acceleration within the preset time period, where the multiple sampling points are evenly distributed within the preset time period; Based on the first acceleration, the second acceleration, and the third acceleration at the multiple sampling points, determine the resultant acceleration of the first acceleration, the second acceleration, and the third acceleration at the multiple sampling points; Determine the variance of the first-order difference of the resultant acceleration at the multiple sampling points; Based on the variance of the first-order difference of the resultant acceleration at the multiple sampling points, determine the amount of movement change of the user within the preset time period.
9. An electronic device, characterized in that, It includes a processor and a memory. The memory stores programs or instructions that can run on the processor. When the programs or instructions are executed by the processor, the steps of the step-counting method described in any one of claims 1-4 are implemented.
10. A readable storage medium, characterized in that, Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by the processor, the steps of the step-counting method described in any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Step counting device, step counting method thereof, controller and readable storage medium
CN111006683A
Step counting method and device
CN114034313A