CN106502819B - Control method and device based on proximity sensor and mobile terminal - Google Patents

Control method and device based on proximity sensor and mobile terminal Download PDF

Info

Publication number
CN106502819B
CN106502819B CN201611034458.4A CN201611034458A CN106502819B CN 106502819 B CN106502819 B CN 106502819B CN 201611034458 A CN201611034458 A CN 201611034458A CN 106502819 B CN106502819 B CN 106502819B
Authority
CN
China
Prior art keywords
value
state
proximity
proximity sensor
approach
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.)
Expired - Fee Related
Application number
CN201611034458.4A
Other languages
Chinese (zh)
Other versions
CN106502819A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201611034458.4A priority Critical patent/CN106502819B/en
Publication of CN106502819A publication Critical patent/CN106502819A/en
Application granted granted Critical
Publication of CN106502819B publication Critical patent/CN106502819B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Electronic Switches (AREA)

Abstract

The embodiment of the invention discloses a control method and device based on a proximity sensor and a mobile terminal, and relates to the mobile terminal technology. Wherein the method comprises acquiring a proximity value of a proximity sensor; judging whether the proximity sensor is in an abnormal state or not according to the proximity value; and when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold at the next moment of the abnormal state moment, and determining the approaching state or the far state of the shielding object at the next moment according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state. The embodiment of the invention solves the problem that the judgment of the approaching state or the far state is disordered due to the abnormity of the approaching sensor in the severe environment at present, improves the judgment accuracy of the approaching state or the far state in the severe environment, and reduces the probability of the disorder of the approaching state or the far state.

Description

