Action recognition method based on mobile terminal

Through collaborative judgment of multiple sensors, the problem of insufficient accuracy in mobile terminals when identifying user actions is solved, accurate identification and feedback of complex motions and position changes is achieved, and the effect of human-computer interaction is improved.

CN116389639BActive Publication Date: 2024-12-06UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310103596.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-03
Publication Date
2024-12-06
Estimated Expiration
2043-02-03

AI Technical Summary

Technical Problem

Existing mobile terminals lack accuracy when identifying user actions, which affects the effect of human-computer interaction, especially when detecting complex movements and position changes, it is difficult to provide accurate feedback.

Method used

Multi-sensor collaborative judgment methods are adopted, including acceleration sensors, linear acceleration sensors, light sensors and magnetic field sensors. Through threshold judgment and data analysis, users' action status on mobile terminals is identified in real time, such as flipping, moving direction and answering calls.

Benefits of technology

It improves the accuracy and real-timeness of mobile terminals in identifying user actions, enhances the feedback ability of human-computer interaction, can more accurately detect user movement and position changes, and improves the user experience of mobile terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389639B_ABST
    Figure CN116389639B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for motion recognition based on a mobile terminal, and belongs to the technical field of motion recognition of mobile terminals. The present invention comprises: obtaining the acceleration of the mobile terminal, and the acceleration of the x-axis and the y-axis are both greater than or equal to the first threshold, then identifying the flipping state of the mobile terminal based on the acceleration; if the deviation of the acceleration of the x-axis and the y-axis from the first threshold is within a specified range, then identifying the flipping state of the mobile terminal based on the linear acceleration; if the acceleration of the x-axis and the y-axis are both less than the first threshold, and the deviation therefrom is not within the specified range, then identifying the motion state of the mobile terminal in combination with the linear acceleration: uniform speed and acceleration; and identifying the answering state of the mobile terminal in combination with the light sensor and the proximity sensor. With the aid of sensor sampling technology, the present invention analyzes the obtained data, and calculates the approximate motion or position of the mobile terminal according to the interaction performed in different areas, thereby realizing the human-computer interaction of mobile phone motion recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of motion recognition of mobile terminals, and in particular relates to a motion recognition method based on a mobile terminal. Background Art

[0002] In current human-computer interaction, the degree to which users are satisfied with the feedback from mobile terminals (mobile phones) depends on the accuracy of the mobile phone's recognition of actions. With the popularization of smart devices, the construction of human-computer interaction has also moved one step closer. In the future, this field will also develop towards higher integration, broader detection functions and greater load capacity.

[0003] Motion recognition technology is an important area of ​​human behavior cognition and is also a popular research topic in the computer field. Therefore, with the continuous development of Internet of Things technology, motion recognition based on mobile terminals can help people's lives more. It can detect changes in human motion within a specific range and analyze the approximate changes in human activities, so as to provide timely feedback. Summary of the invention

[0004] The present invention provides a motion recognition method based on a mobile terminal, which can be used to improve the accuracy of motion recognition of a user when the user uses the mobile terminal.

[0005] The technical solution adopted by the present invention is:

[0006] A method for motion recognition based on a mobile terminal, the method comprising:

[0007] Step S1, acquiring real-time data of an acceleration sensor of a mobile terminal, wherein the real-time data of the acceleration sensor includes accelerations of x, y and z axes, the x and y axes are parallel to the mobile terminal screen, the x axis is parallel to the horizontal direction of the mobile terminal screen, the y axis is parallel to the vertical direction of the mobile terminal screen, and the z axis is perpendicular to the mobile terminal screen;

[0008] Step S2, if the acceleration of the x-axis and y-axis of the acceleration sensor is greater than or equal to a first threshold value (preferably 8.8), then execute step S3; if the deviation of the acceleration of the x-axis and y-axis of the acceleration sensor from the first threshold value is within a specified range, then execute step S4; if the acceleration of the x-axis and y-axis of the acceleration sensor is less than the first threshold value, and the deviation from the first threshold value is not within the specified range, then execute step S5 and step S8;

[0009] Step S3, determine whether the acceleration of the y-axis is greater than a second threshold value (preferably 8.9), if so, output the action state of the mobile terminal: inversion; if not, continue to determine whether the acceleration of the x-axis is greater than the second threshold value, if so, further determine whether the acceleration value of the x-axis is a positive number, if it is a positive number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is a negative number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction; if the acceleration of the x-axis is less than the second threshold value, return to step S1, and re-acquire the real-time data of the acceleration sensor of the mobile terminal;

[0010] Step S4, acquiring real-time data of a linear acceleration sensor of the mobile terminal;

[0011] Determine whether the linear acceleration of the x-axis and y-axis is 0. If so, it indicates that the action state of the mobile terminal has not changed, and return to step S1 to reacquire the real-time data of the acceleration sensor of the mobile terminal;

[0012] If the linear acceleration of the x-axis and the y-axis is not 0, then continue to determine whether the linear acceleration of the y-axis is greater than a third threshold value (preferably 0.1). If so, then output the action state of the mobile terminal as: the mobile terminal is reversed; if not, then continue to determine whether the linear acceleration of the x-axis is greater than the third threshold value. If it is greater than the third threshold value, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is less than or equal to the third threshold value, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction;

[0013] Step S5, obtaining real-time data of the linear acceleration sensor of the mobile terminal, determining whether the linear acceleration is 0, if the linear acceleration of the x-axis and the y-axis are not 0, executing step S6, if both are 0, executing step S7; if only the linear acceleration of the x-axis is 0, re-executing step S5;

[0014] Step S6, obtaining data from the acceleration sensor of the mobile terminal, determining whether the acceleration of the y-axis is greater than 0, if greater than 0, indicating that the top of the mobile terminal is facing upward, and continuing to determine whether the linear velocity in the y-direction is greater than 0, if the linear velocity in the y-direction is greater than 0, outputting the action state of the mobile terminal: longitudinal variable speed motion state; if the linear velocity in the y-direction is less than or equal to 0, re-execute step S5; and detecting whether the linear velocity on the z-axis is greater than 0, if so, outputting the action state of the mobile terminal: the mobile terminal is in a forward and backward variable speed motion state, otherwise, re-execute step S5;

[0015] If the acceleration of the y-axis is greater than 0, it means that the top of the mobile terminal is facing downward, and then it is further determined whether the linear speed of the y-axis is greater than 0. If the linear speed of the y-axis is greater than 0, the action state of the mobile terminal is output: the mobile terminal is in a forward and backward speed-changing motion state; if the linear speed in the y-direction is less than or equal to 0, step S5 is re-executed; and it is detected whether the linear speed on the z-axis is greater than 0. If so, the action state of the mobile terminal is output: the mobile terminal is in a longitudinal speed-changing motion state, otherwise, step S5 is re-executed;

[0016] Step S7, continue to obtain the data of the magnetic field sensor of the mobile terminal, determine whether the values ​​of the magnetic field sensor at a certain time interval are the same, if they are the same, it means that the mobile terminal is in a stationary state, and re-execute step S5; if they are not the same, continue to determine whether the acceleration of the y-axis is greater than 0, if it is greater than 0, it means that the top of the mobile terminal is upward, and continue to determine whether the linear speed in the y-direction is greater than 0, if the linear speed in the y-direction is greater than 0, then output the action state of the mobile terminal: longitudinal uniform motion state; if the linear speed in the y-direction is less than or equal to 0, re-execute step S5; and detect whether the linear speed on the z-axis is greater than 0, if so, then output the action state of the mobile terminal: the mobile terminal is in a forward and backward uniform motion state, otherwise, re-execute step S5;

[0017] If the acceleration of the y-axis is greater than 0, it means that the top of the mobile terminal is facing downward, and then continue to determine whether the linear speed of the y-axis is greater than 0. If the linear speed of the y-axis is greater than 0, the action state of the mobile terminal is output: the mobile terminal is in a forward and backward uniform motion state; if the linear speed in the y direction is less than or equal to 0, re-execute step S5; and detect whether the linear speed on the z-axis is greater than 0. If so, the action state of the mobile terminal is output: the mobile terminal is in a longitudinal uniform motion state, otherwise, re-execute step S5.

[0018] Step S8, obtaining data from the light sensor and the proximity sensor, and determining whether the values ​​of the two sensors are both 0. If not, it means that the user did not answer the call, and step S8 is executed again;

[0019] If the values ​​of both sensors are 0, continue to obtain data from the acceleration sensor to determine whether the acceleration of the y-axis is greater than 0. If so, output the action status of the mobile terminal: answer the call; if not, it means that the user did not answer the call, and re-execute step S8.

[0020] Furthermore, step S8 can be further configured as follows: if the data of the light sensor and the data of the proximity sensor are both less than a fourth threshold, and the acceleration on the y-axis is greater than a fifth threshold, then the action state of the mobile terminal is outputted as answering a call.

[0021] The technical solution provided by the present invention brings at least the following beneficial effects:

[0022] The present invention uses sensor sampling technology to analyze the acquired data, calculates the approximate movement or position of the mobile terminal according to the interactions in different areas, and outputs and prompts the user in real time the action recognition results of the mobile terminal, thereby realizing human-computer interaction of mobile phone action recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 It is a schematic diagram of a processing process of a motion recognition method based on a mobile terminal provided by an embodiment of the present invention;

[0025] Figure 2 Schematic diagram of acceleration coordinates in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0027] In the lives of contemporary people, mobile terminals (mobile phones) can be said to be essential electronic products for everyone, which allows various sensor-based mobile phone motion recognition to fully play and improve human-computer interaction. After the introduction of sensor devices, mobile phones can be used for safe driving of vehicles such as cars, recognition of mobile phone motion behaviors, and location positioning, etc. Various sensors have played an irreplaceable role in this. Without mobile phone sensors, it is difficult for mobile phones to achieve these functions. Various devices with different functions have been installed in mobile phones, such as acceleration sensors, light sensors, etc. Mobile phones are no longer just communication devices in life, but have become a tool that affects and improves people's lives. Mobile phones themselves have powerful perception capabilities.

[0028] In order to realize the action recognition based on the mobile terminal, that is, the action recognition of the user on the mobile terminal, the present invention first needs to determine the sampling method of the sensor, and intends to adopt the sampling method of the acceleration sensor or the inertial sensor or the gesture segmentation method based on the motion. According to the different sampling methods, the required technology and knowledge are also different, and accordingly, the processing of the data is also different. For the acceleration sensor and the inertial sensor, it is also necessary to solve the acquisition of the state and calculate the corresponding physical quantities such as the speed, acceleration, and motion time. Secondly, how to store and process the collected data. The data collected by the sensor has a large flow, many types, and different signal categories, so how to process the data collected by the sensor in a timely manner is an important issue. If the information obtained is large, the corresponding data needs to be split, classified, and other operations, and then stored. The storage also needs to determine whether it is random storage or sequential storage, depending on how to efficiently obtain information from the database later. Finally, how to display the processed data to the user. After processing the corresponding data, it is also necessary to display it to the user in a timely manner in some way so that it can get sufficient feedback. The display method is selected according to the user's preference or whether the practicality meets the standard, which is roughly the physical display of the mobile phone and the software display. The software display needs to solve the implementation and design of the display interface. The physical display method needs to solve the problem of how to make users feel the changes obviously without disturbing them.

[0029] When realizing the user's action recognition of the mobile terminal (mobile phone) (whether answering a call, stationary, moving at a constant speed, screen flipping), the present invention performs collaborative judgment based on multiple sensors, prioritizes the judgment of the value of the acceleration sensor, and determines whether to interrupt the judgment and re-judge the acceleration sensor or further determine whether the acceleration in the x- and y-axis directions is near the threshold of 8.8 by judging whether it exceeds the threshold or is near the threshold, and then determines whether the acceleration in the x- and y-axis directions exceeds the threshold of 8.9 to determine whether the mobile phone is in a flipped state or inverted state. If the data of the linear acceleration sensor is obtained near the threshold, the result is output by further judging whether the value of the linear acceleration sensor is 0. The subsequent judgment is the same as the process of judging whether the mobile phone is flipped or inverted.

[0030] Next, the data of the linear acceleration sensor, light sensor and proximity sensor are taken to make simultaneous judgments on the three sensors. First, the value of the linear acceleration sensor is judged. By detecting whether the linear acceleration is 0, it is judged whether the mobile phone is making the next judgment or in a variable speed motion state. If the linear acceleration of the mobile phone is 0, the value of the magnetic field sensor is further called. By defining an array to realize the storage of the data of the magnetic field sensor, the array is delayed and written, and then it is judged whether the values ​​of the magnetic field sensor obtained at a certain interval are the same. If the two values ​​are the same, it means that the mobile phone is in a stationary state, and return to the first step. If they are not the same, it means that the mobile phone is in a uniform motion state, and then the data of the acceleration sensor is obtained to judge the direction of movement of the mobile phone. According to whether the acceleration in the x and y directions is greater than 0, the front and back, left and right, up and down movement of the mobile phone can be judged, and the variable speed movement direction of the mobile phone is the same. Finally, the analyzed mobile phone status is displayed through the front-end display module.

[0031] like Figure 1 As shown, the motion recognition method based on a mobile terminal of the present invention specifically includes the following steps:

[0032] For a mobile terminal with a built-in acceleration sensor, linear acceleration sensor, proximity sensor, light sensor, and magnetic field sensor, perform the following steps:

[0033] Step S1, obtaining real-time data of the acceleration sensor of the mobile terminal, wherein the real-time data of the acceleration sensor includes accelerations of the x, y and z axes, the x and y axes are parallel to the mobile terminal screen, the x axis is parallel to the horizontal direction of the mobile terminal screen, the y axis is parallel to the vertical direction of the mobile terminal screen, and the z axis is perpendicular to the mobile terminal screen, such as Figure 2 As shown. When the user places the mobile terminal flat on the ground, the initial value of the data on the x-axis of the sensor is 0, the initial value of the data on the y-axis is 0, and the initial value of the data on the z-axis is 9.81 due to the existence of the earth's gravity. When the mobile terminal is placed face down on the ground, the initial value of the data on the z-axis is -9.81. When the mobile terminal is tilted to the left, the initial value of the data on the x-axis is positive. When the mobile terminal is tilted to the right, the initial value of the data on the x-axis is negative. When the mobile terminal is tilted upward, the initial value of the data on the y-axis is negative. When the mobile terminal is tilted downward, the initial value of the data on the y-axis is positive.

[0034] Step S2, if the acceleration of the x-axis and y-axis of the acceleration sensor is greater than or equal to 8.8, then execute step S3; if the deviation of the acceleration of the x-axis and y-axis of the acceleration sensor from 8.8 is within the specified range, then execute step S4; if the acceleration of the x-axis and y-axis of the acceleration sensor is less than 8.8 and the deviation from 8.8 is not within the specified range, then execute step S5 and step S8;

[0035] Step S3, determine whether the acceleration of the y-axis is greater than 8.9, if so, output the action state of the mobile terminal: inversion; if not, continue to determine whether the acceleration of the x-axis is greater than 8.9, if so, further determine whether the acceleration value of the x-axis is a positive number, if it is a positive number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is a negative number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction; if the acceleration of the x-axis is less than 8.9, return to step S1, and re-acquire the real-time data of the acceleration sensor of the mobile terminal;

[0036] Step S4, acquiring real-time data of a linear acceleration sensor of the mobile terminal;

[0037] Determine whether the linear acceleration of the x-axis and y-axis is 0. If so, it indicates that the action state of the mobile terminal has not changed, and return to step S1 to reacquire the real-time data of the acceleration sensor of the mobile terminal;

[0038] If the linear acceleration of the x-axis and y-axis is not 0, then continue to determine whether the linear acceleration of the y-axis is greater than 0.1. If so, then output the action state of the mobile terminal: the mobile terminal is reversed; if not, then continue to determine whether the linear acceleration of the x-axis is greater than 0.1. If it is greater than 0.1, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is less than or equal to 0.1, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction;

[0039] Preferably, in the embodiment of the present invention, the detection of flipping and reversing of the mobile terminal can also be specifically set as follows: when the acceleration of the x-axis (x-direction) is detected to be at (8.8, 10) and the linear acceleration on the x-axis is greater than 0.1, the action state of the mobile terminal is identified as: left horizontal screen state; and when the acceleration on the x-axis is detected to be at (8.9, 10), the action state of the mobile terminal is identified as: left horizontal screen state; and when the acceleration on the x-axis is at (-10, -8.8) and the linear acceleration on the x-axis is less than -0.1, the action state of the mobile terminal is identified as: right horizontal screen state; and when the acceleration on the x-axis is detected to be at (-10, -8.9), the action state of the mobile terminal is identified as: left horizontal screen state; when the acceleration on the y-axis is less than -0.85, or the acceleration on the y-axis is less than -8.6 and the linear acceleration on the y-axis is greater than 0.1, the action state of the mobile terminal is identified as: reversal state.

[0040] Step S5, obtaining real-time data of the linear acceleration sensor of the mobile terminal, determining whether the linear acceleration is 0 (both the x-axis and the y-axis are 0), if the linear acceleration of both the x-axis and the y-axis are not 0, executing step S6, if both are 0, executing step S7; if only the linear acceleration of the x-axis is 0, re-executing step S5;

[0041] Step S6, obtaining data from the acceleration sensor of the mobile terminal, determining whether the acceleration of the y-axis is greater than 0, if greater than 0, indicating that the top of the mobile terminal is facing upward, and continuing to determine whether the linear velocity in the y-direction is greater than 0, if the linear velocity in the y-direction is greater than 0, outputting the action state of the mobile terminal: longitudinal variable speed motion state; if the linear velocity in the y-direction is less than or equal to 0, re-execute step S5; and detecting whether the linear velocity on the z-axis is greater than 0, if so, outputting the action state of the mobile terminal: the mobile terminal is in a forward and backward variable speed motion state, otherwise, re-execute step S5;

[0042] If the acceleration of the y-axis is greater than 0, it means that the top of the mobile terminal is facing downward, and then it is further determined whether the linear speed of the y-axis is greater than 0. If the linear speed of the y-axis is greater than 0, the action state of the mobile terminal is output: the mobile terminal is in a forward and backward speed-changing motion state; if the linear speed in the y-direction is less than or equal to 0, step S5 is re-executed; and it is detected whether the linear speed on the z-axis is greater than 0. If so, the action state of the mobile terminal is output: the mobile terminal is in a longitudinal speed-changing motion state, otherwise, step S5 is re-executed;

[0043] Step S7, continue to obtain the data of the magnetic field sensor of the mobile terminal, determine whether the values ​​of the magnetic field sensor at a certain time interval are the same, if they are the same, it means that the mobile terminal is in a stationary state, and re-execute step S5; if they are not the same, continue to determine whether the acceleration of the y-axis is greater than 0, if it is greater than 0, it means that the top of the mobile terminal is upward, and continue to determine whether the linear speed in the y-direction is greater than 0, if the linear speed in the y-direction is greater than 0, then output the action state of the mobile terminal: longitudinal uniform motion state; if the linear speed in the y-direction is less than or equal to 0, re-execute step S5; and detect whether the linear speed on the z-axis is greater than 0, if so, then output the action state of the mobile terminal: the mobile terminal is in a forward and backward uniform motion state, otherwise, re-execute step S5;

[0044] If the acceleration of the y-axis is greater than 0, it means that the top of the mobile terminal is facing downward, and then it is further determined whether the linear velocity of the y-axis is greater than 0. If the linear velocity of the y-axis is greater than 0, the action state of the mobile terminal is output: the mobile terminal is in a forward and backward uniform motion state; if the linear velocity in the y-direction is less than or equal to 0, step S5 is re-executed; and it is detected whether the linear velocity on the z-axis is greater than 0. If so, the action state of the mobile terminal is output: the mobile terminal is in a longitudinal uniform motion state, otherwise, step S5 is re-executed;

[0045] As a preferred manner, in the embodiment of the present invention, the specific detection process of the recognition of the mobile phone movement can be specifically set as follows:

[0046] Obtain linear acceleration and magnetic field acceleration data. If the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is greater than 0.5, then the output mobile terminal is in a falling state; if the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is less than -0.5, then the output mobile terminal is in an ascending state; if the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is greater than 9.8, then the output mobile terminal is in a falling state; if the two magnetic field values ​​obtained at an interval are the same, the linear acceleration in the x direction is 0, and the acceleration in the y direction is greater than 7, then the output mobile terminal is in a lateral uniform speed state; if the two magnetic field values ​​obtained at an interval are the same, the linear acceleration in the y direction is 0, and the acceleration in the y direction is greater than 7, then the output mobile terminal is in a longitudinal uniform speed state. uniform speed state; if the linear acceleration in the x direction is greater than 1 or less than -1, the output mobile terminal is in a lateral movement state; on the premise that the linear acceleration in the y direction is greater than 5, if the linear acceleration in the y direction is greater than 1 or less than -1, the output mobile terminal is in a longitudinal movement state; on the premise that the linear acceleration in the y direction is greater than 5, if the linear acceleration in the z direction is greater than 1 or less than -1, the output mobile terminal is in a forward and backward movement state; on the premise that the linear acceleration in the y direction is less than 3, if the linear acceleration in the z direction is greater than 1 or less than -1, the output mobile terminal is in a longitudinal movement state; on the premise that the linear acceleration in the y direction is less than 3, if the linear acceleration in the y direction is greater than 1 or less than -1, the output mobile terminal is in a forward and backward movement state.

[0047] Step S8, obtaining data from the light sensor and the proximity sensor, and determining whether the values ​​of the two sensors are both 0. If not, it means that the user did not answer the call, and step S8 is executed again;

[0048] If the values ​​of both sensors are 0, continue to obtain data from the acceleration sensor to determine whether the acceleration of the y-axis is greater than 0. If so, output the action status of the mobile terminal: answer the call; if not, it means that the user did not answer the call, and re-execute step S8.

[0049] Preferably, step S8 can be further configured as follows: if the data of the light sensor and the data of the proximity sensor are both less than 3, and the acceleration on the y-axis is greater than 7, then the action state of the mobile terminal is outputted as answering a call.

[0050] When implementing the embodiment of the present invention, the following interfaces are required to assist in obtaining the sensors of the mobile terminal:

[0051] The SensorManager interface is used to create an instance of the sensor service. This interface type can access the corresponding sensor and display the sensor name on the virtual machine, and register and unregister the sensor event listener. This interface type also provides several sensor constants to display the accuracy of the corresponding sensor data, set the frequency of sensor data acquisition, and calibrate the corresponding sensor.

[0052] Sensor interface, through which a specific sensor instance can be generated and the performance of the sensor can be defined.

[0053] SensorEvent interface, creating a sensor object can be achieved by calling this interface type, and the object can give all the data about the sensor event. The date and time stamp of the event, the type of information generated by the event, the correctness of the information, and the original sensor information are all important information about the sensor.

[0054] SensorEventListene interface, creating two callback methods is done by using this interface type. These two callback methods can modify the sensor value or the accuracy of the sensor, and arrange when the sensor event should receive notification.

[0055] Take the acceleration sensor as an example:

[0056] Step 1: Get the sensor management object.

[0057] Step 2: Use SensorManager to obtain the acceleration sensor object;

[0058] Step 3: Create and register a custom sensor listening function.

[0059] Step 4: After creating and registering the listener function, implement the call to unregister the listener.

[0060] After defining these, you can use the corresponding sensors. Then define variables in the main function for the data to be collected in the future to facilitate subsequent storage. Then make judgments with if statements, collect the corresponding data, and display the corresponding data changes on the virtual machine or real machine.

[0061] (1) The inversion of the phone is equivalent to the phone rotating to the left or right at an angle greater than 135 degrees. At this time, the acceleration of the y-axis collected by the acceleration sensor is <-8.8, and the phone is detected to be in an inverted state. Or when the value fluctuates near the relevant threshold, the linear acceleration sensor is used for collaborative judgment. When the previous conditions are met and the y-axis linear acceleration is greater than 0, it means that the phone is about to invert and there is a slight fluctuation, which means that it is already in an inverted state. At this time, the judgment of the flip state of the phone is completed.

[0062] (2) When the mobile phone moves horizontally, an acceleration along the x-axis will be generated. At this time, if the x-axis acceleration collected by the acceleration sensor is >10 or <-10, it is detected that the mobile phone is in a state of left-right movement. However, this detection is inaccurate, because at this time, only the large-scale movement of the mobile phone is judged, while subtle changes must be judged in coordination with the linear acceleration sensor. By removing the influence of the mobile phone's own gravity, it will not conflict with the judgment of the horizontal state of the mobile phone. That is, when the value collected by the linear acceleration in the x-axis direction is greater than 0, the mobile phone has moved in the horizontal plane. At the same time, there is also a uniform motion situation. By introducing a magnetic field sensor for collaborative judgment, first set an array and use a delay function to collect values ​​on the same coordinate axis at two different times. By judging whether the acceleration is 0 and whether the values ​​obtained at two different times are the same, it is possible to comprehensively judge whether the mobile phone is in a state of uniform horizontal motion. The judgment about the up, down, left, right, front and back of the mobile phone must first judge the data obtained by the acceleration sensor. Because the coordinate axis of the linear acceleration sensor is based on the mobile phone, unlike the coordinate axis of the acceleration sensor which is based on the ground, it is necessary to first judge the acceleration data in the y-axis direction to determine whether the mobile phone is head-up or the mobile phone screen is parallel to the ground, and then judge the linear acceleration of the three axes to determine the moving direction of the mobile phone.

[0063] (3) When the mobile phone moves downward, due to the existence of gravity in the natural state, a downward acceleration is generated. At this time, the acceleration of the y-axis collected by the acceleration sensor is greater than 10, and the mobile phone is detected to be in a falling state. However, there is an error that it cannot detect small movements. At this time, a linear acceleration sensor is introduced to replace it to determine the fall of the mobile phone. Because the influence of gravity is removed, the data on the y-axis will not change significantly with the flipping of the mobile phone. At this time, it is only necessary to observe the linear acceleration of the y-axis. Once the linear acceleration is greater than 0, that is, the mobile phone has generated a vertical downward movement, then it is judged whether it is a positive number to detect that the mobile phone is in a falling state.

[0064] (4) Flipping a mobile phone is equivalent to rotating the phone to the left or right by an angle greater than 75 degrees. At this time, the x-axis acceleration collected by the accelerometer is >8.8 or <-8.8, and the phone is detected to be in landscape mode. There is a threshold problem. When the data read by the mobile phone sensor has reached the vicinity of the threshold, it is necessary to determine whether the flip threshold can be reached. At this time, the linear acceleration sensor can come in handy again. At this time, it is only necessary to measure the values ​​of the linear acceleration sensor and the acceleration sensor at the same time. If the values ​​measured by the acceleration sensor have reached the threshold, and the linear acceleration sensor also detects that the value is greater than 0, that is, the mobile phone has a small movement when it is about to flip, so it can enter landscape mode. As for if the value of the acceleration sensor is slightly greater than the threshold, it is in landscape mode.

