A method and apparatus for recognizing a shaking action of a mobile terminal device
By using a triaxial accelerometer and dynamic coefficient filtering method to determine the gravity vector, the problems of false triggering and insufficient sensitivity in recognizing shaking motions in mobile terminal devices without gyroscopes are solved, achieving high accuracy in recognizing shaking motions and reducing system resource and energy consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI DROI TECH CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-05-29
Smart Images

Figure CN122111245A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mobile terminal device data processing technology, and in particular to a method and apparatus for recognizing shaking motions of mobile terminal devices. Background Technology
[0002] The "shake" interaction requires mobile terminal devices to be able to sense dynamic changes in three spatial axes. Traditional shaking interaction relies on the gyroscope configured on the mobile terminal device to identify the spatial rotation angular velocity. However, in mobile terminal devices without a gyroscope, the accelerometer alone cannot distinguish between "translational jitter" and "flipping or rotational movements" and is easily affected by the gravitational component, leading to false triggering or insufficient sensitivity.
[0003] Currently, mobile terminal devices without gyroscopes typically set an acceleration threshold directly when recognizing shaking motions. When a user shakes the phone, the instantaneous acceleration value exceeds the set threshold, triggering a shaking motion. In this scenario, the accelerometer simultaneously measures motion acceleration and gravitational acceleration, leading to inconsistent trigger thresholds for different grip postures. Furthermore, relying solely on acceleration modulus calculations cannot identify whether the device has rotated, easily causing false triggers in linear vibration scenarios such as walking or riding in a vehicle. It also cannot distinguish between "rapid waving" and "slow tilting," reducing the user's interactive experience with mobile terminal devices. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method and apparatus for recognizing the shaking motion of a mobile terminal device. This method utilizes a three-axis accelerometer to collect three-axis acceleration data of the mobile terminal device in real time, and uses a dynamic coefficient filtering method to determine the gravity vector. Then, based on the projection switching rate of the gravity vector between each axis, angular velocity data is determined. Furthermore, linear target acceleration data is separated through gravity compensation. The method also detects in real time whether the angular velocity data and target acceleration data meet the shaking conditions to determine the shaking motion recognition result of the mobile terminal device in the current time frame. This method achieves a gyroscope-like effect without increasing hardware costs, effectively filters linear interference in the data, reduces system resource consumption and energy consumption, and improves the accuracy of recognizing shaking motions triggered by the mobile terminal device.
[0005] This application provides a method for recognizing shaking motions in a mobile terminal device. The method is applied to mobile terminal devices without a gyroscope and includes: The triaxial acceleration data corresponding to the target mobile terminal device is collected in real time using the triaxial accelerometer configured on the target mobile terminal device, and the gravity vector corresponding to each time frame is determined by the dynamic coefficient filtering method based on the triaxial acceleration data corresponding to each time frame. Based on the gravity vector, the angular velocity data corresponding to each time frame is determined using a projection transformation method, and the target acceleration data corresponding to each time frame is determined based on the triaxial acceleration data and the gravity vector. The system detects in real time whether the angular velocity data and the target acceleration data within a preset time window meet the preset shaking conditions, and obtains the detection result corresponding to the current time frame. Based on the detection results, the shaking action recognition result of the target mobile terminal device in the current time frame is determined.
[0006] Furthermore, the determination of the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method includes: For each time frame, based on the triaxial acceleration data corresponding to that time frame, the resultant acceleration modulus value corresponding to that time frame is determined, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. The absolute value of the deviation is compared with a preset stability threshold to obtain the comparison result corresponding to the time frame, and the filter gain coefficient corresponding to the time frame is determined based on the comparison result. Based on the filter gain coefficient, the triaxial acceleration data corresponding to the current time frame, and the gravity vector corresponding to the previous time frame, the gravity vector corresponding to the current time frame is determined using a preset dynamic coefficient filtering formula.
[0007] Furthermore, the gravity vector includes a lateral gravity value, a longitudinal gravity value, and a vertical gravity value; the step of determining the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method includes: Based on the lateral gravity value, the longitudinal gravity value, and the vertical gravity value, the pitch angle change corresponding to each time frame is determined, and based on the pitch angle change, the longitudinal angular velocity value corresponding to each time frame is determined. Based on the longitudinal gravity value and the vertical gravity value, the roll angle change corresponding to each time frame is determined, and based on the roll angle change, the lateral angular velocity value corresponding to each time frame is determined. The lateral angular velocity value and the longitudinal angular velocity value are determined as angular velocity data corresponding to each time frame.
[0008] Furthermore, determining the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector includes: The difference between the triaxial acceleration data and the gravity vector is used to determine the target acceleration data for each time frame, so as to eliminate the offset of the gravity vector on each direction axis.
[0009] Furthermore, the real-time detection of whether the angular velocity data and the target acceleration data within the preset time window meet the preset shaking conditions, and obtaining the detection result corresponding to the current time frame, includes: Real-time detection of whether the angular velocity data within a preset time window indicates that the number of times the target mobile terminal device flips is greater than a preset number; In response to the detection that the angular velocity data within the preset time window indicates that the number of times the target mobile terminal device has flipped is greater than the preset number, the resultant acceleration modulus value corresponding to the current time frame is determined based on the triaxial acceleration data corresponding to the current time frame, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. Determine whether the absolute value of the deviation corresponding to the current time frame is greater than or equal to a preset stability threshold; If the absolute value of the deviation is greater than or equal to the preset stability threshold, the detection result is determined to meet the preset shaking condition. If the angular velocity data within the preset time window does not indicate that the number of times the target mobile terminal device has flipped is greater than a preset number, or the absolute value of the deviation is less than a preset stability threshold, then the detection result is determined to be that the shaking condition is not met.
[0010] Furthermore, the step of real-time detection of whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions, and obtaining the detection result corresponding to the current time frame, also includes: If the absolute value of the deviation is greater than or equal to a preset stability threshold, then the gravity vector is updated; If the absolute value of the deviation is less than a preset stability threshold, the update of the gravity vector is frozen, and the angular velocity data is updated based on the absolute value of the deviation.
[0011] Furthermore, determining the shaking action recognition result of the target mobile terminal device in the current time frame based on the detection result includes: When the detection result satisfies the shaking condition, the shaking action recognition result of the target mobile terminal device in the current time frame is determined to be dynamic shaking; When the detection result indicates that the shaking condition is not met, the shaking action recognition result is determined to be static and stable.
[0012] This application embodiment also provides a device for recognizing shaking motions of a mobile terminal device, the device comprising: The dynamic filtering module is used to collect the triaxial acceleration data corresponding to the target mobile terminal device in real time using the triaxial accelerometer configured on the target mobile terminal device, and to determine the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method. The data calculation module is used to determine the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method, and to determine the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector. The condition detection module is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet the preset shaking conditions, and obtain the detection result corresponding to the current time frame; The shaking recognition module is used to determine the shaking action recognition result of the target mobile terminal device in the current time frame based on the detection result.
[0013] Furthermore, when the dynamic filtering module is used to determine the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method, the dynamic filtering module is used to: For each time frame, based on the triaxial acceleration data corresponding to that time frame, the resultant acceleration modulus value corresponding to that time frame is determined, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. The absolute value of the deviation is compared with a preset stability threshold to obtain the comparison result corresponding to the time frame, and the filter gain coefficient corresponding to the time frame is determined based on the comparison result. Based on the filter gain coefficient, the triaxial acceleration data corresponding to the current time frame, and the gravity vector corresponding to the previous time frame, the gravity vector corresponding to the current time frame is determined using a preset dynamic coefficient filtering formula.
[0014] Furthermore, the gravity vector includes a lateral gravity value, a longitudinal gravity value, and a vertical gravity value; when the data calculation module is used to determine the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method, the data calculation module is used to: Based on the lateral gravity value, the longitudinal gravity value, and the vertical gravity value, the pitch angle change corresponding to each time frame is determined, and based on the pitch angle change, the longitudinal angular velocity value corresponding to each time frame is determined. Based on the longitudinal gravity value and the vertical gravity value, the roll angle change corresponding to each time frame is determined, and based on the roll angle change, the lateral angular velocity value corresponding to each time frame is determined. The lateral angular velocity value and the longitudinal angular velocity value are determined as angular velocity data corresponding to each time frame.
[0015] Furthermore, when the data calculation module determines the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector, the data calculation module is used to: The difference between the triaxial acceleration data and the gravity vector is used to determine the target acceleration data for each time frame, so as to eliminate the offset of the gravity vector on each direction axis.
[0016] Furthermore, when the condition detection module is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions and obtain the detection result corresponding to the current time frame, the condition detection module is used to: Real-time detection of whether the angular velocity data within a preset time window indicates that the number of times the target mobile terminal device flips is greater than a preset number; In response to the detection that the angular velocity data within the preset time window indicates that the number of times the target mobile terminal device has flipped is greater than the preset number, the resultant acceleration modulus value corresponding to the current time frame is determined based on the triaxial acceleration data corresponding to the current time frame, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. Determine whether the absolute value of the deviation corresponding to the current time frame is greater than or equal to a preset stability threshold; If the absolute value of the deviation is greater than or equal to the preset stability threshold, the detection result is determined to meet the preset shaking condition. If the angular velocity data within the preset time window does not indicate that the number of times the target mobile terminal device has flipped is greater than a preset number, or the absolute value of the deviation is less than a preset stability threshold, then the detection result is determined to be that the shaking condition is not met.
[0017] Furthermore, when the condition detection module is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions and obtain the detection result corresponding to the current time frame, the condition detection module is also used to: If the absolute value of the deviation is greater than or equal to a preset stability threshold, then the gravity vector is updated; If the absolute value of the deviation is less than a preset stability threshold, the update of the gravity vector is frozen, and the angular velocity data is updated based on the absolute value of the deviation.
[0018] Furthermore, when the shake recognition module determines the shake action recognition result of the target mobile terminal device in the current time frame based on the detection result, the shake recognition module is used to: When the detection result satisfies the shaking condition, the shaking action recognition result of the target mobile terminal device in the current time frame is determined to be dynamic shaking; When the detection result indicates that the shaking condition is not met, the shaking action recognition result is determined to be static and stable.
[0019] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the mobile terminal device shaking action recognition method described above are performed.
[0020] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the mobile terminal device shaking action recognition method described above.
[0021] The present application provides a method and apparatus for recognizing shaking motions of a mobile terminal device. The recognition method is applied to a mobile terminal device without a gyroscope. The recognition method includes: real-time acquisition of triaxial acceleration data corresponding to the target mobile terminal device using a triaxial accelerometer configured on the target mobile terminal device; determining the gravity vector corresponding to each time frame using a dynamic coefficient filtering method based on the triaxial acceleration data corresponding to each time frame; determining the angular velocity data corresponding to each time frame using a projection transformation method based on the gravity vector; and determining the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector; real-time detection of whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions to obtain the detection result corresponding to the current time frame; and determining the shaking motion recognition result of the target mobile terminal device in the current time frame based on the detection result.
[0022] Compared to existing technologies that rely solely on accelerometers and directly set acceleration thresholds for comparison and identification, this method utilizes a triaxial accelerometer to collect triaxial acceleration data from a mobile terminal device in real time. It then uses a dynamic coefficient filtering method to determine the gravity vector, and further determines angular velocity data based on the projection switching rate of the gravity vector across axes. By separating linear target acceleration data through gravity compensation, and by real-time detection of whether the angular velocity and target acceleration data meet the shaking conditions, the method determines the shaking action identification result of the mobile terminal device in the current time frame. This achieves a gyroscope-like effect without increasing hardware costs, effectively filters linear interference in the data, reduces system resource consumption and energy consumption, and improves the accuracy of identifying shaking actions triggered by the mobile terminal device.
[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A flowchart illustrating a method for recognizing shaking motions of a mobile terminal device provided in an embodiment of this application; Figure 2 A schematic diagram of the structure of a mobile terminal device shaking action recognition device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0027] Research has found that the "shake" interaction requires mobile terminal devices to be able to sense dynamic changes in three spatial axes. Traditional shaking interaction relies on the gyroscope configured on the mobile terminal device to identify the spatial rotation angular velocity. However, in mobile terminal devices without a gyroscope, the accelerometer alone cannot distinguish between "translational jitter" and "flipping or rotational movements" and is easily affected by the gravitational component, leading to false triggering or insufficient sensitivity.
[0028] Currently, mobile terminal devices without gyroscopes typically set an acceleration threshold directly when recognizing shaking motions. When a user shakes the phone, the instantaneous acceleration value exceeds the set threshold, triggering a shaking motion. In this scenario, the accelerometer simultaneously measures motion acceleration and gravitational acceleration, leading to inconsistent trigger thresholds for different grip postures. Furthermore, relying solely on acceleration modulus calculations cannot identify whether the device has rotated, easily causing false triggers in linear vibration scenarios such as walking or riding in a vehicle. It also cannot distinguish between "rapid waving" and "slow tilting," reducing the user's interactive experience with mobile terminal devices.
[0029] Based on this, this application provides a method for recognizing the shaking motion of a mobile terminal device. It utilizes a three-axis accelerometer to collect three-axis acceleration data of the mobile terminal device in real time, and uses a dynamic coefficient filtering method to determine the gravity vector. Then, based on the projection switching rate of the gravity vector between each axis, it determines the angular velocity data. Furthermore, it separates the linear target acceleration data through gravity compensation, and detects in real time whether the angular velocity data and target acceleration data meet the shaking conditions to determine the shaking motion recognition result of the mobile terminal device in the current time frame. This method achieves a gyroscope-like effect without increasing hardware costs, effectively filters linear interference in the data, reduces system resource consumption and energy consumption, and improves the accuracy of recognizing shaking motions triggered by the mobile terminal device.
[0030] Please see Figure 1 , Figure 1 A flowchart illustrating a method for recognizing shaking motions in a mobile terminal device, as provided in an embodiment of this application. Figure 1 As shown in the figure, the method for recognizing shaking motion of a mobile terminal device provided in this application embodiment is applied to a mobile terminal device that is not equipped with a gyroscope.
[0031] Here, the mobile terminal device refers to a portable smart hardware device equipped with a smart operating system and capable of sensor data acquisition and data processing, covering categories such as smartphones, tablets, portable smart IoT terminals, and smart wearable devices.
[0032] The method described in this application embodiment specifically points out that, due to hardware cost control considerations, low-to-mid-range mobile terminal devices that are equipped with only a basic triaxial accelerometer and lack a physical gyroscope are the core application carriers of the method described in this application embodiment. A triaxial accelerometer is a sensor based on microelectromechanical systems (MEMS) technology that can measure the linear acceleration of an object in three-dimensional space along the X (horizontal axis), Y (vertical axis), and Z (vertical axis) axes in real time, and is a basic sensing component of low-end mobile terminal devices.
[0033] Furthermore, a virtual gyroscope, also known as a software gyroscope, refers to a software implementation scheme that does not rely on physical gyroscope hardware. It uses software algorithms to analyze, calculate, and transform data collected by basic sensing devices such as three-axis accelerometers, simulating the spatial rotational angular velocity detection function of a physical gyroscope. It can also output sensing event data in the same format as the physical gyroscope to the smart terminal system. This is the core technology carrier for the method described in the embodiments of this application to make up for the lack of motion perception in devices without physical gyroscopes. The method described in the embodiments of this application constructs a virtual gyroscope through pure software algorithms, processes the data collected by the three-axis accelerometer, simulates the angular velocity sensing function of the gyroscope, and achieves high-precision recognition of shaking motions.
[0034] The core of the method described in this application is to construct a virtual gyroscope for mobile terminal devices that are not equipped with a physical gyroscope. This method is applied to mobile terminal devices that are equipped with a three-axis accelerometer (MEMS Accelerometer) but do not have a physical gyroscope. The virtual gyroscope can be embedded in the "SensorService layer" of the operating system (e.g., Android system) to realize system-wide action recognition, or it can be embedded in the corresponding sensing service layer according to the needs of the customized system. Preferably, C / C++ or Java language is used for algorithm development. Among them, C / C++ language is suitable for mobile terminal devices with high requirements for computing efficiency, and Java language is suitable for smart terminal systems with high requirements for development adaptability.
[0035] like Figure 1 As shown, the identification method includes: S101. The three-axis acceleration data corresponding to the target mobile terminal device is collected in real time using the three-axis accelerometer configured on the target mobile terminal device, and the gravity vector corresponding to each time frame is determined by the dynamic coefficient filtering method based on the three-axis acceleration data corresponding to each time frame.
[0036] It should be noted that the target mobile terminal device is a mobile terminal device that is expected to perform shaking action recognition using the method described in the embodiments of this application.
[0037] The triaxial acceleration data includes horizontal axis acceleration values, vertical axis acceleration values, and vertical axis acceleration values; the gravity vector includes horizontal gravity values, vertical gravity values, and vertical gravity values.
[0038] Here, the dynamic coefficient filtering method refers to balancing the weights of newly acquired acceleration data and historical gravity vector data by dynamically adjusting the filter gain coefficient.
[0039] For example, taking into account both the real-time nature of motion recognition on mobile terminal devices and the power consumption requirements of the devices, the sampling interval of the preset time frame is set to 10ms, that is, 100 frames of three-axis acceleration data are collected per second. This sampling frequency allows the virtual gyroscope to accurately capture the user's shaking motion without increasing the power consumption of the mobile terminal device due to excessive sampling frequency. The collected raw three-axis acceleration data is directly transmitted to the system's sensing service layer as the raw input data of the virtual gyroscope, preparing for subsequent data analysis and processing.
[0040] In one possible implementation of this application, in specific implementation, the step S101 of determining the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method may include: S1011. For each time frame, based on the triaxial acceleration data corresponding to that time frame, determine the resultant acceleration modulus value corresponding to that time frame, and determine the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant.
[0041] In this embodiment of the application, the resultant acceleration modulus value is calculated using the following formula.
[0042] .
[0043] in, This represents the magnitude of the resultant acceleration, that is, the magnitude of the vector formed by the three-axis acceleration values; , , These represent the horizontal axis acceleration value, vertical axis acceleration value, and longitudinal axis acceleration value in the triaxial acceleration data, respectively.
[0044] Here, the standard gravity constant refers to the Earth's gravitational acceleration, which is usually taken as 9.81; the absolute value of the deviation is the core indicator for the virtual gyroscope to determine the current motion state of the mobile terminal device, and its magnitude directly reflects the proportion of motion acceleration in the acceleration data.
[0045] S1012. Compare the absolute value of the deviation with a preset stability threshold to obtain the comparison result corresponding to the time frame, and determine the filter gain coefficient corresponding to the time frame based on the comparison result.
[0046] In this embodiment of the application, a preset stability threshold (e.g., 1 m / s) is set. 2 The preset stability threshold can be flexibly adjusted according to the hardware performance and actual usage scenarios of different mobile terminal devices. For example, for portable IoT terminals that are prone to vibration, the preset stability threshold can be appropriately increased (e.g., 1.5 m / s²), while for handheld mobile terminal devices such as smartphones, the preset stability threshold can be appropriately decreased (e.g., 0.5 m / s²).
[0047] Here, the absolute value of the deviation is compared with a preset stability threshold, and the filter gain coefficient is dynamically adjusted according to the comparison result. The filter gain coefficient is a parameter used to adjust the weight of newly acquired acceleration data and historical gravity vector data in the dynamic coefficient filtering of the virtual gyroscope. The larger the coefficient, the higher the weight of the newly acquired data and the faster the gravity vector is updated. Conversely, the lower the coefficient, the higher the weight of the historical data and the more stable the gravity vector is.
[0048] In this embodiment, based on the comparison results, the specific adjustment rule for the filter gain coefficient corresponding to the time frame is as follows: If the absolute value of the deviation is less than the preset stability threshold, the virtual gyroscope determines that the mobile terminal device is in a quasi-static or stable mode, such as when the device is stationary on a desktop or when the user slowly rotates the device. In this case, the filter gain coefficient is increased (e.g., 0.8) to quickly correct the gravity vector, eliminate zero-point drift caused by the slow rotation of the device, and ensure the accuracy of the gravity vector. If the absolute value of the deviation is greater than or equal to the preset stability threshold, the virtual gyroscope determines that the mobile terminal device is in a high-dynamic or shaking mode, such as when the user shakes the device or the device violently bounces with the vehicle body. In this case, the filter gain coefficient is significantly reduced (e.g., 0.1) to maintain the inertia of the gravity vector, prevent "noise" caused by motion acceleration from contaminating the gravity reference, and ensure the accuracy of the subsequent angular velocity extrapolation by the virtual gyroscope.
[0049] S1013. Based on the filter gain coefficient, the triaxial acceleration data corresponding to the current time frame, and the gravity vector corresponding to the previous time frame, the gravity vector corresponding to the current time frame is determined using a preset dynamic coefficient filtering formula.
[0050] In this embodiment of the application, the expression of the dynamic coefficient filtering formula is as follows.
[0051] .
[0052] in, Indicates the first Gravity vectors corresponding to each time frame; Indicates the first Gravity vectors corresponding to each time frame; Indicates the filter gain coefficient; Indicates the first The triaxial acceleration data corresponding to each time frame.
[0053] Here, when the template mobile terminal device is powered on for the first time to collect data, the virtual gyroscope first judges the raw three-axis acceleration data of multiple consecutive frames. If all of them are judged to be in static steady mode, the average value of the raw three-axis acceleration data of multiple frames is normalized and used as the initial gravity vector to lay the benchmark for subsequent gravity vector updates and complete the initial calibration of the virtual gyroscope.
[0054] S102. Based on the gravity vector, the angular velocity data corresponding to each time frame is determined using the projection transformation method, and the target acceleration data corresponding to each time frame is determined based on the triaxial acceleration data and the gravity vector.
[0055] Here, angular velocity data is the core output data of the virtual gyroscope, used to characterize the rotational features of the template mobile terminal device. The angular velocity data includes lateral angular velocity values and longitudinal angular velocity values. The virtual gyroscope solves this by calculating the changes in pitch and roll angles corresponding to the gravity vector, combined with the time interval of the time frame.
[0056] Among them, pitch angle refers to the rotation angle of the equipment around the Y-axis, and roll angle refers to the rotation angle of the equipment around the X-axis. Both are core angular parameters that characterize the spatial rotational attitude of the equipment, and their changes are the direct basis for deriving angular velocity data from virtual gyroscopes.
[0057] Furthermore, the process of determining the target acceleration data corresponding to each time frame based on triaxial acceleration data and gravity vector is called gravity compensation, which is the basic data processing step of the virtual gyroscope. By eliminating the interference of gravity components in the acceleration data through vector subtraction, the target acceleration data reflects only the actual motion state of the device.
[0058] In one possible implementation of this application, in specific implementation, the step S102 of determining the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method may include: S1021. Based on the lateral gravity value, the longitudinal gravity value, and the vertical gravity value, determine the pitch angle change corresponding to each time frame, and based on the pitch angle change, determine the longitudinal angular velocity value corresponding to each time frame.
[0059] In this embodiment of the application, the pitch angle change is determined by the following formula.
[0060] .
[0061] in, This indicates the change in pitch angle; , , These represent the lateral gravity value, longitudinal gravity value, and vertical gravity value, respectively.
[0062] In this embodiment of the application, the longitudinal angular velocity value is determined by the following formula.
[0063] .
[0064] in, This represents the longitudinal angular velocity value; Indicates the duration of the time frame interval; This indicates the change in pitch angle.
[0065] S1022. Based on the longitudinal gravity value and the vertical gravity value, determine the roll angle change corresponding to each time frame, and based on the roll angle change, determine the lateral angular velocity value corresponding to each time frame.
[0066] In this embodiment of the application, the change in roll angle is determined by the following formula.
[0067] .
[0068] in, This indicates the change in the roll angle; , These represent the longitudinal gravity value and the vertical gravity value, respectively.
[0069] In this embodiment of the application, the lateral angular velocity value is determined by the following formula.
[0070] .
[0071] in, This represents the lateral angular velocity value; Indicates the duration of the time frame interval; This indicates the change in the roll angle.
[0072] S1023. The lateral angular velocity value and the longitudinal angular velocity value are determined as angular velocity data corresponding to each time frame.
[0073] In this embodiment, the virtual gyroscope transforms the change in the direction of the gravity vector into a change in the rotation angle of the device through projection transformation, and then derives the angular velocity through the rate of change of angle, thus perfectly realizing the transformation of the "force" information of the accelerometer into the "rotation" information of the device, and completing the core function simulation of the physical gyroscope.
[0074] In one possible implementation of this application, in specific implementation, the step S102 of determining the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector may include: S1024. The difference between the triaxial acceleration data and the gravity vector is determined as the target acceleration data corresponding to each time frame, so as to eliminate the offset of the gravity vector on each direction axis.
[0075] In this embodiment of the application, the target acceleration data is determined by the following formula.
[0076]
[0077] in, Indicates the first Target acceleration data corresponding to each time frame; Indicates the first Gravity vectors corresponding to each time frame; Indicates the first The three-axis acceleration data corresponding to each time frame.
[0078] Here, the virtual gyroscope completely eliminates the gravity component in the acceleration data through vector subtraction, so that the target acceleration data of the mobile terminal device in a stationary state tends to (0,0,0) under any holding posture. This eliminates the interference of gravity on motion recognition from the data level and provides an accurate motion data basis for the virtual gyroscope's subsequent sway condition determination.
[0079] S103. Real-time detection of whether the angular velocity data and the target acceleration data within the preset time window meet the preset shaking conditions, and obtain the detection result corresponding to the current time frame.
[0080] In this embodiment of the application, in order to achieve accurate determination of effective shaking motion, the virtual gyroscope adopts a dual feature determination mechanism, sets a preset time window and a preset number of flips, and detects in real time whether the angular velocity data and acceleration data within the preset time window meet the preset shaking conditions.
[0081] Here, the shaking conditions include detecting that the number of times the target mobile terminal device flips within a preset time window is greater than a preset number, and the absolute value of the deviation between the resultant acceleration modulus value corresponding to the target acceleration data and the calibrated gravity constant is greater than or equal to a preset stability threshold.
[0082] Among them, the calibrated gravity constant refers to the standard gravitational acceleration on the Earth's surface, which is a fixed value that has been physically calibrated (usually taken as 9.81 m / s²), and is used as a benchmark to determine the proportion of gravity component in the device's acceleration data; the preset stability threshold is the acceleration deviation threshold used to distinguish between the quasi-static and dynamic states of the device. It is a constant set by the user based on the actual usage scenario of the mobile terminal device, and is a key threshold for the virtual gyroscope to determine the motion state of the device.
[0083] In one possible implementation of this application, step S103 may include: S1031. Real-time detection of whether the angular velocity data within a preset time window indicates that the number of times the target mobile terminal device has flipped is greater than a preset number.
[0084] The preset number of times refers to the threshold number of times the target mobile terminal device rotates in the opposite direction (for example, two reverse flips within 0.5 seconds). The virtual gyroscope filters out slight rotational jitters of the device through this threshold to ensure that the user's active and effective shaking action is detected.
[0085] In this embodiment, the virtual gyroscope counts the number of rotations and flips of the mobile terminal device based on angular velocity data within a preset time window in real time, and determines whether the number is greater than a preset number, i.e., whether the device has undergone more than a preset number of reverse rotations. If the preset number is not reached, it indicates that the device has only undergone slight rotation or no rotation, and the virtual gyroscope directly determines that the current time frame does not meet the shaking condition. If the preset number is reached, it indicates that the device has undergone obvious rotation, and the virtual gyroscope proceeds to the next step of acceleration deviation characteristic determination.
[0086] S1032. In response to the detection that the angular velocity data within the preset time window indicates that the number of times the target mobile terminal device has flipped is greater than the preset number, based on the triaxial acceleration data corresponding to the current time frame, determine the resultant acceleration modulus value corresponding to the current time frame, and determine the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant.
[0087] S1033. Determine whether the absolute value of the deviation corresponding to the current time frame is greater than or equal to a preset stability threshold.
[0088] S1034. If the absolute value of the deviation is greater than or equal to the preset stability threshold, then the detection result is determined to meet the preset shaking conditions.
[0089] S1035. If the angular velocity data within the preset time window does not indicate that the number of times the target mobile terminal device has flipped is greater than a preset number, or the absolute value of the deviation is less than a preset stability threshold, then the detection result is determined to be that the shaking condition is not met.
[0090] In this embodiment, if the absolute value of the deviation is greater than or equal to the preset stability threshold, it indicates that the template mobile terminal device is rotating and also has obvious motion acceleration, and the virtual gyroscope determines that the current time frame meets the shaking condition; if the absolute value of the deviation is less than the preset stability threshold, it indicates that the target mobile terminal device is only rotating slowly and there is no obvious external shaking action, and the virtual gyroscope determines that the current time frame does not meet the shaking condition.
[0091] In one possible implementation of this application, step S103 further includes: S1036. If the absolute value of the deviation is greater than or equal to a preset stability threshold, then update the gravity vector.
[0092] In this embodiment, the gravity vector is updated synchronously, that is, it is recalculated according to the dynamic coefficient filtering method in step S101 above, to ensure the real-time performance of the gravity vector and to ensure that the simulation data of the virtual gyroscope always matches the device status.
[0093] S1037. If the absolute value of the deviation is less than a preset stability threshold, then freeze the update of the gravity vector and update the angular velocity data based on the absolute value of the deviation.
[0094] In this embodiment, freezing the update of the gravity vector means keeping the current gravity vector data unchanged and not correcting it with newly acquired acceleration data. This prevents motion acceleration from contaminating the gravity reference and is an important strategy for virtual gyroscopes to ensure the accuracy of angular velocity extrapolation. At the same time, the angular velocity data is corrected and updated based on the absolute value of the deviation to ensure the accuracy of subsequent angular velocity extrapolation by the virtual gyroscope.
[0095] S104. Based on the detection results, determine the shaking action recognition result of the target mobile terminal device in the current time frame.
[0096] In this embodiment of the application, the shaking motion recognition result includes either dynamic shaking or static stability.
[0097] Dynamic shaking refers to a user-initiated and effective shaking action on the device, characterized by rotational features and significant acceleration. This is the trigger condition for the virtual gyroscope to determine as a valid interaction and output a sensing event. Static stability refers to a state where the device is stationary, slowly rotating, or subjected to only linear vibration, without any effective shaking action. In this case, the virtual gyroscope will continuously monitor the device status and will not output any interaction trigger signals.
[0098] In one possible implementation of this application, step S104 may include: S1041. When the detection result satisfies the shaking condition, the shaking action recognition result of the target mobile terminal device in the current time frame is determined to be dynamic shaking.
[0099] For example, if the detection result meets the shaking condition, the virtual gyroscope determines that the shaking action of the target mobile terminal device is a dynamic shaking. At this time, the virtual gyroscope distributes a virtual gyroscope with the same format as the physical gyroscope to the system layer of the mobile terminal, triggering the "shake" interaction event. At the same time, the trigger signal is transmitted to the advertising display module to complete the pop-up or interaction logic of the advertisement, realizing the precise linkage between the user's shaking action and the advertisement interaction.
[0100] S1042. When the detection result is that the shaking condition is not met, the shaking action recognition result is determined to be static and stable.
[0101] For example, if the detection result is that the shaking condition is not met, the virtual gyroscope determines that the shaking action of the target mobile terminal device is static and stable. At this time, the virtual gyroscope control system returns to the three-axis accelerometer data acquisition stage to continue to collect and process data in real time, and continuously monitor the status of the mobile terminal device until an action that meets the shaking condition is detected.
[0102] The method for recognizing shaking motions of mobile terminal devices provided in this application uses a three-axis accelerometer to collect three-axis acceleration data of the mobile terminal device in real time, and uses a dynamic coefficient filtering method to determine the gravity vector. Then, based on the projection switching rate of the gravity vector between each axis, the angular velocity data is determined, and linear target acceleration data is separated by gravity compensation. The method detects in real time whether the angular velocity data and target acceleration data meet the shaking conditions to determine the shaking motion recognition result of the mobile terminal device in the current time frame. It can achieve a gyroscope-like effect without increasing hardware costs, effectively filters linear interference in the data, reduces system resource consumption and energy consumption, and improves the accuracy of recognizing shaking motions triggered by mobile terminal devices.
[0103] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a mobile terminal device shaking action recognition device provided in an embodiment of this application. Figure 2 As shown, the identification device 200 includes: The dynamic filtering module 210 is used to collect the triaxial acceleration data corresponding to the target mobile terminal device in real time using the triaxial accelerometer configured on the target mobile terminal device, and to determine the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method. The data calculation module 220 is used to determine the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method, and to determine the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector. The condition detection module 230 is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet the preset shaking conditions, and obtain the detection result corresponding to the current time frame; The shaking recognition module 240 is used to determine the shaking action recognition result of the target mobile terminal device in the current time frame based on the detection result.
[0104] Furthermore, when the dynamic filtering module 210 is used to determine the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method, the dynamic filtering module 210 is used to: For each time frame, based on the triaxial acceleration data corresponding to that time frame, the resultant acceleration modulus value corresponding to that time frame is determined, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. The absolute value of the deviation is compared with a preset stability threshold to obtain the comparison result corresponding to the time frame, and the filter gain coefficient corresponding to the time frame is determined based on the comparison result. Based on the filter gain coefficient, the triaxial acceleration data corresponding to the current time frame, and the gravity vector corresponding to the previous time frame, the gravity vector corresponding to the current time frame is determined using a preset dynamic coefficient filtering formula.
[0105] Furthermore, the gravity vector includes a lateral gravity value, a longitudinal gravity value, and a vertical gravity value; when the data calculation module 220 determines the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method, the data calculation module 220 is used to: Based on the lateral gravity value, the longitudinal gravity value, and the vertical gravity value, the pitch angle change corresponding to each time frame is determined, and based on the pitch angle change, the longitudinal angular velocity value corresponding to each time frame is determined. Based on the longitudinal gravity value and the vertical gravity value, the roll angle change corresponding to each time frame is determined, and based on the roll angle change, the lateral angular velocity value corresponding to each time frame is determined. The lateral angular velocity value and the longitudinal angular velocity value are determined as angular velocity data corresponding to each time frame.
[0106] Furthermore, when the data calculation module 220 determines the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector, the data calculation module 220 is used to: The difference between the triaxial acceleration data and the gravity vector is used to determine the target acceleration data for each time frame, so as to eliminate the offset of the gravity vector on each direction axis.
[0107] Furthermore, when the condition detection module 230 is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet a preset shaking condition and obtain the detection result corresponding to the current time frame, the condition detection module 230 is used to: Real-time detection of whether the angular velocity data within a preset time window indicates that the number of times the target mobile terminal device flips is greater than a preset number; In response to the detection that the angular velocity data within the preset time window indicates that the number of times the target mobile terminal device has flipped is greater than the preset number, the resultant acceleration modulus value corresponding to the current time frame is determined based on the triaxial acceleration data corresponding to the current time frame, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. Determine whether the absolute value of the deviation corresponding to the current time frame is greater than or equal to a preset stability threshold; If the absolute value of the deviation is greater than or equal to the preset stability threshold, the detection result is determined to meet the preset shaking condition. If the angular velocity data within the preset time window does not indicate that the number of times the target mobile terminal device has flipped is greater than a preset number, or the absolute value of the deviation is less than a preset stability threshold, then the detection result is determined to be that the shaking condition is not met.
[0108] Furthermore, when the condition detection module 230 is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions and obtain the detection result corresponding to the current time frame, the condition detection module 230 is also used to: If the absolute value of the deviation is greater than or equal to a preset stability threshold, then the gravity vector is updated; If the absolute value of the deviation is less than a preset stability threshold, the update of the gravity vector is frozen, and the angular velocity data is updated based on the absolute value of the deviation.
[0109] Furthermore, when the shake recognition module 240 determines the shake action recognition result of the target mobile terminal device in the current time frame based on the detection result, the shake recognition module 240 is used to: When the detection result satisfies the shaking condition, the shaking action recognition result of the target mobile terminal device in the current time frame is determined to be dynamic shaking; When the detection result indicates that the shaking condition is not met, the shaking action recognition result is determined to be static and stable.
[0110] The mobile terminal device shaking action recognition device provided in this application embodiment acquires the three-axis acceleration data of the mobile terminal device in real time using a three-axis accelerometer, determines the gravity vector using a dynamic coefficient filtering method, determines the angular velocity data based on the projection switching rate of the gravity vector between each axis, and separates the linear target acceleration data through gravity compensation. It then detects in real time whether the angular velocity data and the target acceleration data meet the shaking conditions to determine the shaking action recognition result of the mobile terminal device in the current time frame. It can achieve a gyroscope-like effect without increasing hardware costs, effectively filters linear interference in the data, reduces system resource consumption and energy consumption, and improves the accuracy of recognizing shaking actions triggered by the mobile terminal device.
[0111] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0112] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, they can perform the operations described above. Figure 1 The steps of the method for recognizing the shaking motion of a mobile terminal device in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0113] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the method for recognizing the shaking motion of a mobile terminal device in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0114] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0117] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0118] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0119] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for recognizing shaking motions in a mobile terminal device, characterized in that, The identification method is applied to mobile terminal devices that are not equipped with a gyroscope, and the identification method includes: The triaxial acceleration data corresponding to the target mobile terminal device is collected in real time using the triaxial accelerometer configured on the target mobile terminal device, and the gravity vector corresponding to each time frame is determined by the dynamic coefficient filtering method based on the triaxial acceleration data corresponding to each time frame. Based on the gravity vector, the angular velocity data corresponding to each time frame is determined using a projection transformation method, and the target acceleration data corresponding to each time frame is determined based on the triaxial acceleration data and the gravity vector. The system detects in real time whether the angular velocity data and the target acceleration data within a preset time window meet the preset shaking conditions, and obtains the detection result corresponding to the current time frame. Based on the detection results, the shaking action recognition result of the target mobile terminal device in the current time frame is determined.
2. The method according to claim 1, characterized in that, The determination of the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method includes: For each time frame, based on the triaxial acceleration data corresponding to that time frame, the resultant acceleration modulus value corresponding to that time frame is determined, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. The absolute value of the deviation is compared with a preset stability threshold to obtain the comparison result corresponding to the time frame, and the filter gain coefficient corresponding to the time frame is determined based on the comparison result. Based on the filter gain coefficient, the triaxial acceleration data corresponding to the current time frame, and the gravity vector corresponding to the previous time frame, the gravity vector corresponding to the current time frame is determined using a preset dynamic coefficient filtering formula.
3. The method according to claim 1, characterized in that, The gravity vector includes lateral gravity value, longitudinal gravity value, and vertical gravity value; The step of determining the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method includes: Based on the lateral gravity value, the longitudinal gravity value, and the vertical gravity value, the pitch angle change corresponding to each time frame is determined, and based on the pitch angle change, the longitudinal angular velocity value corresponding to each time frame is determined. Based on the longitudinal gravity value and the vertical gravity value, the roll angle change corresponding to each time frame is determined, and based on the roll angle change, the lateral angular velocity value corresponding to each time frame is determined. The lateral angular velocity value and the longitudinal angular velocity value are determined as angular velocity data corresponding to each time frame.
4. The method according to claim 1, characterized in that, The step of determining the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector includes: The difference between the triaxial acceleration data and the gravity vector is used to determine the target acceleration data for each time frame, so as to eliminate the offset of the gravity vector on each direction axis.
5. The method according to claim 1, characterized in that, The real-time detection process checks whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions, and obtains the detection result corresponding to the current time frame, including: Real-time detection of whether the angular velocity data within a preset time window indicates that the number of times the target mobile terminal device flips is greater than a preset number; In response to the detection that the angular velocity data within the preset time window indicates that the number of times the target mobile terminal device has flipped is greater than the preset number, the resultant acceleration modulus value corresponding to the current time frame is determined based on the triaxial acceleration data corresponding to the current time frame, and the absolute value of the deviation between the resultant acceleration modulus value and the calibrated gravity constant is determined. Determine whether the absolute value of the deviation corresponding to the current time frame is greater than or equal to a preset stability threshold; If the absolute value of the deviation is greater than or equal to the preset stability threshold, the detection result is determined to meet the preset shaking condition. If the angular velocity data within the preset time window does not indicate that the number of times the target mobile terminal device has flipped is greater than a preset number, or the absolute value of the deviation is less than a preset stability threshold, then the detection result is determined to be that the shaking condition is not met.
6. The method according to claim 5, characterized in that, The real-time detection of whether the angular velocity data and the target acceleration data within a preset time window meet preset shaking conditions, and obtaining the detection result corresponding to the current time frame, further includes: If the absolute value of the deviation is greater than or equal to a preset stability threshold, then the gravity vector is updated; If the absolute value of the deviation is less than a preset stability threshold, the update of the gravity vector is frozen, and the angular velocity data is updated based on the absolute value of the deviation.
7. The method according to claim 5, characterized in that, The step of determining the shaking action recognition result of the target mobile terminal device in the current time frame based on the detection result includes: When the detection result satisfies the shaking condition, the shaking action recognition result of the target mobile terminal device in the current time frame is determined to be dynamic shaking; When the detection result indicates that the shaking condition is not met, the shaking action recognition result is determined to be static and stable.
8. A device for recognizing shaking motions in a mobile terminal device, characterized in that, The identification device includes: The dynamic filtering module is used to collect the triaxial acceleration data corresponding to the target mobile terminal device in real time using the triaxial accelerometer configured on the target mobile terminal device, and to determine the gravity vector corresponding to each time frame based on the triaxial acceleration data corresponding to each time frame using a dynamic coefficient filtering method. The data calculation module is used to determine the angular velocity data corresponding to each time frame based on the gravity vector using a projection transformation method, and to determine the target acceleration data corresponding to each time frame based on the triaxial acceleration data and the gravity vector. The condition detection module is used to detect in real time whether the angular velocity data and the target acceleration data within a preset time window meet the preset shaking conditions, and obtain the detection result corresponding to the current time frame; The shaking recognition module is used to determine the shaking action recognition result of the target mobile terminal device in the current time frame based on the detection result.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the method for recognizing shaking motions of a mobile terminal device as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the method for recognizing shaking motions of a mobile terminal device as described in any one of claims 1 to 7.