Exercise frequency calculation method and related device

By using gyroscope sensors on smart devices, integrating the gyroscope signal and trend removal, the accuracy and convenience of the calculation of the number of rope skipping movements in the prior art are solved, and more accurate calculation of the number of movements is achieved.

CN119337104BActive Publication Date: 2025-05-13SHENZHEN FENDA SMART TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411884208.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-13
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

When calculating the number of periodic movements such as skipping ropes, the prior art has problems such as large environmental factors, high user operation requirements, and poor counting accuracy.

Method used

Using an intelligent device equipped with a gyroscope sensor, the first integration processing of the gyroscope signal is performed by recording the motion start time, the motion state is judged, the trend is removed, the number of motions is calculated, and the number of zero crossings is used for accurate calculations.

Benefits of technology

It realizes a more accurate calculation of the number of movements of periodic movements, reduces the influence of environmental factors, improves the accuracy of counting and the convenience of user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337104B_ABST
    Figure CN119337104B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of data processing technology, and provides a method for calculating the number of movements and a related device, which can accurately calculate the number of movements of periodic movements. The method for calculating the number of movements of the present application is applied to an intelligent device equipped with a gyroscope sensor, and mainly includes: when it is determined that the target user is currently in a periodic motion state, recording the start time of the movement, and performing a first integral processing on the gyroscope signal curve to obtain a first integral signal curve, the first integral processing is to accumulate the signal value of the gyroscope signal; judging whether the target user is in a continuous motion state according to the first integral signal curve; when it is determined that the target user changes from a continuous motion state to an end motion state, recording the end motion time; performing a detrending operation on the first integral curve to obtain a second integral signal curve; calculating the number of movements of the target user performing periodic motion according to the number of zero crossings of the second integral signal curve.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to a method and a related device for calculating the number of movements of an intelligent device equipped with a gyroscope sensor. Background Art

[0002] As an aerobic exercise that takes little time, has high intensity, and takes up little space, skipping rope can consume a lot of energy and effectively reduce obesity. Skipping rope has become the choice of many people for weight loss exercises.

[0003] Taking rope skipping as an example, currently, the number of rope skipping is usually calculated by smart devices. Smart device counting includes counting through camera recognition, counting with a rope skipping handle with a counter, and counting with smart wearable devices with sensors. Among them, the camera recognition counting method is greatly affected by environmental factors (such as venue space, light brightness, etc.), which is not convenient enough; the rope skipping handle with a counter is easy to generate counts when the user does not use it properly, which has high requirements for user operation and poor counting accuracy; smart wearable devices with sensors (usually three-axis acceleration sensors) mainly rely on the combined acceleration of the acceleration sensor to judge the motion state and count the number of exercises, which is easy to misjudge the motion state of users who are in other outdoor activities, resulting in large errors in the calculation of the number of exercises, and the accuracy of the calculation of the number of exercises for periodic exercises is still relatively poor.

[0004] In order to improve the accuracy of calculating the number of exercises when users perform periodic exercises (such as skipping rope), a new solution for calculating the number of exercises is urgently needed. Summary of the invention

[0005] The purpose of this application is to provide a method and related device for calculating the number of exercises, so as to achieve more accurate calculation of the number of exercises of periodic exercises (such as skipping rope), so that users can plan and determine their own exercise volume.

[0006] In a first aspect, the present application provides a method for calculating the number of movements, which is applied to a smart device equipped with a gyroscope sensor, and the method comprises:

[0007] When it is determined that the target user is currently in a periodic motion state, recording the start time of the target user entering the periodic motion state, and performing a first integral processing on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integral signal curve, wherein the first integral processing is to accumulate signal values ​​of the gyroscope signal;

[0008] determining whether the target user is in a continuous motion state according to the first integral signal curve;

[0009] When it is determined that the target user changes from the continuous motion state to the end motion state, the end motion time of the target user is recorded;

[0010] Performing a detrending operation on the first integral curve to obtain a second integral signal curve;

[0011] Determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement;

[0012] The number of times the target user performs periodic exercise is calculated according to the number of zero-crossing points of the second integral signal curve.

[0013] Optionally, calculating the number of movements of the target user according to the number of zero-crossing points of the second integral signal curve includes:

[0014] Calculate the average of the start signal values ​​corresponding to the previous X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5;

[0015] Subtracting the mean value from the second integrated signal curve to obtain a new second integrated signal curve;

[0016] The number of movements of the target user is calculated according to the number of zero-crossing points of the new second integral signal curve.

[0017] Optionally, calculating the number of movements of the target user according to the number of zero-crossing points of the new second integral signal curve includes:

[0018] Determine the positive and negative state of the previous adjacent data value of each zero-crossing point of the new second integral signal curve, and determine the positive and negative state of the next adjacent data value of each zero-crossing point of the new second integral signal curve;

[0019] When the positive and negative states of the preceding adjacent data value of the first target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are negative, the first target zero-crossing point is recorded as point, the first target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0020] When the positive and negative state of the previous adjacent data value of the second target zero-crossing point is negative and the positive and negative state of the next adjacent data value is positive, the second target zero-crossing point is recorded as point, the second target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0021] Each pair of adjacent ones of the new second integrated signal curve Points and The point is recorded as one exercise number, and the exercise number of the target user is obtained.

[0022] Optionally, each pair of adjacent Points and Points are counted as one exercise including:

[0023] Determine each on the new second integrated signal curve point, the first Point Point or point;

[0024] The adjacent pair of previous ones on the new second integral signal curve are arranged in chronological order. Point and the next Points are counted as one movement, where the previous Point and the next The points are different, and each A point is counted only once.

[0025] Optionally, the method further includes:

[0026] When the positive and negative states of the preceding adjacent data value of the third target zero-crossing point are negative and the positive and negative states of the succeeding adjacent data value are negative, the third target zero-crossing point is recorded as point, the third target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0027] Eliminate the point;

[0028] When the positive and negative states of the preceding adjacent data value of the fourth target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are positive, the fourth target zero-crossing point is recorded as point, the fourth target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0029] Eliminate the point.

[0030] Optionally, the gyro sensor is a three-axis gyro sensor, and the gyro signal of the gyro sensor includes: an X-axis gyro signal, a Y-axis gyro signal, and a Z-axis gyro signal;

[0031] Performing a first integration process on the gyro signal curve of the gyro sensor to obtain a first integrated signal curve includes:

[0032] Performing first integration processing on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the three-axis gyroscope sensor, respectively, to obtain an X-axis first integration signal curve, a Y-axis first integration signal curve, and a Z-axis first integration signal curve;

[0033] The X-axis first integrated signal curve, the Y-axis first integrated signal curve, and the Z-axis first integrated signal curve are respectively regarded as the first integrated signal curve, and the step of determining whether the target user is in a continuous motion state according to the first integrated signal curve is triggered;

[0034] After calculating the number of movements of the target user according to the number of zero-crossing points of the second integral signal curve, the method further includes:

[0035] Obtain the X-axis movement times, Y-axis movement times, and Z-axis movement times of the target user;

[0036] The X-axis movement number, the Y-axis movement number, and the Z-axis movement number are selected by using a preset model to obtain a target movement number, wherein the target movement number is one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number;

[0037] The preset model is a trained model that can select one of the X-axis movement times, the Y-axis movement times and the Z-axis movement times as the target movement times based on the X-axis gyroscope signal, the Y-axis gyroscope signal and the Z-axis gyroscope signal of the target user performing periodic movements.

[0038] Optionally, after performing a first integration process on the gyroscope signal curve of the gyroscope sensor to obtain a first integrated signal curve, the method further includes:

[0039] Check in chronological order whether the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold;

[0040] When the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold, the subsequent ordinate data values ​​of the first integral signal curve are reduced by m times, where m is a preset positive number.

[0041] In a second aspect, the present application provides a device for calculating the number of movements, which is applied to a smart device equipped with a gyroscope sensor, and the device comprises:

[0042] A recording unit, configured to, when determining that the target user is currently in a periodic motion state, record a start time of the target user entering the periodic motion state;

[0043] a first integration unit, configured to perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve, wherein the first integration process is to accumulate signal values ​​of the gyroscope signal;

[0044] a judging unit, configured to judge whether the target user is in a continuous motion state according to the first integral signal curve;

[0045] The recording unit is further configured to record the end-of-exercise time of the target user when it is determined that the target user changes from a continuous exercise state to an end-of-exercise state;

[0046] a removal unit, used for performing a trend removal operation on the first integral curve to obtain a second integral signal curve;

[0047] A determination unit, used to determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement;

[0048] A calculation unit is used to calculate the number of times the target user performs periodic movements according to the number of zero-crossing points of the second integral signal curve.

[0049] Optionally, the calculating unit calculating the number of movements of the target user according to the number of zero crossings of the second integral signal curve includes:

[0050] Calculate the average of the start signal values ​​corresponding to the previous X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5;

[0051] Subtracting the mean value from the second integrated signal curve to obtain a new second integrated signal curve;

[0052] The number of movements of the target user is calculated according to the number of zero-crossing points of the new second integral signal curve.

[0053] Optionally, the calculating unit calculates the number of movements of the target user according to the number of zero crossings of the new second integral signal curve, including:

[0054] Determine the positive and negative state of the previous adjacent data value of each zero-crossing point of the new second integral signal curve, and determine the positive and negative state of the next adjacent data value of each zero-crossing point of the new second integral signal curve;

[0055] When the positive and negative states of the preceding adjacent data value of the first target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are negative, the first target zero-crossing point is recorded as point, the first target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0056] When the positive and negative state of the previous adjacent data value of the second target zero-crossing point is negative and the positive and negative state of the next adjacent data value is positive, the second target zero-crossing point is recorded as point, the second target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0057] Each pair of adjacent ones of the new second integrated signal curve Points and The point is recorded as one exercise number, and the exercise number of the target user is obtained.

[0058] Optionally, the calculation unit calculates each adjacent pair of the Points and Points are counted as one exercise including:

[0059] Determine each on the new second integrated signal curve point, the first Point Point or point;

[0060] The adjacent pair of previous ones on the new second integral signal curve are arranged in chronological order. Point and the next Points are counted as one movement, where the previous Point and the next The points are different, and each A point is counted only once.

[0061] Optionally, the device further comprises:

[0062] The calculation unit is further configured to record the third target zero crossing point as point, the third target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0063] A rejection unit is used to reject the point;

[0064] The calculation unit is further configured to record the fourth target zero crossing point as point, the fourth target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0065] The elimination unit is also used to eliminate the point.

[0066] Optionally, the gyroscope sensor is a three-axis gyroscope sensor, and the gyroscope signal of the gyroscope sensor includes: an X-axis gyroscope signal, a Y-axis gyroscope signal, and a Z-axis gyroscope signal;

[0067] When the first integration unit performs a first integration process on the gyro signal curve of the gyro sensor to obtain a first integrated signal curve, it is specifically used to:

[0068] Performing first integration processing on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the three-axis gyroscope sensor, respectively, to obtain an X-axis first integration signal curve, a Y-axis first integration signal curve, and a Z-axis first integration signal curve;

[0069] The X-axis first integrated signal curve, the Y-axis first integrated signal curve, and the Z-axis first integrated signal curve are respectively regarded as the first integrated signal curve;

[0070] A triggering unit, configured to trigger the step of determining whether the target user is in a continuous motion state according to the first integrated signal curve;

[0071] The device also includes:

[0072] An obtaining unit, used to obtain the X-axis movement number, the Y-axis movement number, and the Z-axis movement number of the target user;

[0073] A selection unit, configured to select the X-axis movement number, the Y-axis movement number, and the Z-axis movement number using a preset model to obtain a target movement number, wherein the target movement number is one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number;

[0074] The preset model is a trained model that can select one of the X-axis movement times, the Y-axis movement times and the Z-axis movement times as the target movement times based on the X-axis gyroscope signal, the Y-axis gyroscope signal and the Z-axis gyroscope signal of the target user performing periodic movements.

[0075] Optionally, the device further comprises:

[0076] The judgment unit is further used to traverse the absolute value of the vertical coordinate data value corresponding to the first integral signal curve in chronological order to determine whether it exceeds a preset threshold;

[0077] The reduction unit is used to reduce the data value of the subsequent ordinate of the first integral signal curve by m times when the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold, where m is a preset positive number.

[0078] In a third aspect, the present application provides a smart device, including:

[0079] CPU, memory, bus, network interface, three-axis gyroscope sensor, neural network processor, display screen;

[0080] The central processing unit is connected to the memory, the network interface, the three-axis gyroscope sensor, the neural network processor, and the display screen through the bus;

[0081] The memory stores a program;

[0082] When the processor executes the program stored in the memory, the method for calculating the number of exercises described in any one of the first aspects is executed;

[0083] In a fourth aspect, the present application provides a computer storage medium, wherein the computer storage medium stores instructions, and when the instructions are executed by a computer device, the computer device executes the method for calculating the number of exercises as described in any one of the first aspects above.

[0084] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method for calculating the number of exercises as described in any one of the first aspects above.

[0085] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0086] The method for calculating the number of movements of this embodiment is applied to an intelligent device equipped with a gyroscope sensor. When the intelligent device determines that the target user is currently in a periodic motion state, the start time of the target user entering the periodic motion state is recorded, and the gyroscope signal curve formed by the gyroscope signal of the gyroscope sensor is subjected to a first integral processing to obtain a first integral signal curve, wherein the first integral processing is to accumulate the signal value of the gyroscope signal curve; determine whether the target user is in a continuous motion state according to the first integral signal curve; when it is determined that the target user changes from a continuous motion state to an end motion state, record the end motion time of the target user; remove the trend operation on the first integral curve to obtain a second integral signal curve; determine the second integral signal curve corresponding to the start motion time to the end motion time; and then calculate the number of movements of the target user performing periodic motion according to the number of zero crossings of the second integral signal curve. It can be seen that the embodiment of the present application can realize a more accurate calculation of the number of movements of periodic motion according to the gyroscope signal, so that the user can plan and determine his own amount of exercise. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figure 1A schematic diagram of a flow chart of an embodiment of a method for calculating the number of exercises of the present application;

[0088] Figure 2 This is a flow chart of another embodiment of the method for calculating the number of exercises of the present application;

[0089] Figure 3 This is a schematic diagram of the structure of an embodiment of the exercise frequency calculation device of the present application;

[0090] Figure 4 This is a schematic diagram of another embodiment of the structure of the exercise frequency calculation device of the present application;

[0091] Figure 5 This is a schematic diagram of the structure of an embodiment of the smart wearable device of the present application;

[0092] Figure 6 Y-axis gyroscope signal curve for this application , a schematic diagram of an embodiment of a first integral signal curve on the Y axis and a second integral signal curve on the Y axis;

[0093] Figure 7 Y-axis gyroscope signal curve for this application , a schematic diagram of another embodiment of the first integral signal curve on the Y-axis. DETAILED DESCRIPTION

[0094] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0095] It is worth noting that the exercise frequency calculation method of the embodiment of the present application is applied to a smart device equipped with a gyroscope sensor, which can be a smart bracelet, a smart watch, professional sports equipment (skipping rope handle, running pedometer, sports headphones, sports shoulder strap, sports chest strap, etc.), etc., or a smart mobile terminal device such as a mobile phone and a tablet computer; wherein the smart device here should be configured with a gyroscope sensor, which can be a single-axis (X-axis, Y-axis or Z-axis) gyroscope sensor, a three-axis (X-axis, Y-axis, Z-axis) gyroscope sensor, or a six-axis (X-axis, Y-axis, Z-axis) gyroscope sensor integrated with a three-axis gyroscope sensor The smart device of this embodiment should also be equipped with a power supply, a gyro sensor, a central processing unit, a memory, a neural network processor, a display screen, a network interface module, etc., wherein the power supply is usually composed of a rechargeable battery module, which is mainly used to provide a suitable working voltage for the gyro sensor, the central processing unit, the memory, the neural network processor, the display screen, the network interface module, etc. The gyro sensor is mainly used to monitor the motion signals (gyro signals) of the target user wearing the smart device in various directions (mainly the X-axis, the Y-axis and the Z-axis) in the three-dimensional space, and the motion signals are obtained from the motion signals. The motion signal reflects the target user's motion posture and angle in the three-dimensional space, and stores the gyroscope signals in various directions in the memory in the same time sequence; the central processing unit mainly processes the gyroscope signals stored in the memory to generate data such as the number of movements, the gyroscope signal curve, the first integral signal curve, the second integral signal curve, and transmits the relevant data to the display screen for display as needed; the memory is mainly used to store the gyroscope signals in various directions of the three-dimensional space recorded by the gyroscope sensor in time sequence, store the preset trained algorithm model (such as a neural network model), etc.; and the neural network processor is mainly used to load and run the neural network model pre-stored in the above-mentioned memory, and select one according to the X-axis movement number, Y-axis movement number, and Z-axis movement number transferred by the central processing unit to obtain the target movement number for the central processing unit; the display screen is mainly used to display the relevant data uploaded by the central processing unit that needs to be displayed; the network interface module can be a wired interface or a wireless network interface, which is mainly used to share data with external smart devices or download the data of external smart devices (such as preset models, preset data, etc.) to the memory, and play the function of communicating with external smart devices. At present, gyroscope sensors can be widely used in smart wearable devices, mobile terminals or sports equipment to record and identify people's motion patterns, motion status, exercise times and other motion data. The gyroscope sensor can monitor the changes in the motion angle of the object carrying it in three mutually perpendicular directions in space, that is, the gyroscope sensor can monitor the motion angle data of the object carrying it in the three directions of X-axis, Y-axis and Z-axis in the spatial Cartesian coordinate system, which will not be elaborated here.In order to improve the accuracy of calculating the number of exercises of periodic motion, this embodiment takes rope skipping as an example of periodic motion. In practical applications, the periodic motion can also be walking, running, pull-ups, sit-ups, etc., and the corresponding results can be obtained through the data processing process similar to the following embodiment, which will not be repeated here. The so-called periodic motion is measured by the gyroscope sensor when the user is exercising. The corresponding axis (X axis, Y axis or Z axis) or multiple axes reflected by the gyroscope signal shows a similar periodic change.

[0096] See also Figure 1 The method for calculating the number of movements of the present application is applied to an embodiment of a smart device equipped with a gyroscope sensor, comprising:

[0097] 101. When it is determined that the target user is currently in a periodic motion state, the start motion time of the target user entering the periodic motion state is recorded.

[0098] In practical applications, the smart device can determine that the target user is currently in a periodic motion state based on the gyroscope signal characteristics of the gyroscope. In this step, the start time of the target user's initial identification as entering the periodic motion state is recorded.

[0099] 102. Perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve.

[0100] It should be noted that when the target user uses the smart device to perform periodic exercise (such as skipping rope), the gyroscope sensor in the smart device will obtain the gyroscope signal of the target user performing periodic exercise, and the gyroscope signal includes: one or all of the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal. Among them, the X-axis gyroscope signal reflects the signal value of the target user's angle changing with time around the X-axis direction in the Cartesian three-dimensional coordinate system; the Y-axis gyroscope signal reflects the signal value of the target user's angle changing with time around the Y-axis direction in the Cartesian three-dimensional coordinate system; the Z-axis gyroscope signal reflects the signal value of the target user's angle changing with time around the Z-axis direction in the Cartesian three-dimensional coordinate system. The above signal values ​​reflect the angle value of the corresponding axis (X-axis, Y-axis or Z-axis). When the original angle value is known, the signal value is integrated and calculated to obtain the current angle value of the corresponding axis. In this embodiment, the X-axis gyroscope signal, Y-axis gyroscope signal or Z-axis gyroscope signal detected by the gyroscope sensor in the smart device is sampled at a certain frequency, and the signal value of the corresponding axis (X-axis, Y-axis or Z-axis) is obtained and stored in the memory. The angle values ​​recorded in the memory are separated by the same time interval, and these signal values ​​are represented on the coordinates with the time sequence as the horizontal axis and the signal value as the vertical axis, and then the signal values ​​of the same axis (X-axis, Y-axis or Z-axis) are connected with a smooth line to form a gyroscope signal curve (including the X-axis gyroscope signal curve, the Y-axis gyroscope signal curve, and the Z-axis gyroscope signal curve). In this step, the gyroscope signal curve formed by the gyroscope signal of the above-mentioned gyroscope sensor is subjected to the first integral processing to obtain the first integral signal curve; the so-called first integral processing is to accumulate the signal value of the gyroscope signal.

[0101] See also Figure 6 , taking the gyroscope signal as the Y-axis gyroscope signal as an example, from top to bottom, the first curve is the Y-axis gyroscope signal curve formed by the signal value corresponding to the Y-axis gyroscope signal The second graph is the Y-axis gyroscope signal curve The first Y-axis integral signal curve is formed after the first integral processing, and the third curve is the second Y-axis integral signal curve formed after the first Y-axis integral signal curve is detrended (i.e., detrended, such as by linear regression, differential method, etc.). The first Y-axis integral signal curve is a Y-axis gyroscope signal curve. Perform the first integral processing to obtain the Y-axis gyroscope signal curve The signal values ​​corresponding to the original gyroscope signals are accumulated one by one (in this embodiment, since the time is a fixed value, it is not necessary to multiply the time, which reduces the amount of calculation and avoids excessive signal values, saving storage space). Figure 6From the first integral curve of the Y axis represented by the second graph, it can be seen that the first integral curve of the Y axis presents an upward trend with a relatively stable slope when the target user is in periodic motion.

