CN106776092B - State detection method and device of proximity sensor and terminal - Google Patents

State detection method and device of proximity sensor and terminal Download PDF

Info

Publication number
CN106776092B
CN106776092B CN201611108535.6A CN201611108535A CN106776092B CN 106776092 B CN106776092 B CN 106776092B CN 201611108535 A CN201611108535 A CN 201611108535A CN 106776092 B CN106776092 B CN 106776092B
Authority
CN
China
Prior art keywords
proximity
proximity sensor
state
sensor
interrupt
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
CN201611108535.6A
Other languages
Chinese (zh)
Other versions
CN106776092A (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 CN201611108535.6A priority Critical patent/CN106776092B/en
Publication of CN106776092A publication Critical patent/CN106776092A/en
Application granted granted Critical
Publication of CN106776092B publication Critical patent/CN106776092B/en
Active 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/0706Error 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 the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error 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 the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a method, a device and a terminal for detecting the state of a proximity sensor, and relates to the technical field of terminals, wherein the method comprises the following steps: detecting whether a proximity sensor reports the state of the proximity sensor; when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not; determining a state of the proximity sensor according to the proximity interruption detection result; wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession. According to the embodiment of the invention, the state of the proximity sensor can be accurately detected when the proximity sensor is interfered, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.

Description

State detection method and device of proximity sensor and terminal
Technical Field
The invention relates to the technical field of terminals, in particular to a method and a device for detecting the state of a proximity sensor and a terminal.
Background
At present, the proximity sensor, as a standard configuration of the terminal, plays an important role in implementing functions such as turning on or off a screen, and automatically adjusting a backlight.
The proximity sensor provided in the terminal is typically 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 shield and the 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 shield and the received infrared light.
To facilitate the determination of the proximity or the distance of the obstruction based on the proximity value, a proximity threshold and a distance threshold are typically set, the proximity threshold being greater than or equal to the distance threshold. And when the approach value is larger than the approach threshold value, the approach sensor generates an approach interruption and controls the screen to be extinguished. When the approach value is smaller than the approach threshold value, the approach sensor generates an approach interrupt, and the control screen is lighted.
However, in the process of implementing the invention, the inventor finds that the prior art has the following defects: when the proximity sensor is subjected to interference of radio frequency or the like, the proximity value becomes large. If the approach value is greater than the approach threshold, an approach interruption occurs, and the state of the proximity sensor cannot be accurately detected, resulting in an inability to accurately control the screen.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a terminal for detecting a state of a proximity sensor, which can accurately detect the state of the proximity sensor and avoid abnormal states of the proximity sensor caused by interference.
In a first aspect, an embodiment of the present invention provides a method for detecting a state of a proximity sensor, including:
detecting whether a proximity sensor reports the state of the proximity sensor;
when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not;
determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
In a second aspect, an embodiment of the present invention further provides a state detection apparatus for a proximity sensor, including: :
the first detection module is used for detecting whether the proximity sensor reports the state of the proximity sensor;
the second detection module is used for detecting whether the proximity sensor generates proximity interruption or not when the proximity sensor is detected not to report the state;
a proximity sensor state determination module for determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
In a third aspect, an embodiment of the present invention provides a terminal, including: a processor and a memory;
the memory for storing executable program code;
the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing:
detecting whether a proximity sensor reports the state of the proximity sensor;
when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not;
determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
According to the technical scheme provided by the embodiment of the invention, when the proximity sensor is detected not to report the state, whether the proximity sensor generates the proximity interruption or not is detected based on the proximity value acquired continuously for multiple times, so that the state of the proximity sensor is determined. When the proximity sensor is interfered, the state of the proximity sensor can be accurately detected, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a flowchart of a method for detecting a state of a proximity sensor according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for detecting a state of a proximity sensor according to another embodiment of the present invention;
FIG. 3 is a flow chart of a method for detecting a state of a proximity sensor according to another embodiment of the present invention;
FIG. 4 is a flow chart of a method for detecting a state of a proximity sensor according to another embodiment of the present invention;
fig. 5 is a block diagram of a state detection device of a proximity sensor according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an 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 but not all of the relevant aspects of the present invention are shown in the drawings.
Fig. 1 is a flowchart of a method for detecting a state of a proximity sensor, which is performed by a state detecting apparatus of the proximity sensor, where the apparatus is implemented by software and/or hardware according to an embodiment of the present invention; the device is configured in a terminal such as a mobile phone. In this embodiment, when the terminal is a mobile phone, optionally, the method may be applied to a call scenario and may also be applied to other scenarios.
As shown in fig. 1, the technical solution provided in this embodiment is as follows:
s110: detecting whether a proximity sensor reports a state of the proximity sensor.
In the present embodiment, the proximity sensor is capable of detecting a distance between the obstacle and the terminal, determining a proximity value of the current proximity sensor from the distance, and determining whether the proximity sensor is in a proximity state or a distant state from the proximity value. Wherein the state of the proximity sensor includes a proximity state and a distant state.
In this embodiment, whether the proximity sensor reports the state of the proximity sensor is determined by whether the processor receives the state information sent by the proximity sensor. Specifically, if the processor receives the state information sent by the proximity sensor, the reporting state is judged, and if the processor does not receive the state information sent by the proximity sensor, the reporting state is not judged. The state information includes a far state or a near state, and the like. And the detection method of whether the proximity sensor reports the status is not limited to the above method.
S120: and when detecting that the proximity sensor does not report the state, detecting whether the proximity sensor generates proximity interruption or not.
In the present embodiment, the proximity interruption is triggered by the proximity sensor based on the proximity values acquired a plurality of times in succession. Illustratively, the proximity interrupt is triggered to be generated by the proximity sensor based on proximity values acquired a plurality of times in succession, including: the proximity sensor generates a proximity interrupt when the proximity values acquired a plurality of consecutive times are each greater than a proximity threshold value. The approximate value may be obtained twice, three times, or other times. And other ways of triggering generation of the proximity interrupt are possible.
When the proximity sensor is interfered, the proximity value becomes large (e.g., easily interfered by radio frequency during a call). When the approach value is larger than the approach threshold value, approach interruption is generated, and the screen of the terminal is controlled to be extinguished, so that the problem of inaccurate control of on-off of the screen is caused. Therefore, the proximity sensor needs to acquire the proximity value a plurality of times in succession. Therefore, whether the approach interruption is generated or not is judged through the obtained approach values for multiple times, the state of the approach sensor subjected to interference can be accurately judged, and the phenomenon of inaccurate screen control caused by the abnormal state after the interference is avoided.
When the proximity sensor receives an enable signal sent by an upper system, the state of the proximity sensor, namely the far state and the near state, needs to be reported. Otherwise, the upper system defaults the state of the proximity sensor to the last state, which causes the problem of inaccurate screen control. If the proximity sensor does not report the state of the proximity sensor after receiving the enabling signal, the processor actively reads the current acquired proximity value of the proximity sensor, compares the proximity value with the proximity threshold value to obtain the state of the current proximity sensor, and reports the state of the proximity sensor to an upper system. The upper system may be a terminal system, or may be a processor configured with the upper system.
However, when the processor actively acquires the current proximity value of the proximity sensor, the processor may acquire the proximity value of the proximity sensor after being interfered, which may cause a wrong state determination of the proximity sensor, resulting in inaccurate screen control. Therefore, when the proximity sensor is detected not to report the state, whether the proximity sensor generates the proximity interruption or not is detected, and the situation that the state judgment of the proximity sensor is wrong due to the interfered proximity value is avoided. The processor may be a processor for managing sensors in the terminal, or may be another processor.
S130: determining a state of the proximity sensor according to the proximity interruption detection result.
In this embodiment, for example, the determining the state of the proximity sensor according to the proximity interruption detection result includes: determining that the proximity sensor is in a proximity state when it is detected that the proximity sensor generates a proximity interrupt; determining that the proximity sensor is in a distant state when it is detected that the proximity sensor does not generate a proximity interrupt.
In the method for detecting a state of a proximity sensor provided in this embodiment, when it is detected that the proximity sensor does not report a state, whether the proximity sensor triggers generation of a proximity interrupt based on proximity values obtained continuously for multiple times is detected, so as to determine the state of the proximity sensor. When the proximity sensor is interfered, the state of the proximity sensor can be accurately detected, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.
Fig. 2 is a flowchart of a method for detecting a state of a proximity sensor according to another embodiment of the present invention, and as shown in fig. 2, after detecting that the proximity sensor does not report the state, the following operations are further performed:
actively forgoing reading the proximity value acquired by the proximity sensor.
Therefore, when the proximity sensor is detected not to report, the phenomenon that the state judgment of the proximity sensor is wrong due to the interfered proximity value is avoided by actively giving up reading the proximity value of the proximity sensor.
Further, before the detecting whether the proximity sensor reports the state of the proximity sensor, the following operations are also performed:
modifying a parameter of the proximity sensor that determines a number of proximity value acquisitions such that the proximity sensor acquires a proximity value a plurality of times.
Thus, by modifying the parameters of the proximity sensor so that the proximity sensor acquires the proximity value a plurality of times in succession, it is possible to prevent erroneous determination of the state of the proximity sensor.
Further, the method further comprises the following steps:
and reporting the state of the proximity sensor to an upper system so that the upper system controls a screen of the terminal based on the state.
The state of the proximity sensor is reported to the uploading system to control the screen, so that the screen can be automatically controlled.
As shown in fig. 2, the technical solution provided in this embodiment is as follows:
s210: the parameters of the proximity sensor for determining the number of times of proximity value acquisition are modified so that the proximity sensor acquires the proximity value a plurality of times in succession.
In the present embodiment, the parameter for determining the number of times of proximity value acquisition includes a persistence parameter of the proximity sensor. The persistence parameter of the proximity sensor is 1 as an original value, and the persistence parameter of the proximity sensor may be modified to 2, that is, the proximity sensor acquires the proximity value twice in succession. Or the persistence parameter of the proximity sensor can be modified to other values, so that the proximity sensor can acquire the proximity value for multiple times continuously as required.
In the present embodiment, the operation of modifying the parameter of the proximity sensor for determining the number of times of proximity value acquisition may be performed by the processor, may also be performed by the proximity sensor, or may also be performed by other devices within the terminal.
S220: detecting whether a proximity sensor reports a state of the proximity sensor.
S230: and actively giving up reading the proximity value acquired by the proximity sensor when the proximity sensor is detected not to report the state.
In this embodiment, the reading of the proximity value acquired by the proximity sensor is actively abandoned, that is, the proximity value acquired by the proximity sensor is not actively acquired. Therefore, when the processor detects that the proximity sensor does not report the state, the processor does not actively acquire the proximity value acquired by the proximity sensor and does not determine the state of the proximity sensor by comparing the acquired proximity value with the proximity threshold value, so that the situation of state misjudgment caused by abnormal proximity value after the proximity sensor is interfered is avoided.
S240: detecting whether the proximity sensor generates a proximity interrupt.
Wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
S250: determining a state of the proximity sensor according to the proximity interruption detection result.
S260: and reporting the state of the proximity sensor to an upper system so that the upper system controls a screen of the terminal based on the state.
In this embodiment, the upper system may be a terminal system, and the upper system may be configured in an upper processor.
In this embodiment, for example, the controlling, by the upper system, the screen of the terminal based on the state includes: when the state of the proximity sensor is in a proximity state, the screen of the control terminal is turned off; when the state of the proximity sensor is a distant state, the screen of the control terminal is lit.
In the present embodiment, the state detection of the proximity sensor of the present embodiment is exemplified, and for example, the proximity threshold is set to 200. At the current position, the state of the proximity sensor is judged through the proximity values acquired by the proximity sensor twice, if the proximity value acquired for the first time is 180, when the proximity value is acquired for the second time, the interference is caused, and the acquired proximity value is 240. In the prior art, when the proximity sensor does not report a state to the processor, if the proximity value actively read by the processor is 240, it is determined that the proximity sensor is in a proximity state, and the screen is controlled to be turned off. Since the proximity value actively read by the processor is a value after the proximity sensor is disturbed, the proximity value actively read by the processor is an abnormal value, and the state of the proximity sensor cannot be accurately determined (the state of the proximity sensor is actually a distant state).
In the embodiment of the invention, when the proximity sensor does not report the state to the processor, the processor does not actively read the proximity value acquired by the proximity sensor, but detects whether the proximity sensor generates the proximity interrupt. For the detection of the generation of the proximity interruption, the judgment is made by the proximity sensor by comparing the acquired proximity value twice with the proximity threshold value, that is, the proximity interruption is generated when both the proximity values (180 and 240) acquired by the proximity sensor are greater than the proximity threshold value (200). Therefore, when the proximity sensor acquires the proximity values of 180 and 240, respectively, through two times at the current position, the proximity interrupt is not generated. The processor detects that the proximity sensor does not generate a proximity interrupt, determines that the proximity sensor is in a far state (the same as the actual state of the proximity sensor at the current position), and controls the screen to be lightened so as to realize accurate control of the screen.
It should be noted that, in the present embodiment, the state detection method of the proximity sensor is performed by exemplarily combining S210-S260 as one example, but is only one example of the present invention, and in other embodiments of the present invention, S210 may also be combined with S110-S130 as one example to perform the state detection method of the proximity sensor, or S260 may also be combined with S110-S130 as one example to perform the state detection method of the proximity sensor, or S210-S250 may be combined with one example to perform the state detection method of the proximity sensor, or S220-S260 may also be combined with one example to perform the state detection method of the proximity sensor.
In the embodiment, when the proximity sensor is detected not to report, the phenomenon that the state judgment of the proximity sensor is wrong due to the interfered proximity value is avoided by actively giving up reading the proximity value of the proximity sensor; the parameters of the proximity sensor are modified to enable the proximity sensor to continuously acquire the proximity value for multiple times, so that the state of the proximity sensor can be prevented from being judged wrongly; the state of the proximity sensor is reported to the uploading system to control the screen, so that the screen can be automatically controlled.
Fig. 3 is a flowchart of a method for detecting a state of a proximity sensor according to another embodiment of the present invention, where, optionally, the operation of modifying a parameter of the proximity sensor for determining the number of times of obtaining a proximity value is performed by a processor. As shown in fig. 3, the technical solution provided in this embodiment is as follows:
s310: the processor modifies a parameter of the proximity sensor that is used to determine the number of proximity value acquisitions.
S320: the processor sends an instruction to the proximity sensor to control the proximity sensor to acquire the proximity value a plurality of times in succession.
S330: the proximity sensor acquires proximity values a plurality of times in succession according to the received instruction, and determines whether to generate a proximity interrupt based on the proximity values acquired a plurality of times in succession.
S340: the processor detects whether the proximity sensor reports the state of the proximity sensor.
S350: and when the processor detects that the proximity sensor does not report the state, actively abandoning to read the proximity value acquired by the proximity sensor.
S360: the processor sends a detection instruction to the proximity sensor to detect whether the interrupt occurs.
S370: the proximity sensor receives a detection instruction.
S380: the proximity sensor sends information to the processor whether a proximity interrupt is triggered.
S390: a processor detects whether the proximity sensor generates a proximity interrupt based on the received information.
S391: the processor determines a state of the proximity sensor according to the proximity interruption detection result.
S392: and the processor reports the state of the proximity sensor to an upper-layer system.
S393: and the upper system controls the screen of the terminal based on the state.
It should be noted that the method for detecting the state of the proximity sensor shown in fig. 3 is merely an example, and the order of the steps in the method shown in fig. 3 may be changed to achieve the purpose of detecting the state of the proximity sensor.
In this embodiment, when it is detected that the proximity sensor does not report a state, it is detected whether the proximity sensor triggers generation of a proximity interrupt based on proximity values acquired continuously for multiple times, so as to determine the state of the proximity sensor. When the proximity sensor is interfered, the state of the proximity sensor can be accurately detected, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.
Fig. 4 is a flowchart of a state detection method of a proximity sensor according to another embodiment of the present invention, as shown in fig. 4, optionally, an operation of modifying a parameter of the proximity sensor for determining a proximity value acquisition time is performed by the proximity sensor, and the technical solution provided in this embodiment is as follows:
s410: the proximity sensor modifies a parameter for determining the number of times the proximity value is acquired.
S420: the proximity sensor acquires proximity values a plurality of times in succession, and determines whether to trigger generation of a proximity interrupt based on the proximity values acquired a plurality of times in succession.
S430: the processor detects whether the proximity sensor reports the state of the proximity sensor.
S440, when the processor detects that the proximity sensor does not report the status, actively abandoning reading the proximity value acquired by the proximity sensor.
S450: the processor sends a detection instruction to the proximity sensor to detect whether the interrupt occurs.
S460: the proximity sensor receives a detection instruction.
S470: the proximity sensor sends information to the processor whether a trigger interrupt has occurred.
S480: a processor detects whether the proximity sensor generates a proximity interrupt based on the received information.
S490: the processor determines a state of the proximity sensor according to the proximity interruption detection result.
S491: and the processor reports the state of the proximity sensor to an upper-layer system.
S492: and the upper system controls the screen of the terminal based on the state.
In this embodiment, when it is detected that the proximity sensor does not report a state, it is detected whether the proximity sensor triggers generation of a proximity interrupt based on proximity values acquired continuously for multiple times, so as to determine the state of the proximity sensor. When the proximity sensor is interfered, the state of the proximity sensor can be accurately detected, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.
Fig. 5 is a block diagram of a control apparatus of a terminal screen according to an embodiment of the present invention, where the apparatus is configured to execute a control method of the terminal screen, and as shown in fig. 5, the apparatus includes: a first detection module 510, a second detection module 520, and a proximity sensor status determination module 530.
The first detecting module 510 is configured to detect whether a proximity sensor reports a state of the proximity sensor;
a second detecting module 520, configured to detect whether the proximity sensor generates a proximity interrupt when detecting that the proximity sensor does not report the status;
a proximity sensor state determination module 530 for determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
Further, after the detecting that the proximity sensor does not report the status, the method further includes:
actively forgoing reading the proximity value acquired by the proximity sensor.
Further, the method further comprises:
and the control module 540 is configured to report the state of the proximity sensor to an upper system, so that the upper system controls a screen of the terminal based on the state of the sensor.
Further, the proximity sensor state determining module 530 is specifically configured to:
determining that the proximity sensor is in a proximity state when it is detected that the proximity sensor generates a proximity interrupt;
determining that the proximity sensor is in a distant state when it is detected that the proximity sensor does not generate a proximity interrupt.
Further, the apparatus further comprises:
a parameter modifying module 550, configured to modify a parameter of the proximity sensor, which is used to determine the number of times of obtaining the proximity value, before detecting whether the proximity sensor reports the state of the proximity sensor, so that the proximity sensor obtains the proximity value multiple times continuously.
Further, the proximity interrupt is triggered and generated by the proximity sensor based on proximity values acquired consecutively a plurality of times, including:
the proximity sensor generates a proximity interrupt when the proximity values acquired a plurality of consecutive times are each greater than a proximity threshold value.
The state detection device for the proximity sensor provided in this embodiment detects whether the proximity sensor triggers generation of a proximity interrupt based on proximity values obtained continuously for multiple times to determine the state of the proximity sensor when detecting that the proximity sensor does not report a state. When the proximity sensor is interfered, the state of the proximity sensor can be accurately detected, and the condition that the state of the proximity sensor is abnormal due to interference is avoided.
The embodiment of the invention provides a terminal, and the terminal can be integrated with the state detection device of the proximity sensor provided by the embodiment of the invention. Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in fig. 6, the terminal may include: a housing (not shown), a memory 601, a Central Processing Unit (CPU) 602 (also called a processor, hereinafter referred to as CPU), a circuit board (not shown), a touch panel 612, and a power circuit (not shown). The touch screen 612 is used for converting user operation into an electric signal, inputting the electric signal to the processor, and displaying a visual output signal; the circuit board is arranged in a space enclosed by the touch screen 612 and the shell; the CPU602 and the memory 601 are disposed on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 601 is used for storing executable program codes; the CPU602 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 601, to execute: detecting whether a proximity sensor reports the state of the proximity sensor; when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not; determining a state of the proximity sensor according to the proximity interruption detection result; wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession.
The terminal further comprises: peripheral interface 603, RF (Radio Frequency) circuitry 605, audio circuitry 606, speakers 611, power management chip 608, input/output (I/O) subsystem 609, other input/control devices 610, and external port 604, which communicate via one or more communication buses or signal lines 607.
It should be understood that the illustrated terminal 600 is merely one example of a terminal and that the terminal 600 may have more or fewer components than shown in the figures, 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 a terminal integrated with a state detection device of a proximity sensor, which is provided in this embodiment and takes a mobile phone as an example.
A memory 601, the memory 601 being accessible by the CPU602, the peripheral interface 603, and the like, the memory 601 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.
A peripheral interface 603, said peripheral interface 603 may connect input and output peripherals of the device to the CPU602 and the memory 601.
An I/O subsystem 609, the I/O subsystem 609 may connect input and output peripherals on the device, such as a touch screen 612 and other input/control devices 610, to the peripheral interface 603. The I/O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610. Where one or more input controllers 6092 receive electrical signals from or transmit electrical signals to other input/control devices 610, the other input/control devices 610 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 6092 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 612, which touch screen 612 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 6091 in the I/O subsystem 609 receives electrical signals from the touch screen 612 or transmits electrical signals to the touch screen 612. The touch screen 612 detects a contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 612, that is, to implement a human-computer interaction, where the user interface object displayed on the touch screen 612 may be 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 605 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, RF circuitry 605 receives and transmits RF signals, also referred to as electromagnetic signals, through which RF circuitry 605 converts electrical signals to or from electromagnetic signals and communicates with a communication network and other devices. RF circuitry 605 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 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electric signal, and transmit the electric signal to the speaker 611.
The speaker 611 is used to convert the voice signal received by the handset from the wireless network through the RF circuit 605 into sound and play the sound to the user.
And a power management chip 608 for supplying power and managing power to the hardware connected to the CPU602, the I/O subsystem, and the peripheral interface.
The terminal provided in this embodiment is used to execute the method for detecting the state of the proximity sensor described in the above embodiments, and the technical principle and the generated technical effect are similar, which are not described herein again.
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 (11)

1. A method of detecting a state of a proximity sensor, comprising:
detecting whether a proximity sensor reports the state of the proximity sensor;
when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not;
determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession;
wherein after the detecting that the proximity sensor is not reporting the status, further comprising:
actively forgoing reading the proximity value acquired by the proximity sensor.
2. The method of claim 1, further comprising:
and reporting the state of the proximity sensor to an upper system so that the upper system controls a screen of the terminal based on the state.
3. The method of claim 1, wherein said determining a state of said proximity sensor based on said proximity interruption detection comprises:
determining that the proximity sensor is in a proximity state when it is detected that the proximity sensor generates a proximity interrupt;
determining that the proximity sensor is in a distant state when it is detected that the proximity sensor does not generate a proximity interrupt.
4. The method of claim 1, further comprising, prior to said detecting whether a proximity sensor reports a status of the proximity sensor:
and modifying the parameters of the proximity sensor for determining the number of times of acquiring the proximity value so as to control the proximity sensor to acquire the proximity value for a plurality of times in succession.
5. The method of claim 1, wherein the proximity interrupt is triggered by the proximity sensor based on a plurality of consecutive acquired proximity values, comprising:
the proximity sensor generates a proximity interrupt when the proximity values acquired a plurality of consecutive times are each greater than a proximity threshold value.
6. A state detection device of a proximity sensor, comprising:
the first detection module is used for detecting whether the proximity sensor reports the state of the proximity sensor;
the second detection module is used for detecting whether the proximity sensor generates proximity interruption or not when the proximity sensor is detected not to report the state;
a proximity sensor state determination module for determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession;
wherein after the detecting that the proximity sensor is not reporting the status, further comprising:
actively forgoing reading the proximity value acquired by the proximity sensor.
7. The apparatus of claim 6, further comprising:
and the control module is used for reporting the state of the proximity sensor to an upper system so that the upper system controls a screen of the terminal based on the state of the sensor.
8. The apparatus of claim 6, wherein the proximity sensor state determination module is specifically configured to:
determining that the proximity sensor is in a proximity state when it is detected that the proximity sensor generates a proximity interrupt;
determining that the proximity sensor is in a distant state when it is detected that the proximity sensor does not generate a proximity interrupt.
9. The apparatus of claim 6, further comprising:
and the parameter modifying module is used for modifying the parameter of the proximity sensor for determining the acquisition times of the proximity value before detecting whether the proximity sensor reports the state of the proximity sensor or not, so that the proximity sensor continuously acquires the proximity value for multiple times.
10. The apparatus of claim 6, wherein the proximity interrupt is triggered by the proximity sensor based on a plurality of consecutive proximity values acquired, comprising:
the proximity sensor generates a proximity interrupt when the proximity values acquired a plurality of consecutive times are each greater than a proximity threshold value.
11. A terminal, comprising: a processor and a memory;
the memory for storing executable program code;
the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing:
detecting whether a proximity sensor reports the state of the proximity sensor;
when the proximity sensor is detected not to report the state, detecting whether the proximity sensor generates proximity interruption or not;
determining a state of the proximity sensor according to the proximity interruption detection result;
wherein the proximity interrupt is triggered by the proximity sensor based on proximity values acquired a plurality of times in succession;
wherein after the detecting that the proximity sensor is not reporting the status, further comprising:
actively forgoing reading the proximity value acquired by the proximity sensor.
CN201611108535.6A 2016-12-06 2016-12-06 State detection method and device of proximity sensor and terminal Active CN106776092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611108535.6A CN106776092B (en) 2016-12-06 2016-12-06 State detection method and device of proximity sensor and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611108535.6A CN106776092B (en) 2016-12-06 2016-12-06 State detection method and device of proximity sensor and terminal

Publications (2)

Publication Number Publication Date
CN106776092A CN106776092A (en) 2017-05-31
CN106776092B true CN106776092B (en) 2020-06-02

Family

ID=58879026

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611108535.6A Active CN106776092B (en) 2016-12-06 2016-12-06 State detection method and device of proximity sensor and terminal

Country Status (1)

Country Link
CN (1) CN106776092B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107817534B (en) * 2017-10-31 2020-05-12 深圳市元征科技股份有限公司 Data acquisition method and device of intelligent wearable device and intelligent wearable device
CN108829542B (en) * 2018-06-20 2022-03-29 Oppo广东移动通信有限公司 Mobile terminal, control method thereof and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8977974B2 (en) * 2008-12-08 2015-03-10 Apple Inc. Ambient noise based augmentation of media playback
CN101951444A (en) * 2010-09-29 2011-01-19 中兴通讯股份有限公司 Method for realizing screen locking and unlocking of mobile terminal and mobile terminal
CN103369142B (en) * 2013-07-09 2015-02-04 广东欧珀移动通信有限公司 Method and system for avoiding call-up malfunction
CN104994240B (en) * 2015-07-10 2018-04-06 Tcl移动通信科技(宁波)有限公司 A kind of proximity transducer power-saving control method and system based on mobile terminal
CN105224147A (en) * 2015-10-13 2016-01-06 Tcl移动通信科技(宁波)有限公司 A kind of mobile terminal proximity transducer that prevents is by the method and system of ambient light interference
CN205750722U (en) * 2016-04-25 2016-11-30 北京墨迹风云科技股份有限公司 A kind of gesture sensor-based system and device
CN105975090A (en) * 2016-06-21 2016-09-28 广东欧珀移动通信有限公司 Event-reporting control method and device for proximity sensor and mobile terminal

Also Published As

Publication number Publication date
CN106776092A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106855782B (en) A kind of method, apparatus and terminal for preventing from accidentally touching
US10884550B2 (en) Method, mobile terminal and non-transitory computer-readable storage medium for response control of touch screen
CN106681635B (en) Split screen false touch prevention method and device and mobile terminal
CN106775087B (en) Touch screen control method and device of mobile terminal and mobile terminal
US10466849B2 (en) Method and terminal for preventing unintentional triggering of a touch key and storage medium
CN106776385B (en) A kind of transmission method, device and the terminal of log log information
CN107942306B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment
US10657347B2 (en) Method for capturing fingerprint and associated products
CN107105090B (en) A kind of control method, device and the mobile terminal of suspension button
US11157334B2 (en) Control method and apparatus for broadcast sending, storage medium, and electronic device
CN109240551B (en) Method for controlling electronic device by using gestures and related product
US11012970B2 (en) Method for processing radio frequency interference and electronic device
KR102559651B1 (en) Electromagnetic interference control method and related products
CN106776092B (en) State detection method and device of proximity sensor and terminal
CN106708332B (en) threshold setting method and device of proximity sensor and terminal
CN106502819B (en) Control method and device based on proximity sensor and mobile terminal
US11048568B2 (en) Broadcast sending control method and apparatus, storage medium, and electronic device
CN108833033B (en) Method and device for determining radio frequency calibration parameters, storage medium and mobile terminal
CN106791108B (en) Threshold updating method and device of proximity sensor and terminal
CN110267142B (en) Mobile terminal and control method
CN106686222A (en) Ambient light sensor control method, ambient light sensor control device and terminal
CN113329072B (en) Data processing method and device, electronic equipment and computer readable medium
US10666789B2 (en) Control method and device for sensors of mobile terminal, storage medium and mobile terminal
CN109375855B (en) Terminal state determination method and device, terminal equipment and storage medium
CN106598521B (en) Screen state control method and device of mobile terminal and mobile terminal

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
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant