Ambient light detection method and electronic device

By using two ambient light detection units and calibration coefficients in electronic devices, the inaccurate ambient light detection problem under the influence of screen light leakage is solved, and ambient light detection with high accuracy and low computing power overhead is achieved.

CN115479665BActive Publication Date: 2025-04-22HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110904449.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-06-15
Filing Date
2021-08-06
Publication Date
2025-04-22
Estimated Expiration
2041-08-06

AI Technical Summary

Technical Problem

When existing electronic devices detect ambient light, due to the influence of screen light leakage and screen transmittance, the ambient light intensity detection is inaccurate, and the computing power overhead is high to eliminate the impact of screen light leakage.

Method used

Two ambient light detection units are adopted. The first ambient light detection unit is used to receive ambient light and screen light leakage, and the second ambient light detection unit is mainly used to receive a screen light leakage, and accurately strips the influence of the screen light leakage through the calibration coefficient to determine the intensity of the ambient light.

Benefits of technology

Accurate detection of ambient light is achieved, detection errors caused by screen light leakage and transmittance are avoided, and computing power overhead of electronic devices is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115479665B_ABST
    Figure CN115479665B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an ambient light detection method and an electronic device, which relates to the field of electronic devices, and can avoid the influence of screen leakage and / or screen transmittance on ambient light detection, and realize accurate ambient light detection. The specific scheme is: the method is applied to an electronic device, and a first ambient light detection unit and a second ambient light detection unit are provided in the electronic device, and the first photosensitive area of ​​the first ambient light detection unit is used to detect the intensity of the first light, and the second photosensitive area of ​​the second ambient light detection unit is used to detect the intensity of the second light, the first light includes ambient light and screen leakage, and the second light includes screen leakage. The electronic device is also configured with a calibration coefficient, and the method includes: the electronic device determines the intensity of the ambient light according to the first value, the second value, and the calibration coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on June 15, 2021, with application number 202110661847.4 and application name “Differential Ambient Light Calibration Method”, all contents of which are incorporated by reference in this application. Technical Field

[0002] The embodiments of the present application relate to the field of electronic devices, and in particular to an ambient light detection method and electronic device. Background Art

[0003] Electronic devices can detect the intensity of ambient light through ambient light sensors, and then automatically adjust the screen brightness to improve display performance. In the current ambient light detection scheme, the detection of ambient light by ambient light sensors is inevitably affected by screen light leakage, and the detection of ambient light intensity is not accurate enough. If the electronic device eliminates the influence of screen light leakage from the response of the ambient light sensor through calculation based on the display content of the display, it will cause a large computing power overhead. Summary of the invention

[0004] The embodiments of the present application provide an ambient light detection method and an electronic device, which can avoid the influence of screen leakage and / or screen transmittance on ambient light detection, achieve accurate ambient light detection, and will not cause high computing power overhead to the electronic device.

[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0006] In a first aspect, an ambient light detection method is provided, which is applied to an electronic device, wherein a first ambient light detection unit and a second ambient light detection unit are provided in the electronic device, wherein the first photosensitive area of ​​the first ambient light detection unit is used to detect the intensity of a first light, and the second photosensitive area of ​​the second ambient light detection unit is used to detect the intensity of a second light, the first light includes ambient light and screen leakage light, and the second light includes screen leakage light, and the electronic device is also configured with a calibration coefficient, and the calibration coefficient is used to indicate a relationship between a first value and the second value and the intensity of the ambient light, the first value is an output value of the first ambient light detection unit in response to the first light, and the second value is an output value of the second ambient light detection unit in response to the second light, and the method comprises: the electronic device determines the intensity of the ambient light according to the first value, the second value, and the calibration coefficient.

[0007] Based on this scheme, a scheme for accurately detecting ambient light is provided. In this example, a calibration coefficient may be configured in the electronic device. By calibrating the calibration coefficient, the influence of screen light leakage can be accurately removed from the first value, thereby accurately detecting ambient light. It can be understood that the first ambient light detection unit can be used to receive screen light leakage and ambient light, and the second ambient light detection unit can be used to receive screen light leakage. In some implementations, in order to achieve the above effect, the reflection of ambient light (such as total reflection or near total reflection) can be achieved by coating on the path of the second ambient light detection unit receiving ambient light, so that most of the light received by the second ambient light detection unit can be considered to be screen light leakage. Due to the differences in the positions and responses of different ambient light detection units, the scheme described in the present application can calibrate the calculation error introduced by the second ambient light detection unit inevitably receiving a small amount of ambient light, and the error introduced by the response difference between the first ambient light detection unit and the second ambient light detection unit through the calibration coefficient. In this way, the ambient light can be accurately detected. At the same time, since there is no need for the electronic device to autonomously perform calculations based on the display content of the current display screen, the algorithm can filter out the impact of screen light leakage from the response of the ambient light sensor, thereby avoiding the resulting computing power overhead and inaccuracy of the calculation results.

[0008] In a possible design, the calibration coefficient is obtained based on a dark field calibration coefficient and a bright field calibration coefficient. Among them, the dark field calibration coefficient is used to indicate the difference in response of the first ambient light detection unit and the second ambient light detection unit to the received ambient light and / or screen leakage. The bright field calibration coefficient is used to indicate the correspondence between the first response value and the output value of the first ambient light detection unit and the output value of the second ambient light detection unit in the presence of ambient light, and the first response value is the output value of the first ambient light detection unit in response to the ambient light. Based on this scheme, a method for obtaining a calibration coefficient is provided. It can be understood that, in combination with the scheme provided in the first aspect above, the calibration coefficient plays a very important role in the process of accurately obtaining the ambient light detection result. In this example, a method for obtaining a calibration coefficient is provided, such as obtaining the calibration coefficient corresponding to the current first ambient light detection unit and the second ambient light detection unit through the process of dark field calibration and bright field calibration.

[0009] In a possible design, the dark field calibration coefficient is obtained through dark field calibration, and the dark field calibration includes: in a dark field environment, the electronic device controls the display screen of the electronic device to display a first interface, and there is no ambient light in the dark field environment. Obtain a third value of the output of the first ambient light detection unit and a fourth value of the output of the second ambient light detection unit, and obtain the dark field calibration coefficient according to the third value and the fourth value. Based on this scheme, a specific implementation example of dark field calibration is provided. In this example, a calibration process can be performed in a dark field environment. The dark field calibration coefficient is determined by the difference in responses of the two ambient light detection units to the same light input.

[0010] In a possible design, before the electronic device controls the display screen of the electronic device to display the first interface, the method further includes: the electronic device controls the display screen of the electronic device to turn off the screen, and the electronic device determines that the current environment is a dark field environment when the output value of the first ambient light detection unit and / or the second ambient light detection unit is less than the dark field threshold. Based on this solution, an example of a solution for determining that the current environment is a dark field environment is provided. Through this solution, the electronic device can determine that the current environment is a dark field environment, thereby ensuring the accuracy of the dark field calibration process.

[0011] In one possible design, the first interface is a single-color interface. Based on this solution, a light providing solution is provided during a dark field calibration process. In this example, during the dark field calibration process, the electronic device can be controlled to display a single-color interface, so as to obtain the difference in response of two ambient light detection units to the same light. In one possible design, the first interface is a white interface. Based on this solution, a light providing solution is provided during a dark field calibration process. For example, the electronic device can determine the difference in response of two ambient light detection units to light by controlling the display screen to display a white interface. Since the wavelength of white light is in the middle of the wavelength of visible light, the dark field calibration coefficient obtained by the wavelength calibration of white light can also be well applied to display scenarios of other colors in the visible light band.

[0012] In a possible design, after obtaining the third value of the output of the first ambient light detection unit and the fourth value of the output of the second ambient light detection unit, the dark field calibration also includes: the electronic device controls the display screen of the electronic device to display a second interface. The color of the second interface is different from the first interface. The fifth value of the output of the second ambient light detection unit and the sixth value of the output of the second ambient light detection unit are obtained, and the dark field calibration coefficient is obtained according to the third value and the fourth value, including: according to the third value, the fourth value, the fifth value, and the sixth value, the dark field calibration coefficient is calculated. Based on this scheme, another mechanism for dark field calibration is provided. Exemplarily, since the response difference of the two ambient light detection units to light of different colors is different, in some embodiments of the present application, the electronic device can control the display screen to display interfaces of different colors respectively, and obtain the response difference of the two ambient light detection units under different color interfaces. According to the response difference under the multiple color scenes, the response difference of the two ambient light detection units to light is finally determined.

