CN110270079B - Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium - Google Patents

Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium Download PDF

Info

Publication number
CN110270079B
CN110270079B CN201910559123.1A CN201910559123A CN110270079B CN 110270079 B CN110270079 B CN 110270079B CN 201910559123 A CN201910559123 A CN 201910559123A CN 110270079 B CN110270079 B CN 110270079B
Authority
CN
China
Prior art keywords
time period
shake
characteristic variable
current time
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910559123.1A
Other languages
Chinese (zh)
Other versions
CN110270079A (en
Inventor
李文波
胡茂伟
况海斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yuedongtianxia Technology Co ltd
Original Assignee
Shenzhen Yuedongtianxia Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yuedongtianxia Technology Co ltd filed Critical Shenzhen Yuedongtianxia Technology Co ltd
Priority to CN201910559123.1A priority Critical patent/CN110270079B/en
Publication of CN110270079A publication Critical patent/CN110270079A/en
Application granted granted Critical
Publication of CN110270079B publication Critical patent/CN110270079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B71/00Games or sports accessories not covered in groups A63B1/00 - A63B69/00
    • A63B71/06Indicating or scoring devices for games or players, or for other sports activities
    • A63B71/0619Displays, user interfaces and indicating devices, specially adapted for sport equipment, e.g. display mounted on treadmills
    • A63B71/0622Visual, audio or audio-visual systems for entertaining, instructing or motivating the user
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B71/00Games or sports accessories not covered in groups A63B1/00 - A63B69/00
    • A63B71/06Indicating or scoring devices for games or players, or for other sports activities
    • A63B71/0619Displays, user interfaces and indicating devices, specially adapted for sport equipment, e.g. display mounted on treadmills
    • A63B71/0669Score-keepers or score display devices
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B71/00Games or sports accessories not covered in groups A63B1/00 - A63B69/00
    • A63B71/06Indicating or scoring devices for games or players, or for other sports activities
    • A63B71/0686Timers, rhythm indicators or pacing apparatus using electric or electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B71/00Games or sports accessories not covered in groups A63B1/00 - A63B69/00
    • A63B71/06Indicating or scoring devices for games or players, or for other sports activities
    • A63B71/0619Displays, user interfaces and indicating devices, specially adapted for sport equipment, e.g. display mounted on treadmills
    • A63B71/0622Visual, audio or audio-visual systems for entertaining, instructing or motivating the user
    • A63B2071/0625Emitting sound, noise or music
    • A63B2071/063Spoken or verbal instructions

Abstract

The invention relates to a method and a device for detecting a shaking state during movement, an intelligent terminal and a storage medium, wherein the method comprises the following steps: acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer; calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration; determining a shaking state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm; and if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period. The intelligent terminal shakes and initiatively shakes the accurate detection and the differentiation of intelligent terminal when having realized normal swing arm in the motion process, and then can be in the definite intelligent terminal that initiatively shakes the trigger language report, and user experience is high.

Description

Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium
Technical Field
The invention relates to the technical field of data analysis, in particular to a method and a device for detecting a shaking state during movement, an intelligent terminal and a storage medium.
Background
Along with the improvement of living standard of people, people attach more and more importance to the health problem, and it is more and more common to build up body through running. With the rise of internet sports APP (Application), a user starts to record various sports data in the running process, such as running kilometers, exercise duration, pace, stride and the like, by using a mobile phone APP, and can know the running state in real time in the running process. In order to observe running data in real time, a user needs to open a mobile phone screen, but fingers generating sweat often cannot open the mobile phone screen in the running process. In addition, watching the mobile phone screen easily causes the eyes to deviate from the runway and fall.
The method comprises the following steps that a user searches for a nearby user, shakes and shakes in the prior art are widely applied to WeChat red envelope searching, the fixed threshold is set on the basis of an acceleration sensor, the shaking state is similar to the swing arm in the running process, however, the shaking state is different in the running process, and the shaking of the intelligent terminal and the shaking action triggered by the user during normal swing arm in the running process are difficult to distinguish.
Disclosure of Invention
In view of this, a method and an apparatus for detecting a shake state during motion, an intelligent terminal and a storage medium are provided to solve the problem in the prior art that a motion state cannot be obtained by shaking the intelligent terminal during a motion process due to the fact that the shake of the intelligent terminal during a normal swing arm cannot be distinguished from the active shake of the intelligent terminal.
The invention adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for detecting a shake state during motion, where the method includes:
acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer;
calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration;
determining a shaking state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm;
and if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period.
Further, after determining that the user has enabled the pan function within the current time period, the method further includes: triggering a voice broadcasting function, and broadcasting the motion state data in the current time period;
wherein the motion state data comprises: running kilometers, length of exercise, pace and/or stride.
Further, the preset calculation rule includes square, sum, and square, and correspondingly, the target characteristic variable is calculated according to the preset calculation rule according to the first rotation angular velocity and the first acceleration, including:
performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain corresponding first-order difference characteristic variables;
and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first rotation angular velocity, and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first acceleration to calculate a target characteristic variable.
Further, before collecting the first motion state detection data of the user in the current time period, the method further includes:
and determining a preset calculation rule.
Further, the determining the preset calculation rule includes:
acquiring training data, wherein the training data comprises second motion state detection data over a training time period, the second motion state detection data comprising a second rotational angular velocity measured by a gyroscope and a second acceleration measured by an accelerometer;
performing first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis respectively to obtain corresponding second-order difference characteristic variables;
performing square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and performing square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable;
labeling the second rotational angular velocity, the second acceleration, the second first order difference feature variable, and the intermediate feature variable according to the training data sources, wherein the training data sources include shake-time generation and non-shake-time generation;
and classifying the characteristic variables by using a preset classifier to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
Further, classifying the feature variables by using a preset classifier to determine a preset calculation rule, where the feature variables corresponding to the preset calculation rule are target feature variables, and the method includes:
and respectively calculating the importance of the characteristic variables by using a preset classifier, and determining the characteristic variable with the highest importance as a target characteristic variable, wherein the calculation rule corresponding to the target characteristic variable is a preset calculation rule.
Further, the determining the shake-shake state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm includes:
and comparing the target characteristic variable with the target characteristic variable added with the mark in the training data by applying a preset abnormal value detection algorithm, and identifying the mark of the target characteristic variable so as to determine the shake-shake state in the current time period.
In a second aspect, an embodiment of the present application provides a device for detecting a shake state during exercise, where the device includes:
the data acquisition module is used for acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer;
the target characteristic variable calculation module is used for calculating a target characteristic variable according to the first rotation angular velocity and the first acceleration and a preset calculation rule;
the shaking state determining module is used for applying a preset abnormal value detection algorithm and determining a shaking state in the current time period according to the target characteristic variable;
and the function state determining module is used for determining that the user has started the shake function in the current time period when the number of times of the shake state in the current time period is greater than a preset number threshold.
The voice broadcasting triggering module is used for triggering the voice broadcasting function and broadcasting the motion state data in the current time period after the user is determined to start the shaking function in the current time period;
wherein the motion state data comprises: running kilometers, length of exercise, pace and/or stride.
Further, the preset calculation rule includes square, sum, and square, and correspondingly, the target feature variable calculation module is specifically configured to:
performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain corresponding first-order difference characteristic variables;
and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first rotation angular velocity, and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first acceleration to calculate a target characteristic variable.
The system further comprises a calculation rule determining module, which is used for determining a preset calculation rule before acquiring the first motion state detection data of the user in the current time period.
Further, the calculation rule determining module specifically includes:
a training data acquisition sub-module configured to acquire training data, wherein the training data includes second motion state detection data for a training period, and the second motion state detection data includes a second rotation angular velocity measured by the gyroscope and a second acceleration measured by the accelerometer;
the first-order difference characteristic variable acquisition submodule is used for respectively carrying out first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis so as to acquire corresponding second-order difference characteristic variables;
the intermediate variable acquisition submodule is used for carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable;
a feature variable labeling module, configured to label the second rotation angular velocity, the second acceleration, the second first-order difference feature variable, and the intermediate feature variable according to the training data source, where the training data source includes shake-time generation and non-shake-time generation;
and the classification submodule is used for classifying the characteristic variables by applying a preset classifier so as to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
Further, the classification sub-module is specifically configured to include:
and respectively calculating the importance of the characteristic variables by using a preset classifier, and determining the characteristic variable with the highest importance as a target characteristic variable, wherein the calculation rule corresponding to the target characteristic variable is a preset calculation rule.
Further, the shake state determination module is specifically configured to include:
and comparing the target characteristic variable with the target characteristic variable added with the mark in the training data by applying a preset abnormal value detection algorithm, and identifying the mark of the target characteristic variable so as to determine the shake-shake state in the current time period.
In a third aspect, an embodiment of the present application provides an intelligent terminal, where the intelligent terminal includes:
a processor, and a memory coupled to the processor;
the memory is configured to store a computer program, where the computer program is at least configured to execute the method for detecting a shake-while-moving state in motion according to the first aspect of the embodiment of the present application;
the processor is used for calling and executing the computer program in the memory.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the method for detecting a shake-while-moving state according to the first aspect are implemented.
By adopting the technical scheme, after the first motion state data in the current time period are collected, the target characteristic variable is calculated according to the preset calculation rule, so that the calculated target characteristic variable is more in line with the actual motion situation of the user in the motion process; then, a preset abnormal value detection algorithm is applied, and a target characteristic variable is applied to detect a shake-shake state in the current time period; when the number of times of the shake-shake state is greater than the preset number threshold, it can be determined that the shake-shake function in the current time period is enabled, and then other subsequent operations can be performed, for example, a voice broadcast motion state and the like. Like this, realized through the normal swing arm time intelligent terminal's of distinguishing rocking and the initiative intelligent terminal's of rocking the condition, and then can acquire the motion state through rocking intelligent terminal.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting a shake-while-moving status according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for determining a preset calculation rule according to an embodiment of the present invention;
FIG. 3 is a histogram of the importance of a variety of characteristic variables suitable for use in embodiments of the present invention;
FIG. 4 is a schematic structural diagram of a device for detecting a shake-during-exercise status according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
Examples
Fig. 1 is a flowchart of a method for detecting a shake-during-exercise status according to an embodiment of the present invention, where the method may be performed by a shake-during-exercise status detecting apparatus according to an embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner. Referring to fig. 1, the method may specifically include the following steps:
s101, first motion state detection data of a user in a current time period are collected, wherein the first motion state detection data comprise a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer.
The intelligent terminal is a mobile phone as an example, the mobile phone usually comprises a gyroscope and an accelerometer, the gyroscope is an angular motion detection device which uses a momentum moment sensitive shell of a high-speed revolving body to rotate around one or two axes which are orthogonal to an axis of rotation relative to an inertial space, and the gyroscope is used for measuring a rotation angular velocity; an accelerometer, a meter that measures the linear acceleration of a vehicle, here used to measure acceleration, is a cell phone in the example of the application. It should be noted that, when there is no gyroscope or no accelerometer in the mobile phone, the corresponding measured first rotation angular velocity or first acceleration is represented by zero.
Specifically, the current time period is the time period during the movement of the user, and may be 30 minutes, for example. In order to distinguish from the data in the training phase, the data acquired in the current time period in the application process is classified into the first type of data, the first type of data is added in front of the data, the data acquired in the training time period in the training phase is classified into the second type of data, and the second type of data is added in front of the data. First motion state detection data of a user in a current time period are collected, and the first motion state detection data mainly comprise a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer. In a specific example, the first rotation angular velocity on the X, Y, Z axis is represented as (rot _ rate _ x1, rot _ rate _ y1, rot _ rate _ z1), the first acceleration on the X, Y, Z axis is represented as (user _ acc _ x1, user _ acc _ y1, user _ acc _ z1), and the collection density can be achieved by collecting fixed data points per unit time, for example, 20 data points per 1 second.
And S102, calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration.
Specifically, after the first rotation angular velocity and the first acceleration of the axes are acquired X, Y, Z, the target characteristic variable is calculated according to a preset calculation rule, where the preset calculation rule is a calculation rule that calculates the first rotation angular velocity and the first acceleration of each axis, such as an addition, subtraction, multiplication, division, square, or square mathematical operation, or a combination of a plurality of mathematical operations. In this way, a target feature variable can be obtained. The preset calculation rule is determined by calculation according to an actual condition, that is, the feature variable calculated according to the preset calculation rule is called a target feature variable. The target feature variables may be used for the identification of a pan-tilt state.
S103, a preset abnormal value detection algorithm is applied, and the shaking state in the current time period is determined according to the target characteristic variable.
The preset abnormal value detection algorithm can be z-score, 3sigma, iforcest and other algorithms, each target characteristic variable can be detected through the preset abnormal value detection, and the shaking state in the current time period is judged according to the detection result of the target characteristic variable. In a specific example, for example, the current time period is 0.4 seconds, and the detection result may be that 5 suspected shake-shake states are generated in the 0.4 seconds.
And S104, if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period.
Specifically, the preset number threshold may be 4, and the current time period is, for example, 0.4 second, and then 5 times of shake-and-shake states are generated within 0.4 second of the current time period, and at this time, it may be determined that the user has enabled the shake-and-shake function within the current time period. That is, at this time, the current shake-shake state can be distinguished, which is triggered by the user actively shaking the mobile phone, rather than the swing of the arm naturally occurring during the following movement of the mobile phone.
By adopting the technical scheme, after the first motion state data in the current time period are collected, the target characteristic variable is calculated according to the preset calculation rule, so that the calculated target characteristic variable is more in line with the actual motion situation of the user in the motion process; then, a preset abnormal value detection algorithm is applied, and a target characteristic variable is applied to detect a shake-shake state in the current time period; when the number of times of the shake-shake state is greater than the preset number threshold, it can be determined that the shake-shake function in the current time period is enabled, and then other subsequent operations can be performed, for example, a voice broadcast motion state and the like. Like this, realized through the normal swing arm time intelligent terminal's of distinguishing rocking and the initiative intelligent terminal's of rocking the condition, and then can acquire the motion state through rocking intelligent terminal.
On the basis of the foregoing technical solution, in the technical solution of the present application, after determining that the user has enabled the shake-and-shake function within the current time period, the method further includes: triggering a voice broadcasting function, and broadcasting the motion state data in the current time period; wherein the motion state data comprises: running kilometers, length of exercise, pace and/or stride.
Specifically, after the user is confirmed to have started to shake the function in the current time quantum, it indicates that it is user-triggered to shake the function, rather than following natural triggering when running in-process normal swing arm, and at this moment, intelligent terminal triggers the voice broadcast function of self, broadcasts the motion state data in the current time quantum. In a specific example, the exercise state data comprises running kilometers, exercise duration, pace and/or stride and the like, so that a user can know the exercise state data in real time without opening a mobile phone screen in the exercise process, the situation that the mobile phone screen cannot be opened due to sweat stains on hands is avoided, and inconvenience brought by opening and watching the screen by the user is reduced. In addition, voice broadcast not only can report motion state data, can also report weather conditions, for example: immediately, it is raining, and the user pays attention to the termination of the early season. The motion state data is only used for example, and may also include other motion state data, which is not limited herein.
Optionally, the preset calculation rule includes square, sum, and square, and correspondingly, the target characteristic variable is calculated according to the first rotation angular velocity and the first acceleration according to the preset calculation rule, which may specifically be implemented as follows: performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain corresponding first-order difference characteristic variables; and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first rotation angular velocity, and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first acceleration to calculate a target characteristic variable.
Specifically, the preset calculation rules include square, sum, and square. Accordingly, the way of calculating the target feature variable is as follows: performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain a corresponding first-order difference characteristic variable, for example, at time t, the first-order difference characteristic variable of the first rotation angular velocity in the X-axis direction is denoted as diff _ rot _ rate _ X1[ t ] ═ rot _ rate _ X1[ t ] -rot _ rate _ X1[ t-1], and similarly, the first acceleration is also subjected to first-order difference along each coordinate axis respectively, taking the X-axis as an example, and the first-order difference characteristic variable of the first acceleration in the X-axis direction is denoted as diff _ user _ acc _ X1[ t ] ═ user _ acc _ X1[ t ] -user _ acc _ X1[ t-1 ]; then, taking the square sum of the first linear differential characteristic variables respectively, and then performing power division to obtain 2 new variables without directions, for example, at time t, the power division of the square sum of the first linear differential characteristic variables of the first rotation angular velocity along different directions is rot _ rate _ rms1[ t ] ═ sqrt (diff _ rot _ rate _ x1[ t ] ^2+ diff _ rot _ rate _ y1[ t ] ^2+ diff _ rot _ rate _ z1[ t ] ^ 2); the evolution of the sum of the squares of the first order difference characteristic variables of the first acceleration in different directions is: user _ acc _ rms1[ t ] ═ sqrt (diff _ user _ acc _ x1[ t ] ^2+ diff _ user _ acc _ y1[ t ] ^2+ diff _ user _ acc _ z1[ t ] ^ 2). Thus, the target feature variables are rot _ rate _ rms1[ t ] and user _ acc _ rms1[ t ].
Fig. 2 is a flowchart of a method for determining a preset calculation rule according to another embodiment of the present invention, which is implemented on the basis of the above embodiment, and in an actual application process, the preset calculation rule is determined before first motion state detection data of a user in a current time period is collected. Referring to fig. 2, the method may specifically include the following steps:
s201, training data are obtained, wherein the training data comprise second motion state detection data in a training time period, and the second motion state detection data comprise a second rotation angular velocity measured by a gyroscope and a second acceleration measured by an accelerometer.
Specifically, training data is acquired, which is not generated in real motion but generated for determining a target feature variable or a preset calculation rule, for example, data in both motion states of a shake state and a non-shake state is simulated, that is, data in what case the data belongs is known. Although the training data is acquired during the training period and the first motion state detection data is acquired during the current period of the application process, the two types of data have the same attribute, that is, both the rotational angular velocity and the acceleration. For the purpose of distinction, the training data of the training phase are each referred to as a second type of data, for example, the second motion state detection data includes a second rotational angular velocity measured by the gyroscope and a second acceleration measured by the accelerometer. For example, the second rotational angular velocity on the X, Y, Z axis is represented as (rot _ rate _ x2, rot _ rate _ y2, rot _ rate _ z2), and the second acceleration on the X, Y, Z axis is represented as (user _ acc _ x2, user _ acc _ y2, user _ acc _ z 2).
S202, performing first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis respectively to obtain corresponding second-order difference characteristic variables.
For example, the second angular velocity and the second acceleration are respectively first-order differentiated along each coordinate axis to obtain a corresponding second-order differentiated feature variable, for example, at time t, the second-order differentiated feature variable of the second angular velocity in the X-axis direction is represented as diff _ rot _ rate _ X2[ t ] ═ rot _ rate _ X2[ t ] -rot _ rate _ X2[ t-1], and similarly, the second acceleration is also respectively first-order differentiated along each coordinate axis, taking the X-axis as an example, to obtain diff _ user _ acc _ X2[ t ] ═ user _ acc _ X2[ t ] -user _ acc _ X2[ t-1 ].
S203, performing square, sum, and square operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and performing square, sum, and square operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable.
Specifically, the second first-order differential characteristic variables corresponding to the second rotation angular velocity are respectively squared, summed, and then squared to obtain 2 new variables without directions, for example, at time t, the sum of squares of the second first-order differential characteristic variables of the second rotation angular velocity along different directions is rot _ rate _ rms2[ t ] ═ sqrt (diff _ rot _ rate _ x2[ t ] ^2+ diff _ rot _ rate _ y2[ t ] ^2+ diff _ rot _ rate _ z2[ t ] ^ 2); the square root of the second first-order difference feature variable square sum of the second acceleration along different directions is user _ acc _ rms2[ t ] ═ sqrt (diff _ user _ acc _ x2[ t ] ^2+ diff _ user _ acc _ y2[ t ] ^2+ diff _ user _ acc _ z2[ t ] ^ 2). Thus, the intermediate feature variables are rot _ rate _ rms2[ t ] and user _ acc _ rms2[ t ].
And S204, marking the second rotation angular velocity, the second acceleration, the second first-order difference characteristic variable and the intermediate characteristic variable according to the training data source, wherein the training data source comprises shaking generation and non-shaking generation.
The shaking refers to shaking of the intelligent terminal, and the non-shaking refers to non-shaking of the intelligent terminal. Specifically, since the training data is generated by simulation, it is known whether each data is generated by shaking or not. At this time, the second rotational angular velocity, the second acceleration, the second first-order difference feature variable, and the intermediate feature variable are labeled according to whether the training data is generated during shaking or non-shaking, and for example, the data generated during shaking is labeled as 1 and the data generated during non-shaking is labeled as 0.
S205, classifying the characteristic variables by using a preset classifier to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
The classifier is a general term of a method for classifying samples in data mining, and comprises algorithms such as a decision tree, logistic regression, naive Bayes, a neural network and the like. Specifically, a preset classifier is used to calculate the importance of the feature variables respectively, that is, a feature importance analysis is performed, for example, 14 feature variables are taken as an example, which are the second rotation angular velocity and the second acceleration of the X axis respectively; a second rotation angular velocity and a second acceleration of the Y axis; a second rotational angular velocity and a second acceleration of the Z axis; and second-order difference characteristic variables corresponding to the six characteristic variables; and, the two intermediate characteristic variables mentioned in the above embodiments. In this specific example, a random forest algorithm, which may be a principal component analysis algorithm, a Lasso algorithm, or the like, is applied, and here, the importance of each feature variable is calculated by taking the random forest algorithm as an example. The importance may be a dimensionless percentage, the feature variable with the highest importance is selected as the target feature variable, fig. 3 shows an importance histogram of each feature variable, and the vertical axis is the importance corresponding to each feature variable; at this time, the calculation rule corresponding to the target feature variable is a preset calculation rule. In the embodiment of the present application, the target feature variables are the two intermediate feature variables described above, i.e., rot _ rate _ rms2[ t ] and user _ acc _ rms2[ t ].
In the embodiment of the application, training data are mainly acquired, the training data are operated to determine a plurality of characteristic variables, and then the importance of each characteristic variable is calculated to determine a target characteristic variable. The calculation amount is saved, and the accuracy of determining the shaking state is improved.
On the basis of the technical scheme, a preset abnormal value detection algorithm is applied, and a shaking state in the current time period is determined according to the target characteristic variable, and the method specifically comprises the following steps: and comparing the target characteristic variable with the target characteristic variable added with the mark in the training data by applying a preset abnormal value detection algorithm, and identifying the mark of the target characteristic variable so as to determine the shake-shake state in the current time period.
Specifically, in an actual application process, after the first motion state monitoring data of the current time period is acquired, the target characteristic variable is calculated, at this time, the target characteristic variable is compared with the target characteristic variable added with the mark in the training data, so that whether the mark corresponding to the target characteristic variable in the current time period is 0 or 1 can be distinguished, that is, the shake-shake state in the current time period can be determined, for example, 0 represents a non-shake state, and 0 represents a shake-shake state.
In a specific example, an adaptive outlier detection algorithm may be applied, and specifically, for different users, a shake-shake status to be recognized each time during a running process is detected based on a running status of the user for a fixed time period, so that a normal running and shake-shake status of different users or the same user at different time periods may be distinguished, that is, whether the intelligent terminal shakes along with the running motion of the user or the shake actively triggered by the user is distinguished. In the embodiment of the present application, the previous fixed time period is the current time period in the above embodiment.
Fig. 4 is a schematic structural diagram of an apparatus for detecting a shake-during-exercise status according to an embodiment of the present invention, which is suitable for executing a method for detecting a shake-during-exercise status according to an embodiment of the present invention. As shown in fig. 4, the apparatus may specifically include: a data acquisition module 401, a target characteristic variable calculation module 402, a shake state determination module 403, and a function state determination module 404.
The data acquisition module 401 is configured to acquire first motion state detection data of a user in a current time period, where the first motion state detection data includes a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer; a target characteristic variable calculation module 403, configured to calculate a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration; a shake state determination module 403, configured to apply a preset abnormal value detection algorithm, and determine a shake state within the current time period according to the target characteristic variable; a function state determining module 404, configured to determine that the user has enabled the shake-and-shake function in the current time period when the number of times of the shake-and-shake states in the current time period is greater than a preset number threshold.
By adopting the technical scheme, after the first motion state data in the current time period are collected, the target characteristic variable is calculated according to the preset calculation rule, so that the calculated target characteristic variable is more in line with the actual motion situation of the user in the motion process; then, a preset abnormal value detection algorithm is applied, and a target characteristic variable is applied to detect a shake-shake state in the current time period; when the number of times of the shake-shake state is greater than the preset number threshold, it can be determined that the shake-shake function in the current time period is enabled, and then other subsequent operations can be performed, for example, a voice broadcast motion state and the like. Like this, realized through the normal swing arm time intelligent terminal's of distinguishing rocking and the initiative intelligent terminal's of rocking the condition, and then can acquire the motion state through rocking intelligent terminal.
The voice broadcasting triggering module is used for triggering the voice broadcasting function and broadcasting the motion state data in the current time period after the user is determined to start the shaking function in the current time period;
wherein the motion state data comprises: running kilometers, length of exercise, pace and/or stride.
Further, the preset calculation rule includes square, sum, and square, and correspondingly, the target feature variable calculation module 402 is specifically configured to:
performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain corresponding first-order difference characteristic variables;
and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first rotation angular velocity, and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first acceleration to calculate a target characteristic variable.
The system further comprises a calculation rule determining module, which is used for determining a preset calculation rule before acquiring the first motion state detection data of the user in the current time period.
Further, the calculation rule determining module specifically includes:
a training data acquisition sub-module configured to acquire training data, wherein the training data includes second motion state detection data for a training period, and the second motion state detection data includes a second rotation angular velocity measured by the gyroscope and a second acceleration measured by the accelerometer;
the first-order difference characteristic variable acquisition submodule is used for respectively carrying out first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis so as to acquire corresponding second-order difference characteristic variables;
the intermediate variable acquisition submodule is used for carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable;
a feature variable labeling module, configured to label the second rotation angular velocity, the second acceleration, the second first-order difference feature variable, and the intermediate feature variable according to the training data source, where the training data source includes shake-time generation and non-shake-time generation;
and the classification submodule is used for classifying the characteristic variables by applying a preset classifier so as to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
Further, the classification sub-module is specifically configured to include:
and respectively calculating the importance of the characteristic variables by using a preset classifier, and determining the characteristic variable with the highest importance as a target characteristic variable, wherein the calculation rule corresponding to the target characteristic variable is a preset calculation rule.
Further, the shake state determination module 403 is specifically configured to include:
and comparing the target characteristic variable with the target characteristic variable added with the mark in the training data by applying a preset abnormal value detection algorithm, and identifying the mark of the target characteristic variable so as to determine the shake-shake state in the current time period.
The device for detecting the shaking state during the movement provided by the embodiment of the invention can execute the method for detecting the shaking state during the movement provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
An embodiment of the present invention further provides an intelligent terminal, please refer to fig. 5, fig. 5 is a schematic structural diagram of an intelligent terminal, and as shown in fig. 5, the intelligent terminal includes: a processor 510, and a memory 520 coupled to the processor 510; the memory 520 is used for storing a computer program at least for executing the shake-while-moving state detection method in the embodiment of the present invention; the processor 510 is configured to call and execute the computer program in the memory, and the method for detecting a shake-while-moving state at least includes: acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer; calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration; determining a shaking state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm; and if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period.
An embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting a shake-during-exercise state in the embodiment of the present invention is implemented, where the method for detecting a shake-during-exercise state at least includes: acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer; calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration; determining a shaking state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm; and if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A method for detecting a shaking state during movement is characterized by comprising the following steps:
acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer;
calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration;
determining a shaking state in the current time period according to the target characteristic variable by applying a preset abnormal value detection algorithm;
if the number of times of shaking the one-touch state in the current time period is greater than a preset number threshold, determining that the user has started the shaking one-touch function in the current time period;
before acquiring first motion state detection data of a user in a current time period, the method further comprises the following steps: determining a preset calculation rule;
wherein the determining the preset calculation rule comprises:
acquiring training data, wherein the training data comprises second motion state detection data over a training time period, the second motion state detection data comprising a second rotational angular velocity measured by a gyroscope and a second acceleration measured by an accelerometer;
performing first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis respectively to obtain corresponding second-order difference characteristic variables;
performing square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and performing square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable;
labeling the second rotational angular velocity, the second acceleration, the second first order difference feature variable, and the intermediate feature variable according to the training data sources, wherein the training data sources include shake-time generation and non-shake-time generation;
and classifying the characteristic variables by using a preset classifier to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
2. The method of claim 1, after determining that a user has enabled a pan function within the current time period, further comprising: triggering a voice broadcasting function, and broadcasting the motion state data in the current time period;
wherein the motion state data comprises: running kilometers, length of exercise, pace and/or stride.
3. The method of claim 1, wherein the pre-set calculation rules include squaring, summing, and squaring;
correspondingly, calculating a target characteristic variable according to a preset calculation rule according to the first rotation angular velocity and the first acceleration includes:
performing first-order difference on the first rotation angular velocity and the first acceleration along each coordinate axis respectively to obtain corresponding first-order difference characteristic variables;
and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first rotation angular velocity, and performing squaring, summing and evolution operations on each first one-step difference characteristic variable corresponding to the first acceleration to calculate a target characteristic variable.
4. The method according to claim 1, wherein classifying the feature variables by applying a preset classifier to determine a preset calculation rule, wherein the feature variables corresponding to the preset calculation rule are target feature variables, and the method comprises:
and respectively calculating the importance of the characteristic variables by using a preset classifier, and determining the characteristic variable with the highest importance as a target characteristic variable, wherein the calculation rule corresponding to the target characteristic variable is a preset calculation rule.
5. The method of claim 1, wherein applying a preset outlier detection algorithm to determine a shake-shake status within the current time period from the target feature variable comprises:
and comparing the target characteristic variable with the target characteristic variable added with the mark in the training data by applying a preset abnormal value detection algorithm, and identifying the mark of the target characteristic variable so as to determine the shake-shake state in the current time period.
6. A device for detecting a shake state during exercise, comprising:
the data acquisition module is used for acquiring first motion state detection data of a user in a current time period, wherein the first motion state detection data comprises a first rotation angular velocity measured by a gyroscope and a first acceleration measured by an accelerometer;
the target characteristic variable calculation module is used for calculating a target characteristic variable according to the first rotation angular velocity and the first acceleration and a preset calculation rule;
the shaking state determining module is used for applying a preset abnormal value detection algorithm and determining a shaking state in the current time period according to the target characteristic variable;
the function state determining module is used for determining that the user starts the shaking function in the current time period when the frequency of the shaking state in the current time period is greater than a preset number threshold;
the device also comprises a calculation rule determining module, a calculation rule determining module and a calculation rule determining module, wherein the calculation rule determining module is used for determining a preset calculation rule before acquiring first motion state detection data of a user in the current time period;
the calculation rule determining module specifically includes:
a training data acquisition sub-module configured to acquire training data, wherein the training data includes second motion state detection data for a training period, and the second motion state detection data includes a second rotation angular velocity measured by the gyroscope and a second acceleration measured by the accelerometer;
the first-order difference characteristic variable acquisition submodule is used for respectively carrying out first-order difference on the second rotation angular velocity and the second acceleration along each coordinate axis so as to acquire corresponding second-order difference characteristic variables;
the intermediate variable acquisition submodule is used for carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second rotation angular velocity, and carrying out square, summation and evolution operation on each second-order difference characteristic variable corresponding to the second acceleration to obtain an intermediate characteristic variable;
a feature variable labeling sub-module, configured to label the second rotation angular velocity, the second acceleration, the second first-order difference feature variable, and the intermediate feature variable according to a source of the training data, where the source of the training data includes shake-time generation and non-shake-time generation;
and the classification submodule is used for classifying the characteristic variables by applying a preset classifier so as to determine a preset calculation rule, wherein the characteristic variables corresponding to the preset calculation rule are target characteristic variables.
7. An intelligent terminal, comprising:
a processor, and a memory coupled to the processor;
the memory is used for storing a computer program at least for executing the method for detecting a shake-while-moving state according to any one of claims 1 to 5;
the processor is used for calling and executing the computer program in the memory.
8. A storage medium storing a computer program which, when executed by a processor, implements the steps of the method for detecting a shake-while-moving state according to any one of claims 1 to 5.
CN201910559123.1A 2019-06-26 2019-06-26 Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium Active CN110270079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910559123.1A CN110270079B (en) 2019-06-26 2019-06-26 Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910559123.1A CN110270079B (en) 2019-06-26 2019-06-26 Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110270079A CN110270079A (en) 2019-09-24
CN110270079B true CN110270079B (en) 2020-11-06

Family

ID=67963297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910559123.1A Active CN110270079B (en) 2019-06-26 2019-06-26 Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110270079B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651414B (en) * 2019-10-10 2023-06-27 马上消费金融股份有限公司 Method, device, equipment and storage medium for processing motion data and training model

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067613A (en) * 2013-01-31 2013-04-24 广东欧珀移动通信有限公司 Short message processing method and device and mobile terminal
US20170039358A1 (en) * 2015-08-07 2017-02-09 Fitbit, Inc. Transaction prevention using fitness data
CN107028298B (en) * 2016-10-12 2019-03-01 广东乐源数字技术有限公司 A kind of method that bracelet shakes judgement
CN106775358A (en) * 2017-01-16 2017-05-31 康梅 A kind of method by shaking triggering voice exhibition information
CN109831570A (en) * 2017-11-23 2019-05-31 惠州臻享云科技有限公司 A kind of control method and system of mobile terminal flashlight

Also Published As

Publication number Publication date
CN110270079A (en) 2019-09-24

Similar Documents

Publication Publication Date Title
US10451744B2 (en) Detecting user activity based on location data
KR102252269B1 (en) Swimming analysis system and method
CN108304758B (en) Face characteristic point tracking method and device
CN110263870B (en) Motion state identification method and device, intelligent terminal and storage medium
CN109959379B (en) Positioning method and electronic equipment
JP2014513291A (en) Device location estimation from motion classifier and ambient light classifier
KR20140116481A (en) Activity classification in a multi-axis activity monitor device
US20130335571A1 (en) Vision based target tracking for constrained environments
US9805285B2 (en) State estimation apparatus, state estimation method, and integrated circuit
CN111288986B (en) Motion recognition method and motion recognition device
CN110263871B (en) Step-counting cheating detection method and device, intelligent terminal and storage medium
US11516336B2 (en) Surface detection for mobile devices
SE1350894A1 (en) Method and system for determining performance indicators for periodic movements
CN110270079B (en) Method and device for detecting shake-shake state during movement, intelligent terminal and storage medium
CN104713566B (en) A kind of step-recording method, step count set and pedometer
CN107277222A (en) User behavior state judging method based on mobile phone built-in sensors
CN106303041A (en) A kind of generation method of early warning information and a kind of mobile terminal
CN110811578A (en) Step counting device and step counting method thereof, controller and readable storage medium
US11782496B2 (en) Smart context subsampling on-device system
CN109540133B (en) Self-adaptive gait division method and system based on micro-inertia technology
Salvi et al. An optimised algorithm for accurate steps counting from smart-phone accelerometry
JP2012524578A (en) System and method for determining the activity of moving elements
Harasimowicz et al. Accelerometer-based human activity recognition and the impact of the sample size
WO2014191803A1 (en) Acceleration-based step activity detection and classification on mobile devices
CN113611387B (en) Motion quality assessment method based on human body pose estimation and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant