Disclosure of Invention
In view of this, the present invention provides a terminal, a method for implementing control based on multiple modes, and a storage device thereof, which can provide individual control modes for different users, and improve the accuracy of operation control.
In an embodiment of the present invention, a multi-mode terminal control method includes a terminal including an acceleration sensor and a magnetic field sensor, the terminal being preset with a normal control mode in which a first operation is performed when a horizontal acceleration of the terminal is smaller than a first threshold and a second operation is performed when a vertical acceleration of the terminal is smaller than a second threshold, the method including:
adding an individualized control mode for the terminal, and executing a third operation when the horizontal acceleration of the terminal is smaller than a third threshold value and executing a fourth operation when the vertical acceleration of the terminal is smaller than a fourth threshold value in the individualized control mode;
acquiring the acceleration of the terminal in the three-dimensional direction through the started acceleration sensor, and acquiring the magnetic field angle change parameter of the terminal through the started magnetic field sensor;
judging whether the magnetic field angle change parameter is smaller than a preset fifth threshold value or not;
when the magnetic field angle change parameter is smaller than a fifth threshold value, detecting whether the terminal is currently set to be in a common control mode or an individualized control mode;
and controlling the terminal to execute corresponding operation according to the detection result and the acceleration in the three-dimensional direction.
The terminal for realizing control based on multiple modes of the embodiment of the invention is preset with a common control mode, under the common control mode, when the horizontal acceleration of the terminal is smaller than a first threshold value, the terminal executes a first operation, and when the vertical acceleration of the terminal is smaller than a second threshold value, the terminal executes a second operation, the terminal comprises a processor, an acceleration sensor, a magnetic field sensor and a memory, the acceleration sensor, the magnetic field sensor and the memory are all connected with the processor,
the processor is used for adding an individualized control mode for the terminal, and under the individualized control mode, when the horizontal acceleration of the terminal is smaller than a third threshold value, a third operation is executed, and when the vertical acceleration of the terminal is smaller than a fourth threshold value, a fourth operation is executed;
the memory is used for storing a first threshold, a second threshold, a third threshold, a fourth threshold and a preset fifth threshold;
the acceleration sensor is used for acquiring the acceleration of the terminal in the three-dimensional direction;
the magnetic field sensor is used for acquiring magnetic field angle change parameters of the terminal;
the processor is used for judging whether the magnetic field angle change parameter is smaller than a fifth threshold value;
the processor is further used for detecting whether the terminal is currently set to be in a common control mode or an individual control mode when the magnetic field angle change parameter is smaller than a fifth threshold value, and controlling the terminal to execute corresponding operation according to a detection result and the acceleration in the three-dimensional direction.
The storage device of an embodiment of the present invention stores program data that can be executed to implement the above-described multimode terminal control method.
Has the advantages that: the invention allows the terminal to add an individualized control mode outside the common control mode, and compared with the setting of the threshold value of the terminal for executing the preset operation in the common mode according to the habits of a great number of users, the threshold value of the terminal for executing the preset operation in the individualized control mode is set in a pertinence mode according to different users, so that the individualized control mode can be provided for different users, and the accuracy of operation control is improved.
Detailed Description
It is a main object of the present invention to add a personalized control mode to a terminal on the basis of a general control mode so that the way in which the terminal performs operations is in accordance with the desires of different users. The normal control mode corresponds to a default control mode of the terminal, and the threshold values for executing the predetermined operation are set according to habits of a large number of users, specifically, in the normal control mode, when the horizontal acceleration of the terminal is smaller than a first threshold value, a first operation is executed, and when the vertical acceleration of the terminal is smaller than a second threshold value, a second operation different from the first operation is executed.
The technical solutions of the exemplary embodiments provided by the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention. The various embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 1 shows a multi-mode terminal control method according to an embodiment of the present invention. The method may include steps S11-S15.
S11: adding an individualized control mode for a terminal with a preset common control mode, and executing a third operation when the horizontal acceleration of the terminal is smaller than a third threshold value and executing a fourth operation when the vertical acceleration of the terminal is smaller than a fourth threshold value in the individualized control mode; in the normal control mode, a first operation is performed when the horizontal acceleration of the terminal is less than a first threshold, and a second operation different from the first operation is performed when the vertical acceleration of the terminal is less than a second threshold.
In the real-scene application scenario, the manner of adding the personalized control mode in the embodiment includes, but is not limited to: taking a mobile phone as an example, firstly, a script or an application program is programmed in advance to set options for adding personalized control modes in a setting interface of a terminal; then, the option is opened or closed by sliding the slider; when the option is started, the terminal interface automatically or according to the instruction of the user starts the sensor, detects data generated when the current user operates the mobile phone through the started sensor, and continuously sets each threshold value of the preset operation according to the data.
Taking the terminal as an example to start the acceleration sensor and the magnetic field sensor, referring to fig. 2, the method for adding the personalized control mode to the terminal in this embodiment may include steps S111 to S117.
S111: the acceleration sensor and the magnetic field sensor are activated.
S112: when the terminal is swung horizontally, a first acceleration in the three-dimensional direction of the terminal is obtained through the acceleration sensor, and a first magnetic field angle change parameter of the terminal is obtained through the magnetic field sensor.
The first acceleration in the three-dimensional direction comprises accelerations on an X axis, a Y axis and a Z axis in a three-dimensional rectangular coordinate system. The first magnetic field angle variation parameter may be an angle variation parameter of the terminal with respect to a north pole direction of the geomagnetic field when the terminal is horizontally swung.
S113: and judging whether the first magnetic field angle change parameter is smaller than a preset fifth threshold value.
The fifth threshold is equivalent to adding a judgment triggering condition for terminal control, and the judgment triggering condition is used as a standard for judging whether the terminal is located in a stable environment with gravity change, so that misoperation of the terminal in an environment with overlarge gravity change can be avoided.
If the first magnetic field angle variation parameter is smaller than the fifth threshold, step S114 is executed. If the first magnetic field angle variation parameter is greater than (or equal to) the fifth threshold, prompting the current user to swing the terminal horizontally again, i.e. continuing to execute steps S112 and S113, and executing step S114 until the first magnetic field angle variation parameter is less than the fifth threshold.
S114: and setting the first acceleration in the horizontal direction as a third threshold when the terminal is horizontally swung.
The third threshold value is a parameter value of the first acceleration on the X axis in a three-dimensional rectangular coordinate system corresponding to the first acceleration.
S115: when the terminal is vertically swung, a second acceleration in the three-dimensional direction of the terminal is obtained through the acceleration sensor, and a second magnetic field angle change parameter of the terminal is obtained through the magnetic field sensor.
The second acceleration in the three-dimensional direction comprises accelerations on an X axis, a Y axis and a Z axis in a three-dimensional rectangular coordinate system. The second magnetic field angle variation parameter may be an angle variation parameter of the terminal with respect to the north pole direction of the geomagnetic field when vertically swung.
S116: and judging whether the second magnetic field angle change parameter is smaller than a fifth threshold value.
If the second magnetic field angle variation parameter is smaller than the fifth threshold, step S117 is executed. If the second magnetic field angle variation parameter is greater than (or equal to) the fifth threshold, the user is prompted to swing the terminal horizontally again, i.e., steps S115 and S116 are continued until the second magnetic field angle variation parameter is less than the fifth threshold, and step S117 is not executed.
S117: and setting the second acceleration in the vertical direction as a fourth threshold when the terminal is vertically swung.
The fourth threshold is a parameter value of the second acceleration on the Y axis in the spatial three-dimensional rectangular coordinate system, corresponding to the second acceleration.
S12: and acquiring the acceleration of the terminal in the three-dimensional direction through the started acceleration sensor, and acquiring the magnetic field angle change parameter of the terminal through the started magnetic field sensor.
Whether the terminal is swung or not can be judged through the acceleration in the three-dimensional direction, so that misoperation caused by the situations that the terminal shakes in a small amplitude due to walking of a user and the like is avoided. In this embodiment, when the accelerations on the X-axis, the Y-axis, and the Z-axis are all greater than the corresponding threshold, it may be determined that the terminal is swung, and then steps S13 to S15 are performed.
S13: and judging whether the magnetic field angle change parameter is smaller than a preset fifth threshold value.
S14: and when the magnetic field angle change parameter is smaller than a fifth threshold value, the detection terminal is set to be in a common control mode or an individualized control mode.
S15: and controlling the terminal to execute corresponding operation according to the detection result and the acceleration in the three-dimensional direction.
If it is detected in step S14 that the terminal is currently set to the normal control mode, the acceleration in the three-dimensional direction acquired in step S12 is compared with a first threshold value and a second threshold value, respectively. Specifically, the acceleration in the horizontal direction (X axis) in the three-dimensional direction is compared with a first threshold value, and the acceleration in the vertical direction (Y axis) in the three-dimensional direction is compared with a second threshold value.
The first operation is performed if the horizontal acceleration (acceleration in the horizontal direction) is less than the first threshold value. The second operation is performed if the vertical acceleration (acceleration in the vertical direction) is smaller than the second threshold value. If the horizontal acceleration is greater than or equal to the first threshold and the vertical acceleration is greater than or equal to the second threshold, the terminal may not perform any operation and continue to perform steps S12 to S15.
If it is detected in step S14 that the terminal is currently set to the personalized control mode, the acceleration in the three-dimensional direction acquired in step S12 is compared with a third threshold value and a fourth threshold value, respectively. Specifically, the acceleration in the horizontal direction (X axis) in the three-dimensional direction is compared with a third threshold value, and the acceleration in the vertical direction (Y axis) in the three-dimensional direction is compared with a fourth threshold value.
If the horizontal acceleration is less than a third threshold, a third operation is performed, which may be the same as the first operation. If the vertical acceleration is less than a fourth threshold, a fourth operation is performed, which may be the same as the second operation. If the horizontal acceleration is greater than or equal to the third threshold and the vertical acceleration is greater than or equal to the fourth threshold, the terminal may not perform any operation and continue to perform steps S12 to S15.
As can be seen from the above, in the embodiment, the terminal is allowed to add the personalized control mode in addition to the normal control mode, and compared with the setting that the threshold value for the terminal to perform the predetermined operation in the normal mode is set according to the habits of a large number of users, the threshold value for the terminal to perform the predetermined operation in the personalized control mode is set according to different users, so that the personalized control mode can be provided for different users, and the accuracy of operation control is improved.
Taking an example that the common control mode and the personalized control mode are used for controlling music playing of the terminal, the first operation and the third operation may be playing a next song, and correspondingly, the second operation and the fourth operation may be playing a previous song. Of course, the first operation and the third operation may be volume increase, and correspondingly, the second operation and the fourth operation may be volume decrease.
The functions described in the above embodiments, if implemented in software and sold or used as a standalone product, may be stored in a storage medium readable by an electronic device, that is, the present invention also provides a storage device storing program data, which can be executed to implement the method of the above embodiments, and the storage device may be, for example, a usb disk, an optical disk, a server, etc.
Please refer to fig. 3, which illustrates a terminal according to an embodiment of the present invention. The terminal 30 is preset with a normal control mode in which a first operation is performed when the horizontal acceleration of the terminal 30 is smaller than a first threshold value and a second operation is performed when the vertical acceleration is smaller than a second threshold value.
The terminal 30 may comprise a processor 31, a memory 32, an acceleration sensor 33 and a magnetic field sensor 34, the processor 31 may be connected to the memory 32, the acceleration sensor 33 and the magnetic field sensor 34 by a communication bus 35. Wherein:
the processor 31 is configured to add an individualized control mode to the terminal 30, and in the individualized control mode, when the horizontal acceleration of the terminal 30 is smaller than a third threshold, the third operation is performed, and when the vertical acceleration of the terminal 30 is smaller than a fourth threshold, the fourth operation is performed.
The memory 32 is used for storing a first threshold, a second threshold, a third threshold, a fourth threshold and a preset fifth threshold.
The acceleration sensor 33 is used to acquire acceleration in the three-dimensional direction of the terminal 30.
The magnetic field sensor 34 is used for acquiring the magnetic field angle change parameter of the terminal 30.
The processor 31 is configured to determine whether the magnetic field angle variation parameter is smaller than a fifth threshold.
The processor 31 is further configured to detect whether the terminal is currently set to the normal control mode or the personalized control mode when the magnetic field angle variation parameter is smaller than a fifth threshold, and control the terminal 30 to perform a corresponding operation according to the detection result and the acceleration in the three-dimensional direction.
If the detection terminal 30 is currently set to the normal control mode, the processor 31 compares the acceleration in the three-dimensional direction with the first threshold value and the second threshold value, respectively. The processor 31 controls the terminal 30 to perform the first operation if the horizontal acceleration is less than the first threshold value. The processor 31 controls the terminal 30 to perform the second operation if the vertical acceleration is less than the second threshold.
If the detection terminal 30 is currently set to the personalized control mode, the processor 31 compares the acceleration in the three-dimensional direction with a third threshold value and a fourth threshold value, respectively. If the horizontal acceleration is less than the third threshold, the processor 31 controls the terminal 30 to perform a third operation, which may be the same as the first operation. If the vertical acceleration is less than the fourth threshold, the processor 31 controls the terminal 30 to perform a fourth operation, which may be the same as the second operation.
In the process of adding the personalized control mode,
the acceleration sensor 33 is further configured to obtain a first acceleration of the terminal 30 in a three-dimensional direction when the terminal 30 is horizontally swung, and the magnetic field sensor 34 is further configured to obtain a first magnetic field angle variation parameter of the terminal 30 when the terminal 30 is horizontally swung. The processor 31 is configured to determine whether the first magnetic field angle variation parameter is smaller than a fifth threshold, and set a first acceleration in a horizontal direction in the three-dimensional direction as a third threshold when the terminal 30 is horizontally swung when the first magnetic field angle variation parameter is smaller than the fifth threshold.
The acceleration sensor 33 is further configured to obtain a second acceleration of the terminal 30 in the three-dimensional direction when the terminal 30 is vertically swung, and the magnetic field sensor 34 is further configured to obtain a second magnetic field angle variation parameter of the terminal 30 when the terminal 30 is vertically swung. The processor 31 is configured to determine whether the second magnetic field angle variation parameter is smaller than a fifth threshold, and set a second acceleration in the vertical direction in the three-dimensional direction as a fourth threshold when the terminal 30 is vertically swung when the second magnetic field angle variation parameter is smaller than the fifth threshold.
The above-described structural elements of the terminal 30 of the present embodiment correspond to the terminal control method for performing the multi-mode of each of the above-described embodiments, and have the same technical effects.
The terminal can be a mobile terminal such as a smart phone, a Personal Digital Assistant (PDA) or a tablet Personal Computer (PC) and the like, and can also be wearable equipment worn on limbs or embedded in clothes, ornaments and accessories.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or equivalent flow transformations made by using the contents of the specification and the drawings, such as the mutual combination of technical features between various embodiments, or the direct or indirect application to other related technical fields, are included in the scope of the present invention.