[0013] In a possible design, the bright field calibration coefficient is obtained through bright field calibration, and the bright field calibration includes: in a bright field environment, the electronic device controls the display screen of the electronic device to turn off the screen, and a preset ambient light source is set in the bright field environment. The seventh value of the output of the first ambient light detection unit and the eighth value of the output of the second ambient light detection unit are obtained, and the bright field calibration coefficient is determined according to the seventh value and the eighth value. Based on this scheme, an example of a scheme for obtaining a bright field calibration coefficient is provided. In this example, the electronic device can obtain the response difference between the two ambient light detection units for a scene where only ambient light is received through bright field calibration, and accordingly, the small amount of ambient light received by the second ambient light detection unit can be effectively screened out through the bright field calibration coefficient, thereby improving the overall ambient light detection accuracy.

[0014] In a possible design, the bright field calibration coefficient is determined according to the seventh value and the eighth value, including: determining the bright field calibration coefficient according to the following formula, Z=xK×y, wherein Z is the bright field calibration coefficient, x is the seventh value, y is the eighth value, and K is the dark field calibration coefficient. Based on this solution, a specific calculation example of the bright field calibration coefficient is provided. Based on this example, the electronic device can accurately and quickly calculate and obtain the bright field calibration coefficient.

[0015] In a possible design, the calibration coefficient is calculated according to the following formula: a=L / Z, where a is the calibration coefficient, L is the intensity of the preset ambient light source during the bright field calibration process, and Z is the bright field calibration coefficient. Based on this solution, a specific calculation example of the calibration coefficient is provided. Based on this example, the electronic device can accurately and quickly calculate the calibration coefficient.

[0016] In one possible design, after obtaining the calibration coefficient, the method further includes: storing the calibration coefficient in a memory of the electronic device. Based on this solution, a specific implementation of an ambient light detection solution based on a calibration coefficient is provided. For example, the calculated calibration coefficient can be stored in the memory of the electronic device in advance, so that when ambient light detection is required, the electronic device can call the calibration coefficient from the memory to achieve fast and accurate ambient light detection.

[0017] In a possible design, when the dark field calibration coefficient is not in the preset dark field calibration interval, it is determined that the calibration of the electronic device currently performing dark field calibration has failed, and / or, when the bright field calibration coefficient is not in the preset bright field calibration interval, it is determined that the calibration of the electronic device currently performing bright field calibration has failed. Based on this scheme, an example of screening out defective electronic devices during dark field calibration and / or bright field calibration is provided. It should be understood that for the first ambient light detection unit and the second ambient light detection unit of the same design, the bright field calibration result and / or the dark field calibration result should be close. If, during the calibration process of some devices, it is found that the calibration result is not within the preset range, or is significantly different from the calibration result of other devices, then it can be considered that the calibration process is wrong and needs to be recalibrated. If this is still the case after recalibration, it means that there is a problem in the production of the first ambient light detection unit and / or the second ambient light detection unit of the device, so that these devices can be screened out from the good equipment, thereby achieving the effect of screening out defective products and improving the shipment yield.

[0018] In a second aspect, an ambient light detection method is provided, which is applied to an electronic device, wherein a first ambient light detection unit and a second ambient light detection unit are provided in the electronic device, wherein a first photosensitive area of ​​the first ambient light detection unit is used to detect the intensity of a first light, and a second photosensitive area of ​​the second ambient light detection unit is used to detect the intensity of a second light, wherein the first light includes ambient light and screen leakage light, and the second light includes screen leakage light, and the method comprises: the first ambient light detection unit receives the first light and outputs a first value, wherein the first value is used to identify the intensity of the first light. The second ambient light detection unit receives the second light and outputs a second value, wherein the second value is used to identify the intensity of the second light. The processor of the electronic device determines the intensity of the ambient light according to the first value, the second value, and a calibration coefficient stored in the electronic device.

[0019] Based on this scheme, a scheme for accurately detecting ambient light is provided. In this example, a calibration coefficient may be configured in the electronic device. By calibrating the calibration coefficient, the influence of screen light leakage can be accurately removed from the first value, thereby accurately detecting ambient light. It can be understood that the first ambient light detection unit can be used to receive screen light leakage and ambient light, and the second ambient light detection unit can be used to receive screen light leakage. In some implementations, in order to achieve the above effect, the reflection of ambient light (such as total reflection or near total reflection) can be achieved by coating on the path of the second ambient light detection unit receiving ambient light, so that most of the light received by the second ambient light detection unit can be considered to be screen light leakage. Due to the differences in the positions and responses of different ambient light detection units, the scheme described in the present application can calibrate the calculation error introduced by the second ambient light detection unit inevitably receiving a small amount of ambient light, and the error introduced by the response difference between the first ambient light detection unit and the second ambient light detection unit through the calibration coefficient. In this way, the ambient light can be accurately detected. At the same time, since there is no need for the electronic device to autonomously perform calculations based on the display content of the current display screen, the algorithm can filter out the impact of screen light leakage from the response of the ambient light sensor, thereby avoiding the resulting computing power overhead and inaccuracy of the calculation results.

[0020] In one possible design, the calibration coefficient is obtained according to the ambient light detection method described in the first aspect and any possible design thereof.

[0021] In one possible design, before the processor of the electronic device determines the intensity of the ambient light based on the first value, the second value, and the calibration coefficient stored in the electronic device, the method also includes: the processor obtains the first value from the first ambient light detection unit, and obtains the second value from the second ambient light detection unit.

[0022] In one possible design, before the processor of the electronic device determines the ambient light intensity in the current environment based on the first value, the second value, and the calibration coefficient stored in the electronic device, the method also includes: the processor reads the calibration coefficient from the memory of the electronic device, and the calibration coefficient is used to indicate the relationship between the first value and the second value and the ambient light intensity.

[0023] In a third aspect, an electronic device is provided, the electronic device comprising one or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories store computer instructions; when the one or more processors execute the computer instructions, the electronic device executes the ambient light detection method as described in the first aspect and any possible design thereof. Alternatively, the electronic device executes the ambient light detection method as described in the second aspect and any possible design thereof.

[0024] In a fourth aspect, a chip system is provided, the chip system comprising an interface circuit and a processor; the interface circuit and the processor are interconnected through a line; the interface circuit is used to receive a signal from a memory and send a signal to the processor, the signal comprising a computer instruction stored in the memory; when the processor executes the computer instruction, the chip system executes the ambient light detection method as described in the first aspect and any possible design thereof. Alternatively, the chip system executes the ambient light detection method as described in the second aspect and any possible design thereof.

[0025] In a fifth aspect, a computer-readable storage medium is provided, the computer-readable storage medium comprising computer instructions, and when the computer instructions are executed, the ambient light detection method as described in the first aspect and any possible design thereof is executed. Alternatively, the ambient light detection method as described in the second aspect and any possible design thereof is executed.

[0026] In a sixth aspect, a computer program product is provided, the computer program product comprising instructions, and when the computer program product is run on a computer, the computer can execute the ambient light detection method as described in the first aspect and any possible design thereof according to the instructions. Alternatively, the ambient light detection method as described in the second aspect and any possible design thereof is executed.

[0027] It should be understood that the technical solutions provided in the second to sixth aspects above and their technical features can all correspond to the ambient light detection method provided in the first aspect and its possible design, so the beneficial effects that can be achieved are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a schematic diagram of a setting of an ambient light sensor;

[0029] Figure 2 A schematic diagram of a setting of an ambient light sensor;

[0030] Figure 3 is a working schematic diagram of an ambient light sensor;

[0031] Figure 4 is a schematic diagram of a setting of an ambient light sensor;

[0032] Figure 5 is a working schematic diagram of an ambient light sensor;

[0033] Figure 6 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application;

[0034] Figure 7A schematic diagram of the composition of an ambient light sensor provided in an embodiment of the present application;

[0035] Figure 8 A schematic diagram of an ambient light sensor provided in an embodiment of the present application;

[0036] Fig. 9 A schematic diagram of the working state of an ambient light sensor provided in an embodiment of the present application;

[0037] Fig.10 A schematic diagram of the arrangement of an ambient light sensor in an electronic device provided in an embodiment of the present application;

[0038] Fig.11 A schematic diagram of the arrangement of an ambient light sensor in an electronic device provided in an embodiment of the present application;

[0039] Fig.12 A schematic diagram of the arrangement of an ambient light sensor in an electronic device provided in an embodiment of the present application;

[0040] Fig.13 A schematic diagram of an ambient light detection provided in an embodiment of the present application;

[0041] Fig.14 A calibration schematic diagram provided for an embodiment of the present application;

[0042] Fig.15 A schematic diagram of dark field calibration provided in an embodiment of the present application;

[0043] Fig.16 A schematic diagram of the response difference of light of different wavelengths provided in an embodiment of the present application;