Control method and device based on proximity sensor and mobile terminal
Technical Field
The embodiment of the invention relates to a mobile terminal technology, in particular to a control method and device based on a proximity sensor and a mobile terminal.
Background
At present, a proximity sensor, as a standard configuration of a mobile terminal, plays an important role in implementing functions such as turning on or off a display screen and automatically adjusting a backlight.
The proximity sensor provided in the mobile terminal is generally an infrared proximity sensor. The infrared proximity sensor includes an infrared transmitting tube and an infrared receiving tube. First, infrared light is emitted from an infrared emitting tube in the direction of the screen of the display screen. Then, the infrared receiving tube receives the infrared light reflected by the shielding object and converts the infrared light into an electric signal, the electric signal is amplified and subjected to analog-to-digital conversion (A/D conversion) to obtain a digital signal corresponding to the intensity of the reflected infrared light, and the digital signal is sent to the CPU, and the CPU takes the digital signal as a proximity value for further judgment. For example, the distance between the shielding object and the mobile terminal is determined by the proximity value, and the stronger the intensity of the received infrared light, the larger the proximity value, the smaller the distance between the shielding object and the shielding object.
In order to facilitate the judgment of the approaching or the departing of the obstruction according to the approaching value, a approaching threshold value and a departing threshold value are usually preset, wherein the approaching threshold value is greater than or equal to the departing threshold value. When the approach value is larger than the approach threshold value, judging that the obstruction is in an approach state; and when the approach value is smaller than the far threshold value, judging that the obstruction is in a far state. However, the above conclusion is obtained without considering a severe environment. In the process of implementing the invention, the inventor finds that under the strong light interference environment, the proximity sensor may generate a probabilistic overflow phenomenon because the infrared light received by the infrared receiving tube reaches a saturation value, so that the proximity value is returned to zero. And, in the electrostatic experiment process, the process progress of the infrared receiving tube may be interrupted due to electrostatic shock, so that the process progress is probabilistically interrupted, resulting in the near value being zeroed. When the approach value is zero, if a mode of determining the threshold value in the prior art (a mode of obtaining the approach threshold value and the distance threshold value at the next moment by superimposing a fixed value on the approach value at the current moment) is adopted, the obtained approach threshold value and the distance threshold value are very small. If the approach value at the next moment is recovered to the value in the normal state, the approach value at the next moment is larger than the determined approach threshold value, and the far state is directly and wrongly judged as the approach state, so that the state judgment at the next moment is influenced, and the state judgment is wrong.
Disclosure of Invention
The invention provides a control method and device based on a proximity sensor and a mobile terminal, which are used for accurately judging the approaching state or the far state of a shielding object in a severe environment and avoiding disorder in judgment of the approaching state or the far state.
In a first aspect, an embodiment of the present invention provides a proximity sensor-based control method, including:
acquiring a proximity value of a proximity sensor;
judging whether the proximity sensor is in an abnormal state or not according to the proximity value;
and when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold of the proximity sensor at the next moment of the abnormal state moment, and determining the proximity state or the far state of the shielding object at the next moment according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state.
In a second aspect, an embodiment of the present invention further provides a proximity sensor-based control apparatus, where the apparatus includes:
the proximity value acquisition module is used for acquiring a proximity value of the proximity sensor;
the state judgment module is used for judging whether the proximity sensor is in an abnormal state or not according to the proximity value;
and the threshold value determining module is used for taking the preset highlight threshold value as a judgment threshold value of the proximity sensor at the next moment of the abnormal state moment so as to determine the proximity state or the far state of the shielding object at the next moment according to the judgment threshold value, wherein the preset highlight threshold value is larger than the normal threshold value of the proximity sensor at the normal state.
In a third aspect, an embodiment of the present invention further provides a mobile terminal, which integrates the control device based on the proximity sensor according to the second aspect.
According to the technical scheme of the embodiment of the invention, the approach value of the approach sensor is obtained; judging whether the proximity sensor is in an abnormal state or not according to the proximity value; and when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold of the proximity sensor at the next moment of the abnormal state moment, and determining the proximity state or the far state of the shielding object at the next moment according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state. The embodiment of the invention solves the problem that the judgment of the approaching state or the far state is disordered due to the abnormity of the approaching sensor in the severe environment at present, avoids the condition that the judgment threshold value of the approaching sensor is wrong at the next moment due to the zeroing of the approaching value in the strong light environment or the static experiment, improves the judgment accuracy of the approaching state or the far state in the severe environment, and reduces the probability that the approaching state or the far state is disordered.
Drawings
FIG. 1 is a flow chart of a proximity sensor based control method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of another proximity sensor based control method according to a second embodiment of the present invention;
FIG. 3 is a flow chart of yet another proximity sensor based control method in a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a proximity sensor based control device in a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a mobile terminal in a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a proximity sensor-based control method according to an embodiment of the present invention, where the embodiment is applicable to a case where a proximity value sent by a proximity sensor is zero when a mobile terminal is in a strong light environment or an electrostatic experiment environment, and the method may be executed by a proximity sensor-based control device, where the device may be implemented by software and/or hardware, and may generally be integrated in the mobile terminal. As shown in fig. 1, the method specifically includes the following steps:
and step 110, acquiring a proximity value of the proximity sensor.
The proximity sensor is used for detecting whether the shielding object is in proximity relation or far-away relation with the mobile terminal. When the mobile terminal detects that the mobile terminal is in the proximity relation with the obstruction, the mobile terminal determines that the current obstruction is in the proximity state. Accordingly, when the mobile terminal detects that the mobile terminal is far away from the obstruction, the mobile terminal determines that the current obstruction is in a far away state. Illustratively, the proximity sensor may be an infrared proximity sensor. The infrared receiving tube receives the infrared light signal, converts the infrared light signal into an electric signal, and performs amplification, analog-to-digital conversion and other processing on the electric signal to obtain a proximity value of the infrared proximity sensor. The infrared light signal is converted into a digital signal, so that the mobile terminal CPU can conveniently judge the state of the shielding object according to the approach value. Therefore, the function of preventing false touch is automatically started according to the state of the shielding object, the function of automatically adjusting backlight is realized, and the like.
And step 120, judging whether the proximity sensor is in an abnormal state or not according to the proximity value.
Comparing the acquired approach value with zero, and if the approach value is equal to zero, determining that the proximity sensor is in an abnormal state at the current moment; otherwise, determining that the proximity sensor is in a normal state at the current moment.
When the proximity sensor is in a normal state at the current moment, in order to determine whether the shielding object is in a close state or a far state according to the proximity value, the mobile terminal automatically determines the judgment threshold value according to a set rule. The decision threshold value may be a value determined by the proximity value at the previous time.
Illustratively, the mobile terminal records the last time (t0) approaching value as 150, and superimposes the fixed values 40 and 60 on the last time (t0) approaching value to obtain the current time (t1) threshold value, i.e. the current time (t1) is far from the threshold value 190 and the current time (t1) is approaching the threshold value 210. If the approaching value at the current time (t1) is 200, which is larger than the distance threshold 190 but smaller than the approaching threshold 210, the determination result of the state of the obstacle at the previous time (t0) is kept unchanged. At this time, superimposing the reinforcement constants 40 and 60 on the basis of 200 results in the next time (t2) being far from the threshold 240 and the next time (t2) being close to the threshold 260. If the proximity value of 270 is exceeded by the proximity threshold value of 260 at the next time (t2), it is determined that an object is near the mobile terminal at the next time (t 2).
And step 130, when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold of the next time of the abnormal state time, and determining the proximity state or the far state of the shielding object at the next time according to the judgment threshold.
The preset highlight threshold is larger than a normal threshold of the proximity sensor in a normal state. The normal threshold value of the proximity sensor in the normal state is obtained by superposing the proximity value of the previous moment on a set numerical value. The normal threshold value in the normal state may include a near threshold value N and a far threshold value F. The approach threshold value and the departure threshold value may be the same value (N ═ F). When the approaching threshold value and the far threshold value are not the same value, namely N is larger than F, when the approaching value is larger than the approaching threshold value N, it is judged that an object blocks light rays, namely the object is close to the mobile terminal; when the approach is smaller than the far threshold value F, the light shielding is eliminated, namely the object leaves the mobile terminal.
For example, when the approach value of the proximity sensor is zero, a preset highlight threshold value is used as a determination threshold value of the next time of the abnormal state time, so as to determine the approach state or the far state of the obstruction at the next time according to the determination threshold value. When factory setting is carried out, the preset highlight threshold value is determined according to the full scale of the proximity sensor, and the highlight threshold value comprises a proximity threshold value and a far threshold value. For example, the proximity sensor has a full scale of 1023, and the proximity threshold of the highlight threshold may be set to 950 and the distance threshold to 900. The advantage of this arrangement is that even at the time when the proximity sensor is in an abnormal state (the proximity value is zero), the highlight threshold value can be used as the determination threshold value at the next time, instead of determining the determination threshold value at the next time by superimposing the set value with the proximity value as in the prior art. If the proximity sensor returns to the normal state at the next moment, the situation that the far state is mistakenly judged as the close state does not occur.
According to the technical scheme of the embodiment, the approach value of the approach sensor is obtained; judging whether the proximity sensor is in an abnormal state or not according to the proximity value; and when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold of the proximity sensor at the next moment of the abnormal state moment, and determining the proximity state or the far state of the shielding object at the next moment according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state. The problem that the judgment of the approaching state or the far-away state is disordered due to the fact that the approaching sensor is abnormal in the severe environment at present is solved, the situation that the judgment threshold value of the approaching sensor is wrong at the next moment due to the fact that the approaching value returns to zero in the strong light environment or the static experiment is avoided, the judgment accuracy of the approaching state or the far-away state in the severe environment is improved, and the probability that the approaching state or the far-away state is disordered is reduced.
Example two
Fig. 2 is a flowchart of another proximity sensor based control method according to a second embodiment of the present invention. On the basis of the foregoing technical solution, in the present embodiment, when the proximity sensor is in an abnormal state, after taking the preset highlight threshold as the determination threshold at the next time of the abnormal state time, the method may further include: judging whether the proximity sensor recovers to a normal state or not according to the proximity value at each moment after the abnormal state moment;
and when the proximity sensor recovers to the normal state, superposing the proximity value at the moment of recovering to the normal state with a set numerical value to obtain the judgment threshold value at the next moment of recovering to the normal state of the proximity sensor.
Based on the above optimization, as shown in fig. 2, the method of this embodiment specifically includes the following steps:
and 210, when the proximity sensor is in an abnormal state, taking a preset highlight threshold value as a judgment threshold value at the next moment of the abnormal state moment.
In step 220, the proximity value of the proximity sensor after the time of the abnormal state is acquired.
And when the proximity sensor is determined to be in the abnormal state, continuously acquiring the proximity value of the proximity sensor according to a set period.
Step 230, determining whether the approach value is equal to zero, if yes, performing step 240, otherwise, performing step 250.
The mobile terminal compares the proximity value with zero, and if the proximity value is equal to zero, step 240 is executed. If the approach value is not equal to zero, step 250 is performed.
The reason why the approach value is equal to zero may be that the proximity sensor is in a strong light environment, and infrared light in the environment is received by the infrared receiving tube after being superimposed with infrared light reflected by the blocking object. Since the received infrared light exceeds the saturation threshold of the infrared receiving tube, the infrared receiving tube will overflow probabilistically, and the approach value will be zero. It is also possible that the proximity sensor is in a strong electrostatic environment (e.g., an electrostatic experiment), and the integration process of the proximity sensor is affected due to electrostatic shock, so that the analog-to-digital conversion process is probabilistically interrupted, resulting in the proximity value being zeroed. Of course, it is also possible to zero the proximity value of the proximity sensor due to other factors, and is not limited to the two cases enumerated in the present embodiment.
And 240, determining that the proximity sensor is in an abnormal state.
When the approach value of the proximity sensor is zero, it is determined that the proximity sensor is in an abnormal state at this time, and the process proceeds to step 220.
And step 250, determining that the proximity sensor recovers to a normal state.
When the approach value of the proximity sensor is returned from zero to a non-zero value, it is determined that the proximity sensor is returned to a normal state at that time.
And step 260, superposing the proximity value at the moment of recovering to the normal state with a set numerical value to obtain a judgment threshold value at the next moment of recovering to the normal state of the proximity sensor.
And if the proximity sensor is determined to be recovered to the normal state, superposing the proximity value at the moment of recovering to the normal state and a set numerical value to obtain a judgment threshold value at the next moment of recovering to the normal state of the proximity sensor.
According to the technical scheme of the embodiment, whether the proximity sensor recovers the normal state is judged according to the proximity value of each time after the abnormal state time; when the proximity sensor returns to the normal state, the proximity value at the time of returning to the normal state is superposed with the set numerical value to obtain the judgment threshold value at the next time when the proximity sensor returns to the normal state, so as to judge the proximity state or the far state of the shielding object at the next time. The embodiment realizes that the determination mode of the judgment threshold value is adjusted after the proximity sensor recovers to the normal state, so that the situation that the proximity state of the shielding object is wrongly judged to be the far state due to the fact that the preset highlight threshold value is adopted as the judgment threshold value is avoided, the judgment accuracy of the proximity state or the far state when the proximity sensor is in the abnormal state is improved, and the problem that the proximity state or the far state is disordered when the proximity sensor recovers to the normal state is avoided.
EXAMPLE III
Fig. 3 is a flowchart of another proximity sensor based control method according to a third embodiment of the present invention. As shown in fig. 3, the method of this embodiment specifically includes the following steps:
in step 310, a proximity value of the proximity sensor is obtained.
Step 320, determining whether the proximity value is zero, if yes, executing step 340, and if no, executing step 330.
And step 330, superposing the set numerical value on the approach value of the current moment to obtain the judgment threshold value of the next moment.
And when the proximity value is not zero, the mobile terminal determines that the proximity sensor is in a normal state. And determining the judgment threshold value of the next moment by adopting a mode of superposing the set numerical value on the approach value at the current moment, and turning to execute the step 360.
And 340, determining that the proximity sensor is in an abnormal state, and recording that the environment where the proximity sensor is located is a strong light interference environment or a static experiment environment.
When the proximity value is zero, the mobile terminal determines that the proximity sensor is in an abnormal state. The environmental flag for marking the environment is modified to a value corresponding to a strong light interference environment or an electrostatic experiment environment. For example, when the proximity sensor is in a strong light interference environment, the environmental flag may be preset to take a value of 1; when the proximity sensor is in the static experiment environment, the value of the environment mark is preset to be 2; and when the proximity sensor is in a normal state, the value of the environmental label is 0.
And step 350, taking the preset highlight threshold as a judgment threshold at the next moment of the abnormal state moment.
And when the mobile terminal determines that the proximity sensor is in an abnormal state, acquiring a preset highlight threshold value. And taking the highlight threshold as a judgment threshold at the next moment of the abnormal state moment. Wherein, the highlight threshold is larger than the normal threshold of the proximity sensor in the normal state.
And step 360, obtaining the current time judgment threshold value determined according to the last time approach value.
The mobile terminal obtains a current time judgment threshold value, wherein the current time judgment threshold value is determined by an approaching value at the previous time. When the last time approach value is zero, judging that the threshold value is a set highlight threshold value at the current time; and when the approach value at the previous moment is not zero, determining that the threshold value at the current moment is a superposition result of the approach value at the previous moment and the set data.
And 370, comparing the current time approaching value with the current time judging threshold value, and determining that the current shelter is in an approaching state or a departing state according to the comparison result.
Illustratively, the mobile terminal compares the current time proximity value with a current time decision threshold value. The current time threshold value comprises a close threshold value and a far threshold value. And when the approach value at the current moment is larger than the approach threshold value, determining that the current obstruction is in the approach state. And when the approach value at the current moment is smaller than the far threshold value, determining that the current obstruction is in a far state. And when the approach value at the current moment is between the approach threshold value and the departure threshold value, determining that the current obstruction keeps the same approach/departure state as the previous moment.
According to the technical scheme of the embodiment, the approach value of the approach sensor is obtained; judging whether the proximity sensor is in an abnormal state or not according to the proximity value; when the proximity sensor is in an abnormal state, taking a preset highlight threshold value as a judgment threshold value of the next time of the abnormal state time, and determining the proximity state or the far state of the shielding object at the next time according to the judgment threshold value; and acquiring a current time judgment threshold value determined according to the previous time approach value, and determining that the current obstruction is in an approach state or a far state according to the current time judgment threshold value. The method and the device solve the problem that judgment of the approaching state or the far state is disordered due to the abnormity of the approaching sensor in the current severe environment, avoid the condition that the judgment threshold value is wrong at the next moment due to the zeroing of the approaching value, improve the judgment accuracy of the approaching state or the far state in the severe environment, and reduce the probability that the approaching state or the far state is disordered.
Example four
Fig. 4 is a schematic structural diagram of a proximity sensor-based control device in a fourth embodiment of the present invention. As shown in fig. 4, the apparatus of the present embodiment includes: a proximity value acquisition module 410, a state judgment module 420 and a threshold value determination module 430.
A proximity value acquisition module 410 for acquiring a proximity value of the proximity sensor;
a state judgment module 420, configured to judge whether the proximity sensor is in an abnormal state according to the proximity value;
the threshold value determining module 430 is configured to, when the proximity sensor is in an abnormal state, use a preset highlight threshold value as a determination threshold value at a next time of the abnormal state time, so as to determine a close state or a distant state of the obstruction at the next time according to the determination threshold value, where the preset highlight threshold value is greater than a normal threshold value of the proximity sensor in a normal state.
In the technical scheme of the embodiment, the approach value of the approach sensor is acquired by the approach value acquisition module 410; the passing state judgment module 420 judges whether the proximity sensor is in an abnormal state according to the proximity value; when the proximity sensor is in the abnormal state, the threshold value determining module 430 uses the preset highlight threshold value as a determination threshold value of the next time of the abnormal state time, so as to determine the proximity state or the distant state of the shielding object at the next time according to the determination threshold value, wherein the preset highlight threshold value is greater than the normal threshold value of the proximity sensor in the normal state. The problem that the judgment of the approaching state or the far-away state is disordered due to the fact that the approaching sensor is abnormal in the severe environment at present is solved, the situation that the judgment threshold value of the approaching sensor is wrong at the next moment due to the fact that the approaching value returns to zero in the strong light environment or the static experiment is avoided, the judgment accuracy of the approaching state or the far-away state in the severe environment is improved, and the probability that the approaching state or the far-away state is disordered is reduced.
On the basis of the technical scheme, the device further comprises:
the state recovery module is used for judging whether the proximity sensor recovers the normal state or not according to the proximity value at each moment after the abnormal state moment after a preset highlight threshold value is used as a judgment threshold value at the next moment of the abnormal state moment when the proximity sensor is in the abnormal state;
and the proximity value superposition module is used for superposing the proximity value at the moment when the proximity sensor recovers to the normal state and a set numerical value to obtain the judgment threshold value at the next moment when the proximity sensor recovers to the normal state.
On the basis of the above technical solution, the state recovery module is specifically configured to:
comparing the approach value of each time after the abnormal state time with zero;
and when the approach value is not zero, determining that the approach sensor is recovered to a normal state.
On the basis of the foregoing technical solution, the state determining module 420 is specifically configured to:
comparing the proximity value to zero;
if the approach value is zero, determining that the approach sensor is in an abnormal state, and recording that the environment where the approach sensor is located is a strong light interference environment or an electrostatic experiment environment;
and if the approach value is not zero, determining that the approach sensor is in a normal state.
On the basis of the technical scheme, the device further comprises:
and the highlight threshold determination module is used for determining the preset highlight threshold according to the full scale of the proximity sensor when factory setting is carried out, wherein the highlight threshold comprises a proximity threshold and a far threshold.
The control device based on the proximity sensor can execute the control method based on the proximity sensor provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
In a fifth embodiment of the present invention, a mobile terminal is provided, where the mobile terminal integrates the control device based on the proximity sensor as described in the above embodiments. The mobile terminal in this embodiment may be specifically a terminal with an infrared proximity sensor, such as a mobile phone, a tablet computer, a game machine, and a personal digital assistant, and is preferably a smart phone.
Fig. 5 is a schematic structural diagram of a mobile terminal according to a fifth embodiment of the present invention. As shown in fig. 5, the mobile terminal 500 may include: memory 501, a Central Processing Unit (CPU) 502, a peripheral interface 503, RF (Radio Frequency) circuitry 505, audio circuitry 506, speakers 511, a power management chip 508, an input/output (I/O) subsystem 509, a touch screen 512, other input/control devices 510, and an external port 504, which communicate via one or more communication buses or signal lines 507.
It should be understood that the illustrated mobile terminal 500 is merely one example of a mobile terminal and that the mobile terminal 500 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail the mobile terminal 500 provided in the present embodiment and having the proximity sensor based control apparatus according to the above-described embodiment, which is exemplified by a mobile phone.
A memory 501, the memory 501 being accessible by the CPU502, the peripheral interface 503, and the like, the memory 501 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices. User data, system key data, and the like are stored in the memory 501.
A peripheral interface 503, the peripheral interface 503 may connect input and output peripherals of the device to the CPU502 and the memory 501.
An I/O subsystem 509, which I/O subsystem 509 may connect input and output peripherals on the device, such as a touch screen 512 and other input/control devices 510, to the peripheral interface 503. The I/O subsystem 509 may include a display controller 5091 and one or more input controllers 5092 for controlling other input/control devices 510. Where one or more input controllers 5092 receive electrical signals from or send electrical signals to other input/control devices 510, the other input/control devices 510 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels, infrared proximity sensors. It is noted that the input controller 5092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 512, which is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 5091 in the I/O subsystem 509 receives electrical signals from the touch screen 512 or transmits electrical signals to the touch screen 512. The touch screen 512 detects a contact on the touch screen, and the display controller 5091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 512, that is, to implement a human-computer interaction, where the user interface object displayed on the touch screen 512 may be a message prompt, an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 505 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, the RF circuitry 505 receives and transmits RF signals, also referred to as electromagnetic signals, through which the RF circuitry 505 converts electrical signals to or from electromagnetic signals and communicates with communication networks and other devices. The RF circuitry 505 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 506 is mainly used to receive audio data from the peripheral interface 503, convert the audio data into an electric signal, and transmit the electric signal to the speaker 511.
The speaker 511 is used for restoring the voice signal received by the handset from the wireless network through the RF circuit 505 to sound and playing the sound to the user.
And a power management chip 508 for supplying power to the CPU502, the I/O subsystem 509, and the hardware connected to the peripheral interfaces and performing power management.
The CPU502 provided in the embodiment of the present invention can perform the following operations:
acquiring a proximity value of a proximity sensor;
judging whether the proximity sensor is in an abnormal state or not according to the proximity value;
and when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold at the next moment of the abnormal state moment, and determining the approaching state or the far state of the shielding object at the next moment according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state.
And when the approach value of the approach sensor is detected to be zero, taking a preset highlight threshold value as a judgment threshold value of the next time of the abnormal state time, and determining the approach state or the far state of the shielding object at the next time according to the judgment threshold value. The method solves the problem that the judgment of the approaching state or the far state is disordered due to the abnormity of the approaching sensor in the current severe environment, avoids the occurrence of the condition that the judgment threshold value is wrong at the next moment due to the zeroing of the approaching value, improves the judgment accuracy of the approaching state or the far state in the severe environment, and reduces the probability that the approaching state or the far state is disordered.
The mobile terminal can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (7)

1. A proximity sensor based control method, comprising:
acquiring a proximity value of a proximity sensor;
judging whether the proximity sensor is in an abnormal state or not according to the proximity value;
when the proximity sensor is in an abnormal state, taking a preset highlight threshold as a judgment threshold of the next time of the abnormal state time, and determining the approaching state or the far state of the shielding object at the next time according to the judgment threshold, wherein the preset highlight threshold is larger than the normal threshold of the proximity sensor in the normal state;
obtaining a current time judgment threshold value determined according to a previous time approach value, comparing the approach value with the current time judgment threshold value, and determining whether the current shelter is in an approach state or a far state according to a comparison result;
when the proximity sensor is in an abnormal state, after the preset highlight threshold is used as the determination threshold at the next time of the abnormal state, the method further comprises the following steps:
judging whether the proximity sensor recovers to a normal state or not according to the proximity value at each moment after the abnormal state moment;
when the proximity sensor returns to the normal state, the proximity value at the moment of returning to the normal state is superposed with a set numerical value to obtain a judgment threshold value at the next moment of returning to the normal state of the proximity sensor;
the judging whether the proximity sensor is in an abnormal state according to the proximity value comprises the following steps:
comparing the proximity value to zero;
if the approach value is zero, determining that the approach sensor is in an abnormal state, recording that the environment where the approach sensor is located is a strong light interference environment or an electrostatic experiment environment, and modifying an environment mark for marking the environment to a value corresponding to the strong light interference environment or the electrostatic experiment environment;
and if the approach value is not zero, determining that the approach sensor is in a normal state.
2. The method of claim 1, wherein determining whether the proximity sensor is restored to a normal state based on the proximity value at each time after the time of the abnormal state comprises:
comparing the approach value of each time after the abnormal state time with zero;
and when the approach value is not zero, determining that the approach sensor is recovered to a normal state.
3. The method of claim 1, further comprising:
and when factory setting is carried out, determining the preset highlight threshold value according to the full scale of the proximity sensor, wherein the highlight threshold value comprises a proximity threshold value and a far threshold value.
4. A proximity sensor based control apparatus, comprising:
the proximity value acquisition module is used for acquiring a proximity value of the proximity sensor;
the state judgment module is used for judging whether the proximity sensor is in an abnormal state or not according to the proximity value;
the threshold value determining module is used for taking a preset highlight threshold value as a judgment threshold value of the next moment of the abnormal state moment when the proximity sensor is in the abnormal state, so as to determine the approaching state or the far state of the shielding object at the next moment according to the judgment threshold value, wherein the preset highlight threshold value is larger than the normal threshold value of the proximity sensor in the normal state;
the state determining module is used for acquiring a current moment judgment threshold value determined according to the approach value at the previous moment, comparing the approach value with the current moment judgment threshold value, and determining that the current shelter is in an approach state or a far state according to a comparison result;
the proximity sensor-based control device further includes:
the state recovery module is used for judging whether the proximity sensor recovers the normal state or not according to the proximity value at each moment after the abnormal state moment after a preset highlight threshold value is used as a judgment threshold value at the next moment of the abnormal state moment when the proximity sensor is in the abnormal state;
the proximity value superposition module is used for superposing the proximity value at the moment of recovering to the normal state with a set numerical value when the proximity sensor recovers to the normal state to obtain a judgment threshold value at the next moment of recovering to the normal state;
the state judgment module is specifically configured to:
comparing the proximity value to zero;
if the approach value is zero, determining that the approach sensor is in an abnormal state, recording that the environment where the approach sensor is located is a strong light interference environment or an electrostatic experiment environment, and modifying an environment mark for marking the environment to a value corresponding to the strong light interference environment or the electrostatic experiment environment;
and if the approach value is not zero, determining that the approach sensor is in a normal state.
5. The apparatus of claim 4, wherein the state recovery module is specifically configured to:
comparing the approach value of each time after the abnormal state time with zero;
and when the approach value is not zero, determining that the approach sensor is recovered to a normal state.
6. The apparatus of claim 4, further comprising:
and the highlight threshold determination module is used for determining the preset highlight threshold according to the full scale of the proximity sensor when factory setting is carried out, wherein the highlight threshold comprises a proximity threshold and a far threshold.
7. A mobile terminal characterized in that it integrates a proximity sensor based control device according to any of claims 4 to 6.
CN201611034458.4A 2016-11-08 2016-11-08 Control method and device based on proximity sensor and mobile terminal Expired - Fee Related CN106502819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611034458.4A CN106502819B (en) 2016-11-08 2016-11-08 Control method and device based on proximity sensor and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611034458.4A CN106502819B (en) 2016-11-08 2016-11-08 Control method and device based on proximity sensor and mobile terminal

Publications (2)

Publication Number Publication Date
CN106502819A CN106502819A (en) 2017-03-15
CN106502819B true CN106502819B (en) 2020-01-14

Family

ID=58327679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611034458.4A Expired - Fee Related CN106502819B (en) 2016-11-08 2016-11-08 Control method and device based on proximity sensor and mobile terminal

Country Status (1)

Country Link
CN (1) CN106502819B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107517314B (en) * 2017-08-24 2020-05-08 Oppo广东移动通信有限公司 Mobile terminal, control method, control device, and storage medium
CN109547629A (en) * 2018-11-07 2019-03-29 华为技术有限公司 A kind of control method and electronic equipment close to optical sensor
CN111327760B (en) * 2020-01-17 2021-06-18 珠海格力电器股份有限公司 Control method and device for false touch prevention mode, mobile terminal and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411425A (en) * 2011-07-22 2012-04-11 华为终端有限公司 Method and device for controlling function of touch screen
CN102833419A (en) * 2012-08-31 2012-12-19 华为终端有限公司 Method and terminal for controlling screen state
CN103837910A (en) * 2014-03-20 2014-06-04 深圳市金立通信设备有限公司 Method for determining threshold value of proximity sensor and terminal
CN104683598A (en) * 2015-03-25 2015-06-03 深圳市欧珀通信软件有限公司 Proximity sensor threshold adjusting method and device and intelligent device
CN105025159A (en) * 2015-06-05 2015-11-04 广东欧珀移动通信有限公司 A proximity sensor adjusting method and apparatus
CN105718025A (en) * 2016-01-15 2016-06-29 广东欧珀移动通信有限公司 Method and device for controlling infrared proximity sensor
CN105939427A (en) * 2016-07-06 2016-09-14 广东欧珀移动通信有限公司 Control method of infrared proximity sensor, device and mobile terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8030914B2 (en) * 2008-12-29 2011-10-04 Motorola Mobility, Inc. Portable electronic device having self-calibrating proximity sensors
CN105959492B (en) * 2016-07-06 2019-05-28 Oppo广东移动通信有限公司 A kind of control method of infrared proximity transducer, device and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411425A (en) * 2011-07-22 2012-04-11 华为终端有限公司 Method and device for controlling function of touch screen
CN102833419A (en) * 2012-08-31 2012-12-19 华为终端有限公司 Method and terminal for controlling screen state
CN103837910A (en) * 2014-03-20 2014-06-04 深圳市金立通信设备有限公司 Method for determining threshold value of proximity sensor and terminal
CN104683598A (en) * 2015-03-25 2015-06-03 深圳市欧珀通信软件有限公司 Proximity sensor threshold adjusting method and device and intelligent device
CN105025159A (en) * 2015-06-05 2015-11-04 广东欧珀移动通信有限公司 A proximity sensor adjusting method and apparatus
CN105718025A (en) * 2016-01-15 2016-06-29 广东欧珀移动通信有限公司 Method and device for controlling infrared proximity sensor
CN105939427A (en) * 2016-07-06 2016-09-14 广东欧珀移动通信有限公司 Control method of infrared proximity sensor, device and mobile terminal

Also Published As

Publication number Publication date
CN106502819A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
US10884550B2 (en) Method, mobile terminal and non-transitory computer-readable storage medium for response control of touch screen
CN106775087B (en) Touch screen control method and device of mobile terminal and mobile terminal
CN107294522B (en) Response method and device based on touch key, storage medium and electronic equipment
CN106681635B (en) Split screen false touch prevention method and device and mobile terminal
EP3336679B1 (en) Method and terminal for preventing unintentional triggering of a touch key and storage medium
CN107340910B (en) Touch key response method and device, storage medium and electronic equipment
CN107390931B (en) Response control method and device for touch operation, storage medium and mobile terminal
CN107527048B (en) Fingerprint identification method and device, storage medium and mobile terminal
CN106502819B (en) Control method and device based on proximity sensor and mobile terminal
CN108024128B (en) Control method and device for Bluetooth music playing, terminal equipment and storage medium
AU2013309715B2 (en) Apparatus and method for processing input on touch screen
EP3633880B1 (en) Radio frequency interference processing method and electronic device
CN107105090B (en) A kind of control method, device and the mobile terminal of suspension button
CN107357458B (en) Touch key response method and device, storage medium and mobile terminal
CN107291302B (en) Control method and device of touch screen, storage medium and terminal
KR20210002822A (en) Electronic device for performing ranging and method thereof
CN108076223B (en) Task switching method and device, terminal equipment and storage medium
CN106603870B (en) Control method and device of playing equipment, playing equipment and mobile terminal
CN106713572B (en) Data reporting control method, device and terminal
CN112929492B (en) Control method, control device, storage medium and mobile terminal
CN106708332B (en) threshold setting method and device of proximity sensor and terminal
CN109186657B (en) Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN106571878B (en) Method and device for detecting radio frequency fault
CN106686222A (en) Ambient light sensor control method, ambient light sensor control device and terminal
CN106776092B (en) State detection method and device of proximity sensor and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200114

CF01 Termination of patent right due to non-payment of annual fee