[0065] (5) When the mobile phone moves upward, due to the existence of gravity, an upward acceleration is generated. At this time, the y-axis acceleration collected by the acceleration sensor is <9.81, and the detection result will be confused with the flipping of the mobile phone. At this time, a rotation vector sensor or a geomagnetic field sensor is used to detect the state of the mobile phone at this time. However, there is also an error that small movements cannot be detected. At this time, a linear acceleration sensor is introduced to replace it to determine the fall of the mobile phone. Because the influence of gravity is removed, the y-axis data will not change significantly with the flipping of the mobile phone. At this time, it is only necessary to observe the linear acceleration of the y-axis. Once the linear acceleration is less than 0, that is, the mobile phone has generated a vertical upward movement, then by judging whether it is a negative number, it is detected that the mobile phone is in an upward state.

[0066] (6) When a user is using a mobile phone to make or receive a call, the phone will be close to the face, and the light and the distance between the phone and the face will change. At this time, the light sensor and the proximity sensor are used to simultaneously determine the current state. If both conditions change at the same time, the value of the acceleration sensor is detected. If the acceleration in the y direction is greater than 0, it is detected that the phone is in the state of answering a call.

[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0068] The above are only some embodiments of the present invention. For those skilled in the art, several modifications and improvements can be made without departing from the creative concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A motion recognition method based on a mobile terminal, characterized in that: These include the following: Step S1, acquiring real-time data of an acceleration sensor of a mobile terminal, wherein the real-time data of the acceleration sensor includes accelerations of x, y and z axes, the x and y axes are parallel to the mobile terminal screen, the x axis is parallel to the horizontal direction of the mobile terminal screen, the y axis is parallel to the vertical direction of the mobile terminal screen, and the z axis is perpendicular to the mobile terminal screen; Step S2, if the acceleration of the x-axis and y-axis of the acceleration sensor is greater than or equal to 8.8, then execute step S3; if the deviation of the acceleration of the x-axis and y-axis of the acceleration sensor from 8.8 is within the specified range, then execute step S4; if the acceleration of the x-axis and y-axis of the acceleration sensor is less than 8.8 and the deviation from 8.8 is not within the specified range, then execute step S5 and step S8; Step S3, determine whether the acceleration of the y-axis is greater than the second threshold value, if so, output the action state of the mobile terminal: inversion; if not, continue to determine whether the acceleration of the x-axis is greater than 8.9, if so, further determine whether the acceleration value of the x-axis is a positive number, if it is a positive number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is a negative number, output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction; if the acceleration of the x-axis is less than the second threshold value, return to step S1, and re-acquire the real-time data of the acceleration sensor of the mobile terminal; Step S4, acquiring real-time data of a linear acceleration sensor of the mobile terminal; Determine whether the linear acceleration of the x-axis and y-axis is 0. If so, it indicates that the action state of the mobile terminal has not changed, and return to step S1 to reacquire the real-time data of the acceleration sensor of the mobile terminal; If the linear acceleration of the x-axis and the y-axis is not 0, then continue to determine whether the linear acceleration of the y-axis is greater than the third threshold value. If so, then output the action state of the mobile terminal as: the mobile terminal is reversed; if not, then continue to determine whether the linear acceleration of the x-axis is greater than the third threshold value. If it is greater than the third threshold value, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the left horizontal direction; if it is less than or equal to the third threshold value, then output the action state of the mobile terminal: the terminal screen changes from the vertical direction to the right horizontal direction; Step S5, obtaining real-time data of the linear acceleration sensor of the mobile terminal, determining whether the linear acceleration is 0, if the linear acceleration of the x-axis and the y-axis are not 0, executing step S6, if both are 0, executing step S7; if only the linear acceleration of the x-axis is 0, re-executing step S5; Step S6, obtaining data from the acceleration sensor of the mobile terminal, determining whether the acceleration of the y-axis is greater than 0, if greater than 0, indicating that the top of the mobile terminal is facing upward, and continuing to determine whether the linear acceleration of the y-direction is greater than 0, if the linear acceleration of the y-direction is greater than 0, outputting the action state of the mobile terminal: longitudinal variable speed motion state; if the linear acceleration of the y-direction is less than or equal to 0, re-execute step S5; and detecting whether the linear acceleration on the z-axis is greater than 0, if so, outputting the action state of the mobile terminal: the mobile terminal is in a forward and backward variable speed motion state, otherwise, re-execute step S5; If the acceleration of the y-axis is less than 0, it means that the top of the mobile terminal is downward, and then continue to determine whether the linear acceleration of the y-axis is greater than 0. If the linear acceleration of the y-axis is greater than 0, then output the action state of the mobile terminal: the mobile terminal is in a forward and backward speed-changing motion state; then if the linear acceleration in the y-direction is less than or equal to 0, re-execute step S5; and detect whether the linear acceleration on the z-axis is greater than 0. If so, then output the action state of the mobile terminal: the mobile terminal is in a longitudinal speed-changing motion state, otherwise, re-execute step S5; Step S7, continue to obtain the data of the magnetic field sensor of the mobile terminal, determine whether the values ​​of the magnetic field sensor at a certain time interval are the same, if they are the same, it means that the mobile terminal is in a stationary state, and re-execute step S5; if they are not the same, continue to determine whether the acceleration of the y-axis is greater than 0, if it is greater than 0, it means that the top of the mobile terminal is upward, and continue to determine whether the linear speed in the y-direction is greater than 0, if the linear speed in the y-direction is greater than 0, then output the action state of the mobile terminal: longitudinal uniform motion state; if the linear speed in the y-direction is less than or equal to 0, re-execute step S5; and detect whether the linear speed on the z-axis is greater than 0, if so, then output the action state of the mobile terminal: the mobile terminal is in a forward and backward uniform motion state, otherwise, re-execute step S5; If the acceleration of the y-axis is less than 0, it means that the top of the mobile terminal is facing downward, and then it is further determined whether the linear velocity of the y-axis is greater than 0. If the linear velocity of the y-axis is greater than 0, the action state of the mobile terminal is output: the mobile terminal is in a forward and backward uniform motion state; if the linear velocity in the y-direction is less than or equal to 0, step S5 is re-executed; and it is detected whether the linear velocity on the z-axis is greater than 0. If so, the action state of the mobile terminal is output: the mobile terminal is in a longitudinal uniform motion state, otherwise, step S5 is re-executed; Step S8, obtaining data from the light sensor and the proximity sensor, and determining whether the values ​​of the two sensors are both 0. If not, it means that the user did not answer the call, and step S8 is executed again; If the values ​​of both sensors are 0, continue to obtain data from the acceleration sensor to determine whether the acceleration of the y-axis is greater than 0. If so, output the action status of the mobile terminal: answer the call; if not, it means that the user did not answer the call, and re-execute step S8.