[0044] Fig.17 A schematic diagram of bright field calibration provided in an embodiment of the present application;

[0045] Fig.18 A logic diagram of a calibration process provided in an embodiment of the present application;

[0046] Fig.19 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application;

[0047] Fig. 20 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] During operation, the electronic device can make corresponding adjustments according to the intensity of the light in the environment (such as referred to as ambient light), thereby improving the user experience of the user in the process of using the electronic device. Exemplarily, the electronic device can adaptively adjust the screen brightness according to the intensity of the ambient light. For example, in a scene with strong ambient light, the electronic device can control the display screen (or screen) to use a higher screen brightness for display, thereby avoiding the situation where the user cannot see the display content of the screen due to the strong ambient light. For another example, in the case of weak ambient light, the electronic device can control the screen to use a lower screen brightness for display, thereby achieving the effect of protecting the user's eyesight.

[0049] In some implementations, the electronic device may determine the intensity of the ambient light through an ambient light sensor (ALS) disposed therein.

[0050] Take the mobile phone as an example of an electronic device. Figure 1 An example of the location of an ambient light sensor is shown. Figure 1 As shown, the ambient light sensor can be arranged on the head of the mobile phone. For example, the ambient light sensor can be arranged between the screen of the mobile phone and the shell of the mobile phone, while ensuring that the light-sensitive surface of the ambient light sensor can receive light from the external environment from the front of the mobile phone. Figure 2 , showing a side cross-sectional view of a mobile phone. The cross section may be tangent to the ambient light sensor, thereby making the Figure 2 The side cutaway view shown provides a visual representation of the location of the ambient light sensor.

[0051] In such Figure 2 In the example shown, the ambient light sensor can be set in the gap between the screen (such as a liquid crystal display (LCD) screen) and the shell of the mobile phone head. The ambient light sensor can be covered with glass of the screen. Figure 2 The ambient light at the position shown can be received by its photosensitive surface. In this way, the ambient light sensor can determine the ambient light intensity in the current environment based on the intensity of the light received by the photosensitive surface. Figure 3 , ambient light can pass through the glass and be incident on the ambient light sensor, so that the ambient light sensor can respond accordingly according to the intensity of the received light and obtain an output value corresponding to the intensity of the received light.

[0052] It can be understood that when the light received by the ambient light sensor all comes from ambient light, the output value of the ambient light sensor can be used to identify the intensity of the ambient light.

[0053] However, if Figure 2 In the actual working process of the structure shown, Figure 3 As shown, among the light emitted by the LCD screen, a part of the light (such as the light leakage of the LCD screen) will also be received by the ambient light sensor. At this time, the light received by the ambient light sensor may include both the light leakage of the LCD screen and the ambient light. Therefore, the output value of the ambient light sensor cannot accurately indicate the ambient light intensity.

[0054] Currently, there is also an under-screen ambient light sensor solution that can detect ambient light using an ambient light sensor. For an example, please refer to Figure 4 , the ambient light sensor can be set below the screen. Figure 5 The working mechanism of the under-screen ambient light sensor is explained. Figure 5 As shown, ambient light can pass through glass and screen (such as an organic light-emitting diode (OLED) screen) to enter the ambient light sensor, so that the ambient light sensor responds to the received light and obtains a corresponding output value. It can be understood that since the ambient light sensor is located below the OLED screen, during the display of the OLED screen, the light received by the ambient light sensor can include both light 1 emitted by the OLED screen and light 2 of the ambient light passing through the glass and the OLED screen. In other words, in the embodiment of the present application, the output value of the ambient light sensor corresponds to the sum of light 1 and light 2.

[0055] In order to accurately obtain the ambient light intensity, Figure 4 or Figure 5 Based on the description, the mobile phone can determine the impact of light 1 emitted by the OLED screen on the ambient light sensor through calculation, and then subtract the impact of light 1 emitted by the OLED screen on the ambient light sensor from the output value of the ambient light sensor to obtain the intensity of light 2 of the ambient light passing through the glass and the OLED screen.

[0056] In other words, the mobile phone needs to perform additional calculations to obtain the ambient light intensity. As the screen refresh rate increases, the screen leakage has different effects on the ambient light intensity detected by the ambient light sensor when displaying each frame of the image. Therefore, the mobile phone needs to use more computing power to remove the effect of screen leakage to obtain accurate ambient light intensity. In addition, in order to provide users with a better display experience, the development of the screen has led to a decrease in screen transmittance. This also makes the proportion of ambient light in the light received by the ambient light sensor lower and lower, which will also affect the accuracy of the mobile phone in obtaining the ambient light intensity. It should be noted that for LCD screens, mobile phones can introduce additional calculations and use corresponding algorithms to deduct the effect of LCD screen leakage from the ambient light sensor. For OLED screens, due to the difference between the OLED light-emitting mechanism and LCD, the effect of OLED screen leakage on the ambient light sensor is more complicated (for example, the screen has different effects on the ambient light sensor when displaying images of different colors, etc.), so it is difficult to achieve the purpose of accurately and comprehensively deducting the effect of OLED screen leakage from the ambient light sensor through additional calculations.

[0057] In order to solve the above problems, an embodiment of the present application provides an ambient light detection method, which can avoid the influence of screen leakage and / or screen transmittance on ambient light detection, achieve accurate ambient light detection, and will not cause high computing power overhead on electronic devices.

[0058] The solution provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0059] It should be noted that the ambient light detection method provided in the embodiment of the present application can be applied to the user's electronic device. The electronic device can be a device with ambient light detection requirements. For example, the electronic device can be a portable mobile device with a shooting function such as a mobile phone, a tablet computer, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, a media player, etc., and the electronic device can also be a wearable electronic device such as a smart watch. The embodiment of the present application does not impose any special restrictions on the specific form of the device.

[0060] Please refer to Figure 6 , is a structural diagram of an electronic device 400 provided in an embodiment of the present application.

[0061] like Figure 6As shown, the electronic device 600 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, an earphone interface 670D, a sensor module 680, a button 690, a motor 691, an indicator 692, a camera 693, a display screen 694, and a subscriber identification module (SIM) card interface 695, etc. Among them, the sensor module 680 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0062] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 600. In other embodiments, the electronic device 600 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0063] The processor 610 may include one or more processing units, for example, the processor 610 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or may be integrated into one or more processors 610. In some embodiments, the processor 610 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0064] The electronic device 600 can realize the shooting function through ISP, camera 693, video codec, GPU, display screen 694 and application processor.

[0065] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 600 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0066] Video codecs are used to compress or decompress digital videos. The electronic device 600 may support one or more video codecs. Thus, the electronic device 600 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0067] NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic device 600, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0068] The charging management module 640 is used to receive charging input from a charger, which may be a wireless charger or a wired charger. The power management module 641 is used to connect the battery 642, the charging management module 640 and the processor 610.

[0069] The wireless communication function of the electronic device 600 can be implemented through the antenna 1, the antenna 2, the mobile communication module 650, the wireless communication module 660, the modem processor 610 and the baseband processor 610, etc.

[0070] The electronic device 600 implements the display function through a GPU, a display screen 694, and an application processor 610. The GPU is a microprocessor for image processing, which connects the display screen 694 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 610 may include one or more GPUs, which execute program instructions to generate or change display information.

[0071] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 600. The external memory card communicates with the processor 610 through the external memory interface 620 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0072] The internal memory 621 may be used to store computer executable program codes, which include instructions. The processor 610 executes various functional applications and data processing of the electronic device 600 by running the instructions stored in the internal memory 621. The internal memory 621 may include a program storage area and a data storage area.

[0073] The electronic device 600 can implement audio functions such as music playing and recording through the audio module 670, the speaker 670A, the receiver 670B, the microphone 670C, the headphone jack 670D, and the application processor 610.

[0074] The touch sensor is also called a "touch panel". The touch sensor can be set on the display screen 694. The touch sensor and the display screen 694 form a touch screen, also called a "touch screen". The touch sensor is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.

[0075] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be arranged on the display screen 694.

[0076] like Figure 6 As shown, in the embodiment of the present application, the electronic device 600 may also be provided with an ambient light sensor for sensing the brightness of the ambient light.

[0077] The ambient light detection method provided in the embodiments of the present application can be applied to Figure 6 In an electronic device composed as shown.