[0102] It is worth noting that the X-axis gyroscope signal, Y-axis gyroscope signal, and Z-axis gyroscope signal obtained by the three-axis gyroscope sensor are relatively accurate in a short period of time, but may have errors due to drift and other reasons in a longer period of time. In view of this, the gyroscope signal can be first subjected to SG filtering to remove the influence of gyroscope signal drift, and then other filtering methods can be used for processing; an example is given as follows: the gyroscope signal frequency range corresponding to rope skipping is generally between 0.1HZ and 6.5HZ, and the number of rope skipping exercises performed by an ordinary person in 1 minute is less than 300 times. Under normal circumstances, it is difficult for an ordinary person to reach 300 times per minute. Therefore, SG filtering is first used to remove the influence of gyroscope signal drift, and then the designed filter is used to decay rapidly at 6.5HZ. Combined with the fact that the Chebyshev filter decays faster in the transition band and the Butterworth filter has a relatively flat passband, this embodiment can use a cutoff frequency of 0 for rope skipping. The combination of a 1.1 Hz Butterworth high-pass filter and a 6.5 Hz Chebyshev I-type low-pass filter can better filter out noise and retain the gyroscope signal of rope skipping. For other periodic movements, similar processing methods can be used to filter the actual situation, which will not be described here.

[0103] 103. Determine whether the target user is in a continuous motion state based on the first integral signal curve. When it is determined that the target user is in a continuous motion state, continue monitoring; when it is determined that the target user changes from a continuous motion state to an end motion state, execute step 104.

[0104] from Figure 6 It can be seen from the listed first integral curve of the Y axis that the first integral curve of the Y axis shows an upward trend with a relatively stable slope when the target user is in periodic motion. This step can determine whether the target user is in a continuous motion state based on whether the first integral curve maintains an upward trend with a relatively stable slope, that is, when the target user maintains a periodic motion state, such as continuously exercising the same action (i.e., continuous rope skipping state), the first integral curve (e.g., the first integral curve of the Y axis) will continue to show a "linear" upward trend with a relatively stable slope; when the target user stops the periodic motion state, such as stopping the exercise (i.e., ending the rope skipping state and being in a resting state), the first integral curve (e.g., the first integral curve of the Y axis) will show a trend of a large slope change, such as Figure 7 Another embodiment of the Y-axis gyroscope signal curve is shown , as shown by the first integral signal curve on the Y axis. This step can use this characteristic of the first integral signal curve to determine whether the target user is in a continuous motion state of periodic motion. When it is determined that the target user is continuously in a continuous motion state, monitoring continues; when it is determined that the target user changes from a continuous motion state to an end motion state, it indicates that the target user has stopped maintaining the current periodic motion and entered a resting state. To avoid misjudgment, this embodiment can further be set: when the first integral curve (for example, the first integral curve on the Y axis) shows a trend of a large slope change within a few seconds (for example, 10 seconds, and the rest time of people who usually perform periodic motion is more than 10 seconds), it does not continue to show a "linear" upward trend with a relatively stable slope, and then confirm that the target user stops maintaining the current periodic motion and enters a resting state or other state.

[0105] In a possible embodiment, an example is given as follows: when it is determined that the target user is in a periodic motion state, the signal value corresponding to the gyroscope signal with a time window of a preset duration (e.g., 5 seconds) on the first integral signal curve is taken, and the slope of the signal value within the preset duration is calculated using the least squares method. , then slide the time window forward by 1 second, and calculate the slope of the signal value in the new time window with the same preset time length again ,like or , it indicates that the target user has stopped the current periodic exercise; otherwise, if a relatively stable “linear” upward trend is not continuously presented within a few seconds (e.g., 10 seconds), it is confirmed that the target user has stopped the current periodic exercise and entered a resting state or other state.

[0106] 104. Record the end time of the target user ending the continuous exercise state.

[0107] When it is determined in step 103 that the target user changes from the continuous motion state to the end motion state, this step records the end motion time of the target user's periodic motion (eg, rope skipping) that ends the continuous motion state in step 103 .

[0108] 105. Perform a detrending operation on the first integral curve to obtain a second integral signal curve.

[0109] For example, see Figure 6 , Figure 6 The third curve graph is the second integral signal curve of the Y-axis formed by the detrending operation (i.e., detrending processing, such as linear regression, differential method, least squares method, etc.) of the first integral signal curve of the Y-axis. The second integral signal curve obtained after the detrending operation can clearly reflect that when the target user performs periodic motion (such as skipping rope), the signal value corresponding to the gyroscope signal fluctuates up and down near the zero axis of the plane coordinate system, which is conducive to counting the number of periodic motions.

[0110] 106. Determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement.

[0111] It should be noted that in order to reduce the computing power input of smart devices and save the electricity expenditure of smart devices, this embodiment can only calculate the number of times the target user performs periodic exercises for the second integral signal curve corresponding to the start time to the end time of the exercise; in view of this, this step should at least determine the second integral signal curve corresponding to the start time to the end time of the exercise.

[0112] 107. Calculate the number of periodic movements performed by the target user according to the number of zero-crossing points of the second integral signal curve.

[0113] The study of gyroscope signal data of rope skipping, which is a periodic motion, shows that when people perform normal rope skipping, each rope skipping action will cause the axes corresponding to the gyroscope sensor (X axis, Y axis and Z axis) to rotate one circle, which is reflected in the second integral signal curve as follows: the second integral signal curve will cross the zero axis of the plane coordinate system (the horizontal axis with the ordinate being 0) twice. Then, this step will at least count the number of zero crossings of the second integral signal curve corresponding to the start time to the end time of the motion in step 106, and take half of the number of zero crossings of the second integral signal curve as the number of periodic motions performed by the target user.

[0114] It can be seen that the method for calculating the number of exercises in the embodiment of the present application can achieve a more accurate calculation of the number of exercises of periodic exercises based on the gyroscope signal, so that the user can plan and determine his or her own exercise amount.

[0115] See also Figure 2 In another embodiment, the method for calculating the number of movements of the present application is applied to a smart device equipped with a gyroscope sensor. In this embodiment, the gyroscope sensor can be a three-axis gyroscope sensor, or a six-axis sensor including a three-axis gyroscope sensor and a three-axis acceleration sensor, or other sensors including a three-axis gyroscope sensor, so that this embodiment can directly obtain: X-axis gyroscope signal, Y-axis gyroscope signal, and Z-axis gyroscope signal. The method of this embodiment includes:

[0116] 201. When it is determined that the target user is currently in a periodic motion state, a start motion time when the target user starts to enter the periodic motion state is recorded.

[0117] This step is performed in the same way as above. Figure 1 The operations performed in step 101 in the embodiment are similar, and the repeated parts are not repeated here.

