CN108759881B - Relative position detection method and terminal equipment - Google Patents

Relative position detection method and terminal equipment Download PDF

Info

Publication number
CN108759881B
CN108759881B CN201810502840.6A CN201810502840A CN108759881B CN 108759881 B CN108759881 B CN 108759881B CN 201810502840 A CN201810502840 A CN 201810502840A CN 108759881 B CN108759881 B CN 108759881B
Authority
CN
China
Prior art keywords
light
color
intensity value
light intensity
preset
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
CN201810502840.6A
Other languages
Chinese (zh)
Other versions
CN108759881A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201810502840.6A priority Critical patent/CN108759881B/en
Publication of CN108759881A publication Critical patent/CN108759881A/en
Application granted granted Critical
Publication of CN108759881B publication Critical patent/CN108759881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • G01D5/26Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light
    • G01D5/32Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Telephone Function (AREA)

Abstract

The invention provides a method for detecting relative positions and terminal equipment, wherein the method comprises the following steps: displaying an image of a first predetermined color; receiving visible light penetrating from a display screen through a color identification sensor, and acquiring light ray information of different color light rays in the visible light; and determining that the external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.

Description

Relative position detection method and terminal equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for detecting a relative position and a terminal device.
Background
With the rapid development of terminal devices, the terminal devices have become an essential tool in people's life, and bring great convenience to various aspects of user's life. Existing terminal devices basically have a distance sensor and an ambient light sensor. The distance sensor can detect the distance of some objects from the terminal equipment, and the ambient light sensor can detect the condition of light.
However, in the prior art, the terminal device needs a distance sensor to detect the distance and an ambient light sensor to detect the light, which results in higher cost of the terminal device.
Disclosure of Invention
The embodiment of the invention provides a method for detecting a relative position and a terminal device, and aims to solve the problem that the terminal device is high in cost due to the fact that the terminal device needs a distance sensor to detect distance and an ambient light sensor to detect light.
In order to solve the technical problem, the invention is realized as follows: a method for detecting relative position is applied to terminal equipment with a color recognition sensor arranged below a display screen, and comprises the following steps:
displaying an image of a first predetermined color;
receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light;
and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range.
In a first aspect, an embodiment of the present invention provides a method for detecting a relative position, which is applied to a terminal device with a color recognition sensor below a display screen, and includes:
displaying an image of a first predetermined color;
receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light;
and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range.
In a second aspect, an embodiment of the present invention further provides a terminal device, where a color recognition sensor is arranged below a display screen of the terminal device, and the terminal device includes:
the display module is used for displaying an image with a first preset color;
the receiving module is used for receiving the visible light transmitted from the display screen through the color identification sensor and acquiring light ray information of different color light rays in the visible light;
and the determining module is used for determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is smaller than or equal to a preset wavelength range.
In a third aspect, an embodiment of the present invention further provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the method for detecting a relative position.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for detecting a relative position are implemented.
In an embodiment of the present invention, an image of a first predetermined color is displayed; receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light; and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart of a method for detecting relative position according to an embodiment of the present invention;
fig. 2 is one of the structural diagrams of the terminal device provided in the embodiment of the present invention;
FIG. 3 is a second flowchart of a method for detecting relative position according to an embodiment of the present invention;
fig. 4 is a second structural diagram of a terminal device according to the embodiment of the present invention;
fig. 5 is a structural diagram of a determination module of a terminal device according to an embodiment of the present invention;
fig. 6 is a structural diagram of a fourth determination submodule of the terminal device according to the embodiment of the present invention;
fig. 7 is a third structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for detecting a relative position according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101, displaying an image of a first predetermined color.
In this embodiment, the display screen for displaying the image of the first predetermined color may be a liquid crystal display screen, or may also be a display screen made of light emitting diodes. The displaying of the image of the first predetermined color may be controlling a preset area of a display screen of the terminal device to display the image of the first predetermined color. And the preset area may be any area on the display screen of the terminal device, such as the upper side, the lower side, the left side or the right side of the display screen, and the like. Of course, other positions on the display screen may be used besides these positions, and the embodiment of the present invention is not limited thereto. The first predetermined color may be red, blue or some other color, etc.
And 102, receiving the visible light penetrating from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light.
In this embodiment, the color recognition sensor receives visible light transmitted by the display screen, and the visible light may include light directly receiving external environment, light emitted by the display screen of the terminal device, light reflected by an obstacle, and the like. The light information may be an intensity value or a wavelength of the light, and may also include other information of the light, which is not limited in the embodiment of the present invention.
In this embodiment, the preset area may be some areas around the color recognition sensor, so that the color recognition sensor can better receive the light emitted from the preset area and the light reflected by the obstacle. When the preset area is disposed around the color recognition sensor, it may be an annular area, or may also be a rectangular frame-shaped area, and the like, and the embodiment of the present invention is not limited thereto.
Step 103, determining that the external object and the terminal device are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is smaller than or equal to a preset wavelength range.
In this embodiment, there may be a plurality of implementation manners for determining that the external object and the terminal device are in the close state or the far state according to the light ray information of the first predetermined color light ray and the light ray information of the second predetermined color light ray obtained by the color identification sensor. For example: determining that the external object is close to or far away from the terminal equipment according to the light intensity values of the first preset color light and the second preset color light; or it may be determined that the external object is in a close state or a far state with respect to the terminal device according to a relationship between the light intensity values of the first predetermined color light and the second predetermined color light, and so on. In addition, other parameters may be added to make a more accurate determination, and the embodiment of the present invention is not limited thereto.
In this embodiment, the overlapping range of the wavelengths of the first predetermined color light and the second predetermined color light is smaller than or equal to the preset wavelength range, so that the influence between the first predetermined color light and the second predetermined color light can be reduced, and thus, more accurate detection can be performed in the process of whether an object is approaching.
For better understanding of the whole process, reference may be made to fig. 2, where fig. 2 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 2, fig. 2 includes an object 10 to be detected, a glass cover plate 11, a display screen 12, a light shielding foam 13 and a color recognition sensor 14, a preset area M on the display screen 12 is an annular area around the color recognition sensor 14, and the area can be self-illuminated by the display screen 12. The light emitted from the predetermined area M is indicated by an arrow in fig. 2, and the light reflected by the object 10 can be detected by the color recognition sensor 14. Therefore, the terminal equipment can determine that the external object is close to or far away from the terminal equipment according to the light ray information of the light rays with different colors.
In the prior art, a distance sensor needs to be arranged on a terminal device to detect a distance, and an ambient light sensor also needs to detect light, so that the cost of the terminal device is high. In the embodiment, only one color recognition sensor is needed to be arranged on the terminal device, so that the function of the distance sensor can be realized, and the color recognition sensor can also detect the ambient light, so that the distance sensor and the ambient light sensor are not needed to be arranged, and the cost is saved for the terminal device. Moreover, the color recognition sensor can be arranged below the display screen, and the screen occupation ratio of the terminal equipment can be improved.
In the embodiment of the present invention, the terminal Device may be a Mobile phone, a Tablet personal Computer (Tablet personal Computer), a Laptop Computer (Laptop Computer), a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), a Wearable Device (Wearable Device), or the like.
The method for detecting the relative position displays an image with a first preset color; receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light; and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.
Referring to fig. 3, fig. 3 is a flowchart of a method for detecting a relative position according to an embodiment of the present invention. The main difference between this embodiment and the previous embodiment is that in the method, it is determined that the external object and the terminal device are in the close state or the far state according to the change value of the first light intensity value, the change value of the second light intensity value, and the ratio. As shown in fig. 3, the method comprises the following steps:
step 301, displaying an image of a first predetermined color.
In this embodiment, the display screen for displaying the image of the first predetermined color may be a liquid crystal display screen, or may also be a display screen made of light emitting diodes. The displaying of the image of the first predetermined color may be controlling a preset area of a display screen of the terminal device to display the image of the first predetermined color. And the preset area may be any area on the display screen of the terminal device, such as the upper side, the lower side, the left side or the right side of the display screen, and the like. Of course, other positions on the display screen may be used besides these positions, and the embodiment of the present invention is not limited thereto. The first predetermined color may be red, blue or some other color, etc.
Step 302, receiving the visible light penetrating from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light, wherein the light ray information includes a light ray intensity value.
In this embodiment, the color recognition sensor receives visible light transmitted by the display screen, and the visible light may include light directly receiving external environment, light emitted by the display screen of the terminal device, light reflected by an obstacle, and the like. The light information includes light intensity values so that some judgment can be made according to the light intensity values. Of course, the light information may include some other information of the light besides the light intensity value, so as to perform more accurate determination, and the like, and the embodiment of the present invention is not limited thereto.
Step 303, obtaining a first light intensity value of the first predetermined color light obtained by the color recognition sensor, and determining a variation value of the first light intensity value.
In this embodiment, the first light intensity value of the first predetermined color light is obtained, and the variation value of the first light intensity value is determined, so that subsequent determination can be performed according to the first light intensity value and the variation value of the first light intensity value.
Step 304, obtaining a second light intensity value of the second predetermined color light obtained by the color recognition sensor, and determining a variation value of the second light intensity value.
In this embodiment, the second light intensity value of the second predetermined color light is obtained, and the variation value of the second light intensity value is determined, so that subsequent determination can be performed conveniently according to the second light intensity value and the variation value of the second light intensity value.
Step 305, determining a ratio of the first light intensity value to the second light intensity value.
In this embodiment, a ratio of the first light intensity value to the second light intensity value is determined, so as to facilitate subsequent determination according to the ratio.
Step 306, determining that the external object and the terminal device are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value and the ratio, wherein the wavelength overlapping range of the first preset color light and the second preset color light is smaller than or equal to a preset wavelength range.
In this embodiment, the determining that the external object and the terminal device are in the close state or the far state according to the change value of the first light intensity value, the change value of the second light intensity value, and the ratio may be performed in various ways. For example: when the change value of the first light intensity value and the change value of the second light intensity value respectively represent that the first light intensity value is reduced and the second light intensity value is reduced, and the ratio is increased, determining that an external object is close to the terminal equipment; or, no matter how the first light intensity value and the second light intensity value change, as long as the ratio is within a range, it is determined that the external object is in a distant state from the terminal device.
In this embodiment, the overlapping range of the wavelengths of the first predetermined color light and the second predetermined color light is smaller than or equal to the preset wavelength range, so that the influence between the first predetermined color light and the second predetermined color light can be reduced, and more accurate judgment can be performed, thereby better determining that an external object and the terminal are in a close state or a far state.
Optionally, the determining that the external object and the terminal device are in the close state or the far state according to the variation value of the first light intensity value, the variation value of the second light intensity value, and the ratio includes:
determining that an external object is close to the terminal device under the condition that the change value of the first light intensity value and the change value of the second light intensity value respectively represent that the first light intensity value is reduced and the second light intensity value is reduced, the ratio is larger than a preset threshold value, and the change value of the first light intensity value is smaller than the change value of the second light intensity value;
and under the condition that the ratio is within a preset ratio range, determining that the external object is far away from the terminal equipment.
In this embodiment, when an object is close to the terminal device, that is, an external object is close to the terminal device, the first light intensity value and the second light intensity value are both reduced because the external object shields the light of the environment. However, since the preset area of the display screen displays the image with the first predetermined color, the light with the first predetermined color is reflected by an external object close to the terminal device, so that the first light intensity value has an extra increment, that is, the variation value of the first light intensity value is smaller than the variation value of the second light intensity value. At this time, when the ratio is greater than the preset threshold, it may be determined that the external object is in a close state with the terminal device.
In this embodiment, when the ambient light changes, the light information of the light detected by the color recognition sensor also changes. However, since the spectral components of the ambient light are varied and include the first predetermined color light and the second predetermined color light, the light intensity values of the first predetermined color light and the second predetermined color light may be increased or decreased simultaneously, but the ratio of the first light intensity value to the second light intensity value is substantially kept within a constant range, i.e., the predetermined ratio range. Therefore, when the ratio is within the preset ratio range, it can be determined that no external object is close to the terminal device, that is, it is determined that the external object and the terminal device are in a far state. Of course, when the first light intensity value is stable, it can also be determined that the environment is stable.
In this embodiment, it is determined that the external object and the terminal device are in the close state or the far state through the variation value of the first light intensity value, the variation value of the second light intensity value and the ratio, and the detection process is convenient. And the function of the distance sensor can be replaced by the color recognition sensor, so that the cost of the terminal equipment is saved.
Optionally, the preset wavelength range is 0.
In this embodiment, if the preset wavelength range is 0, it indicates that there is no overlapping range between the wavelengths of the first predetermined color light and the second predetermined color light, so that there is no interference between the first predetermined color light and the second predetermined color light, and the detection result is more accurate.
Optionally, the first predetermined color light is red light, and the second predetermined color light is blue light;
or, the first predetermined color light is blue light, and the second predetermined color light is red light.
In the present embodiment, a general color recognition sensor has three channels, R, G and B channels, respectively. The R channel is most sensitive to red light and least sensitive to blue light due to its respective spectral design; the B channel is most sensitive to blue light and least sensitive to red light. Each pixel of the display screen is divided into three sub-pixels of r, g and b, and the light-emitting spectrum of each pixel is also different. The spectra of the red and blue pixels are completely isolated, while the spectra of the R, g and B channels of the screen are similar to the spectral trends of R, G and B channels of the sensor, so that the R channel of the color recognition sensor is completely unaffected by the blue light of the screen, and the B channel of the color recognition sensor is completely unaffected by the red light of the screen.
Thus, according to the spectral design, light emitted by a red image in a preset area of the screen can be sensed by an R channel in the sensor, and a B channel is not influenced by the red image of the screen; or the light emitted by the blue image in the preset area of the screen can be sensed by the B channel in the sensor, and the R channel is not influenced by the blue image of the screen, so that the detection result is more accurate, and the misjudgment is reduced.
The method for detecting the relative position displays an image with a first preset color; receiving visible light penetrating from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light, wherein the light ray information comprises a light ray intensity value; acquiring a first light intensity value of the first preset color light acquired by the color identification sensor, and determining a change value of the first light intensity value; acquiring a second light intensity value of the second preset color light acquired by the color identification sensor, and determining a change value of the second light intensity value; determining a ratio of the first light intensity value to the second light intensity value; and determining that an external object and the terminal equipment are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value and the ratio, wherein the wavelength overlapping range of the first preset color light and the second preset color light is smaller than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.
Referring to fig. 4, fig. 4 is a structural diagram of a terminal device according to an embodiment of the present invention, and a color recognition sensor is disposed below a display screen of the terminal device, so that details of a method for detecting a relative position in the above embodiment can be implemented, and the same effect can be achieved. As shown in fig. 4, the terminal device 400 includes a display module 401, a receiving module 402, and a determining module 403, the display module 401 is connected to the receiving module 402, and the receiving module 402 is connected to the determining module 403, where:
a display module 401 for displaying an image of a first predetermined color;
a receiving module 402, configured to receive, through the color recognition sensor, visible light penetrating from the display screen, and acquire light information of different color lights in the visible light;
the determining module 403 is configured to determine that an external object and the terminal device are in a close state or a far state according to light information of a first predetermined color light and light information of a second predetermined color light obtained by the color identification sensor, where a wavelength overlapping range of the first predetermined color light and the second predetermined color light is smaller than or equal to a preset wavelength range.
Optionally, the light information includes a light intensity value, as shown in fig. 5, the determining module 403 includes:
a first determining submodule 4031, configured to obtain a first light intensity value of the first predetermined color light obtained by the color identification sensor, and determine a variation value of the first light intensity value;
a second determining submodule 4032, configured to obtain a second light intensity value of the second predetermined color light obtained by the color identification sensor, and determine a variation value of the second light intensity value;
a third determining submodule 4033 for determining a ratio of the first light intensity value to the second light intensity value;
a fourth determining submodule 4034, configured to determine that an external object and the terminal device are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value, and the ratio.
Optionally, as shown in fig. 6, the fourth determining sub-module 4034 includes:
a first determining unit 40341, configured to determine that an external object and the terminal device are in a close state when a change value of the first light intensity value and a change value of the second light intensity value respectively indicate that the first light intensity value decreases and the second light intensity value decreases, the ratio is greater than a preset threshold, and the change value of the first light intensity value is smaller than the change value of the second light intensity value;
a second determining unit 40342, configured to determine that the external object and the terminal device are in a distant state when the ratio is within a preset ratio range.
Optionally, the preset wavelength range is 0.
Optionally, the first predetermined color light is red light, and the second predetermined color light is blue light; or, the first predetermined color light is blue light, and the second predetermined color light is red light.
The terminal device 400 can implement each process implemented by the terminal device in the method embodiments of fig. 1 to fig. 3, and is not described herein again to avoid repetition.
The terminal device 400 of the embodiment of the present invention displays an image of a first predetermined color; receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light; and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.
Referring to fig. 7, fig. 7 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, where the terminal device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, a power supply 711, and the like. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 7 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
Wherein, the processor 710 is configured to display an image of a first predetermined color; receiving visible light penetrating from a display screen through a color identification sensor, and acquiring light ray information of different color light rays in the visible light; and determining that an external object and the terminal equipment are in a close state or a far state according to the light ray information of the first preset color light ray and the light ray information of the second preset color light ray acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light ray and the second preset color light ray is less than or equal to a preset wavelength range. Therefore, the function of the distance sensor can be realized through one color recognition sensor, and the color recognition sensor can also detect light, so that the functions of the distance sensor and the ambient light sensor can be completed through one color recognition sensor, and the cost of the terminal equipment is saved.
Optionally, the light information includes a light intensity value, and the processor 710 is further configured to obtain a first light intensity value of the first predetermined color light obtained by the color identification sensor, and determine a variation value of the first light intensity value; acquiring a second light intensity value of the second preset color light acquired by the color identification sensor, and determining a change value of the second light intensity value; determining a ratio of the first light intensity value to the second light intensity value; and determining that the external object and the terminal equipment are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value and the ratio.
Optionally, the processor 710 is further configured to determine that an external object is in a close state with the terminal device when the change value of the first light intensity value and the change value of the second light intensity value respectively indicate that the first light intensity value decreases and the second light intensity value decreases, the ratio is greater than a preset threshold, and the change value of the first light intensity value is smaller than the change value of the second light intensity value; and under the condition that the ratio is within a preset ratio range, determining that the external object is far away from the terminal equipment.
Optionally, the preset wavelength range is 0.
Optionally, the first predetermined color light is red light, and the second predetermined color light is blue light; or, the first predetermined color light is blue light, and the second predetermined color light is red light.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 701 may be used for receiving and sending signals during a message transmission and reception process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 710; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 701 may also communicate with a network and other devices through a wireless communication system.
The terminal device provides the user with wireless broadband internet access through the network module 702, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 703 may convert audio data received by the radio frequency unit 701 or the network module 702 or stored in the memory 709 into an audio signal and output as sound. Also, the audio output unit 703 may also provide audio output related to a specific function performed by the terminal device 700 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, a receiver, and the like.
The input unit 704 is used to receive audio or video signals. The input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics processor 7041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 706. The image frames processed by the graphic processor 7041 may be stored in the memory 709 (or other storage medium) or transmitted via the radio unit 701 or the network module 702. The microphone 7042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 701 in case of a phone call mode.
The terminal device 700 further comprises at least one sensor 705, such as light sensors, motion sensors and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the luminance of the display panel 7061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 7061 and/or a backlight when the terminal device 700 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 705 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 706 is used to display information input by the user or information provided to the user. The Display unit 706 may include a Display panel 7061, and the Display panel 7061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 707 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 7071 (e.g., operations by a user on or near the touch panel 7071 using a finger, a stylus, or any other suitable object or attachment). The touch panel 7071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 710, receives a command from the processor 710, and executes the command. In addition, the touch panel 7071 can be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 707 may include other input devices 7072 in addition to the touch panel 7071. In particular, the other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 7071 may be overlaid on the display panel 7061, and when the touch panel 7071 detects a touch operation on or near the touch panel 7071, the touch operation is transmitted to the processor 710 to determine the type of the touch event, and then the processor 710 provides a corresponding visual output on the display panel 7061 according to the type of the touch event. Although in fig. 7, the touch panel 7071 and the display panel 7061 are implemented as two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 7071 and the display panel 7061 may be integrated to implement the input and output functions of the terminal device, which is not limited herein.
The interface unit 708 is an interface for connecting an external device to the terminal apparatus 700. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 708 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 700 or may be used to transmit data between the terminal apparatus 700 and the external device.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 709 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 710 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 709 and calling data stored in the memory 709, thereby performing overall monitoring of the terminal device. Processor 710 may include one or more processing units; preferably, the processor 710 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The terminal device 700 may further include a power supply 711 (e.g., a battery) for supplying power to various components, and preferably, the power supply 711 may be logically connected to the processor 710 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 700 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor 710, a memory 709, and a computer program stored in the memory 709 and capable of running on the processor 710, where the computer program is executed by the processor 710 to implement each process of the above-mentioned method for detecting a relative position, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned method for detecting a relative position, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for detecting relative position is applied to terminal equipment with a color recognition sensor arranged below a display screen, and is characterized by comprising the following steps:
displaying an image with a first preset color in a preset area of a display screen;
receiving the visible light transmitted from the display screen through the color recognition sensor, and acquiring light ray information of different color light rays in the visible light; the visible light comprises light rays of an external environment and light rays which are emitted by displaying the image of the first preset color and reflected by encountering an external object;
determining that an external object and the terminal device are in a close state or a far state according to light ray information of first preset color light rays and light ray information of second preset color light rays acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light rays and the second preset color light rays is smaller than or equal to a preset wavelength range;
the light information includes a light intensity value, and the determining that the external object and the terminal device are in a close state or a far state according to the light information of the first predetermined color light and the light information of the second predetermined color light acquired by the color recognition sensor includes:
acquiring a first light intensity value of the first preset color light acquired by the color identification sensor, and determining a change value of the first light intensity value;
acquiring a second light intensity value of the second preset color light acquired by the color identification sensor, and determining a change value of the second light intensity value;
determining a ratio of the first light intensity value to the second light intensity value;
and determining that the external object and the terminal equipment are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value and the ratio.
2. The method according to claim 1, wherein the determining that the external object is in the close state or the far state from the terminal device according to the variation value of the first light intensity value, the variation value of the second light intensity value and the ratio comprises:
determining that an external object is close to the terminal device under the condition that the change value of the first light intensity value and the change value of the second light intensity value respectively represent that the first light intensity value is reduced and the second light intensity value is reduced, the ratio is larger than a preset threshold value, and the change value of the first light intensity value is smaller than the change value of the second light intensity value;
and under the condition that the ratio is within a preset ratio range, determining that the external object is far away from the terminal equipment.
3. The method according to any one of claims 1 to 2, wherein the preset wavelength range is 0.
4. The method according to any one of claims 1 to 2, wherein the first predetermined color light is red light and the second predetermined color light is blue light;
or, the first predetermined color light is blue light, and the second predetermined color light is red light.
5. The utility model provides a terminal equipment, terminal equipment's display screen below is equipped with colour identification sensor, its characterized in that includes:
the display module is used for displaying an image with a first preset color in a preset area of the display screen;
the receiving module is used for receiving the visible light transmitted from the display screen through the color identification sensor and acquiring light ray information of different color light rays in the visible light; the visible light comprises light rays of an external environment and light rays which are emitted by displaying the image of the first preset color and reflected by encountering an external object;
the determining module is used for determining that an external object and the terminal equipment are in a close state or a far state according to light ray information of first preset color light rays and light ray information of second preset color light rays acquired by the color identification sensor, wherein the wavelength overlapping range of the first preset color light rays and the second preset color light rays is smaller than or equal to a preset wavelength range;
the light information includes a light intensity value, and the determining module includes:
the first determining submodule is used for obtaining a first light intensity value of the first preset color light obtained by the color identification sensor and determining a change value of the first light intensity value;
the second determining submodule is used for obtaining a second light intensity value of the second preset color light obtained by the color identification sensor and determining a change value of the second light intensity value;
a third determining submodule for determining a ratio of the first light intensity value to the second light intensity value;
and the fourth determining submodule is used for determining that the external object and the terminal equipment are in a close state or a far state according to the change value of the first light intensity value, the change value of the second light intensity value and the ratio.
6. The terminal device of claim 5, wherein the fourth determining submodule comprises:
the first determining unit is used for determining that an external object and the terminal equipment are in a close state under the condition that the change value of the first light intensity value and the change value of the second light intensity value respectively represent that the first light intensity value is reduced and the second light intensity value is reduced, the ratio is larger than a preset threshold value, and the change value of the first light intensity value is smaller than the change value of the second light intensity value;
and the second determining unit is used for determining that the external object and the terminal equipment are in a far state under the condition that the ratio is within a preset ratio range.
7. The terminal device according to any of claims 5 to 6, wherein the preset wavelength range is 0.
8. A terminal device according to any one of claims 5 to 6, characterised in that the first light of a predetermined colour is red and the second light of a predetermined colour is blue;
or, the first predetermined color light is blue light, and the second predetermined color light is red light.
9. A terminal device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of detecting relative position according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of detecting a relative position according to any one of claims 1 to 4.
CN201810502840.6A 2018-05-23 2018-05-23 Relative position detection method and terminal equipment Active CN108759881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810502840.6A CN108759881B (en) 2018-05-23 2018-05-23 Relative position detection method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810502840.6A CN108759881B (en) 2018-05-23 2018-05-23 Relative position detection method and terminal equipment