[0078] The ambient light detection solution provided in the embodiment of the present application can accurately determine the influence of screen leakage on the ambient light detection unit provided in the electronic device when detecting ambient light, and extract the influence of screen leakage from the output of the ambient light detection unit by calculation, thereby obtaining accurate ambient light detection results. Figure 3 or Figure 4 The scheme shown is a scheme in which the mobile phone calculates and determines the influence of screen light leakage according to the display of each frame of the screen image. In an embodiment of the present application, the above-mentioned effect can be achieved by arranging two ambient light detection units. Exemplarily, the two ambient light detection units may include a first ambient light detection unit and a second ambient light detection unit. In the process of ambient light detection, the first ambient light detection unit can be used to receive ambient light and screen light leakage, and the second ambient light detection unit can be used to receive screen light leakage. The electronic device can accurately remove the influence of screen light leakage from the response of the first ambient light detection unit based on the response of the second ambient light detection unit to screen light leakage, combined with the calibration coefficient determined by calibration (such as dark field calibration coefficient and bright field calibration coefficient), thereby obtaining accurate ambient light detection results.

[0079] It should be understood that the ambient light detection unit involved in the embodiments of the present application can be implemented by a device or component having an ambient light detection function. For example, the ambient light detection unit can be an ambient light sensor. For ease of description, in the following description of the embodiments of the present application, the first ambient light detection unit is used as the main ambient light sensor, and the second ambient light detection unit is used as the auxiliary ambient light sensor.

[0080] For example, in the embodiments of the present application, Figure 7 As shown, the electronic device may be configured with a main ambient light sensor (such as referred to as the main ALS for short) and an auxiliary ambient light sensor (such as referred to as the auxiliary ALS for short). The main ALS can be used to receive a first light (such as including ambient light and screen light leakage), and the auxiliary ALS can be mainly used to receive a second light (such as including screen light leakage). The electronic device can calculate and obtain the ambient light intensity based on the main ALS and the auxiliary ALS and the calibration coefficient. In an embodiment of the present application, the calibration coefficient may include a dark field calibration coefficient K and a bright field calibration coefficient a. The dark field calibration coefficient can be used to identify the difference in response of the main ALS and the auxiliary ALS to screen light leakage, and the bright field calibration coefficient a can be used to identify the difference in response of the main ALS and the auxiliary ALS to ambient light.

[0081] It should be noted that in some implementations, in order to make the screen leakage received by the auxiliary ALS close to or equal to the screen leakage received by the main ALS, the main ALS and the auxiliary ALS can be set close to each other. For example, the distance between the photosensitive surfaces of the main ALS and the auxiliary ALS is controlled to be no more than 3 mm.

[0082] In some embodiments, by coating the glass above the main ALS and / or the auxiliary ALS (such as in the positive direction of the Z axis), the transmission characteristics of the ambient light in different areas when passing through the glass can be changed, so that the main ALS receives the ambient light and screen leakage, and the auxiliary ALS mainly receives the screen leakage. It should be understood that in the embodiment of the present application, the differential processing of the ambient light incident on the main ALS and the auxiliary ALS is achieved by coating the glass. In some other embodiments of the present application, it is also possible to deploy inks with different transmittances to ambient light (such as white light) on the glass so that the ambient light can pass through the glass and the ink to be incident on the main ALS. Correspondingly, the ambient light can be reflected at the ink deployed corresponding to the auxiliary ALS, so that the auxiliary ALS does not receive (or basically does not receive) the ambient light. As a possible implementation, the ink deployed corresponding to the main ALS can be a transparent black ink, and the ink deployed corresponding to the auxiliary ALS can be an opaque ink.

[0083] Exemplary, combined Figure 8 .like Figure 8As shown in (a) of FIG. 1 , a coating region 1 can be formed by coating above the main ALS, and a coating region 2 can be formed by coating above the auxiliary ALS. When light passes through glass (or glass cover), as shown in FIG. Figure 8 As shown in (b) in the figure, the coating area 1 can allow ambient light to pass through and then be incident on the main ALS, thereby enabling the main ALS to receive ambient light. In addition, the coating area 2 can reflect ambient light, so that after passing through the glass, the ambient light is reflected at the coating area 2 instead of being projected onto the auxiliary ALS. As a result, the auxiliary ALS will not receive ambient light. When an image is displayed on the display screen, the auxiliary ALS can receive screen leakage light. It can be understood that when the main ALS is working, if an image is displayed on the display screen, the main ALS will also receive screen leakage light at the same time. In this way, the following can be achieved: Fig. 9 The light receiving effect shown, that is, the main ALS can receive ambient light and screen leakage light, while the auxiliary ALS can mainly receive screen leakage light.

[0084] In such Figure 7-Figure 9 In the example shown, the electronic device may be configured with one main ALS and one auxiliary ALS. The relative position relationship between the main ALS and the auxiliary ALS is not limited. Figure 7 In the example, the ambient light sensor on the left can be the main ALS, and correspondingly, the ambient light sensor on the right can be the auxiliary ALS. In other examples, the ambient light sensor on the left can be the auxiliary ALS, and correspondingly, the ambient light sensor on the right can be the main ALS. In some embodiments, the distance between the main ALS and the auxiliary ALS can be less than a preset threshold. For example, the preset threshold can be less than or equal to 3 mm. As a result, the screen leakage light incident on the main ALS and the auxiliary ALS can be basically the same, thereby improving the accuracy of the solution provided in the embodiment of the present application.

[0085] It should be noted that the functions of the main ALS and the auxiliary ALS can also be integrated into the same component. For example, taking one main ALS and one auxiliary ALS as an example, their functions can be implemented by an ambient light sensor configured with at least two photosensitive areas. Exemplarily, one of the photosensitive areas can be used to receive ambient light and screen leakage, that is, to implement the function of the main ALS. The other photosensitive area can be mainly used to receive screen leakage, that is, to implement the function of the auxiliary ALS.

[0086] As a possible implementation, it is assumed that two ambient light sensors (such as one main ALS and one auxiliary ALS) are configured in an electronic device, and the electronic device is a mobile phone. Fig.10 , is a schematic diagram of the distribution position of an ambient light sensor provided in an embodiment of the present application. Fig.10In the example of FIG. 1 , both the main ALS and the auxiliary ALS can be arranged in the gap between the display screen and the housing of the mobile phone, so that the main ALS can receive ambient light through the gap.

[0087] In another possible implementation, it is still assumed that the electronic device is equipped with two ambient light sensors (such as one main ALS and one auxiliary ALS), and the electronic device is a mobile phone. Fig.11 , which is a schematic diagram of the distribution position of another ambient light sensor provided in the present application. In this example, the ambient light sensor can also be arranged under the display screen. It can be understood that when the display screen is working, the screen may include an effective display area (Active Area, AA area, or operable area) and a non-AA area. In this example, the ambient light sensor can be arranged in the projection area of ​​the non-AA area in the Z direction as shown in the figure. In this way, when the main ALS is working, ambient light can be incident on the main ALS through the non-AA area of ​​the display screen, thereby enabling the ALS to detect the ambient light.

[0088] In the above examples, the positions of two ambient light sensors in the electronic device are the same as an example. For example, the main ALS and the auxiliary ALS can be located in the gap at the same time, or at the bottom of the screen at the same time (such as below the non-AA area, etc.). In other embodiments of the present application, the positions of the main ALS and the auxiliary ALS can also be different. For example, the main ALS can be located in the gap, and the auxiliary ALS can be located below the screen, etc.

[0089] In addition, in the above examples, two ambient light sensors are configured in the electronic device for illustration. In other embodiments, more main ALS and / or auxiliary ALS can be configured in the electronic device. The more ambient light sensors there are, the higher the accuracy of detecting the ambient light intensity. In some implementations, when multiple ambient light sensors are configured in the electronic device, the positions of the main ALS and the auxiliary ALS can be set at intervals.

[0090] For example, the electronic device may be configured with two main ALSs and one auxiliary ALS. Alternatively, the electronic device may be configured with one main ALS and two auxiliary ALSs. Fig.12 , taking an electronic device equipped with three ambient light sensors (such as ALS1, ALS2, and ALS3) as an example.

[0091] Then, ALS1 and ALS3 may be primary ALSs, and correspondingly, ALS2 may be a secondary ALS. In other implementations, ALS1 and ALS3 may be secondary ALSs, and ALS2 may be a primary ALS.

[0092] In the following description, an example is firstly given in which two ambient light sensors are configured in an electronic device.

[0093] Exemplary, combined Fig.13 , is a logic diagram of an ambient light detection provided by an embodiment of the present application. Fig.13 As shown, when performing ambient light detection, both the main ALS and the auxiliary ALS can respond accordingly based on the received light, thereby obtaining their respective corresponding reporting values. For example, the main ALS can respond accordingly based on the received ambient light and screen leakage to obtain a first value. The auxiliary ALS can respond accordingly based on the received screen leakage to obtain a second value.