[0118] Regarding determining that the target user is currently in a periodic motion state based on the gyroscope signal, this embodiment may use a first-order difference value of a gyroscope signal curve formed by the gyroscope signal. The peak and trough of the gyroscope signal curve (X-axis gyroscope signal curve, Y-axis gyroscope signal curve or Z-axis gyroscope signal curve) are determined by the change of , the first-order difference value of the signal value point of the gyroscope signal curve at the current moment , and the corresponding signal value of the signal value point of the current gyroscope signal curve is greater than 10000, then the current signal value point of the gyroscope signal curve at the current moment is identified as the peak point; when the first-order difference value of the signal value point of the gyroscope signal curve at the previous moment , the first-order difference value of the signal value point of the gyroscope signal curve at the current moment , and the corresponding signal value of the signal value point of the current gyroscope signal curve is less than -10000, then the current signal value point of the gyroscope signal curve at the current moment is identified as a trough point. Taking rope skipping as an example of periodic motion, in this embodiment, at least one peak point and one trough point appear, and the time interval between the peak point and the trough point is between 0.2 seconds and 3 seconds, it is identified as rope skipping once (when there are multiple consecutive peak points and / or multiple consecutive trough points, the peak point takes the maximum peak point and the trough point takes the minimum trough point); this embodiment reduces the impact of other actions of the target user by setting the thresholds of the peak point and the trough point, and the time interval between the peak point and the trough point.

[0119] Some users show periodic gyroscope signal value changes in the X-axis direction over time that are obviously consistent with the accurate calculation of the number of movements. At this time, the periodic changes in the gyroscope signal in the Y-axis and Z-axis directions over time may not be accurate enough to calculate the number of movements; of course, some users may show more obvious periodicity in the Y-axis direction, while some users may show obvious periodicity in the Z-axis direction, which depends on the exercise habits of different users and different types of periodic movements; and when the target user enters the exercise number recording mode of periodic movement (the user starts the exercise number mode of the smart device) and does not start the corresponding periodic movement (such as skipping rope), if the target user performs large-scale movements in space at this time, such as stretching, swinging, jumping, etc., it may also be included in the calculation of the number of periodic movements; in order to avoid misjudgment of the target user entering the periodic movement state, this embodiment can further determine that the X-axis, Y-axis, and Z-axis directions of the gyroscope sensor all reach preset values ​​before determining that the target user is currently in a periodic movement state, and add the preset value when subsequently calculating the total number of periodic movements. The preset value of this embodiment can be 5 times, 10 times, etc.

[0120] 202. Perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve.

[0121] This step is performed in the same way as above. Figure 1 The operations performed in step 102 of the embodiment are similar, and the repeated parts are not repeated here.

[0122] It should be noted that this step requires performing a first integration process on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the three-axis gyroscope sensor, respectively, to obtain the X-axis first integral signal curve, the Y-axis first integral signal curve, and the Z-axis first integral signal curve, respectively; that is, this step regards the X-axis first integral signal curve, the Y-axis first integral signal curve, and the Z-axis first integral signal curve as the first integral signal curves.

[0123] Regarding calculating the angle value (relative angle) of the corresponding axis (X-axis, Y-axis, Z-axis) relative to the initial position (original angle) based on the gyroscope signal of the gyroscope sensor, it is necessary to calculate the time integral of the signal value on the corresponding axis. For example, the Y-axis gyroscope signal value of the gyroscope sensor is converted by the analog-to-digital converter (ADC) within 1 to 5 seconds to [1640, 3280, -3280, -1640, 3280], it can be considered that the angular velocity at the first second is 1640, which can be understood as the angular velocity in the period from the first second to the second second is 1640. Assuming that the signal value 1640 in this embodiment represents a positive rotation of 10 degrees, at the end of the second, the angle of rotation relative to the first second is: 1640 / 1640×10×1 (seconds) = 10 degrees; by analogy, at the end of the third second, the angle of rotation relative to the first second is: 1640 / 1640×10×1 (seconds) + 3280 / 1640×10×1 (seconds) =30 degrees; at the end of the 4th second, the angle of rotation relative to the 1st second is: 1640 / 1640×10×1 (seconds) + 3280 / 1640×10×1 (seconds) - 3280 / 1640×10×1 (seconds) = 10 degrees; at the end of the 5th second, the angle of rotation relative to the 1st second is: 1640 / 1640×10×1 (seconds) + 3280 / 1640×10×1 (seconds) - 3280 / 1640×10×1 (seconds) - 1640 / 1640×10×1 (seconds) = 0 degrees.

[0124] 203. Determine whether the target user is in a continuous motion state based on the first integral signal curve. When it is determined that the target user is in a continuous motion state, continue monitoring; when it is determined that the target user changes from a continuous motion state to an end motion state, execute step 204.

[0125] This step is performed in the same way as above. Figure 1 The operations performed in step 103 in the embodiment are similar, and the repeated parts are not repeated here.

[0126] 204. Record the end time of the target user ending the continuous exercise state.

[0127] This step is performed in the same way as above. Figure 1 The operations performed in step 104 in the embodiment are similar, and the repeated parts are not repeated here.

[0128] 205. Perform a detrending operation on the first integral curve to obtain a second integral signal curve.

[0129] This step is performed in the same way as above. Figure 1 The operations performed in step 105 in the embodiment are similar, and the repeated parts are not repeated here.

[0130] 206. Determine a second integral signal curve corresponding to the movement start time to the movement end time.

[0131] This step is performed in the same way as above. Figure 1 The operations performed in step 106 in the embodiment are similar, and the repeated parts are not repeated here.

[0132] 207. Calculate the number of periodic movements performed by the target user according to the number of zero-crossing points of the second integral signal curve.

[0133] This step is performed in the same way as above. Figure 1 The operations performed in step 107 in the embodiment are similar, and the repeated parts are not repeated here.

[0134] Specifically, in order to avoid poor data on the starting position of periodic motion, this embodiment causes the calculated second integral signal curve to be offset up and down in the coordinate system as a whole, resulting in errors in calculating the number of movements of the target user performing periodic motion based on the number of zero crossings of the second integral signal curve. This embodiment needs to correct this, specifically: calculate the mean of the start signal values ​​corresponding to the first X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5; subtract the mean from the second integral signal curve to obtain a new second integral signal curve, at which point the new second integral signal curve moves the distance of the mean in the vertical axis direction of the coordinate system compared to the second integral signal curve; and then calculate the number of movements of the marked user based on the number of zero crossings of the new second integral signal curve. The number of movements of the marked user is calculated according to the number of zero-crossing points of the new second integral signal curve, specifically: determining the positive and negative state of the previous adjacent data value of each zero-crossing point of the new second integral signal curve (that is, the adjacent data value (signal value) is positive above the zero axis of the coordinate system and negative below the zero axis of the coordinate system), and determining the positive and negative state of the next adjacent data value of each zero-crossing point of the new second integral signal curve; when the positive and negative state of the previous adjacent data value of the first target zero-crossing point is positive and the positive and negative state of the next adjacent data value is negative, the first target zero-crossing point is recorded as point, the first target zero-crossing point is a zero-crossing point of the new second integral signal curve; when the positive and negative states of the previous adjacent data value of the second target zero-crossing point are negative and the positive and negative states of the next adjacent data value are positive, the second target zero-crossing point is recorded as point, the second target zero-crossing point is a zero-crossing point of the new second integral signal curve; this embodiment also needs to eliminate some "zero-crossing points" whose vertices intersect the zero axis. When the positive and negative states of the previous adjacent data value of the third target zero-crossing point are negative and the positive and negative states of the next adjacent data value are negative, the third target zero-crossing point is recorded as point, the third target zero-crossing point is a zero-crossing point of the new second integral signal curve, and the When the positive and negative states of the previous adjacent data value of the fourth target zero-crossing point are positive and the positive and negative states of the next adjacent data value are positive, the fourth target zero-crossing point is recorded as point, the fourth target zero-crossing point is a zero-crossing point of the new second integral signal curve, eliminating points; each pair of adjacent points on the new second integral signal curve Point and The point is recorded as one exercise number, and the exercise number of the target user is obtained. Point and The specific method of recording a point as one movement number is as follows: each zero point is determined on the new second integral signal curve, wherein the first zero point is the pzero point or the nzero point; a pair of adjacent previous zero points and the next zero point on the new second integral signal curve are counted as one movement number in chronological order, wherein the previous zero point is different from the next zero point, and each zero point participates in the statistics only once.

