CN112887475B - Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium - Google Patents

Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN112887475B
CN112887475B CN202110120027.4A CN202110120027A CN112887475B CN 112887475 B CN112887475 B CN 112887475B CN 202110120027 A CN202110120027 A CN 202110120027A CN 112887475 B CN112887475 B CN 112887475B
Authority
CN
China
Prior art keywords
gravity sensor
mobile terminal
height
height value
timer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110120027.4A
Other languages
Chinese (zh)
Other versions
CN112887475A (en
Inventor
俞斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Jianla Biotechnology Co ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202110120027.4A priority Critical patent/CN112887475B/en
Publication of CN112887475A publication Critical patent/CN112887475A/en
Application granted granted Critical
Publication of CN112887475B publication Critical patent/CN112887475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Telephone Function (AREA)

Abstract

The invention discloses a gravity sensor adjusting method, a mobile terminal and a computer readable storage medium, wherein the method comprises the following steps: a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position is stored in the mobile terminal in advance; setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time; and acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number. The invention solves the problem that the detection of the vertical screen of the mold is inaccurate due to the failure of the gravity sensor when the height of the user is changed due to the detection timing of the gravity sensor in the prior art, and simultaneously can keep lower energy consumption and bring convenience to the user.

Description

Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a gravity sensor adjusting method, a mobile terminal and a computer readable storage medium.
Background
The mobile terminal or called mobile communication terminal refers to a computer device which can be used in mobile, and broadly includes a mobile phone, a notebook, a tablet computer, a POS machine, and even a vehicle-mounted computer. But most often refer to cell phones or smart phones and tablets with multiple application functions. With the development of networks and technologies towards increasingly broader bands, the mobile communications industry will move towards a true mobile information age. On the other hand, with the rapid development of integrated circuit technology, the processing capability of the mobile terminal has already possessed strong processing capability, and the mobile terminal is changing from a simple conversation tool to an integrated information processing platform. This also adds more development space to mobile terminals.
Mobile terminals have been developed as simple communication devices with mobile communications for decades. From 2007, the gene mutation of the mobile terminal is intelligently triggered, and the traditional positioning of the terminal as a mobile network terminal is fundamentally changed. The mobile intelligent terminal is almost instantly changed into a key entrance and a main innovation platform of internet business, a novel media, electronic commerce and information service platform, the most important hub of internet resources, mobile network resources and environment interaction resources, and an operating system and a processor chip of the mobile intelligent terminal even become the strategic high points of the whole ICT industry at present. The subversive change caused by the mobile intelligent terminal opens the sequence of mobile internet industry development and opens a new technical industry period. With the continuous development of the mobile intelligent terminal, the influence of the mobile intelligent terminal is more extensive than that of a shoulder radio, a television and the internet (PC), and the mobile intelligent terminal becomes a 4 th terminal product which has wide penetration, rapid popularization and great influence and can reach the aspects of human social life historically.
The gravity sensor, also called as gravity sensor, uses elastic sensitive element to make cantilever type displacement device, and uses the energy-storage spring made of elastic sensitive element to drive electric contact so as to implement the conversion from gravity change to electric signal. At present, most of middle-high-end smart phones and tablet computers are internally provided with gravity sensors, such as apple series products iphone and iPad, Android series mobile phones and the like.
The display of the mobile terminal is divided into horizontal screen display and vertical screen display, which are particularly commonly used on interfaces such as video watching, photographing and navigation, and the horizontal and vertical screen detection of the mobile terminal is carried out by the mobile terminal through a gravity sensor; the problems are not great when the above-mentioned use is carried out at a general position; however, at present, along with wide distribution of operator base stations, mobile terminals can be used at various altitudes, and the gravity values at different heights can be changed, particularly, the gravity changes more obviously on some devices such as elevators and aircrafts in high buildings, and when the change speed of the gravity values is higher than the gravity speed detected by the mobile terminals, the gravity detection of the mobile terminals is inaccurate.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The invention mainly aims to provide a gravity sensor adjusting method, a mobile terminal and a computer readable storage medium, and aims to solve the problem that in the prior art, when the height of a user changes due to the detection timing of a gravity sensor, the gravity sensor fails, and the detection of a vertical screen of a mold is inaccurate.
In order to achieve the above object, the present invention provides a gravity sensor adjusting method, including the steps of:
a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position is stored in the mobile terminal in advance;
setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time;
and acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number.
Optionally, the gravity sensor adjusting method, where the mobile terminal stores in advance a correspondence table of the detection configuration of the gravity sensor corresponding to each height value of the location, specifically includes:
setting the height value of the position of the mobile terminal as a plurality of height value grades in advance;
setting the configuration of a gravity sensor of the mobile terminal to a plurality of gravity sensor levels in advance;
corresponding each height value grade of the mobile terminal to a gravity sensor grade, and generating a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position;
wherein, the lower the height value grade, the higher the corresponding gravity sensor grade.
Optionally, the gravity sensor adjusting method, wherein the setting of the timeout time of the timer, and obtaining the height value of the current location of the mobile terminal when the timer reaches the timeout time specifically include:
setting the overtime time of a timer, wherein the overtime time comprises overtime time of a plurality of levels, and the overtime time is longer when the level is higher;
and when the timer reaches the overtime, acquiring the height value of the current position of the mobile terminal.
Optionally, the gravity sensor adjusting method, wherein the obtaining a height value of a current location of the mobile terminal further includes:
judging whether the height value of the current position of the mobile terminal and the height value of the last detected position of the mobile terminal are changed or not;
when the detected stage number corresponding to the height value of the position is changed, the counting value of the height change counter is increased by one;
when the detected stage number corresponding to the height value of the position is unchanged, adding one to the count value of the unchanged height counter;
when the count value of the height change counter is greater than or equal to a first preset threshold value, reducing the overtime of the timer by one level;
and when the count value of the height unchangeable counter is greater than or equal to a second preset threshold value, increasing the overtime of the timer by one step.
Optionally, the gravity sensor adjusting method, wherein the obtaining of the corresponding gravity sensor stage number in the correspondence table according to the height value of the current position of the mobile terminal and setting as the current gravity sensing stage number specifically includes:
according to the updated overtime time of the timer, the mobile terminal acquires the latest height value of the current position after the timer reaches the updated overtime time;
and searching the corresponding gravity sensor detection configuration in a pre-stored corresponding relation table of the gravity sensor detection configuration corresponding to each position height value according to the latest current position height value of the mobile terminal, and setting the gravity sensor detection configuration as the current gravity sensing stage number.
Optionally, the gravity sensor adjusting method, wherein a correspondence table of the gravity sensor detection configuration corresponding to each height value of the located position is stored in advance in the mobile terminal, and before the method, the method further includes:
presetting a height change counter and a height unchanged counter;
the height change counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is changed;
the height unchangeable counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is unchanged.
Optionally, in the gravity sensor adjustment method, the first preset threshold is 2, and the second preset threshold is 6.
In addition, to achieve the above object, the present invention also provides a gravity sensor adjustment system, wherein the gravity sensor adjustment system includes:
the timer setting module is used for setting the overtime time of the timer;
the timer is used for triggering the height detection module to detect the height value of the position at regular time, and the overtime time of the timer is dynamically set by the timer setting module;
the height detection module is used for detecting the height value of the position where the mobile terminal is located;
the height change counter is used for automatically adding one to the count value when the level number corresponding to the height value of the position is changed;
the height unchanged counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is not changed;
and the gravity sensor detection module is used for setting the number of stages of the gravity sensor of the mobile terminal according to the height value of the position acquired by the height detection module.
In addition, to achieve the above object, the present invention also provides a mobile terminal, wherein the mobile terminal includes: a memory, a processor and a gravity sensor adjustment program stored on the memory and executable on the processor, the gravity sensor adjustment program when executed by the processor implementing the steps of the gravity sensor adjustment method as described above.
Further, to achieve the above object, the present invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a gravity sensor adjustment program, which when executed by a processor, implements the steps of the gravity sensor adjustment method as described above.
The invention pre-stores the corresponding relation table of the detection configuration of the gravity sensor corresponding to the height value of each position in the mobile terminal; setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time; and acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number. The invention solves the problem that the detection of the vertical screen of the mold is inaccurate due to the failure of the gravity sensor when the height of the user is changed due to the detection timing of the gravity sensor in the prior art, and simultaneously can keep lower energy consumption and bring convenience to the user.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a gravity sensor adjustment method of the present invention;
FIG. 2 is a flow chart of step S10 in the preferred embodiment of the gravity sensor adjusting method of the present invention;
FIG. 3 is a flowchart of step S20 in the preferred embodiment of the gravity sensor adjusting method of the present invention;
FIG. 4 is a flow chart of setting a timer level in a preferred embodiment of the gravity sensor adjustment method of the present invention;
FIG. 5 is a flowchart of step S30 in the preferred embodiment of the gravity sensor adjusting method of the present invention;
FIG. 6 is a schematic diagram of a preferred embodiment of the gravity sensor adjustment system of the present invention;
FIG. 7 is a diagram illustrating an operating environment of a mobile terminal according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The display of the mobile terminal is divided into horizontal screen display and vertical screen display, which are particularly commonly used on interfaces such as video watching, photographing and navigation, and the horizontal and vertical screen detection of the mobile terminal is carried out by the mobile terminal through a gravity sensor; the problems are not great when the above-mentioned use is carried out at a general position; however, at present, along with wide distribution of operator base stations, mobile terminals can be used at various altitudes, and the gravity values at different heights can be changed, particularly, the gravity changes more obviously on some devices such as elevators and aircrafts in high buildings, and when the change speed of the gravity values is higher than the gravity speed detected by the mobile terminals, the gravity detection of the mobile terminals is inaccurate.
In view of the above-mentioned drawbacks of the prior art, a gravity sensor adjusting method according to a preferred embodiment of the present invention, as shown in fig. 1, includes the following steps:
in step S10, a correspondence table of the detection arrangement of the gravity sensor corresponding to each of the positional height values is stored in advance in the mobile terminal.
Please refer to fig. 2, which is a flowchart of step S10 in the gravity sensor adjusting method according to the present invention.
As shown in fig. 2, the step S10 includes:
s11, setting the height value of the position of the mobile terminal as a plurality of height value grades in advance;
s12, setting the configuration of the gravity sensor of the mobile terminal into a plurality of gravity sensor levels in advance;
and S13, corresponding each height value grade of the mobile terminal to a gravity sensor grade, and generating a corresponding relation table of gravity sensor detection configuration corresponding to each height value of the position.
Wherein, the lower the height value grade, the higher the corresponding gravity sensor grade.
Specifically, for example, five levels of 1, 2, 3, 4, and 5 are provided for the gravity sensor detection configuration in the mobile terminal, and a higher level indicates a larger gravity sensor detection period; the height value of the position is also set to be 1, 2, 3, 4 and 5, and the higher the detected level number of the height value of the position is, the faster the height is changed; therefore, when the height value of the detected position is 1 st level, the gravity sensor detection is configured to be 5 th level; when the detected position height value is level 2, configuring the gravity sensor detection as level 4; when the height value of the detected position is 3 rd level, the gravity sensor detection is configured to be 3 rd level; when the height value of the detected position is level 4, configuring the gravity sensor detection as level 2; when the detected height value of the position is 5 th level, configuring the detection of the gravity sensor as 1 st level, which is equivalent to generating a corresponding relation table of the detection configuration of the gravity sensor corresponding to each height value of the position; i.e. a lower level of said height value corresponds to a higher level of the gravity sensor.
And step S20, setting the overtime time of the timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time.
Please refer to fig. 3, which is a flowchart of step S20 in the gravity sensor adjusting method according to the present invention.
As shown in fig. 3, the step S20 includes:
s21, setting the overtime time of the timer, wherein the overtime time comprises overtime time of a plurality of levels, and the overtime time is longer when the number of the levels is higher;
and S22, when the timer reaches the overtime, acquiring the height value of the current position of the mobile terminal.
Specifically, the mobile terminal sets the timeout time of the timer, for example, the timeout time of the timer is set to five levels, for example, 1, 2, 3, 4, and 5 levels of timeout time, where a higher level indicates a longer timeout time.
Further, as shown in fig. 4, acquiring a height value of a current position of the mobile terminal, and then:
s221, judging whether the height value of the current position of the mobile terminal and the height value of the last detected position of the mobile terminal are changed;
s222, when the number of stages corresponding to the detected height value of the position is changed, adding one to the count value of the height change counter;
s223, when the number of stages corresponding to the detected height value of the position is not changed, adding one to the count value of the height unchangeable counter;
s224, when the count value of the height change counter is greater than or equal to a first preset threshold (the first preset threshold is preferably 2), reducing the timeout time of the timer by one step;
and S225, when the count value of the height unchangeable counter is greater than or equal to a second preset threshold (the second preset threshold is preferably 6), increasing the timeout time of the timer by one step.
And detecting the height value of the current position of the mobile terminal after the timer is overtime.
Step S30, obtaining the corresponding gravity sensor stage number from the corresponding relationship table according to the height value of the current position of the mobile terminal, and setting the stage number as the specific process of the current gravity sensor stage number, please refer to fig. 5, which is a flowchart of step S30 in the gravity sensor adjusting method provided by the present invention.
As shown in fig. 5, the step S30 includes:
s31, according to the updated overtime time of the timer, the mobile terminal obtains the latest current position height value after the timer reaches the updated overtime time;
and S32, according to the latest current position height value of the mobile terminal, searching the corresponding gravity sensor detection configuration in a corresponding relation table of the gravity sensor detection configuration corresponding to each position height value stored in advance, and setting the gravity sensor detection configuration as the current gravity sensing stage number.
Specifically, the gravity sensor detection configuration of the mobile terminal is set according to the acquired height value of the position; for example, when the detected position height value is 1 st level, the gravity sensor detection is configured to be 5 th level; when the detected position height value is level 2, configuring the gravity sensor detection as level 4; when the height value of the detected position is 3 rd level, the gravity sensor detection is configured to be 3 rd level; when the height value of the detected position is level 4, configuring the gravity sensor detection as level 2; and when the detected position height value is the 5 th level, configuring the gravity sensor detection as the 1 st level.
Further, based on the gravity sensor adjusting method, as shown in fig. 6, the present invention further provides a gravity sensor adjusting system, wherein the gravity sensor adjusting system includes:
a timer setting module 100, configured to set a timeout time of the timer 200;
the timer 200 is used for triggering the height detection module 300 to detect the height value of the located position at regular time, and the timeout time of the timer 200 is dynamically set by the timer setting module 100;
the height detection module 300 is configured to detect a height value of a position where the mobile terminal is located;
a height change counter 600 for automatically incrementing a count value by one when the number of steps corresponding to the height value of the position is changed;
the height unchanged counter 500 is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is not changed;
the gravity sensor detecting module 400 is configured to set the number of gravity sensor stages of the mobile terminal according to the height value of the position obtained by the height detecting module 300.
The timer setting module 100 is configured to set the timeout time of the timer 200, where the timeout time of the timer 200 has five stages: 1. 2, 3, 4 and 5 levels of timeout time, wherein the higher the level number is, the longer the timeout time is; the timer setting module 100 sets the timeout time of the timer 200 according to the count values of the height change counter 500 and the height unchangeable counter 600: when the count value of the altitude change counter 500 is greater than or equal to 2, the timer setting module 100 performs degradation processing on the timeout time of the timer 200; when the count value of the height unchangeable counter 600 is greater than or equal to 6, the timer setting module 100 performs an upgrade process on the timeout time of the timer 200.
The timer 200 is used for triggering the height detection module 300 to detect the height value of the located position at regular time; the timeout time of the timer 200 is dynamically set by the timer setting module 100.
The height detection module 300 is configured to detect a height value of the located position, and when the height detection module 300 detects that the number of steps corresponding to the height value of the located position and the number of steps corresponding to the height of the located position detected by the height detection module 300 last time are changed, increment a count value of the height change counter 500 by one; when the height detection module 300 detects that the number of levels corresponding to the height value of the located position and the number of levels corresponding to the height of the located position detected by the height detection module 300 last time are not changed, the count value of the unchanged height counter 600 is increased by one.
The gravity sensor detection module 400 is configured to set a gravity sensor of the mobile terminal according to the height value of the position obtained by the height detection module 300; when the detected position height value is 1 st level, the gravity sensor detection is configured to be 5 th level; when the detected position height value is level 2, configuring the gravity sensor detection as level 4; when the height value of the detected position is 3 rd level, the gravity sensor detection is configured to be 3 rd level; when the height value of the detected position is level 4, configuring the gravity sensor detection as level 2; and when the detected position height value is the 5 th level, configuring the gravity sensor detection as the 1 st level.
Wherein, the height change counter 500 is used to detect whether there is a change from the last acquired height value of the located position each time the height detection module 300 acquires the height value of the located position, and if so, the height change counter 500 is incremented by 1.
Wherein, the height unchangeable counter 600 is used for detecting whether there is a change from the last acquired height value of the located position each time the height detection module 300 acquires the height value of the located position, if not, the height unchangeable counter 600 adds 1.
Further, the principle of implementing the mobile terminal gravity sensor detection and adjustment method based on the gravity sensor adjustment system is as follows:
step S1, starting the timer 200, where the timeout TIME is set to level 3 by the timer setting module 100, and a variable TIME is set to 3;
step S2, determining whether the timer 200 is overtime, if yes, performing step S3, otherwise, performing step S2;
step S3, the height detection module 300 detects the height value of the located position and assigns the height value to TIME1, and the gravity sensor detection module 400 sets a corresponding gravity sensor for detection according to the height TIME 1; then, whether the TIME1 is equal to the TIME is judged, if so, the step S4 is executed, and if not, the step S7 is executed;
step S4, adding 1 to the height unchangeable counter 600, and clearing the height changeable counter 500; then step S5 is executed;
step S5, determining whether the height invariant counter 600 is greater than or equal to 6, if so, executing step S6, otherwise, executing step S2;
step S6, the timer setting module 100 increases the timeout period of the timer 200 by one step, and clears both the height change counter 500 and the height unchanged counter 600; then, step S100 is executed;
step S7, adding 1 to the height change counter 500, and clearing the height change counter 600; then step S8 is executed;
step S8, determining whether the height change counter 500 is greater than or equal to 2, if so, executing step S9, otherwise, executing step S2;
step S9, the timer setting module 100 decreases the timeout period of the timer 200 by one step, and clears both the height change counter 500 and the height unchanged counter 600; then, step S100 is executed;
in step S100, the value of TIME1 is assigned to TIME, and then step S2 is executed.
Further, as shown in fig. 7, based on the gravity sensor adjusting method and system, the present invention also provides a mobile terminal, which includes a processor 10, a memory 20, and a display 30. Fig. 7 shows only some of the components of the mobile terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the mobile terminal, such as a hard disk or a memory of the mobile terminal. The memory 20 may also be an external storage device of the mobile terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the mobile terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the mobile terminal. The memory 20 is used for storing application software installed in the mobile terminal and various data, such as program codes of the installed mobile terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a gravity sensor adjustment program 40, and the gravity sensor adjustment program 40 can be executed by the processor 10 to implement the gravity sensor adjustment method of the present application.
The processor 10 may be a Central Processing Unit (CPU), microprocessor or other data Processing chip in some embodiments, and is used for running program codes stored in the memory 20 or Processing data, such as executing the gravity sensor adjusting method.
The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 30 is used for displaying information at the mobile terminal and for displaying a visual user interface. The components 10-30 of the mobile terminal communicate with each other via a system bus.
In one embodiment, the following steps are implemented when the processor 10 executes the gravity sensor adjustment program 40 in the memory 20:
a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position is stored in the mobile terminal in advance;
setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time;
and acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number.
The method includes that a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each located position is stored in the mobile terminal in advance, and specifically includes:
setting the height value of the position of the mobile terminal as a plurality of height value grades in advance;
setting the configuration of a gravity sensor of the mobile terminal to a plurality of gravity sensor levels in advance;
corresponding each height value grade of the mobile terminal to a gravity sensor grade, and generating a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position;
wherein, the lower the height value grade, the higher the corresponding gravity sensor grade.
The setting of the timeout time of the timer, and obtaining the height value of the current position of the mobile terminal when the timer reaches the timeout time specifically include:
setting the overtime time of a timer, wherein the overtime time comprises overtime time of a plurality of levels, and the overtime time is longer when the level is higher;
and when the timer reaches the overtime, acquiring the height value of the current position of the mobile terminal.
The obtaining of the height value of the current position of the mobile terminal then further includes:
judging whether the height value of the current position of the mobile terminal and the height value of the last detected position of the mobile terminal are changed or not;
when the detected stage number corresponding to the height value of the position is changed, the counting value of the height change counter is increased by one;
when the detected stage number corresponding to the height value of the position is unchanged, adding one to the count value of the unchanged height counter;
when the count value of the height change counter is greater than or equal to a first preset threshold value, reducing the overtime of the timer by one level;
and when the count value of the height unchangeable counter is greater than or equal to a second preset threshold value, increasing the overtime of the timer by one step.
The acquiring, according to the height value of the current position of the mobile terminal, the corresponding gravity sensor stage number in the correspondence table, and setting the stage number as the current gravity sensor stage number specifically includes:
according to the updated overtime time of the timer, the mobile terminal acquires the latest height value of the current position after the timer reaches the updated overtime time;
and searching the corresponding gravity sensor detection configuration in a pre-stored corresponding relation table of the gravity sensor detection configuration corresponding to each position height value according to the latest current position height value of the mobile terminal, and setting the gravity sensor detection configuration as the current gravity sensing stage number.
The mobile terminal is pre-stored with a corresponding relationship table of the gravity sensor detection configuration corresponding to each of the height values of the located positions, and the method further includes:
presetting a height change counter and a height unchanged counter;
the height change counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is changed;
the height unchangeable counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is unchanged.
The first preset threshold is 2, and the second preset threshold is 6.
The present invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a gravity sensor adjustment program, which when executed by a processor implements the steps of the gravity sensor adjustment method as described above.
In summary, the present invention provides a gravity sensor adjusting method, a mobile terminal and a computer-readable storage medium, where the method includes: a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position is stored in the mobile terminal in advance; setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time; and acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number. The invention solves the problem that the detection of the vertical screen of the mold is inaccurate due to the failure of the gravity sensor when the height of the user is changed due to the detection timing of the gravity sensor in the prior art, and simultaneously can keep lower energy consumption and bring convenience to the user.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods described above. The computer readable storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (8)

1. A gravity sensor adjustment method, characterized by comprising:
a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position is stored in the mobile terminal in advance;
the mobile terminal is pre-stored with a corresponding relationship table of the gravity sensor detection configuration corresponding to the height value of each location, and specifically includes:
setting the height value of the position of the mobile terminal as a plurality of height value grades in advance;
setting the configuration of a gravity sensor of the mobile terminal to a plurality of gravity sensor levels in advance;
corresponding each height value grade of the mobile terminal to a gravity sensor grade, and generating a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position;
wherein the lower the height value grade, the higher the corresponding gravity sensor grade;
setting the overtime time of a timer, and acquiring the height value of the current position of the mobile terminal when the timer reaches the overtime time;
acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number;
the acquiring the corresponding gravity sensor stage number in the corresponding relation table according to the height value of the current position of the mobile terminal, and setting the stage number as the current gravity sensing stage number specifically comprises:
according to the updated overtime time of the timer, the mobile terminal acquires the latest height value of the current position after the timer reaches the updated overtime time;
and searching the corresponding gravity sensor detection configuration in a pre-stored corresponding relation table of the gravity sensor detection configuration corresponding to each position height value according to the latest current position height value of the mobile terminal, and setting the gravity sensor detection configuration as the current gravity sensing stage number.
2. The gravity sensor adjusting method according to claim 1, wherein the setting of the timeout time of the timer, and obtaining the height value of the current location of the mobile terminal when the timer reaches the timeout time specifically comprises:
setting the overtime time of a timer, wherein the overtime time comprises overtime time of a plurality of levels, and the overtime time is longer when the level is higher;
and when the timer reaches the overtime, acquiring the height value of the current position of the mobile terminal.
3. The gravity sensor adjusting method according to claim 2, wherein the obtaining of the height value of the current position of the mobile terminal further comprises:
judging whether the height value of the current position of the mobile terminal and the height value of the last detected position of the mobile terminal are changed or not;
when the detected stage number corresponding to the height value of the position is changed, the counting value of the height change counter is increased by one;
when the detected stage number corresponding to the height value of the position is unchanged, adding one to the count value of the unchanged height counter;
when the count value of the height change counter is greater than or equal to a first preset threshold value, reducing the overtime of the timer by one level;
and when the count value of the height unchangeable counter is greater than or equal to a second preset threshold value, increasing the overtime of the timer by one step.
4. The gravity sensor adjusting method according to claim 1, wherein a correspondence table of the gravity sensor detection configuration corresponding to each of the height values of the located positions is stored in advance in the mobile terminal, and the method further comprises:
presetting a height change counter and a height unchanged counter;
the height change counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is changed;
the height unchangeable counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is unchanged.
5. The gravity sensor adjustment method according to claim 3, wherein the first preset threshold value is 2 and the second preset threshold value is 6.
6. A gravity sensor adjustment system, characterized in that the gravity sensor adjustment system comprises:
the timer setting module is used for setting the overtime time of the timer;
the timer is used for triggering the height detection module to detect the height value of the position at regular time, and the overtime time of the timer is dynamically set by the timer setting module;
the height detection module is used for detecting the height value of the position where the mobile terminal is located;
the height change counter is used for automatically adding one to the count value when the level number corresponding to the height value of the position is changed;
the height unchanged counter is used for automatically adding one to the count value when the number of stages corresponding to the height value of the position is not changed;
the gravity sensor detection module is used for setting the number of gravity sensor stages of the mobile terminal according to the height value of the position acquired by the height detection module;
setting the height value of the position of the mobile terminal as a plurality of height value grades in advance;
setting the configuration of a gravity sensor of the mobile terminal to a plurality of gravity sensor levels in advance;
corresponding each height value grade of the mobile terminal to a gravity sensor grade, and generating a corresponding relation table of detection configuration of the gravity sensor corresponding to the height value of each position;
wherein the lower the height value grade, the higher the corresponding gravity sensor grade;
according to the updated overtime time of the timer, the mobile terminal acquires the latest height value of the current position after the timer reaches the updated overtime time;
and searching the corresponding gravity sensor detection configuration in a pre-stored corresponding relation table of the gravity sensor detection configuration corresponding to each position height value according to the latest current position height value of the mobile terminal, and setting the gravity sensor detection configuration as the current gravity sensing stage number.
7. A mobile terminal, characterized in that the mobile terminal comprises: memory, a processor and a gravity sensor adjustment program stored on the memory and executable on the processor, the gravity sensor adjustment program when executed by the processor implementing the steps of the gravity sensor adjustment method according to any of claims 1-5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a gravity sensor adjustment program, which when executed by a processor implements the steps of the gravity sensor adjustment method according to any one of claims 1-5.
CN202110120027.4A 2021-01-28 2021-01-28 Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium Active CN112887475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110120027.4A CN112887475B (en) 2021-01-28 2021-01-28 Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110120027.4A CN112887475B (en) 2021-01-28 2021-01-28 Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112887475A CN112887475A (en) 2021-06-01
CN112887475B true CN112887475B (en) 2022-03-25

Family

ID=76053157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110120027.4A Active CN112887475B (en) 2021-01-28 2021-01-28 Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112887475B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107770301A (en) * 2016-08-16 2018-03-06 中兴通讯股份有限公司 A kind of method and Shatter-resistant device of mobile terminal shatter-resistant
WO2020195691A1 (en) * 2019-03-28 2020-10-01 Ntn株式会社 State monitoring system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5477238B2 (en) * 2010-09-13 2014-04-23 富士通株式会社 Information processing method, apparatus and program
CN103529490B (en) * 2013-10-15 2016-05-11 Tcl通讯(宁波)有限公司 A kind of bearing calibration of mobile terminal gravity sensor and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107770301A (en) * 2016-08-16 2018-03-06 中兴通讯股份有限公司 A kind of method and Shatter-resistant device of mobile terminal shatter-resistant
WO2020195691A1 (en) * 2019-03-28 2020-10-01 Ntn株式会社 State monitoring system

Also Published As

Publication number Publication date
CN112887475A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US11429276B2 (en) Method for displaying graphical user interface and mobile terminal
WO2018059076A1 (en) Memory recovery method and apparatus
EP3206110B1 (en) Method of providing handwriting style correction function and electronic device adapted thereto
EP3961427A1 (en) Display control method and terminal device
CN104238918B (en) List View component slippage display methods and device
CN113939814A (en) Content push method and related product
CN108984095A (en) gesture interaction method, device, storage medium and electronic equipment
CN104954402A (en) Application recommending method, system and apparatus
US10558840B2 (en) Fingerprint recognition method and electronic device
CN103455348A (en) Subarea adjustment method, device, terminal, server and system
CN107391198B (en) Method for scheduling task and device, computer readable storage medium, mobile terminal
US10621259B2 (en) URL error-correcting method, server, terminal and system
CN108536349B (en) Icon management method and mobile terminal
CN109416615A (en) Handle the method for touch event and the electronic device suitable for this method
US20110059778A1 (en) Touchscreen with Z-Velocity Enhancement
CN106055455A (en) Anti-interference method and device for key
CN107229728B (en) Searching method, device and storage medium based on neural network
CN109815349B (en) Information acquisition method and terminal equipment
CN111064842B (en) Method, terminal and storage medium for recognizing special-shaped touch
CN108628534B (en) Character display method and mobile terminal
CN112887475B (en) Gravity sensor adjusting method and system, mobile terminal and computer readable storage medium
CN104169860A (en) Intelligent terminal and method used for displaying input operation interface
CN113791725A (en) Touch pen operation identification method, intelligent terminal and computer readable storage medium
CN109325003B (en) Application program classification method and system based on terminal equipment
CN104636367B (en) A kind of recommended method and device of bookmark

Legal Events

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

Effective date of registration: 20230411

Address after: 710075 Room 1401-A0618, 14th Floor, Tianxing Building, Tongde Road, Fengxi New City, Xixian New District, Xi'an City, Shaanxi Province

Patentee after: Shaanxi Yiqi Future Software Co.,Ltd.

Address before: 516003 No.86, hechangqi Road West, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240310

Address after: 710000, Room 412, Unit 2, Building 6, Phase 2, Lingang Industrial Park, Airport New City, Xixian New Area, Xi'an City, Shaanxi Province, China, B212

Patentee after: Xi'an Jianla Biotechnology Co.,Ltd.

Country or region after: China

Address before: 710075 Room 1401-A0618, 14th Floor, Tianxing Building, Tongde Road, Fengxi New City, Xixian New District, Xi'an City, Shaanxi Province

Patentee before: Shaanxi Yiqi Future Software Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right