[0094] The main ALS and the auxiliary ALS can transmit the reported values ​​(such as the first value and the second value) to the processor of the electronic device, so that the processor can determine the ambient light intensity according to the first value and the second value. In an embodiment of the present application, the processor can determine the current ambient light intensity according to the calibration coefficient in the electronic device, combined with the first value and the second value. In some embodiments, Fig.13 As shown, the calibration coefficient may be stored in a memory of the electronic device. The electronic device may read the calibration coefficient from the memory when the calibration coefficient is needed. In other embodiments of the present application, the calibration coefficient may also be stored in the cloud or set by the user. In the following embodiments, the calibration coefficient is pre-stored in the memory as an example for explanation.

[0095] It can be understood that, in this example, the calibration coefficient can be obtained through a calibration process.

[0096] In the following, an example is given in which two ambient light sensors (such as a main ALS and an auxiliary ALS) are configured in an electronic device to illustrate a method for obtaining a calibration coefficient.

[0097] For example, Fig.14 As shown, in this example, the calibration process of obtaining the calibration coefficients (such as the dark field calibration coefficient K and the bright field calibration coefficient a) may include the following four steps:

[0098] Step 1. Start.

[0099] The electronic device can be configured with a corresponding calibration program so that the electronic device can cooperate with the following steps to perform the calibration process in each step. In addition, through the calibration program, the electronic device can also store the results obtained through step 2 (such as dark field calibration) and step 3 (such as bright field calibration), and then calculate the calibration coefficient corresponding to the electronic device according to the results of the dark field calibration and the results of the bright field calibration.

[0100] Step 2: Dark field calibration.

[0101] In this step, the electronic device can obtain a dark field calibration coefficient K through dark field calibration.

[0102] During the dark field calibration process, the electronic device may be in a dark field environment. Among them, the dark field environment may be an environment where the ambient light intensity is 0. That is to say, during the dark field calibration process, there is no light from the outside. In some embodiments, the electronic device may determine that the current environment is a dark field environment in the following manner. Exemplarily, the electronic device may control the backlight brightness of the display screen to 0, that is, it is in the screen-off state. The electronic device may also start working by setting the main ALS and / or auxiliary ALS, and obtain the report value of the ambient light sensor. When the report value of the main ALS and / or the auxiliary ALS is less than a preset threshold value (such as a dark field threshold value), it is determined that the current environment is a dark field environment.

[0103] It can be understood that, in combination with the above description, both the main ALS and the auxiliary ALS can be used to receive light. Among them, the main ALS can receive ambient light. Therefore, in a dark field environment, the ambient light received by the main ALS is close to 0. At the same time, since the display screen is in the off state, there is no screen leakage, that is, when the report value of the main ALS is less than the dark field threshold, it indicates that the intensity of the light (i.e., ambient light) received by the main ALS is very small, then it indicates that the current environment is a dark field environment.

[0104] In other embodiments, the electronic device can further accurately determine that the current environment is a dark field environment through the value reported by the auxiliary ALS. Figure 8 As shown in the description, under ideal conditions, the auxiliary ALS may not receive any ambient light at all. However, in actual implementation, since the main ALS and the auxiliary ALS are very close (such as within 3mm in the above example), it is difficult for the two to completely isolate the light, so the auxiliary ALS will still receive some ambient light. Then, in this example, it is also possible to determine that the current environment is a dark field environment based on the report value of the auxiliary ALS in the current environment. For example, when the report value of the auxiliary ALS is less than the corresponding dark field threshold, it indicates that the light intensity received by the auxiliary ALS is very small, and since the current display screen is in the off state, the light intensity received by the auxiliary ALS only comes from ambient light. Therefore, it can be determined that the current environment is a dark field environment.

[0105] It should be noted that, in different implementations, the dark field threshold corresponding to the main ALS and the dark field threshold corresponding to the auxiliary ALS may be the same or different.

[0106] In other embodiments of the present application, the current environment can also be determined as a dark field environment in combination with the reported values ​​of the main ALS and the auxiliary ALS. For example, when the reported value of the main ALS is less than the dark field threshold corresponding to the main ALS, and the reported value of the auxiliary ALS is less than the dark field threshold corresponding to the auxiliary ALS, the electronic device can determine that the current environment is a dark field environment. Correspondingly, when the reported value of the main ALS is greater than the dark field threshold corresponding to the main ALS, or the reported value of the auxiliary ALS is less than the dark field threshold corresponding to the auxiliary ALS, the electronic device can determine that there is still ambient light in the current environment and does not meet the dark field requirements, and the dark field calibration can be stopped.

[0107] After the electronic device determines that the current environment is a dark field environment, dark field calibration can begin.

[0108] It is understandable that due to the influence of environment and position, even if the main ALS and the auxiliary ALS use the same sensor, the responses (i.e., reported values) of the main ALS and the auxiliary ALS may be different under the same lighting environment. Therefore, in this example, dark field calibration can be performed to determine the dark field calibration coefficient using screen leakage as a single light source. The dark field calibration coefficient can be used to identify the difference in light perception between the main ALS and the auxiliary ALS. Exemplarily, the dark field calibration coefficient can be identified by the ratio of the reported values ​​of the main ALS and the auxiliary ALS.

[0109] In some embodiments, in combination Fig.15 , the electronic device can control the display screen to display the first interface. The first interface can be a single color interface. For example, take the first interface as a white interface. Then both the main ALS and the auxiliary ALS can receive screen leakage when the display screen displays white. The electronic device can also obtain the corresponding reported values ​​of the main ALS and the auxiliary ALS. For example, the reported value of the group ALS is the third value, and the reported value of the auxiliary ALS is the fourth value. In this way, the dark field calibration coefficient can be obtained. For example, taking the third value as M and the fourth value as S during the dark field calibration process as an example. Then the dark field calibration coefficient K can be determined by the following formula (1):

[0110] K=M / S Formula (1)

[0111] In other embodiments, the electronic device can also control the display screen to display other colors (such as displaying a second interface different from the first interface, where the second interface can be a single color interface with a color different from the first interface) to obtain a more accurate dark field calibration coefficient. For example, the electronic device can display the second interface after completing the dark field calibration based on the first interface. Obtain the fifth value reported by the main ALS and the sixth value reported by the auxiliary ALS. Based on the fifth value and the sixth value, the electronic device can calculate and obtain the dark field calibration coefficient corresponding to the current interface color.

[0112] It is understandable that the ambient light sensor generally responds differently to light of different frequencies (i.e., light of different colors or wavelengths). In addition, the transmittance of the screen and the light-diffusing film material to light of different frequencies also varies. Therefore, in actual operation, when the display screen displays images of different colors, the dark field calibration coefficient may be different. For example, Fig.17 As shown, in an environment with the same frequency of light, the response difference between the main ALS and the auxiliary ALS is close to a constant ratio (as indicated by the dark field calibration coefficient). However, in an environment with different frequencies of light (such as red light and blue light), the ratio of the response difference between the main ALS and the auxiliary ALS may be different.

[0113] In this example, the accuracy of the obtained dark field calibration coefficient can be increased through dark field calibration of the multi-color image.

[0114] For example, the electronic device can perform dark field calibration based on the above example (i.e., controlling the display screen to display white), and then repeat the above example when displaying other colors. Fig.15 The dark field calibration process is shown, and the dark field calibration coefficients corresponding to different frequency lights in various environments are obtained.

[0115] As an example, take an electronic device displaying white, red, green, and blue respectively. The electronic device can obtain a dark field calibration coefficient of K1 when displaying a white interface. The electronic device can obtain a dark field calibration coefficient of K2 when displaying a red interface. The electronic device can obtain a dark field calibration coefficient of K3 when displaying a green interface. The electronic device can obtain a dark field calibration coefficient of K4 when displaying a blue interface. Then, based on the dark field calibration coefficients in different scenarios, the electronic device can determine the dark field calibration result (such as K0) after comprehensive judgment. For example, K0 = (K1 + K2 + K3 + K4) / 4.

[0116] Thus, the electronic device can obtain the dark field calibration coefficient. In the following example, the dark field calibration coefficient K=M / S is taken as an example.

[0117] Step 3: Bright field calibration.

[0118] After completing the dark field calibration, the electronic device can obtain the difference in the response of the main ALS and the auxiliary ALS to the same lighting environment. Based on this, the electronic device can perform bright field calibration to obtain the relationship between the reported value obtained by the ambient light sensor and the actual ambient light intensity in the working environment. In this example, the relationship between the reported value obtained by the ambient light sensor and the actual ambient light intensity can be identified by the bright field calibration coefficient.

[0119] As an example, during bright field calibration, the electronic device can be in a fixed lighting environment. For example, the light source can be placed directly above the sensor of the electronic device. The electronic device can control the display screen to be in a screen-off state, that is, during the bright field calibration process, the display screen itself does not emit light, and there is no screen light leakage. In this example, during bright field calibration, the light source can be set according to a preset intensity, for example, the intensity of the light source can be a target value L.

[0120] In this environment, the electronic device can obtain the corresponding reports of the main ALS and the auxiliary ALS. Fig.16 , the value reported by the main ALS can be the seventh value (such as x), and the value reported by the auxiliary ALS can be the eighth value (such as y). Combined with the above description, under ideal conditions, or when the light isolation between the main ALS and the auxiliary ALS is good, the auxiliary ALS can only receive light leakage from the screen, but not external ambient light. At this time, the value reported by the auxiliary ALS during the bright field calibration process is y=0. In general, the auxiliary ALS will also receive some ambient light, in which case the value reported by the auxiliary ALS during the bright field calibration process is y>0.

[0121] The electronic device can determine the output value Z of the main ALS to the ambient light in the current bright field environment based on the reported value x of the main ALS and the reported value of the auxiliary ALS, combined with the dark field calibration coefficient K obtained in the dark field calibration. In this application, the output value Z can also be called the first response value. For example, Z can be obtained by the following formula (2):

[0122] Z=xK×yFormula (2)

[0123] In this way, the electronic device can complete the bright field calibration. The Z value thus obtained can also be called the bright field calibration coefficient. For example, the bright field calibration coefficient can be the output value of the sensor in the current bright field environment. It can be understood that the output value Z of the sensor can correspond to the ambient light intensity in the current bright field calibration environment. Therefore, based on the output value and the ambient light intensity in the current environment, the calibration coefficient a in the bright field (i.e., in a normal working environment) can be determined. For example, the calibration coefficient a can be determined by the following formula (3):

[0124] a=L / Z=L / (xK×y) Formula (3)

[0125] Step 4, end.

[0126] Through the above steps 1 to 3, the electronic device can complete most of the calibration process and obtain the dark field calibration coefficient K and the bright field calibration coefficient a. In some embodiments, the electronic device can store the calibration results (such as the dark field calibration coefficient K and the bright field calibration coefficient a) in the memory of the electronic device, so that when it is necessary to determine the ambient light intensity, the processor of the electronic device can call the calibration coefficients in the memory (such as calling the dark field calibration coefficient K and the bright field calibration coefficient a) to calculate and obtain the accurate ambient light intensity.

[0127] It can be understood that the dark field calibration coefficient and the bright field calibration coefficient obtained during the calibration process according to the above steps 1 to 4 can be used to identify the difference in response of the main ALS and the auxiliary ALS to the received light. For products of the same design, the difference between the dark field calibration coefficient and the bright field calibration coefficient will not be too large. Therefore, in some embodiments of the present application, it is also possible to determine whether there is a problem with the electronic device currently being calibrated based on the dark field calibration coefficient and / or the bright field calibration coefficient, that is, to intercept defective products based on the dark field calibration coefficient and / or the bright field calibration coefficient.

[0128] Exemplarily, a valid interval of a dark field calibration coefficient (such as a dark field calibration interval) and a valid interval corresponding to a bright field calibration coefficient (such as a bright field calibration interval) may be configured in the electronic device. When the dark field calibration coefficient and the bright field calibration coefficient of the electronic device being calibrated are both within the corresponding valid intervals, it indicates that the electronic device does not need to be intercepted. Correspondingly, when the dark field calibration coefficient or the bright field calibration coefficient of the electronic device being calibrated is outside the corresponding valid interval, it indicates that there is a problem with the electronic device, and the problem can be intercepted to confirm.

[0129] As an example, Fig.18 FIG. 1 shows a schematic diagram of the process of intercepting defective products according to the dark field calibration coefficient and the bright field calibration coefficient. Fig.18 As shown, the program may include:

[0130] S1801, start.

[0131] The execution of this process can refer to Fig.14 The description of step 1 shown in the figure is not repeated here.

[0132] S1802, obtaining dark field calibration coefficients.

[0133] The execution of this process can refer to Fig.14 The description of step 2 shown in the figure is not repeated here.

[0134] S1803A, determine whether the dark field calibration coefficient is within the dark field calibration range.

[0135] In this example, after acquiring the dark field calibration coefficient K, the electronic device may determine whether to perform a subsequent calibration according to whether the dark field calibration coefficient is within the dark field calibration interval.

[0136] Exemplarily, when the dark field calibration coefficient K is within the dark field calibration interval, it indicates that the dark field calibration of the current electronic device is normal, and subsequent operations can be continued, such as executing S1804. Correspondingly, when the dark field calibration coefficient K is outside the dark field calibration interval, it indicates that the dark field calibration result of the current electronic device is abnormal, and the electronic device can stop the current calibration process and intercept the electronic device.

[0137] In some embodiments, when the electronic device determines that the dark field calibration of the current electronic device is abnormal, it can execute S1803B, that is, issue a dark field calibration failure warning and record a dark field calibration record. In some implementations, the dark field calibration record may include at least one of the following information: the main ALS value, the auxiliary ALS value, the dark field calibration coefficient K, and the upper and lower thresholds of the dark field calibration interval (i.e., the upper and lower endpoint values ​​of the dark field calibration interval). After that, the electronic device can end the calibration, such as executing S1807, and displaying that the calibration failed. In this way, according to the dark field calibration record, the problem of the current electronic device can be located and analyzed. For example, if the dark field calibration coefficient K value exceeds the dark field calibration interval, the reasons may be that the light-averaging ink has a poor light-averaging effect, foreign objects such as overflow glue block the photosensitive area, the tolerance of the device welding position or assembly is too large, and the sensor itself is abnormal. In this way, defective products can be intercepted during the dark field calibration process.

[0138] In the case where the electronic device has passed the dark field calibration, S1804 may be executed.

[0139] S1804, obtaining a bright field calibration coefficient.

[0140] The execution of this process can refer to Fig.14 The description of step 3 shown in the figure is not repeated here.

[0141] S1805A, determine whether the bright field calibration coefficient is within the bright field calibration range.

[0142] Similar to the interception of defective products during the dark field calibration process, during the bright field calibration process, the electronic device can intercept defective products based on the relationship between the bright field calibration coefficient and the corresponding bright field calibration interval.

[0143] Exemplarily, when the bright field calibration coefficient is within the bright field calibration interval, it indicates that the current electronic device has no abnormality and does not need to be intercepted. For example, the subsequent S1806 is executed. Correspondingly, when the bright field calibration coefficient is outside the bright field calibration interval, it indicates that the bright field calibration of the current electronic device has failed. For example, the electronic device can execute S1805B, that is, execute a bright field calibration failure warning and record a bright field calibration record. Among them, the bright field calibration record may include at least one of the following information: the main ALS value, the auxiliary ALS value, the bright field calibration coefficient a, and the upper and lower thresholds of the bright field calibration interval (i.e., the upper and lower endpoint values ​​of the bright field calibration interval). Afterwards, the electronic device can end the calibration, such as executing S1807 to display a calibration failure.

[0144] In this way, based on the bright field calibration record, the problem of the current electronic equipment can be located and analyzed. For example, if the bright field calibration coefficient a value exceeds the bright field calibration range, the reason may be that the ink area of ​​the main photosensitive area is too large or too small, foreign objects such as overflow glue block the photosensitive area, the tolerance of the device welding position or assembly is too large, the sensor itself is abnormal, etc. In this way, defective products can be intercepted during the bright field calibration process.

[0145] S1806, end.

[0146] If the bright field calibration process and dark field calibration coefficient of the electronic device are successfully passed, it is indicated that there is no abnormality in the calibration process of the electronic device and no interception is required. The electronic device can store the bright field calibration coefficient and the dark field calibration coefficient for subsequent ambient light intensity detection.

[0147] It is understandable that through the above description, those skilled in the art should be able to accurately understand the implementation details of the ambient light detection scheme provided in the embodiment of the present application, as well as the acquisition method of the calibration coefficient used in the ambient light detection scheme. Through this scheme, the electronic device can accurately detect the ambient light without large computing power overhead.

[0148] The following is an example to illustrate the process of obtaining the calibration coefficient.

[0149] In some embodiments, it is taken as an example that two ambient light sensors (such as one main ALS and one auxiliary ALS) are configured in an electronic device, and each ambient light sensor has a four-channel RGBC (ie, red, green, blue, and visible light) light detection capability.

[0150] The calibration process is as follows:

[0151] Step (1), when the electronic device is in a dark room environment, the processor of the electronic device controls the screen backlight brightness to 0, that is, the screen is off. The main ALS and the auxiliary ALS report values ​​respectively. According to the reported values ​​of the main ALS and the auxiliary ALS, and the preset dark field threshold, determine whether the current environment is a dark field environment. When it is determined that the current environment is a dark field environment, start dark field calibration. The electronic device controls the screen to display a pure white picture through the processor and enters step (2).

[0152] Step (2), the main ALS and the auxiliary ALS report values ​​respectively. In this example, each sensor can report values ​​on the four channels of RGBC respectively. For example, the main ALS reports values ​​of RGBC as M1, M2, M3, and M4 respectively. Similarly, the auxiliary ALS reports values ​​of RGBC channels as S1, S2, S3, and S4 respectively. The processor can calculate and obtain the dark field calibration coefficients of each channel based on this, K1c=M1 / S1, K2c=M2 / S2, K3c=M3 / S3, and K4c=M4 / S4.

[0153] Step (3), determine whether the dark field calibration coefficients (such as K1c-K4c) are all within the dark field calibration range. If they are within the dark field calibration range, proceed to step (4). Otherwise, determine that the current electronic device calibration has failed, alert the user that the dark field calibration is abnormal, record relevant logs, and end the calibration.

[0154] Step (4): The processor switches the solid color image displayed on the screen to red, green, and blue. Repeat steps (2) to (3), obtain the sensor report value and calculate the corresponding dark field calibration coefficient, and determine whether the dark field calibration coefficient is within the dark field calibration range. For example, when the screen displays red, the dark field calibration coefficients of the four RGBC channels are calculated to be K1r, K2r, K3r, and K4r respectively; when displaying green, the dark field calibration coefficients calculated are K1g, K2g, K3g, and K4g; when displaying blue, the dark field calibration coefficients calculated are K1b, K2b, K3b, and K4b. When all dark field calibration coefficients are within the corresponding dark field calibration range, proceed to step (5).

[0155] Step (5), calculate the mean of the dark field calibration coefficients of the four channels of RGBC, and obtain the dark field calibration coefficients applicable to the four channels of RGBC: K1 = (K1c + K1r + K1g + K1b) / 4, K2 = (K2c + K2r + K2g + K2b) / 4, K3 = (K3c + K3r + K3g + K3b) / 4, K4 = (K4c + K4r + K4g + K4b) / 4. Store the four dark field calibration coefficients (such as K1, K2, K3 and K4) in the memory (such as non-volatile storage medium) of the electronic device. Then enter the bright field calibration, that is, enter step (6).

[0156] Step (6), transfer the electronic device to a bright field calibration environment, place the main ALS and the auxiliary ALS of the electronic device directly under the calibration light source, control the screen backlight to turn off, ensure that the screen itself does not emit light, and light up the calibration light source. The target light intensities corresponding to the four RGBC channels of the calibration light source are L1, L2, L3, and L4 respectively.

[0157] Step (7), the processor obtains the reported values ​​of each channel of the main ALS and the auxiliary ALS. For example, the reported values ​​of each RGBC channel of the main ALS are x1, x2, x3, x4, and the reported values ​​of RGBC of the auxiliary ALS are y1, y2, y3, y4. Then the equivalent ambient light reported values ​​of each RGBC channel of the current electronic device are z1=x1-K1×y1, z2=x2-K2×y2, z3=x3-K3×y3, z4=x4-K4×y4. Use z1, z2, z3, z4 for calibration, and calculate the bright field calibration coefficients of each RGBC channel a1=L1 / z1, a2=L2 / z2, a3=L3 / z3, a4=L4 / z4.

[0158] Step (8), determining whether the bright field calibration coefficient is within the bright field calibration interval, if it is within the bright field calibration interval, storing the bright field calibration coefficient in the non-volatile memory of the device. Otherwise, determining that the electronic device calibration has failed, alerting the user that the bright field calibration is abnormal, and recording relevant logs.

[0159] Through the above steps (1) to (8), the dark field calibration coefficients K1-K4 and the bright field calibration coefficients a1-a4 can be obtained. These calibration coefficients can be stored in a memory. When the electronic device needs to detect the ambient light intensity, the dark field calibration coefficients K1-K4 and the bright field calibration coefficients a1-a4 can be called from the memory to accurately calculate the ambient light intensity of the current environment.

[0160] The above steps (1) to (8) provide a method for obtaining the calibration coefficient when one main ALS and one auxiliary ALS are configured. The following is an example of the process of obtaining the calibration coefficient when one main ALS and two auxiliary ALSs are configured in an electronic device with a specific example. In this example, the two auxiliary ALSs can be on both sides of the main ALS, respectively. Thus, one of the two auxiliary ALSs can form an ambient light detection device with the main ALS. Correspondingly, the other auxiliary ALS can form an ambient light detection device with the ALS. Through the operation of these two ambient light detection devices, the accuracy of the acquired ambient light intensity can be improved.

[0161] For example, to simplify the description, the following takes the case where both the main ALS and the two auxiliary ALS are single-channel ambient light sensors as an example. The process of obtaining the calibration coefficient in this scenario may include:

[0162] Step (a), when the electronic device is in a dark room environment, the processor controls the screen backlight brightness to 0, that is, the screen is off. Obtain the report value of the main ALS and the two auxiliary ALS. If the report value is less than the set dark field threshold, it is determined that the electronic device is in a dark field environment. Start dark field calibration, control the screen of the electronic device to display a pure white picture through the processor, and enter step (b). Otherwise, it is prompted that there is light source in the current dark room environment, and the dark field calibration is suspended.

[0163] Step (b), obtaining the reported values ​​of the three environmental sensors. For example, if the reported value of the main ALS is M1, and the reported values ​​of the auxiliary ALS are S1B and S1C respectively, the processor calculates the dark field calibration coefficients as K1c=M1 / S1B, K2c=M1 / S1C.

[0164] Step (c) determines whether the dark field calibration coefficients are all within the dark field calibration interval. If they are within the dark field calibration interval, proceed to step (d). Otherwise, it is determined that the electronic equipment calibration has failed, an alarm is issued to indicate that the dark field calibration is abnormal, and relevant logs are recorded.

[0165] Step (d), the processor switches the pure color picture displayed on the screen to red, green, and blue. Repeat steps (b) and (c), obtain the sensor report value and calculate the dark field calibration coefficient. For example, when the screen displays red, the dark field calibration coefficients are K1r and K2r respectively; when it displays green, the dark field calibration coefficients are K1g and K2g; when it displays blue, the dark field calibration coefficients are K1b and K2b. According to the dark field calibration coefficient, determine whether the dark field calibration coefficient is within the dark field calibration range. When all dark field calibration coefficients are within the dark field calibration range, execute step (e).

[0166] Step (e), calculate the average of the dark field calibration coefficients of the sensor under each color background image, and obtain the dark field calibration coefficient applicable to each color: K1 = (K1c + K1r + K1g + K1b) / 4, K2 = (K2c + K2r + K2g + K2b) / 4. Store the two dark field calibration coefficients in the non-volatile memory of the electronic device.

[0167] Step (f), when the electronic device is in a bright field calibration environment, the light sensing areas of the main ALS and two auxiliary ALS of the electronic device are placed directly below the calibration light source, and the backlight of the electronic device is turned off to ensure that the screen itself does not emit light. The calibration light source is turned on. For example, the target value of the calibration under bright field calibration is L.

[0168] Step (g), the processor obtains the reported values ​​of the main ALS and the auxiliary ALS. For example, the reported value of the main ALS is x1, and the reported values ​​of the auxiliary ALS are y1 and y2 respectively. Then the two equivalent ambient light reported values ​​are z1=x1-K1×y1, z2=x1-K2×y2. Use z1 and z2 for calibration, and calculate and obtain two bright field calibration coefficients a1=L / z1, a2=L / z2.

[0169] Step (h), determining whether the bright field calibration coefficients are all within the bright field calibration interval, if so, storing the bright field calibration coefficients (such as a1 and a2) in the non-volatile memory of the electronic device. Otherwise, determining that the electronic device calibration has failed, an alarm is issued to indicate that the bright field calibration is abnormal, and recording relevant logs.

[0170] Through the above steps (a) to (h), the dark field calibration coefficients K1, K2 and the bright field calibration coefficients a1, a2 can be obtained. These calibration coefficients can be stored in a memory. When the electronic device needs to detect the ambient light intensity, the dark field calibration coefficients K1, K2 and the bright field calibration coefficients a1, a2 can be called from the memory to accurately calculate the ambient light intensity of the current environment.