[0135] In another embodiment, in order to improve the accuracy of the number of periodic movements performed by the target user in this embodiment, it is also necessary to eliminate some unqualified periodic movements reflected by the gyroscope signal curve. Taking rope skipping as an example of periodic movement, compare the peak-to-peak values ​​of the crest and trough points corresponding to a certain rope skipping action, and the peak-to-peak values ​​of the crest and trough points corresponding to the previous rope skipping actions. When the peak-to-peak value is greater than 0.7 times the peak-to-peak value, it is considered to be a qualified number of rope skipping, and the number of rope skipping is allowed to be counted; otherwise, it is not counted; in addition, the completion time of a certain rope skipping action can also be compared. The time it takes to complete the previous rope skipping action The size of , it is considered as a qualified number of skipping and is allowed to be counted; otherwise it is not counted.

[0136] 208. Obtain the X-axis movement times, the Y-axis movement times, and the Z-axis movement times of the target user.

[0137] Since step 202 treats the first X-axis integral signal curve, the first Y-axis integral signal curve, and the first Z-axis integral signal curve as first integral signal curves for processing, this step will obtain the X-axis movement times, Y-axis movement times, and Z-axis movement times of the target user after going through step 207.

[0138] 209. Use the preset model to select the X-axis movement times, the Y-axis movement times, and the Z-axis movement times to obtain the target movement times.

[0139] It should be noted that different users have different habits of performing the same periodic exercise. Taking skipping as a periodic exercise and the smart device as a skipping handle as an example, different users hold the handle, swing the skipping handle, and skipping in different ways, which makes the change of the gyroscope signal vary greatly. In order to adapt to different user habits and have a higher accuracy in calculating the number of exercises, this embodiment uses the three-direction gyroscope signals of the three-axis gyroscope sensor to calculate the number of exercises respectively, and combines the signal characteristics of each axis to select the optimal result using a preset model to obtain the target number of exercises, which is one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number; the preset model is a trained model that can select one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number as the target number of exercises based on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the target user performing periodic exercise. For example, the preset model of the present embodiment may be a neural network model, such as a deep neural network model (DNN). The training samples of the deep neural network model may use X-axis gyroscope signals, Y-axis gyroscope signals, and Z-axis gyroscope signals (for example, gyroscope signal values ​​that change over time) recorded by sports volunteers such as senior athletes, sports enthusiasts, and ordinary users wearing smart devices, and the number of X-axis movements obtained from the X-axis gyroscope signals recorded when the sports volunteers perform periodic exercises, the number of Y-axis movements obtained from the Y-axis gyroscope signals, and the number of Z-axis movements obtained from the Z-axis gyroscope signals as input features, and use the actual number of movements corresponding to sports volunteers such as senior athletes, sports enthusiasts, and ordinary users as output features for training. After training, a model is obtained that selects the target number of movements that is closest to the actual number of movements based on the X-axis gyroscope signals, Y-axis gyroscope signals, and Z-axis gyroscope signals of the target users performing periodic exercises. The training of the corresponding neural network model is a relatively mature prior art and will not be described in detail herein.

[0140] 210. Check in chronological order whether the absolute value of the vertical coordinate data value corresponding to the first integral signal curve exceeds a preset threshold. When the absolute value of the vertical coordinate data value corresponding to the first integral signal curve exceeds the preset threshold, execute step 211; when the absolute value of the vertical coordinate data value corresponding to the first integral signal curve does not exceed the preset threshold, ignore it.

[0141] It is worth noting that the first integral processing is to accumulate the signal value of the gyroscope signal. As long as the target user continues to perform periodic motion, the vertical coordinate data value corresponding to the first integral signal curve will continue to increase. In order to avoid the first integral signal curve corresponding to the vertical coordinate data value being too large (not conducive to the storage and calculation of the data value), this step will continue to traverse the absolute value of the vertical coordinate data value corresponding to the first integral signal curve in chronological order to see if it exceeds the preset threshold (when the range of the gyroscope sensor is -32786 to 32767, continuing the first integral processing may cause the data value to exceed 1000000). When the absolute value of the vertical coordinate data value corresponding to the first integral signal curve exceeds the preset threshold, it indicates that the vertical coordinate data value corresponding to the first integral signal curve is too large and needs to be reduced. The overall reduction of the first integral signal curve will not affect the execution of "determining whether the target user is in a continuous motion state based on the first integral signal curve"; when the absolute value of the vertical coordinate data value corresponding to the first integral signal curve does not exceed the preset threshold, it can be ignored. The preset threshold of this step can be set according to actual needs and is not limited here.

[0142] 211. Reduce the data values ​​of the subsequent vertical coordinates of the first integral signal curve by a factor of m.

[0143] When step 210 determines that the data value of the ordinate corresponding to the first integral signal curve is too large and needs to be reduced, this step reduces the data value of the subsequent ordinate of the first integral signal curve by m times, for example, m is equal to 100, 1000, 10000, etc. The value of m in this step can be selected according to the duration and frequency of the periodic motion, and is not specifically limited here.

[0144] The above embodiment describes an embodiment in which the method for calculating the number of movements of the present application is applied to a smart device equipped with a gyroscope sensor. The following describes an embodiment in which the apparatus for calculating the number of movements based on a gyroscope signal of the present application is applied to a smart device equipped with a gyroscope sensor. Figure 3 ,include:

[0145] The recording unit 301 is configured to record the start time of the target user entering the periodic motion state when it is determined that the target user is currently in the periodic motion state;

[0146] A first integration unit 302 is used to perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve, wherein the first integration process is to accumulate signal values ​​of the gyroscope signal;

[0147] A judging unit 303, configured to judge whether the target user is in a continuous motion state according to the first integral signal curve;

[0148] The recording unit 301 is further configured to record the end time of the target user ending the continuous motion state when it is determined that the target user ends the continuous motion state;

[0149] A removal unit 304, configured to perform a trend removal operation on the first integral curve to obtain a second integral signal curve;

[0150] A determination unit 305, configured to determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement;

[0151] The calculation unit 306 is used to calculate the number of times the target user performs periodic movements according to the number of zero-crossing points of the second integral signal curve.

[0152] The operation performed by the exercise frequency calculation device of this embodiment is the same as that of the aforementioned Figure 1 The operations performed in the embodiments are similar, and the repeated parts will not be repeated here.

[0153] See also Figure 4 Another embodiment of the present application of the exercise frequency calculation device applied to a smart device equipped with a gyroscope sensor includes:

[0154] The recording unit 401 is used to record the start time of the target user entering the periodic motion state when it is determined that the target user is currently in the periodic motion state;

[0155] A first integration unit 402 is used to perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve, wherein the first integration process is to accumulate signal values ​​of the gyroscope signal;

