Gait recognition method and device, electronic equipment and computer readable storage medium
By updating the acceleration magnitude during the gait cycle and using the average acceleration of the peak and trough values to determine the end of the gait cycle, the gait recognition error problem of finite state machines in non-horizontal movement environments is solved, and the accuracy of gait recognition is improved.
Patent Information
- Application Number
- CN202211093928.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-09-08
AI Technical Summary
Existing gait recognition methods based on finite state machines suffer from large changes in the magnitude of the initial state resultant acceleration when pedestrians are going up or down slopes or stairs, leading to significant errors in gait period recognition and reducing the accuracy of gait detection.
By acquiring the peak and trough values of acceleration during the gait cycle, the average acceleration is calculated, and the acceleration modulus is updated when the difference between the average acceleration and the preset value exceeds a threshold. The updated acceleration modulus is then used to determine whether the gait cycle has ended.
It improves the accuracy of gait recognition, especially the accuracy of gait cycle recognition in non-horizontal movement situations.
Smart Images

Figure CN116778567B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of terminal technology, and in particular to a gait recognition method, device, electronic device, and computer-readable storage medium. Background Technology
[0002] Currently, gait recognition methods based on finite state machines typically define the transitions of each gait state in a gait cycle using a finite state machine, and identify the initial state of each gait cycle based on the sum of acceleration magnitudes of the initial state, thereby enabling step counting by recognizing gait cycles.
[0003] However, in related technologies, the initial state resultant acceleration magnitude of each gait cycle is a pre-set fixed value and a fixed range of tolerance. Therefore, it is only applicable to flat walking environments. When pedestrians go up or down slopes or stairs, the initial resultant acceleration magnitude within the gait cycle will change significantly. The fixed range of resultant acceleration magnitude cannot match the acceleration changes in these states. This results in a large error in the current finite state machine gait detection method when determining whether a gait cycle has ended or when calculating the gait cycle, thus reducing the accuracy of gait detection. Summary of the Invention
[0004] The present invention aims to provide a gait recognition method, apparatus, electronic device, and computer-readable storage medium that can improve the accuracy of gait recognition.
[0005] The technical solution of this invention is implemented as follows:
[0006] This invention provides a gait recognition method, comprising:
[0007] At the start of the current gait cycle, the acceleration at each sampling moment is obtained according to the preset sampling interval;
[0008] When the acceleration in the current gait cycle has a peak value and a trough value, calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value;
[0009] When the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, the preset initial acceleration modulus is updated based on the average acceleration to obtain the updated acceleration modulus.
[0010] Based on the acceleration at each sampling moment and the updated acceleration magnitude, it is determined whether the current gait cycle has ended, so as to achieve gait recognition.
[0011] In some embodiments, the preset initial acceleration modulus includes: the preset initial acceleration value and the preset acceleration threshold; updating the preset initial acceleration modulus based on the average acceleration to obtain the updated acceleration modulus includes:
[0012] Determine the difference between the average acceleration and the preset initial acceleration value;
[0013] The preset acceleration threshold is updated based on the difference between the preset coefficient and the preset value to obtain the updated acceleration threshold.
[0014] The preset initial acceleration value is updated using the average acceleration to obtain the updated initial acceleration value;
[0015] The updated acceleration threshold and the initial value of the updated acceleration are used as the updated acceleration modulus.
[0016] In some embodiments, determining whether the current gait cycle has ended based on the acceleration at each sampling time and the updated acceleration magnitude includes:
[0017] When the acceleration at each sampling moment is greater than the acceleration at the previous sampling moment, the uphill count is incremented; the initial value of the uphill count is zero.
[0018] When the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the obtained acceleration satisfies the range of the initial acceleration value of the gait cycle represented by the updated acceleration modulus, the current gait cycle is determined to end.
[0019] In some embodiments, before determining the end of the current gait cycle, the method further includes:
[0020] When the acceleration at the current sampling moment is less than or equal to the sum of the initial value of the updated acceleration and the threshold value of the updated acceleration, and is greater than or equal to the difference between the initial value of the updated acceleration and the threshold value of the updated acceleration, the range of initial acceleration values of the gait cycle that satisfies the updated acceleration magnitude value is determined.
[0021] In some embodiments, the method further includes:
[0022] In each sampling time, when the acceleration at sampling time t is greater than the acceleration at sampling time (t-1) and greater than the acceleration at sampling time (t+1), it is determined that a peak value occurs at sampling time t.
[0023] When the acceleration at sampling time t is less than the acceleration at sampling time (t-1) and less than the acceleration at sampling time (t+1), a trough value is determined to occur at sampling time t.
[0024] In some embodiments, obtaining the acceleration at each sampling time point includes:
[0025] The resultant acceleration is determined based on at least one acceleration collected by at least one acceleration sensor, and is used as the acceleration at each sampling time.
[0026] In some embodiments, the gait cycle includes multiple preset states, and after determining that the current gait cycle has ended, the method further includes:
[0027] Enter the initial preset state in the next state cycle and continue to acquire the acceleration at each sampling time.
[0028] When an acceleration greater than the initial value of the updated acceleration is obtained, the system switches from the initial preset state to the first preset state; the first preset state represents a gait where the heel leaves the ground and the acceleration begins to increase.
[0029] In some embodiments, after switching from the initial preset state to the first preset state, the method further includes:
[0030] In the first preset state, the number of uphill climbs is counted by comparing the acceleration at each sampling moment of the next gait cycle with the acceleration at the previous moment. When the number of uphill climbs is greater than the preset threshold for the number of uphill climbs in the previous period and the peak value of the acceleration is obtained, the system switches from the first preset state to the second preset state. The second preset state represents the gait with the toes off the ground and the maximum acceleration.
[0031] In some embodiments, after switching from the first preset state to the second preset state, the method further includes:
[0032] In the second preset state, the downhill count is reset, and the system switches from the second preset state to the third preset state; the third preset state represents a gait where the foot lands after lifting the leg and the acceleration decreases.
[0033] In the third preset state, the acceleration corresponding to each sampling moment continues to be acquired. When the acceleration corresponding to each sampling moment is less than the acceleration corresponding to the previous sampling moment, the downhill count is increased.
[0034] When the downhill count is greater than or equal to a preset downhill threshold and a trough value appears, it is determined to switch from the third preset state to the fourth preset state; the fourth preset state represents the gait where the heel begins to touch the ground and the acceleration is minimal.
[0035] In some embodiments, after switching from the third preset state to the fourth preset state, the method further includes:
[0036] In the fourth preset state, the uphill count is reset, and the average acceleration in the third preset state is calculated;
[0037] When the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than the preset difference threshold, the initial value of the updated acceleration and the updated acceleration threshold are updated based on the average acceleration in the third preset state, and then the switch from the fourth preset state to the fifth preset state is determined.
[0038] When the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is less than or equal to the preset difference threshold, it is determined to switch from the fourth preset state to the fifth preset state.
[0039] In some embodiments, after switching from the fourth preset state to the fifth preset state, the method further includes:
[0040] In the fifth preset state, the acceleration corresponding to each sampling moment is continued to be acquired. When the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment, the uphill count is increased.
[0041] When the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the acceleration is obtained to meet the numerical range corresponding to the initial value of the updated acceleration and the threshold of the updated acceleration, it is determined to switch from the fifth preset state to the sixth preset state; the sixth preset state represents the end gait where the toes touch the ground and the acceleration meets the initial value of the acceleration of the gait cycle.
[0042] This invention provides a gait recognition device, comprising:
[0043] The acquisition unit is used to acquire the acceleration at each sampling moment according to a preset sampling interval at the beginning of the current gait cycle;
[0044] The calculation unit is used to calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value when the acceleration in the current gait cycle has a peak value and a trough value;
[0045] The update unit is used to update the preset initial acceleration modulus value based on the average acceleration when the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, so as to obtain the updated acceleration modulus value.
[0046] The determining unit is used to determine whether the current gait cycle has ended based on the acceleration at each sampling time and the updated acceleration magnitude, so as to achieve gait recognition.
[0047] In some embodiments, the preset initial acceleration modulus includes: the preset initial acceleration value and the preset acceleration threshold. The updating unit is further configured to determine the difference between the average acceleration and the preset initial acceleration value; update the preset acceleration threshold according to a preset coefficient and the difference to obtain an updated acceleration threshold; update the preset initial acceleration value using the average acceleration to obtain an updated initial acceleration value; and use the updated acceleration threshold and the updated initial acceleration value as the updated acceleration modulus.
[0048] In some embodiments, the determining unit is further configured to increase the uphill count when the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment; the initial value of the uphill count is zero; when the uphill count is greater than or equal to a preset threshold for the number of uphill times in the later stage, and the obtained acceleration satisfies the range of the initial acceleration value of the gait cycle represented by the updated acceleration modulus, the current gait cycle is determined to end.
[0049] In some embodiments, the determining unit is further configured to, before determining the end of the current gait cycle, determine the range of initial acceleration values of the gait cycle that satisfies the characteristics of the updated acceleration modulus when the acceleration at the current sampling moment is less than or equal to the sum of the initial value of the updated acceleration and the updated acceleration threshold, and is greater than or equal to the difference between the initial value of the updated acceleration and the updated acceleration threshold.
[0050] In some embodiments, the calculation unit is further configured to, at each sampling time, determine that a peak value occurs at the t-th sampling time when the t-th acceleration obtained at the t-1 sampling time is greater than the (t-1)-th acceleration obtained at the (t-1)-th sampling time and is greater than the (t+1)-th acceleration obtained at the (t+1)-th sampling time; and determine that a trough value occurs at the t-th sampling time when the t-th acceleration obtained at the t-th sampling time is less than the (t-1)-th acceleration obtained at the (t-1)-th sampling time and is less than the (t+1)-th acceleration obtained at the (t+1)-th sampling time.
[0051] In some embodiments, the acquisition unit is further configured to determine a resultant acceleration as the acceleration at each sampling moment based on at least one acceleration collected by at least one acceleration sensor.
[0052] In some embodiments, the gait cycle includes multiple preset states. The acquisition unit is further configured to, after determining that the current gait cycle has ended, enter the initial preset state in the next gait cycle and continue to acquire the acceleration at each sampling moment.
[0053] The determining unit is further configured to switch from the initial preset state to the first preset state when an acceleration greater than the initial value of the updated acceleration is obtained; the first preset state represents a gait where the heel leaves the ground and the acceleration begins to increase.
[0054] In some embodiments, the determining unit is further configured to, in the first preset state, count the number of uphill climbs by comparing the acceleration at each sampling moment of the next gait cycle with the acceleration at the previous moment, and switch from the first preset state to the second preset state when the number of uphill climbs is greater than a preset threshold for the number of uphill climbs in the previous period and the peak value of the acceleration is obtained; the second preset state represents the gait with the toes off the ground and the maximum acceleration.
[0055] In some embodiments, the determining unit is further configured to reset the downhill count in the second preset state and switch from the second preset state to a third preset state; the third preset state represents a gait with reduced acceleration after lifting the leg and landing.
[0056] The acquisition unit is further configured to continue acquiring the acceleration corresponding to each sampling moment in the third preset state;
[0057] The determining unit is further configured to increase the downhill count when the acceleration corresponding to each sampling moment is less than the acceleration corresponding to the previous sampling moment; and to determine to switch from the third preset state to the fourth preset state when the downhill count is greater than or equal to a preset downhill threshold and a trough value appears; the fourth preset state represents the gait where the heel begins to touch the ground and the acceleration is minimal.
[0058] In some embodiments, the calculation unit is further configured to reset the uphill count in the fourth preset state and calculate the average acceleration in the third preset state;
[0059] The determining unit is further configured to, when the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than the preset difference threshold, update the initial value of the updated acceleration and the updated acceleration threshold based on the average acceleration in the third preset state by the updating unit, and then determine to switch from the fourth preset state to the fifth preset state.
[0060] The determining unit is further configured to determine to switch from the fourth preset state to the fifth preset state when the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is less than or equal to the preset difference threshold.
[0061] In some embodiments, the determining unit is further configured to, in the fifth preset state, continue to acquire the acceleration corresponding to each sampling moment through the acquiring unit, and when the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment, increase the uphill count;
[0062] The determining unit is further configured to determine to switch from the fifth preset state to the sixth preset state when the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the acceleration is obtained to satisfy the numerical range corresponding to the initial value of the updated acceleration and the threshold of the updated acceleration; the sixth preset state represents the end gait where the toes touch the ground and the acceleration satisfies the initial value of the acceleration of the gait cycle.
[0063] This invention provides an electronic device, comprising:
[0064] Memory, used to store executable instructions;
[0065] The processor is configured to implement the gait recognition method provided in the embodiments of the present invention when executing executable instructions stored in the memory.
[0066] This invention provides a computer-readable storage medium storing executable instructions that, when executed by a processor, implement the gait recognition method provided in this invention.
[0067] This invention provides a computer program product, including a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the gait recognition method provided in this invention.
[0068] This invention provides a gait recognition method, apparatus, electronic device, and computer-readable storage medium. When the acceleration within the current gait cycle exhibits peak and trough values, it indicates that the sampling interval corresponding to the peak and trough values includes the acceleration change process from its maximum to minimum value. Therefore, when the difference between the average acceleration of multiple accelerations within the sampling interval corresponding to the peak and trough values and a preset initial acceleration value is greater than a preset difference threshold, it indicates that the average acceleration of the current gait cycle has changed significantly compared to the preset initial acceleration magnitude at the start of the gait cycle. Using the original preset initial acceleration magnitude to estimate the gait cycle will result in a large error. This invention updates the preset initial acceleration magnitude to an updated acceleration magnitude based on the average acceleration, and determines whether the gait cycle has ended based on the updated acceleration magnitude, thereby improving the accuracy of gait recognition based on gait cycles. Attached Figure Description
[0069] Figure 1 The curve shows the variation of the gait period under non-horizontal movement conditions;
[0070] Figure 2 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0071] Figure 3 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0072] Figure 4 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0073] Figure 5 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0074] Figure 6 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0075] Figure 7 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0076] Figure 8 This is a schematic diagram of an optional process for a gait recognition method provided in an embodiment of the present invention;
[0077] Figure 9 A schematic diagram of finite state machine state switching for applying a gait recognition method to a real-world scenario, as provided in an embodiment of the present invention;
[0078] Figure 10 This is a schematic diagram of an optional structure of a gait recognition device provided in an embodiment of the present invention;
[0079] Figure 11 This is a schematic diagram of an optional structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0081] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0082] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
[0083] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0084] Gait detection is based on the periodic changes in sensor data during walking. Common methods include peak detection, zero-crossing method, autocorrelation analysis algorithm, spectral analysis method, and finite state machine (FSM) method. Among them, the FSM method divides the walking process into multiple states based on acceleration changes, and performs gait detection through state recognition to achieve functions such as step counting.
[0085] Currently, some gait detection methods combining finite state machines and acceleration thresholds utilize four states—start, peak, trough, and end—for gait detection. However, the detection performance of this method is easily affected by the threshold value, lacking universality and exhibiting low accuracy in real-world applications. In other improved finite state machine methods, by adding identification states and using differential acceleration thresholds to determine state changes, the gait cycle is divided into seven states: "stable (start) - uphill - peak - downhill - trough - uphill - stable (end)," enabling step counting based on gait cycle identification.
[0086] However, in the improved finite state machine method described above, the initial resultant acceleration magnitude of each gait cycle is a pre-set fixed value (e.g., 9.81) and a fixed tolerance range. Therefore, it is only suitable for flat walking environments. When pedestrians go up or down slopes or stairs, the initial resultant acceleration magnitude within the gait cycle will change significantly, such as... Figure 1 As shown.
[0087] Figure 1 In the graph, the horizontal axis represents the sampling time of each resultant acceleration, and the vertical axis represents the resultant acceleration. Each point on the curve represents the resultant acceleration obtained at the corresponding sampling time. Connecting the points yields the following graph: Figure 1 The curve shown. From Figure 1As can be seen, taking going uphill or upstairs as an example, the initial value of the resultant acceleration in the current gait cycle, such as S6(S0), differs significantly from the initial value S0 of the previous gait cycle. Therefore, a fixed range of resultant acceleration magnitudes cannot match the acceleration changes in these states, causing current finite state machine gait detection methods to be unable to accurately determine whether a gait cycle has ended or to accurately calculate the gait cycle, thus reducing the accuracy of gait detection.
[0088] This invention provides a gait recognition method, apparatus, electronic device, and computer-readable storage medium, which can improve the accuracy of gait recognition. The following describes exemplary applications of the electronic device provided in this invention. The electronic device provided in this invention can be implemented as various types of user terminals such as mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices, smart portable devices, such as smartwatches).
[0089] See Figure 2 , Figure 2 This is an optional flowchart illustrating the gait recognition method provided in an embodiment of the present invention, which will be combined with... Figure 2 The steps shown are explained.
[0090] S101. At the start of the current gait cycle, obtain the acceleration at each sampling moment according to the preset sampling interval.
[0091] The embodiments of the present invention are applicable to scenarios that utilize gait cycle recognition for gait recognition functions such as step counting. The specific choice should be made according to the actual situation, and the embodiments of the present invention do not limit this.
[0092] In this embodiment of the invention, at the start of the current gait cycle, the electronic device collects its own acceleration according to a preset sampling interval at each sampling moment corresponding to the preset sampling interval.
[0093] In some embodiments, the electronic device determines a resultant acceleration as the acceleration at each sampling moment based on at least one acceleration acquired by at least one accelerometer. Here, the resultant acceleration represents the vector sum of the accelerations of the electronic device moving in different directions.
[0094] In some embodiments, the resultant acceleration can be obtained through at least one acceleration sensor configured on a portable terminal such as a mobile phone or smartwatch. Exemplarily, the at least one sensor may include: an inertial sensor, a gravitational acceleration sensor, etc., and the resultant acceleration may include at least one of the terminal's gravitational acceleration, lateral acceleration, vertical acceleration, and forward acceleration. The specific selection depends on the actual situation, and this embodiment of the invention does not impose limitations.
[0095] S102. When the acceleration in the current gait cycle has a peak value and a trough value, calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value.
[0096] In this embodiment of the invention, the electronic device samples the acceleration value at each sampling moment. When the acceleration in the current gait cycle has a peak value and a trough value, the electronic device determines the sampling interval corresponding to the peak value and the trough value according to the sampling moment corresponding to the peak value and the sampling moment corresponding to the trough value.
[0097] It is understandable that the sampling interval corresponding to the peak and trough values contains multiple accelerations corresponding to multiple sampling times. The electronic device averages these multiple accelerations to obtain the average acceleration corresponding to the multiple accelerations.
[0098] In some embodiments, for each sampling time, when the acceleration at sampling time t is greater than the acceleration at sampling time (t-1) and greater than the acceleration at sampling time (t+1), the peak value is determined to occur at sampling time t.
[0099] When the acceleration at sampling time t is less than the acceleration at sampling time (t-1) and less than the acceleration at sampling time (t+1), a trough value is determined to occur at sampling time t.
[0100] In some embodiments, the sampling interval corresponding to the peak value and the trough value is t∈[m,n], where t is any sampling time within the sampling interval, m is the sampling time corresponding to the peak value, and n is the sampling time corresponding to the trough value. The electronic device can calculate the average acceleration using formula (1), as follows:
[0101]
[0102] In formula (1), A t A represents the acceleration value obtained at sampling time t within the sampling interval corresponding to the peak and trough values. new This is the average acceleration.
[0103] It is understandable that, for the case where the acceleration obtained from sampling is the resultant acceleration, the average acceleration is the average resultant acceleration.
[0104] S103. When the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, the preset initial acceleration modulus is updated based on the average acceleration to obtain the updated acceleration modulus.
[0105] In this embodiment of the invention, when the difference between the average acceleration calculated based on actual sampling and the preset initial acceleration value is greater than a preset difference threshold, it indicates that the average acceleration of the current gait cycle has changed significantly compared to the preset initial acceleration magnitude at the start of the gait cycle. The user may be performing non-horizontal movements such as going uphill, downhill, upstairs, or downstairs while carrying the electronic device. Estimating the gait cycle using the original preset initial acceleration magnitude will result in a large error. The electronic device updates the preset initial acceleration magnitude based on the average acceleration, obtaining an updated acceleration magnitude, which is then used to further determine whether the gait cycle has ended.
[0106] In some embodiments, the preset initial acceleration modulus includes: a preset initial acceleration value and a preset acceleration threshold, based on Figure 2 S102 can be like Figure 3 As shown, this is achieved by executing S1021-S1024, as follows:
[0107] S1021. Determine the difference between the average acceleration and the preset initial acceleration value.
[0108] S1022. Update the preset acceleration threshold based on the preset coefficient and the difference to obtain the updated acceleration threshold.
[0109] In this embodiment of the invention, the electronic device determines the difference between the average acceleration and the preset initial acceleration value, and uses the product of the preset coefficient and the absolute value of the difference as the updated acceleration threshold, and uses the updated acceleration threshold to update the original preset acceleration threshold.
[0110] In some embodiments, the electronic device can calculate the updated acceleration threshold using formula (2), as follows:
[0111] α=k|A status -A new | (2)
[0112] In formula (2), k is a preset coefficient, and A status The initial acceleration value is preset, and α is the acceleration update threshold. The electronic device predicts the magnitude of acceleration change at the end of the current gait cycle by calculating the product of a coefficient k and the difference between the average acceleration and the preset initial acceleration.
[0113] S1023. Using the average acceleration, update the preset initial acceleration value to obtain the updated initial acceleration value.
[0114] S1024. Use the updated acceleration threshold and the updated acceleration initial value as the updated acceleration modulus.
[0115] In this embodiment of the invention, the electronic device directly uses the average acceleration calculated based on actual sampling to update the original preset initial acceleration value, thereby obtaining an updated preset initial acceleration value, and uses the updated acceleration threshold and the updated initial acceleration value as the updated acceleration modulus.
[0116] S104. Based on the acceleration and updated acceleration magnitude at each sampling time, determine whether the current gait cycle has ended, so as to realize gait recognition.
[0117] In this embodiment of the invention, after updating the preset acceleration modulus, the electronic device continues to acquire the acceleration at each sampling moment according to the preset sampling interval, detects the change in gait based on the change in acceleration at each sampling moment, and determines whether the current gait cycle has ended by combining the updated acceleration modulus, so as to achieve gait recognition.
[0118] In some embodiments, for each sampling time, when the acceleration corresponding to the current sampling time is greater than the acceleration corresponding to the previous sampling time, the uphill count is incremented by one; until the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the obtained acceleration satisfies the range of the initial acceleration values of the gait cycle characterized by the updated acceleration magnitude, the current gait cycle is determined to end. Here, the initial value of the uphill count is zero.
[0119] In some embodiments, updating the acceleration modulus includes updating an initial acceleration value and updating an acceleration threshold. When the acceleration at the current sampling time is less than or equal to the sum of the initial acceleration value and the updated acceleration threshold, and greater than or equal to the difference between the initial acceleration value and the updated acceleration threshold, the electronic device determines that the range of initial acceleration values for the gait cycle characterized by the updated acceleration modulus is satisfied.
[0120] In some embodiments, for scenarios where step counting is performed using gait recognition, the electronic device increments the number of steps by 1 when it determines that the current gait cycle has ended, and then proceeds to the recognition of the next gait cycle.
[0121] It is understandable that when the acceleration within the current gait cycle exhibits peak and trough values, it indicates that the sampling interval corresponding to the peak and trough values includes the process of acceleration changing from its maximum to its minimum value. Therefore, when the difference between the average acceleration of multiple accelerations within the sampling interval corresponding to the peak and trough values and the preset initial acceleration value is greater than a preset difference threshold, it indicates that the average acceleration of the current gait cycle has changed significantly compared to the preset initial acceleration magnitude at the start of the gait cycle. Using the original preset initial acceleration magnitude to estimate the gait cycle will result in a large error. This embodiment of the invention updates the preset initial acceleration magnitude to an updated acceleration magnitude based on the average acceleration, and determines whether the gait cycle has ended based on the updated acceleration magnitude, thereby improving the accuracy of gait recognition based on gait cycles.
[0122] In some embodiments, based on Figure 2 or Figure 3 ,like Figure 4 As shown, after S104, S201-S202 can also be executed, as follows:
[0123] S201. Enter the initial preset state in the next state cycle and continue to acquire the acceleration at each sampling moment.
[0124] In this embodiment of the invention, upon determining the end of the current gait cycle, the electronic device enters the next gait cycle. The gait cycle in this embodiment, such as both the current gait cycle and the next gait cycle, includes multiple preset states. The transition relationships between these preset states can be represented by a finite state machine. These preset states characterize various gaits within a gait cycle. The first preset state of the gait cycle is the initial preset state.
[0125] It should be noted that the processing procedure of the electronic device in the next gait cycle is the same as that in the current gait cycle. The following description of the processing procedure in the next gait cycle is from the perspective of finite state machine relationship switching.
[0126] In this embodiment of the invention, the initial preset state represents a stable (starting) state, with both feet in contact with the ground and the acceleration being the initial value of the gait cycle. In some embodiments, for walking on flat ground, the initial preset state can be a stationary state, and the corresponding initial acceleration value is a preset initial acceleration value, i.e., 9.8 m / s². 2 For non-horizontal movement, such as going uphill, downhill, upstairs, or downstairs, the initial acceleration value of the initial preset state can be used as the updated initial acceleration value.
[0127] S202. When an acceleration greater than the initial value of the updated acceleration is obtained, switch from the initial preset state to the first preset state.
[0128] In this embodiment of the invention, for the preset initial state of the next gait cycle in a non-horizontal movement situation, when the acceleration obtained by the electronic device is greater than the updated initial value of acceleration, it is determined to switch from the initial preset state to the first preset state; here, the first preset state represents the gait where the heel leaves the ground and the acceleration begins to increase.
[0129] In some embodiments, based on Figure 4 ,like Figure 5 As shown, after S202, S203 can also be executed, as follows:
[0130] S203. In the first preset state, the acceleration at each sampling moment of the next state cycle is compared with the acceleration at the previous moment to count the number of uphill climbs. When the number of uphill climbs is greater than the preset threshold for the number of uphill climbs in the previous period and the peak value of the acceleration is obtained, the state switches from the first preset state to the second preset state.
[0131] In this embodiment of the invention, after entering the first preset state, the electronic device continues to acquire the acceleration at each sampling moment according to the preset sampling interval in the next gait cycle, and takes each sampling moment as the current moment, comparing the acceleration at the current moment with the acceleration at the previous moment. When the acceleration at each sampling moment is greater than the acceleration at the previous moment, the uphill count is incremented by one. Here, the initial value of the uphill count in each gait cycle is 0. The uphill count is incremented in this way until the uphill count is greater than the preset threshold for the previous uphill count, and when the electronic device acquires the peak value of the acceleration at the sampling moment, it determines to switch from the first preset state to the second preset state.
[0132] Here, the second preset state represents the gait with the toes off the ground and the maximum acceleration.
[0133] It should be noted that in the first preset state, the electronic device also counts the number of downhill runs. For example, when the acceleration at each sampling moment is less than the acceleration at the previous moment, the downhill run count is incremented by one. The initial value of the downhill run count for each gait cycle is 0. Since the first preset state represents a state where the heel leaves the ground and the acceleration gradually increases, if the downhill run count is greater than or equal to a preset downhill interference threshold during the uphill process in the first preset state, it indicates a significant error, and the electronic device returns to the initial preset state.
[0134] In some embodiments, based on Figure 5 ,like Figure 6 As shown, after S203, S204-S206 can also be executed, as follows:
[0135] S204. In the second preset state, reset the downhill count and switch from the second preset state to the third preset state.
[0136] In this embodiment of the invention, in the second preset state, the electronic device resets the downhill count, that is, clears the downhill count to zero and enters the third preset state. In other words, the third preset state is obtained by accumulating the uphill count in the first preset state until switching to the second preset state, and then accumulating the downhill count in the second preset state.
[0137] Here, the third preset state represents the gait where the foot lands after lifting the leg and the acceleration decreases.
[0138] S205. In the third preset state, continue to acquire the acceleration corresponding to each sampling moment. When the acceleration corresponding to each sampling moment is less than the acceleration corresponding to the previous sampling moment, increase the downhill count.
[0139] S206 When the downhill count is greater than or equal to the preset downhill threshold and a trough value appears, determine to switch from the third preset state to the fourth preset state.
[0140] In this embodiment of the invention, in the third preset state, the electronic device continues to acquire the acceleration corresponding to each sampling moment and continues to count the number of downhill runs. When the number of downhill runs is greater than or equal to a preset downhill threshold and a trough value appears, it is determined to switch from the third preset state to the fourth preset state. That is, the fourth preset state is obtained by switching based on the accumulated downhill run count in the third preset state. Here, the fourth preset state represents the gait where the heel begins to touch the ground and the acceleration is minimal.
[0141] In some embodiments, based on Figure 6 ,like Figure 7 As shown, after S206, S207-S209 can also be executed, as follows:
[0142] S207. In the fourth preset state, reset the uphill count and calculate the average acceleration in the third preset state.
[0143] In this embodiment of the invention, in the fourth preset state, the electronic device resets the uphill count to zero and obtains multiple accelerations in the sampling time interval corresponding to the third preset state, and calculates the average acceleration in the third preset state.
[0144] It is understandable that the third preset state of each gait cycle includes the peak and trough values of acceleration. The electronic device calculates the average acceleration under the third preset state, which is equivalent to calculating the average acceleration corresponding to multiple accelerations within the sampling interval corresponding to the peak and trough values. The method is consistent with the description in S102 and will not be repeated here.
[0145] S208. When the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than the preset difference threshold, based on the average acceleration in the third preset state, the initial value of the updated acceleration and the updated acceleration threshold are updated, and then it is determined to switch from the fourth preset state to the fifth preset state.
[0146] In this embodiment of the invention, when the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than a preset difference threshold, it indicates that the average acceleration has still changed significantly from the initial acceleration at the beginning of the next gait cycle. Based on the average acceleration in the third preset state, the electronic device updates the initial value of the updated acceleration and the updated acceleration threshold, and then determines to switch from the fourth preset state to the fifth preset state.
[0147] Here, the method by which the electronic device updates the initial value of the updated acceleration and the updated acceleration threshold based on the average acceleration in the third preset state is consistent with the process description in S1021-S1023, and will not be repeated here.
[0148] S209. When the difference between the average acceleration and the initial value of the updated acceleration in the third preset state is less than or equal to the preset difference threshold, determine to switch from the fourth preset state to the fifth preset state.
[0149] In this embodiment of the invention, when the difference between the average acceleration and the initial value of the updated acceleration in the third preset state is less than or equal to a preset difference threshold, it indicates that the average acceleration and the initial acceleration at the beginning of the gait cycle have not changed significantly. The electronic device does not update the initial value of acceleration and the updated acceleration threshold, and directly switches from the fourth preset state to the fifth preset state.
[0150] In some embodiments, based on Figure 7 ,like Figure 8 As shown, after S209, S210-S211 can also be executed, as follows:
[0151] S210. In the fifth preset state, continue to acquire the acceleration corresponding to each sampling time. When the acceleration corresponding to each sampling time is greater than the acceleration corresponding to the previous sampling time, increase the uphill count.
[0152] S211. When the number of uphill counts is greater than or equal to the preset threshold for the number of uphill counts in the later stage, and the obtained acceleration meets the numerical range corresponding to the initial value of the updated acceleration and the threshold for the updated acceleration, determine to switch from the fifth preset state to the sixth preset state.
[0153] In this embodiment of the invention, in the fifth preset state, the electronic device continues to count the number of uphill climbs based on the acceleration corresponding to each sampling time. When the number of uphill climbs is greater than or equal to the preset threshold for the number of uphill climbs in the later stage, and the obtained acceleration satisfies the numerical range corresponding to the initial value of the updated acceleration and the threshold for the updated acceleration, the electronic device switches from the fifth preset state to the sixth preset state.
[0154] Here, the numerical range of acceleration that satisfies the conditions of the initial value of updated acceleration and the threshold value of updated acceleration can include: the acceleration is greater than or equal to the difference between the initial value of updated acceleration and the threshold value of updated acceleration, and less than or equal to the sum of the initial value of updated acceleration and the threshold value of updated acceleration.
[0155] In this embodiment of the invention, the sixth preset state represents the end of a gait where the toes touch the ground and the acceleration meets the initial value of the gait cycle. When the electronic device switches to the sixth preset state, it signifies the end of the next gait cycle. The electronic device uses the end state of the next gait cycle as the starting state of the next gait cycle and continues gait recognition for the next gait cycle. Further details are omitted here.
[0156] It is understood that in the embodiments of the present invention, the judgment of non-horizontal movement states is added, and the resultant acceleration magnitude can be continuously corrected according to the movement state, and the finite state machine algorithm is improved. This makes the improved method not only retain the high-precision detection performance of horizontal movement, but also ensure good detection accuracy in movement states such as going up and down slopes and going up and down stairs, thereby improving the accuracy of gait recognition.
[0157] The following will describe an exemplary application of the embodiments of the present invention in a practical application scenario.
[0158] This invention provides a gait recognition method based on a finite state machine. In addition to the existing finite state machine with seven gaits (S0-S6), this invention adds a S7 state, as follows:
[0159] S0: Stable (initial) state, representing the gait state in which both feet are in contact with the ground. The acceleration in the S0 state is the initial value of the gait cycle, which is also the preset initial value of the resultant acceleration.
[0160] S1: Uphill state, which represents the gait state with the heel off the ground. The acceleration increases in the S1 state.
[0161] S2: Peak state, representing the gait state when the toes leave the ground and the acceleration reaches its peak;
[0162] S3: Downhill state, which represents the gait state after lifting the leg and landing the foot, with reduced acceleration;
[0163] S4: trough state, which represents the gait state when the heel begins to strike the ground, with the lowest acceleration;
[0164] S5: Uphill state, which represents the gait state during the heel strike process, and the acceleration begins to increase;
[0165] S6: Stable (end) state, representing the gait state with toes touching the ground, and the resultant acceleration satisfies the S0 state;
[0166] S7: Acceleration correction state, used to identify non-horizontal movement and correct the acceleration threshold.
[0167] It should be noted that the above S0-S6 states are related to... Figure 1 The meanings of S0-S6 shown in the figure are consistent.
[0168] In some embodiments, the above-mentioned gait states can be achieved through methods such as... Figure 9 The finite state machine representation shown is as follows:
[0169] In state S0, count the number of uphill climbs at time t (CU). t The number of downhill runs at time t (CD) t Set to 0, and obtain the resultant acceleration A at time t. t That is, the current acceleration. When A t Greater than the preset initial value of the resultant acceleration A status When the current state is updated to state S1, the current state is updated.
[0170] In state S1, at least one sampling is performed, and each sampling time in the at least one sampling is taken as the current time t. The resultant acceleration A at time t is... t Greater than A at the previous moment t-1 The resultant acceleration is recorded as uphill, and the number of uphill cycles is counted as CU. t +1; when A t Less than A at the previous moment t-1 The resultant acceleration is recorded as downhill, and the number of downhill runs is counted as CD. t +1. when cd t If the uphill interference threshold (CDC) is greater than or equal to the preset threshold, return to S0 to eliminate the influence of errors. When the uphill count (CU) is... t Greater than or equal to the preset threshold number of uphill sections (CU) i And A t When the peak value is reached, it enters state S2. Here, A t The peak value is A. t The resultant acceleration A is greater than the previous sampling time t-1 t-1 And greater than the resultant acceleration A at the next sampling time t+1. t+1 .
[0171] In state S2, count the number of downhill runs CD. t Reset to 0 and enter S3 state.
[0172] In state S3, count the number of downhill runs (CD). t And record the resultant acceleration at each sampling time, and count the number of downhill runs (CD). t It is greater than or equal to the preset downhill threshold CD, and satisfies A. tWhen it reaches a trough, it enters state S4. Here, A t A is the trough. t The resultant acceleration A is less than the previous sampling time t-1 t-1 And less than the resultant acceleration A at the next sampling time t+1. t+1 .
[0173] In state S4, count the number of uphill climbs (CU). t Reset to 0, and calculate the average acceleration A in state S3 based on the resultant acceleration recorded at each sampling time point in state S3. new . When A new With the preset initial value of the resultant acceleration A status The absolute value of the difference between them |A status -A new If the difference is greater than the preset difference threshold β, proceed to state S7; otherwise, proceed to state S5.
[0174] In state S7, the preset acceleration threshold α is updated according to the above formula (2), and the preset initial value of the resultant acceleration A is set. status Updated to A new That is, setting A status =A new Enter S5 state.
[0175] In state S5, the number of uphill climbs is counted according to the above method, and the uphill climb count CU is... t Greater than or equal to the preset threshold for the number of uphill climbs in the latter part of the slope (CU) j And A t ∈(A status +α,A status When -α), it enters state S6.
[0176] In state S6, increment the current step number by 1 and proceed to state S0 of the next state cycle.
[0177] It is understood that this invention overcomes the limitation of current gait recognition technology based on finite state machines, which is only applicable to flat walking. By identifying whether the movement is uphill / downhill or up / down stairs in state S4 based on the difference between the average resultant acceleration in state S3 and the preset initial value of the resultant acceleration, the accuracy of gait recognition is improved. Furthermore, by dynamically adjusting the resultant acceleration threshold and the initial value, this invention makes the gait recognition algorithm more effective in different populations or scenarios, making it suitable for widespread application.
[0178] It is understood that in the embodiments of the present invention, user information, such as step count and other related data, is involved. When the embodiments of the present invention are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0179] This invention provides a gait recognition device, such as... Figure 10 As shown, the gait recognition device 1 includes:
[0180] The acquisition unit 11 is used to acquire the acceleration at each sampling moment according to a preset sampling interval at the beginning of the current gait cycle;
[0181] The calculation unit 12 is used to calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value when the acceleration in the current gait cycle has a peak value and a trough value.
[0182] The updating unit 13 is used to update the preset initial acceleration modulus based on the average acceleration when the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, so as to obtain the updated acceleration modulus.
[0183] The determining unit 14 is used to determine whether the current gait cycle has ended based on the acceleration at each sampling time and the updated acceleration magnitude, so as to realize gait recognition.
[0184] In some embodiments, the preset initial acceleration modulus includes: the preset initial acceleration value and the preset acceleration threshold. The update unit 13 is further configured to determine the difference between the average acceleration and the preset initial acceleration value; update the preset acceleration threshold according to a preset coefficient and the difference to obtain an updated acceleration threshold; update the preset initial acceleration value using the average acceleration to obtain an updated initial acceleration value; and use the updated acceleration threshold and the updated initial acceleration value as the updated acceleration modulus.
[0185] In some embodiments, the determining unit 14 is further configured to increase the uphill count when the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment; the initial value of the uphill count is zero; when the uphill count is greater than or equal to a preset threshold for the number of uphill times in the later stage, and the obtained acceleration satisfies the range of the initial acceleration value of the gait cycle represented by the updated acceleration modulus, the current gait cycle is determined to end.
[0186] In some embodiments, the determining unit 14 is further configured to, before determining the end of the current gait cycle, determine the range of initial acceleration values of the gait cycle that satisfies the characteristics of the updated acceleration modulus when the acceleration at the current sampling moment is less than or equal to the sum of the initial value of the updated acceleration and the updated acceleration threshold, and is greater than or equal to the difference between the initial value of the updated acceleration and the updated acceleration threshold.
[0187] In some embodiments, the calculation unit 12 is further configured to, at each sampling time, determine that a peak value occurs at the t-th sampling time when the t-th acceleration obtained at the t-1 sampling time is greater than the t-1 acceleration obtained at the t-1 sampling time and is greater than the t+1 acceleration obtained at the t+1 sampling time; and determine that a trough value occurs at the t-th sampling time when the t-th acceleration obtained at the t-th sampling time is less than the t-1 acceleration obtained at the t-1 sampling time and is less than the t+1 acceleration obtained at the t+1 sampling time.
[0188] In some embodiments, the acquisition unit 11 is further configured to determine a resultant acceleration based on at least one acceleration collected by at least one acceleration sensor, as the acceleration at each sampling time.
[0189] In some embodiments, the gait cycle includes multiple preset states. The acquisition unit is further configured to, after determining that the current gait cycle has ended, enter the initial preset state in the next gait cycle and continue to acquire the acceleration at each sampling moment.
[0190] The determining unit 14 is further configured to switch from the initial preset state to the first preset state when an acceleration greater than the initial value of the updated acceleration is obtained; the first preset state represents a gait where the heel leaves the ground and the acceleration begins to increase.
[0191] In some embodiments, the determining unit 14 is further configured to, in the first preset state, count the number of uphill climbs by comparing the acceleration at each sampling moment of the next gait cycle with the acceleration at the previous moment, and switch from the first preset state to the second preset state when the number of uphill climbs is greater than a preset threshold for the number of uphill climbs in the previous period and the peak value of the acceleration is obtained; the second preset state represents the gait with the toes off the ground and the maximum acceleration.
[0192] In some embodiments, the determining unit 14 is further configured to reset the downhill count in the second preset state and switch from the second preset state to a third preset state; the third preset state represents a gait with reduced acceleration after lifting the leg and landing.
[0193] The acquisition unit 11 is further configured to continue acquiring the acceleration corresponding to each sampling moment in the third preset state;
[0194] The determining unit 14 is further configured to increase the downhill count when the acceleration corresponding to each sampling moment is less than the acceleration corresponding to the previous sampling moment; and to determine to switch from the third preset state to the fourth preset state when the downhill count is greater than or equal to a preset downhill threshold and a trough value appears; the fourth preset state represents the gait where the heel begins to touch the ground and the acceleration is the minimum.
[0195] In some embodiments, the calculation unit 12 is further configured to reset the uphill count in the fourth preset state and calculate the average acceleration in the third preset state;
[0196] The determining unit 14 is further configured to, when the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than the preset difference threshold, update the initial value of the updated acceleration and the updated acceleration threshold based on the average acceleration in the third preset state by the updating unit 13, and then determine to switch from the fourth preset state to the fifth preset state.
[0197] The determining unit 14 is further configured to determine to switch from the fourth preset state to the fifth preset state when the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is less than or equal to the preset difference threshold.
[0198] In some embodiments, the determining unit 14 is further configured to, in the fifth preset state, continue to acquire the acceleration corresponding to each sampling moment through the acquiring unit 11, and when the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment, increase the uphill count;
[0199] The determining unit 14 is further configured to determine to switch from the fifth preset state to the sixth preset state when the uphill count is greater than or equal to the preset uphill count threshold and the acceleration is obtained to satisfy the numerical range corresponding to the updated acceleration initial value and the updated acceleration threshold; the sixth preset state represents the end gait where the toes touch the ground and the acceleration satisfies the acceleration initial value of the gait cycle.
[0200] In some embodiments, the present invention also provides an electronic device. Figure 11 This is a schematic diagram of an optional structure of an electronic device provided in an embodiment of the present invention. For example... Figure 11As shown, the electronic device 2 includes a memory 22 and a processor 23. The memory 22 and the processor 23 are connected via a communication bus 24. The memory 22 stores executable instructions. The processor 23, when executing the executable instructions stored in the memory 22, implements the method provided in this embodiment of the invention, such as the gait recognition method provided in this embodiment of the invention.
[0201] It should be noted that the description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.
[0202] This invention provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are executed by a processor, causing the processor to execute the gait recognition method provided in this invention.
[0203] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0204] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0205] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0206] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0207] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0208] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0209] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0210] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0211] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of the present invention are included within the scope of protection of the present invention.
Claims
1. A gait recognition method, characterized in that, include: At the start of the current gait cycle, the acceleration at each sampling moment is obtained according to the preset sampling interval; When the acceleration in the current gait cycle has a peak value and a trough value, calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value; When the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, the preset initial acceleration modulus is updated based on the average acceleration to obtain the updated acceleration modulus. Based on the acceleration at each sampling moment and the updated acceleration magnitude, it is determined whether the current gait cycle has ended, so as to achieve gait recognition; The preset initial acceleration modulus includes: the preset initial acceleration value and the preset acceleration threshold. The step of updating the preset initial acceleration modulus based on the average acceleration to obtain the updated acceleration modulus includes: Determine the difference between the average acceleration and the preset initial acceleration value; The preset acceleration threshold is updated based on the difference between the preset coefficient and the preset value to obtain the updated acceleration threshold. The preset initial acceleration value is updated using the average acceleration to obtain the updated initial acceleration value; The updated acceleration threshold and the initial value of the updated acceleration are used as the updated acceleration modulus.
2. The method according to claim 1, characterized in that, The step of determining whether the current gait cycle has ended based on the acceleration at each sampling time and the updated acceleration magnitude includes: When the acceleration at each sampling moment is greater than the acceleration at the previous sampling moment, the uphill count is incremented; the initial value of the uphill count is zero. When the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the obtained acceleration satisfies the range of the initial acceleration value of the gait cycle represented by the updated acceleration modulus, the current gait cycle is determined to end.
3. The method according to claim 2, characterized in that, Before determining the end of the current gait cycle, the method further includes: When the acceleration at the current sampling moment is less than or equal to the sum of the initial value of the updated acceleration and the threshold value of the updated acceleration, and is greater than or equal to the difference between the initial value of the updated acceleration and the threshold value of the updated acceleration, the range of initial acceleration values of the gait cycle that satisfies the updated acceleration magnitude value is determined.
4. The method according to claim 2, characterized in that, The gait cycle includes multiple preset states. After determining that the current gait cycle has ended, the method further includes: Enter the initial preset state in the next state cycle and continue to acquire the acceleration at each sampling time. When an acceleration greater than the initial value of the updated acceleration is obtained, the system switches from the initial preset state to the first preset state; the first preset state represents a gait where the heel leaves the ground and the acceleration begins to increase.
5. The method according to claim 4, characterized in that, The method further includes: In the fourth preset state, the uphill count is reset, and the average acceleration in the third preset state is calculated. The third preset state is obtained by accumulating the uphill count in the first preset state until switching to the second preset state, and then accumulating the downhill count in the second preset state. The third preset state represents a gait where the foot lands after lifting the leg and the acceleration decreases. The fourth preset state is obtained by accumulating the downhill count in the third preset state, and the fourth preset state represents a gait where the heel begins to touch the ground and the acceleration is minimal. When the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is greater than the preset difference threshold, the initial value of the updated acceleration and the updated acceleration threshold are updated based on the average acceleration in the third preset state, and then the switch from the fourth preset state to the fifth preset state is determined. When the difference between the average acceleration in the third preset state and the initial value of the updated acceleration is less than or equal to the preset difference threshold, it is determined to switch from the fourth preset state to the fifth preset state.
6. The method according to claim 5, characterized in that, After switching from the fourth preset state to the fifth preset state, the method further includes: In the fifth preset state, the acceleration corresponding to each sampling moment is continued to be acquired. When the acceleration corresponding to each sampling moment is greater than the acceleration corresponding to the previous sampling moment, the uphill count is increased. When the uphill count is greater than or equal to a preset threshold for the number of uphill counts in the later stage, and the acceleration is obtained to meet the numerical range corresponding to the initial value of the updated acceleration and the threshold of the updated acceleration, it is determined to switch from the fifth preset state to the sixth preset state; the sixth preset state represents the end gait where the toes touch the ground and the acceleration meets the initial value of the acceleration of the gait cycle.
7. A gait recognition device, characterized in that, include: The acquisition unit is used to acquire the acceleration at each sampling moment according to a preset sampling interval at the beginning of the current gait cycle; The calculation unit is used to calculate the average acceleration corresponding to multiple accelerations in the sampling interval corresponding to the peak value and the trough value when the acceleration in the current gait cycle has a peak value and a trough value; The update unit is used to update the preset initial acceleration modulus value based on the average acceleration when the difference between the average acceleration and the preset initial acceleration value is greater than the preset difference threshold, so as to obtain the updated acceleration modulus value. The determining unit is used to determine whether the current gait cycle has ended based on the acceleration at each sampling time and the updated acceleration magnitude, so as to achieve gait recognition; The preset initial acceleration modulus includes: the preset initial acceleration value and the preset acceleration threshold. The update unit is further configured to determine the difference between the average acceleration and the preset initial acceleration value; update the preset acceleration threshold according to a preset coefficient and the difference to obtain an updated acceleration threshold; update the preset initial acceleration value using the average acceleration to obtain an updated initial acceleration value; and use the updated acceleration threshold and the updated initial acceleration value as the updated acceleration modulus.
8. An electronic device, characterized in that, include: Memory, used to store executable data instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores executable instructions for causing a processor to execute, thereby implementing the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for regulating step counting data
CN105698815A
Gait detection algorithm, device and system
CN111358472A