2. The method according to claim 1, characterized in that Step S8 is: if the data of the light sensor and the data of the proximity sensor are both less than the fourth threshold, and the acceleration on the y-axis is greater than the fifth threshold, then outputting the action state of the mobile terminal: answering a call.

3. The method according to claim 2, characterized in that The fourth and fifth thresholds are set to 3 and 7 respectively.

4. The method according to claim 1, characterized in that The third threshold is set to 0.

1.

5. The method according to any one of claims 1 to 4, characterized in that: The following steps are also included: Get linear acceleration and magnetic field acceleration data. If the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is greater than 0.5, then the output mobile terminal is in a falling state; if the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is less than -0.5, then the output mobile terminal is in an ascending state; if the acceleration in the y direction is greater than 7 and the linear acceleration in the y direction is greater than 9.8, then the output mobile terminal is in a falling state; if the two magnetic field values ​​obtained at an interval are the same, the linear acceleration in the x direction is 0, and the acceleration in the y direction is greater than 7, then the output mobile terminal is in a lateral uniform speed state; if the two magnetic field values ​​obtained at an interval are the same, the linear acceleration in the y direction is 0, and the acceleration in the y direction is greater than 7, then the output mobile terminal is in in a longitudinal uniform speed state; if the linear acceleration in the x-direction is greater than 1 or less than -1, the output mobile terminal is in a lateral movement state; on the premise that the linear acceleration in the y-direction is greater than 5, if the linear acceleration in the y-direction is greater than 1 or less than -1, the output mobile terminal is in a longitudinal movement state; on the premise that the linear acceleration in the y-direction is greater than 5, if the linear acceleration in the z-direction is greater than 1 or less than -1, the output mobile terminal is in a forward and backward movement state; on the premise that the linear acceleration in the y-direction is less than 3, if the linear acceleration in the z-direction is greater than 1 or less than -1, the output mobile terminal is in a longitudinal movement state; on the premise that the linear acceleration in the y-direction is less than 3, if the linear acceleration in the y-direction is greater than 1 or less than -1, the output mobile terminal is in a forward and backward movement state.

Citation Information

Patent Citations

  • Gesture recognition method based on acceleration sensor

    CN103984416A

  • Motion gesture recognition method, mobile terminal and computer readable storage medium

    CN108234760A