Publications (2)

Publication Number Publication Date
CN108759881A CN108759881A (en) 2018-11-06
CN108759881B true CN108759881B (en) 2020-09-01

Family

ID=64005060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810502840.6A Active CN108759881B (en) 2018-05-23 2018-05-23 Relative position detection method and terminal equipment

Country Status (1)

Country Link
CN (1) CN108759881B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113175880B (en) * 2021-03-31 2023-09-29 深圳宝新创科技股份有限公司 Detection equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000079766A1 (en) * 1999-06-21 2000-12-28 Telefonaktiebolaget Lm Ericsson (Publ) Apparatus and method of sensing proximity by means of light
CN101729770A (en) * 2008-10-30 2010-06-09 (株)赛丽康 Image sensor capable of realizing night-pthotographing and functions of proximity sensor and illuminance sensor
JP2017173285A (en) * 2016-03-26 2017-09-28 アルパイン株式会社 Object approach detection device and object approach detection method
CN107332948A (en) * 2017-07-11 2017-11-07 广东欧珀移动通信有限公司 Display device, terminal device and proximity state detection method
CN107979663A (en) * 2017-11-22 2018-05-01 广东欧珀移动通信有限公司 Sensor component, display screen component and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000079766A1 (en) * 1999-06-21 2000-12-28 Telefonaktiebolaget Lm Ericsson (Publ) Apparatus and method of sensing proximity by means of light
CN101729770A (en) * 2008-10-30 2010-06-09 (株)赛丽康 Image sensor capable of realizing night-pthotographing and functions of proximity sensor and illuminance sensor
JP2017173285A (en) * 2016-03-26 2017-09-28 アルパイン株式会社 Object approach detection device and object approach detection method
CN107332948A (en) * 2017-07-11 2017-11-07 广东欧珀移动通信有限公司 Display device, terminal device and proximity state detection method
CN107979663A (en) * 2017-11-22 2018-05-01 广东欧珀移动通信有限公司 Sensor component, display screen component and electronic equipment

Also Published As

Publication number Publication date
CN108759881A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN107908383B (en) Screen color adjusting method and device and mobile terminal
CN108491123B (en) Method for adjusting application program icon and mobile terminal
CN108628565B (en) Mobile terminal operation method and mobile terminal
CN107977652B (en) Method for extracting screen display content and mobile terminal
CN109032445B (en) Screen display control method and terminal equipment
CN109238460B (en) Method for obtaining ambient light intensity and terminal equipment
CN109257505B (en) Screen control method and mobile terminal
CN110969981A (en) Screen display parameter adjusting method and electronic equipment
CN107734172B (en) Information display method and mobile terminal
CN110012143B (en) Telephone receiver control method and terminal
CN110913067A (en) Information sending method and electronic equipment
CN108108113B (en) Webpage switching method and device
CN109557697B (en) Display adjusting method and terminal
CN110096203B (en) Screenshot method and mobile terminal
CN107153500B (en) Method and equipment for realizing image display
CN111142723A (en) Icon moving method and electronic equipment
CN108845785B (en) Display method and terminal
CN108494936B (en) Light intensity detection method and mobile terminal
CN111031178A (en) Video stream clipping method and electronic equipment
CN110753155A (en) Proximity detection method and terminal equipment
CN110309003B (en) Information prompting method and mobile terminal
CN109859718B (en) Screen brightness adjusting method and terminal equipment
CN111522613A (en) Screen capturing method and electronic equipment
CN109067975B (en) Contact person information management method and terminal equipment
CN108759881B (en) Relative position detection method and terminal equipment

Legal Events

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