[0171] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of electronic equipment. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0172] The embodiment of the present application can divide the functional modules of the devices involved therein according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0173] Please refer to Fig.19 , is a schematic diagram of the composition of another electronic device 1900 provided in an embodiment of the present application. Fig.19 As shown, the electronic device 1900 may include: a processor 1901 and a memory 1902. The memory 1902 is used to store computer-executable instructions. Exemplarily, in some embodiments, when the processor 1901 executes the instructions stored in the memory 1902, the electronic device 1900 may execute any of the ambient light detection methods shown in the electronic devices involved in the above embodiments.

[0174] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0175] Fig. 20 A schematic diagram of the composition of a chip system 2000 is shown. The chip system 2000 may include: a processor 2001 and a communication interface 2002, which are used to support related devices (such as electronic devices) to implement the functions involved in the above embodiments. In a possible design, the chip system also includes a memory for storing program instructions and data necessary for the electronic device. The chip system can be composed of chips, and can also include chips and other discrete devices. It should be noted that in some implementations of the present application, the communication interface 2002 may also be referred to as an interface circuit.

[0176] As an example, the chip system 2000 may store program instructions and data corresponding to the above steps (1) to (8) to support the electronic device to implement the dark field calibration provided in the embodiment of the present application. In other examples, the chip system 2000 may store program instructions and data corresponding to the above steps (a) to (h) to support the electronic device to implement the bright field calibration provided in the embodiment of the present application.

[0177] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0178] The functions or actions or operations or steps in the above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may include one or more servers, data centers and other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0179] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An ambient light detection method, characterized in that: Used in electronic equipment, The electronic device is provided with a first ambient light detection unit and a second ambient light detection unit, wherein the first photosensitive area of ​​the first ambient light detection unit is used to detect the intensity of a first light, and the second photosensitive area of ​​the second ambient light detection unit is used to detect the intensity of a second light, wherein the first light includes ambient light and screen leakage light, and the second light includes screen leakage light, The electronic device is provided with a calibration coefficient, the calibration coefficient being used to indicate a relationship between a first value and a second value and the intensity of the ambient light, the first value being an output value of the first ambient light detection unit in response to the first light, the second value being an output value of the second ambient light detection unit in response to the second light, The electronic device determines the intensity of the ambient light according to the first value, the second value, and the calibration coefficient; The calibration coefficient is obtained as follows: Acquire a dark field calibration coefficient, where the dark field calibration coefficient is used to indicate a difference in response between the first ambient light detection unit and the second ambient light detection unit to received screen leakage light; Determine a bright field calibration coefficient according to the dark field calibration coefficient, wherein the bright field calibration coefficient is used to indicate a correspondence between a first response value and an output value of the first ambient light detection unit and an output value of the second ambient light detection unit in the presence of ambient light, wherein the first response value corresponds to the intensity of the ambient light; The calibration coefficient is determined according to the bright field calibration coefficient and the ambient light intensity in a bright field calibration environment.

2. The method according to claim 1, characterized in that The dark field calibration coefficient is obtained through dark field calibration. The dark field calibration includes: In a dark field environment, the electronic device controls a display screen of the electronic device to display a first interface, and there is no ambient light in the dark field environment; acquiring a third value output by the first ambient light detection unit and a fourth value output by the second ambient light detection unit, The dark field calibration coefficient is obtained according to the third value and the fourth value.

3. The method according to claim 2, characterized in that Before the electronic device controls the display screen of the electronic device to display the first interface, the method further includes: The electronic device controls the display screen of the electronic device to turn off the screen, and the electronic device determines that the current environment is a dark field environment when the output value of the first ambient light detection unit and / or the second ambient light detection unit is less than a dark field threshold.

4. The method according to claim 2 or 3, characterized in that: The first interface is an interface of a single color.

5. The method according to claim 4, characterized in that The first interface is a white interface.

6. The method according to claim 2, 3 or 5, characterized in that: After acquiring the third value output by the first ambient light detection unit and the fourth value output by the second ambient light detection unit, the dark field calibration further includes: The electronic device controls the display screen of the electronic device to display a second interface; the color of the second interface is different from the first interface; acquiring a fifth value output by the first ambient light detection unit and a sixth value output by the second ambient light detection unit, The obtaining the dark field calibration coefficient according to the third value and the fourth value includes: The dark field calibration coefficient is calculated and obtained according to the third value, the fourth value, the fifth value, and the sixth value.

7. The method according to claim 2, 3 or 5, characterized in that: The bright field calibration coefficient is obtained through bright field calibration, The bright field calibration includes: In a bright field environment, the electronic device controls the display screen of the electronic device to turn off the screen, and a preset ambient light source is set in the bright field environment; acquiring a seventh value output by the first ambient light detection unit and an eighth value output by the second ambient light detection unit, The bright field calibration coefficient is determined according to the seventh value and the eighth value.

8. The method according to claim 7, characterized in that Determining the bright field calibration coefficient according to the seventh value and the eighth value includes: The bright field calibration coefficient is determined according to the following formula: Z = xK × y, Among them, Z is the bright field calibration coefficient, x is the seventh value, y is the eighth value, and K is the dark field calibration coefficient.

9. The method according to claim 2 or 3 or 5 or 8, characterized in that: The calibration coefficient is calculated according to the following formula: a=L / Z, Wherein, a is the calibration coefficient, L is the intensity of the preset ambient light source during the bright field calibration process, and Z is the bright field calibration coefficient.

10. The method according to claim 2 or 3 or 5 or 8, characterized in that: After obtaining the calibration coefficient, the method further includes: The calibration coefficients are stored in a memory of the electronic device.

11. The method according to claim 1 or 2 or 3 or 5 or 8, characterized in that: When the dark field calibration coefficient is not within the preset dark field calibration interval, it is determined that the calibration of the electronic device currently performing dark field calibration has failed, and / or, When the bright field calibration coefficient is not within the preset bright field calibration interval, it is determined that the calibration of the electronic device currently performing bright field calibration has failed.

12. An ambient light detection method, characterized in that: Applied to an electronic device, wherein a first ambient light detection unit and a second ambient light detection unit are provided in the electronic device, a first photosensitive area of ​​the first ambient light detection unit is used to detect the intensity of a first light, and a second photosensitive area of ​​the second ambient light detection unit is used to detect the intensity of a second light, the first light includes ambient light and screen leakage light, and the second light includes screen leakage light, and the method includes: The first ambient light detection unit receives the first light and outputs a first value, where the first value is used to identify the intensity of the first light; The second ambient light detection unit receives the second light and outputs a second value, where the second value is used to identify the intensity of the second light; The processor of the electronic device determines the intensity of the ambient light according to the first value, the second value, and a calibration coefficient stored in the electronic device; The calibration coefficient is obtained as follows: Acquire a dark field calibration coefficient, where the dark field calibration coefficient is used to indicate a difference in response between the first ambient light detection unit and the second ambient light detection unit to received screen leakage light; Determine a bright field calibration coefficient according to the dark field calibration coefficient, wherein the bright field calibration coefficient is used to indicate a correspondence between a first response value and an output value of the first ambient light detection unit and an output value of the second ambient light detection unit in the presence of ambient light, wherein the first response value corresponds to the intensity of the ambient light; The calibration coefficient is determined according to the bright field calibration coefficient and the ambient light intensity in a bright field calibration environment.

13. The method according to claim 12, characterized in that Before the processor of the electronic device determines the intensity of the ambient light according to the first value, the second value, and a calibration coefficient stored in the electronic device, the method further includes: The processor obtains the first value from the first ambient light detection unit, and obtains the second value from the second ambient light detection unit.

14. The method according to claim 12, characterized in that Before the processor of the electronic device determines the ambient light intensity in the current environment according to the first value, the second value, and the calibration coefficient stored in the electronic device, the method further includes: The processor reads the calibration coefficient from the memory of the electronic device, where the calibration coefficient is used to indicate the relationship between the first value and the second value and the ambient light intensity.

15. An electronic device, characterized in that: The electronic device comprises one or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories store computer instructions; When the one or more processors execute the computer instructions, the electronic device executes the ambient light detection method as described in any one of claims 1-11, or executes the ambient light detection method as described in any one of claims 12-14.

16. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the ambient light detection method as claimed in any one of claims 1 to 11, or to execute the ambient light detection method as claimed in any one of claims 12 to 14.

17. A chip system, characterized in that: The chip system includes an interface circuit and a processor; the interface circuit and the processor are interconnected via lines; the interface circuit is used to receive signals from a memory and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the ambient light detection method as described in any one of claims 1 to 11, or executes the ambient light detection method as described in any one of claims 12 to 14.

Citation Information

Patent Citations

  • Light sensation data acquisition method and device, electronic equipment and storage medium

    CN111380609A