[0156] A judging unit 403, configured to judge whether the target user is in a continuous motion state according to the first integral signal curve;

[0157] The recording unit 401 is further configured to record the end time of the target user's exercise when it is determined that the target user changes from a continuous exercise state to an end exercise state;

[0158] A removal unit 404, configured to perform a trend removal operation on the first integral curve to obtain a second integral signal curve;

[0159] A determination unit 405, configured to determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement;

[0160] The calculation unit 406 is used to calculate the number of times the target user performs periodic movements according to the number of zero-crossing points of the second integral signal curve.

[0161] Optionally, the calculating unit 406 calculates the number of movements of the target user according to the number of zero crossings of the second integral signal curve, including:

[0162] Calculate the average of the start signal values ​​corresponding to the previous X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5;

[0163] Subtracting the mean value from the second integrated signal curve to obtain a new second integrated signal curve;

[0164] The number of movements of the target user is calculated according to the number of zero-crossing points of the new second integral signal curve.

[0165] Optionally, the calculation unit 406 calculates the number of movements of the target user according to the number of zero crossings of the new second integral signal curve, including:

[0166] Determine the positive and negative state of the previous adjacent data value of each zero-crossing point of the new second integral signal curve, and determine the positive and negative state of the next adjacent data value of each zero-crossing point of the new second integral signal curve;

[0167] When the positive and negative states of the preceding adjacent data value of the first target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are negative, the first target zero-crossing point is recorded as point, the first target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0168] When the positive and negative state of the previous adjacent data value of the second target zero-crossing point is negative and the positive and negative state of the next adjacent data value is positive, the second target zero-crossing point is recorded as point, the second target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0169] Each pair of adjacent ones of the new second integrated signal curve Points and The point is recorded as one exercise number, and the exercise number of the target user is obtained.

[0170] Optionally, the calculation unit 406 calculates each adjacent pair of the Points and Points are counted as one exercise including:

[0171] Determine each on the new second integrated signal curve point, the first Point Point or point;

[0172] The adjacent pair of previous ones on the new second integral signal curve are arranged in chronological order. Point and the next Points are counted as one movement, where the previous Point and the next The points are different, and each A point is counted only once.

[0173] Optionally, the device further comprises:

[0174] The calculation unit 406 is further configured to record the third target zero crossing point as point, the third target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0175] The elimination unit 407 is used to eliminate the point;

[0176] The calculation unit 406 is further configured to record the fourth target zero crossing point as point, the fourth target zero-crossing point is a zero-crossing point of the new second integral signal curve;

[0177] The elimination unit 407 is also used to eliminate the point.

[0178] Optionally, the gyroscope sensor is a three-axis gyroscope sensor, and the gyroscope signal of the gyroscope sensor includes: an X-axis gyroscope signal, a Y-axis gyroscope signal, and a Z-axis gyroscope signal;

[0179] The first integration unit 402 performs a first integration process on the gyro signal curve of the gyro sensor to obtain a first integrated signal curve, specifically for:

[0180] Performing first integration processing on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the three-axis gyroscope sensor, respectively, to obtain an X-axis first integration signal curve, a Y-axis first integration signal curve, and a Z-axis first integration signal curve;

[0181] The X-axis first integrated signal curve, the Y-axis first integrated signal curve, and the Z-axis first integrated signal curve are respectively regarded as the first integrated signal curve;

[0182] A trigger unit 408, configured to trigger the step of determining whether the target user is in a continuous motion state according to the first integrated signal curve;

[0183] The device also includes:

[0184] An obtaining unit 409 is used to obtain the X-axis movement number, the Y-axis movement number, and the Z-axis movement number of the target user;

[0185] A selection unit 410 is used to select the X-axis movement number, the Y-axis movement number, and the Z-axis movement number using a preset model to obtain a target movement number, where the target movement number is one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number;

[0186] The preset model is a trained model that can select one of the X-axis movement times, the Y-axis movement times and the Z-axis movement times as the target movement times based on the X-axis gyroscope signal, the Y-axis gyroscope signal and the Z-axis gyroscope signal of the target user performing periodic movements.

[0187] Optionally, the device further comprises:

[0188] The judging unit 403 is further used to check in chronological order whether the absolute value of the vertical coordinate data value corresponding to the first integral signal curve exceeds a preset threshold;

[0189] The reduction unit 411 is used to reduce the subsequent ordinate data values ​​of the first integral signal curve by m times when the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold, where m is a preset positive number.

[0190] The operation performed by the exercise frequency calculation device of this embodiment is the same as that of the aforementioned Figure 2 The operations performed in the embodiments are similar, and the repeated parts will not be repeated here.

[0191] The computer device in the embodiment of the present application is described below. Figure 5 , an embodiment of the computer device in the embodiment of the present application includes:

[0192] The computer device 500 may include one or more processors (central processing units, CPU) 501 and a memory 502, in which one or more application programs or data are stored. Among them, the memory 502 is volatile storage or persistent storage. The program stored in the memory 502 may include one or more modules, and each module may include a series of instruction operations in the computer device. Furthermore, the processor 501 can be configured to communicate with the memory 502 to execute a series of instruction operations in the memory 502 on the computer device 500. The computer device 500 may also include: one or more network interfaces 503, one or more input and output interfaces 504, one or more display screens 505, one or more neural network processors 506, one or more power supplies 507, and / or, one or more operating systems, such as Harmony OS, Windows Server, Mac OS, Unix, Linux, FreeBSD, etc. The processor 501 can execute the aforementioned Figure 1 or Figure 2 The operations performed in any of the illustrated embodiments will not be described in detail here.

[0193] In several embodiments provided in the embodiments of the present application, those skilled in the art should understand that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0194] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

[0195] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for calculating the number of exercises, characterized in that: Applied to a smart device equipped with a gyroscope sensor, the method comprises: When it is determined that the target user is currently in a periodic motion state, recording the start time of the target user entering the periodic motion state, and performing a first integral processing on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integral signal curve, wherein the first integral processing is to accumulate signal values ​​of the gyroscope signal; determining whether the target user is in a continuous motion state according to the first integral signal curve; When it is determined that the target user changes from the continuous motion state to the end motion state, the end motion time of the target user is recorded; Performing a detrending operation on the first integral curve to obtain a second integral signal curve; Determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement; Calculating the number of times the target user performs periodic exercise according to the number of zero-crossing points of the second integral signal curve; The determining that the target user changes from the continuous motion state to the end motion state comprises: When it is determined that the target user is in a periodic motion state, the signal value corresponding to the gyroscope signal with a time window of a preset duration on the first integral signal curve is taken, and the slope of the signal value within the preset duration is calculated using the least squares method. ; Then slide the time window on the first integral signal curve forward for 1 second, and calculate the slope of the signal value within the preset time length in the new time window. ; Determine the slope With the slope Is the product of less than zero? If the slope With the slope The product of is less than zero, determining that the target user changes from the continuous motion state to the end motion state; If the slope With the slope The product of is equal to or greater than zero, and continuously presents a linear upward trend with a stable slope for several seconds, determining that the target user is still in the continuous motion state; Calculating the number of movements of the target user according to the number of zero crossings of the second integral signal curve includes: Calculate the average of the start signal values ​​corresponding to the previous X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5; Subtracting the mean value from the second integrated signal curve to obtain a new second integrated signal curve; Calculating the number of movements of the target user according to the number of zero-crossing points of the new second integral signal curve; Calculating the number of movements of the target user according to the number of zero crossings of the new second integral signal curve includes: The number of exercises of the target user is determined according to the positive and negative states of the previous adjacent data values ​​of each zero-crossing point of the new second integral signal curve and the positive and negative states of the subsequent adjacent data values ​​of each zero-crossing point of the new second integral signal curve.

2. The method for calculating the number of exercises according to claim 1, characterized in that: The method further comprises: When the positive and negative states of the preceding adjacent data value of the first target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are negative, the first target zero-crossing point is recorded as point, the first target zero-crossing point is a zero-crossing point of the new second integral signal curve; When the positive and negative state of the previous adjacent data value of the second target zero-crossing point is negative and the positive and negative state of the next adjacent data value is positive, the second target zero-crossing point is recorded as point, the second target zero-crossing point is a zero-crossing point of the new second integral signal curve; Each pair of adjacent ones of the new second integrated signal curve Points and The point is recorded as one exercise number, and the exercise number of the target user is obtained.

3. The method for calculating the number of exercises according to claim 2, characterized in that: Each pair of adjacent ones of the new second integrated signal curve Points and Points are counted as one exercise including: Determine each on the new second integrated signal curve Point, first Point Point or point; The adjacent pair of previous ones on the new second integral signal curve are arranged in chronological order. Point and the next Points are counted as one movement, where the previous Point and the next The points are different, and each A point is counted only once.

4. The method for calculating the number of exercises according to claim 2, characterized in that: The method further comprises: When the positive and negative states of the preceding adjacent data value of the third target zero-crossing point are negative and the positive and negative states of the succeeding adjacent data value are negative, the third target zero-crossing point is recorded as point, the third target zero-crossing point is a zero-crossing point of the new second integral signal curve; Eliminate the point; When the positive and negative states of the preceding adjacent data value of the fourth target zero-crossing point are positive and the positive and negative states of the succeeding adjacent data value are positive, the fourth target zero-crossing point is recorded as point, the fourth target zero-crossing point is a zero-crossing point of the new second integral signal curve; Eliminate the point.

5. The method for calculating the number of exercises according to claim 1, characterized in that: The gyro sensor is a three-axis gyro sensor, and the gyro signal of the gyro sensor includes: an X-axis gyro signal, a Y-axis gyro signal, and a Z-axis gyro signal; Performing a first integration process on the gyro signal curve of the gyro sensor to obtain a first integrated signal curve includes: Performing first integration processing on the X-axis gyroscope signal, the Y-axis gyroscope signal, and the Z-axis gyroscope signal of the three-axis gyroscope sensor, respectively, to obtain an X-axis first integration signal curve, a Y-axis first integration signal curve, and a Z-axis first integration signal curve; The X-axis first integrated signal curve, the Y-axis first integrated signal curve, and the Z-axis first integrated signal curve are respectively regarded as the first integrated signal curve, and the step of determining whether the target user is in a continuous motion state according to the first integrated signal curve is triggered; After calculating the number of movements of the target user according to the number of zero-crossing points of the second integral signal curve, the method further includes: Obtain the X-axis movement times, Y-axis movement times, and Z-axis movement times of the target user; The X-axis movement number, the Y-axis movement number, and the Z-axis movement number are selected by using a preset model to obtain a target movement number, wherein the target movement number is one of the X-axis movement number, the Y-axis movement number, and the Z-axis movement number; The preset model is a trained model that can select one of the X-axis movement times, the Y-axis movement times and the Z-axis movement times as the target movement times based on the X-axis gyroscope signal, the Y-axis gyroscope signal and the Z-axis gyroscope signal of the target user performing periodic movements.

6. The method for calculating the number of exercises according to claim 1, characterized in that: After performing a first integration process on the gyro signal curve of the gyro sensor to obtain a first integrated signal curve, the method further includes: Check in chronological order whether the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold; When the absolute value of the ordinate data value corresponding to the first integral signal curve exceeds a preset threshold, the subsequent ordinate data values ​​of the first integral signal curve are reduced by m times, where m is a preset positive number.

7. A device for calculating the number of times of exercise, characterized in that: Applied to a smart device equipped with a gyroscope sensor, the device comprises: A recording unit, configured to, when determining that the target user is currently in a periodic motion state, record a start time of the target user entering the periodic motion state; A first integration unit is used to perform a first integration process on a gyroscope signal curve formed by a gyroscope signal of the gyroscope sensor to obtain a first integrated signal curve, wherein the first integration process is to accumulate signal values ​​of the gyroscope signal; a judging unit, configured to judge whether the target user is in a continuous motion state according to the first integral signal curve; The recording unit is further configured to record the end time of the target user ending the continuous motion state when it is determined that the target user ends the continuous motion state; a removal unit, used for performing a trend removal operation on the first integral curve to obtain a second integral signal curve; A determination unit, used to determine a second integral signal curve corresponding to the start time of the movement to the end time of the movement; a calculation unit, configured to calculate the number of times the target user performs periodic exercise according to the number of zero-crossing points of the second integral signal curve; When the recording unit determines that the target user changes from a continuous motion state to an end motion state, the recording unit is specifically configured to: When it is determined that the target user is in a periodic motion state, the signal value corresponding to the gyroscope signal with a time window of a preset duration on the first integral signal curve is taken, and the slope of the signal value within the preset duration is calculated using the least squares method. ; Then slide the time window on the first integral signal curve forward for 1 second, and calculate the slope of the signal value within the preset time length in the new time window. ; Determine the slope With the slope Is the product of less than zero? If the slope With the slope The product of is less than zero, determining that the target user changes from the continuous motion state to the end motion state; If the slope With the slope The product of is equal to or greater than zero, and continuously presents a linear upward trend with a stable slope for several seconds, determining that the target user is still in the continuous motion state; When the calculation unit calculates the number of movements of the target user according to the number of zero-crossing points of the second integral signal curve, it is specifically used to: Calculate the average of the start signal values ​​corresponding to the previous X movements reflected by the second integral signal curve, where X is a positive integer equal to or greater than 5; Subtracting the mean value from the second integrated signal curve to obtain a new second integrated signal curve; Calculating the number of movements of the target user according to the number of zero-crossing points of the new second integral signal curve; When the calculation unit calculates the number of movements of the target user according to the number of zero-crossing points of the new second integral signal curve, it is specifically used to: The number of exercises of the target user is determined according to the positive and negative states of the previous adjacent data values ​​of each zero-crossing point of the new second integral signal curve and the positive and negative states of the subsequent adjacent data values ​​of each zero-crossing point of the new second integral signal curve.

8. A smart device, characterized in that: include: CPU, memory, bus, network interface, three-axis gyroscope sensor, neural network processor, display screen; The central processing unit is connected to the memory, the network interface, the three-axis gyroscope sensor, the neural network processor, and the display screen through the bus; The memory stores a program; When the processor executes the program stored in the memory, the method for calculating the number of exercises described in any one of claims 1 to 6 is performed.

9. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed by a computer device, the computer device executes the method for calculating the number of exercises as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Motion recognition method and device, motion evaluation method and device and, dumbbell

    CN112337043A

  • Motion number calculation method and related device

    CN118253080A