Ambient light detection method and system, electronic equipment and storage medium
By rendering a full-black image when the user is not watching the display screen, extending the screen extinguishing time and performing ambient light detection during this period, the problem of low ambient light detection accuracy in the prior art is solved, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202411786921.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, ambient light detection methods generally have the problem of low detection accuracy, and no effective solution has been proposed.
By determining that the user is not looking at the display screen, the image to be displayed on the display screen is rendered into a completely black image, extend the screen extinguishing time of the display screen, and drive the ambient light sensor to perform ambient light detection within the extended black screen time.
It reduces light leakage on the display screen, improves the accuracy of ambient light detection, and solves the problem of low detection accuracy.
Smart Images

Figure CN119718245A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of sensors, and in particular to a method, system, electronic device and storage medium for ambient light detection. Background Art
[0002] Ambient light detection is to detect the brightness and color of the surrounding light through sensors, thereby adjusting the display brightness and color temperature of the device to optimize the user experience. This technology is widely used in smartphones, tablets, laptops and other electronic devices to ensure the readability and comfort of the screen under various lighting conditions. However, the ambient light detection method in related technologies generally has the technical problem of low detection accuracy, and no effective solution has been proposed for this technical problem. Summary of the invention
[0003] The embodiments of the present application provide a method, system, electronic device and storage medium for ambient light detection, so as to at least solve the technical problem of low detection accuracy commonly existing in ambient light detection methods in related technologies.
[0004] According to one aspect of an embodiment of the present application, a method for ambient light detection is provided, which is applied to an electronic device, wherein the electronic device includes a display screen and an ambient light sensor located below the display screen, including: determining that the user is not initially looking at the display screen; rendering an image to be displayed on the display screen as a completely black image; using the completely black image to extend the screen off time of the display screen to obtain an extended black screen time; and driving the ambient light sensor to perform ambient light detection during the extended black screen time.
[0005] Optionally, rendering the image to be displayed on the display screen as a completely black image includes: rendering one or more frames of images to be displayed on the display screen as completely black images; or rendering the image to be displayed on the display screen corresponding to the screen-on time in a pulse modulation (PWM) dimming method as a completely black image.
[0006] Optionally, when rendering one or more frames of images to be displayed on the display screen as a completely black image, the completely black image is used to extend the screen off time of the display screen to obtain an extended black screen time, including: obtaining the display time of the completely black image, wherein the display time of the completely black image is not greater than the time when the user is not looking at the display screen; and setting the display time of the completely black image to the extended black screen time.
[0007] Optionally, when the image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation PWM dimming mode is rendered as a completely black image, the screen-off time of the display screen is extended by the completely black image to obtain an extended black screen time, including: obtaining the screen-on time covered by the completely black image in the PWM dimming mode; setting the screen-on time covered by the completely black image and the screen-off time in the PWM dimming mode to the extended black screen time.
[0008] Optionally, driving the ambient light sensor to perform ambient light detection during the extended black screen time includes: setting the number of times the all-black image is displayed to a working frequency of the ambient light sensor performing ambient light detection; driving the ambient light sensor to perform ambient light detection at the working frequency during the extended black screen time.
[0009] Optionally, determining that the user is not looking at the display screen at the beginning includes: collecting a face photo of the user through the front camera of the electronic device, and identifying a blink of the user based on the face photo to thereby determine that the user is not looking at the display screen; or, collecting a face photo of the user through the front camera of the electronic device, and identifying that the direction in which the user's eyeballs are looking is not on the display screen based on the face photo to thereby determine that the user is not looking at the display screen; or, determining that the user is not looking at the display screen when the front camera of the electronic device does not collect facial information and the electronic device is in a light-screen state.
[0010] According to another aspect of an embodiment of the present application, a system for ambient light detection is also provided, including: a control component, used to control a front camera, a GPU, and an ambient light sensor using the above method; a front camera, used to capture a photo of a user's face to determine that the user is not looking at the display screen at the beginning; a GPU, used to render an image to be displayed on the display screen as a completely black image and input the completely black image to the display screen; an ambient light sensor, used to perform ambient light detection within the extended black screen time after obtaining an extended black screen time.
[0011] According to another aspect of the embodiments of the present application, an electronic device is provided, including: a processor, and a memory storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the method in any of the above embodiments.
[0012] According to another aspect of the embodiments of the present application, a non-transitory machine-readable medium storing computer instructions is also provided, where the computer instructions are used to enable a computer to execute the method in any of the above embodiments.
[0013] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which, when executed by a processor of a computer, causes the computer to execute the method in any of the above embodiments.
[0014] Beneficial effects of the embodiments of the present application:
[0015] In the embodiment of the present application, it is determined that the user is not looking at the display screen at the beginning; the image to be displayed on the display screen is rendered as a completely black image; the completely black image is used to extend the screen off time of the display screen to obtain an extended black screen time; and the ambient light sensor is driven to perform ambient light detection during the extended black screen time. In other words, the embodiment of the present application utilizes the gap when the user is not looking at the display screen, renders the image to be displayed on the display screen as a completely black image, uses the completely black image to extend the screen off time of the display screen, and drives the ambient light sensor to perform ambient light detection during the extended black screen time, thereby reducing light leakage from the display screen and improving the accuracy of ambient light detection, thereby solving the technical problem of low detection accuracy that is common in ambient light detection methods in related technologies.
[0016] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.
[0018] Figure 1 is a flow chart of a method for ambient light detection according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a full black image display time according to an embodiment of the present application;
[0020] Figure 3 is another schematic diagram of the display time of a completely black image according to an embodiment of the present application;
[0021] Figure 4 is another schematic diagram of a full black image display time according to an embodiment of the present application;
[0022] Figure 5 is another schematic diagram of a full black image display time according to an embodiment of the present application;
[0023] Figure 6 is a schematic diagram comparing the operating frequency of the ambient light sensor according to the embodiment of the present application and the operating frequency of the ambient light sensor in the prior art;
[0024] Figure 7is a structural schematic diagram of a device for ambient light detection according to an embodiment of the present application;
[0025] Figure 8 is a structural schematic diagram of a system for ambient light detection according to an embodiment of the present application;
[0026] Fig. 9 Schematic diagram of the structure of the electronic device of this embodiment. DETAILED DESCRIPTION
[0027] Embodiments of the present embodiment will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present embodiment are shown in the accompanying drawings, it should be understood that the present embodiment can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, which are instead provided for a more thorough and complete understanding of the present embodiment. It should be understood that the drawings and embodiments of the present embodiment are only for exemplary purposes and are not intended to limit the scope of protection of the present embodiment.
[0028] Explanation of terms
[0029] PWM dimming, through the rapid switching power supply circuit, allows the light source to switch on and off periodically over a period of time. Although the light source is constantly switching on and off, because the switching speed is very fast (usually between tens to several kilohertz), the human eye does not perceive the flickering phenomenon, but rather perceives a uniform brightness. The PWM signal has a fixed frequency and a variable duty cycle. The duty cycle indicates the proportion of time that the signal is at a high level within a PWM cycle. By adjusting the duty cycle, the average power output and brightness of the light source can be changed.
[0030] Ambient light sensors are devices used to detect and measure the light intensity in the environment. They can sense changes in light intensity and convert these changes into electrical signals. This electrical signal can be used to adjust the screen brightness of electronic devices, optimize the user's visual experience, and save energy.
[0031] There are two main ambient light detection methods in the current related technology: one is to collect light sensing data by using the screen off time of the display screen in pulse width modulation (PWM) dimming, but the screen off time is usually only 333us, or shorter, and there may still be some residual light on the display screen at the moment of screen off, which may be reflected in the cover of the electronic device and re-enter the ambient light sensor, thereby affecting the accuracy of the light sensing data. The other is to establish a light sensing model under the WRGB (i.e., white W sub-pixel, red R sub-pixel, green G sub-pixel, blue B sub-pixel) picture of the display screen, intercept the picture of the current picture during recognition, and eliminate the influence of the display screen through the background noise value in the light sensing model (i.e., the background light or light leakage when the display screen is turned off) to obtain the real light sensing data, but there are usually many reasons such as inaccurate extraction of the background noise value, which leads to the technical problem of low light sensing value accuracy in this method.
[0032] In order to solve the above problems, relevant solutions are provided in the embodiments of the present application, which are described in detail below. Figure 1 is a flow chart of a method for ambient light detection according to an embodiment of the present application. Figure 1 As shown, the method is applied to an electronic device, the electronic device includes a display screen and an ambient light sensor located below the display screen, and includes the following steps:
[0033] Step S102: determining that the user is not looking at the display screen at the beginning.
[0034] It should be noted that the above-mentioned scenarios where the user is not looking at the display screen at the beginning include but are not limited to: the user blinks (usually the blinking time is 0.2 to 0.4 seconds), the user's gaze is not on the display screen, the electronic device is placed on the desktop with the screen on, and the electronic device is shaking or walking with the screen on.
[0035] Step S104: Rendering the image to be displayed on the display screen as a completely black image.
[0036] Exemplarily, a graphics processor (GPU) may be controlled to render an image to be displayed on a display screen as a completely black image. For example, the GPU may render an image as completely black by directly clearing a frame buffer. Specifically, after binding the frame buffer, the clear color is set to black (usually 0, 0, 0, 1), and then a clear command is called to set the entire frame buffer to black. Alternatively, if a completely black image needs to be rendered quickly in a specific case, a completely black texture may be prepared, and then the texture may be covered to the entire rendering area, and the like.
[0037] Step S106, using a completely black image to extend the screen off time of the display screen to obtain an extended black screen time.
[0038] Optionally, in an embodiment of the present application, the extended black screen time may be just the display time of the all-black image, which is unrelated to PWM dimming, or it may be a combination of the PWM screen-on time covered by the all-black image and the PWM screen-off time. It can be adaptively adjusted according to specific application scenarios and user needs, and is not limited here.
[0039] Step S108, driving the ambient light sensor to perform ambient light detection during the extended black screen time.
[0040] Optionally, in an embodiment of the present application, the ambient light sensor may perform a single sampling or multiple sampling to take an average value during the extended black screen time, depending on specific application requirements, which is not limited here.
[0041] Through the above steps S102 to S108, it is determined that the user is not looking at the display screen at the beginning; the image to be displayed on the display screen is rendered as a completely black image; the completely black image is used to extend the screen off time of the display screen to obtain an extended black screen time; the ambient light sensor is driven to perform ambient light detection during the extended black screen time. In other words, the embodiment of the present application utilizes the gap when the user is not looking at the display screen, renders the image to be displayed on the display screen as a completely black image, uses the completely black image to extend the screen off time of the display screen, and drives the ambient light sensor to perform ambient light detection during the extended black screen time, thereby reducing light leakage from the display screen and improving the accuracy of ambient light detection, thereby solving the technical problem of low detection accuracy in the ambient light detection method in the related technology.
[0042] In a possible implementation, rendering the image to be displayed on the display screen as a completely black image may include step S11 or step S12, wherein step S11 renders one or more frames of images to be displayed on the display screen as completely black images. Figure 2 In this step, the black screen time can be controlled to be very long. For example, if the refresh rate of the display is 120HZ, then one frame is 8.33ms, which is much longer than the sampling time of the ambient light sensor of 333us. After the display is completely off, the light leakage is reduced. At this time, the ambient light sensor collects data with less stray light, which improves the accuracy of ambient light detection.
[0043] Considering that the related technology performs ambient light detection during the screen-off time of PWM dimming, there is a problem of low detection accuracy, and one or more frames of completely black images to be displayed on the display generally correspond to many PWM dimming cycles, such as Figure 2As shown. The embodiment of the present application also proposes an improved solution for ambient light detection based on PWM dimming, including step S12, rendering the image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation PWM dimming method as a completely black image. That is to say, in a scenario where the user does not initially look at the display screen, the image corresponding to the screen-on time in the pulse modulation PWM dimming method can be rendered as a completely black image. For example, assuming that the PWM frequency is 360Hz, the duty cycle in each PWM cycle is the same and is 1 / 2, then the PWM cycle is 1 / 360s, i.e. 0.00278s, and the screen-on time is 0.00139s, the image to be displayed on the display screen corresponding to 0.00139 seconds (i.e., 1 / 2*1 / 360 seconds) can be rendered as a completely black image. Optionally, in the above step S12, the image to be displayed on the display screen corresponding to the screen-on time in the PWM dimming mode can be an image corresponding to all or part of the screen-on time in a PWM dimming cycle (i.e., 1 / n of the screen-on time, where n is a natural number), or can be an image corresponding to multiple all or part of the screen-on time in multiple PWM dimming cycles, which can be flexibly determined according to the sampling time set by the ambient light sensor. Among them, the total duration of one or more PWM dimming cycles is less than the time when the user is not looking at the display screen. Compared with the above step S11, this step, under the premise of meeting the sampling time of the ambient light sensor, renders a shorter time for a completely black image, which can further reduce the working time of the GPU, and the power consumption of the electronic device is also optimized to a certain extent.
[0044] Exemplarily, assuming that n=1, the image to be displayed on the display screen corresponding to the complete screen-on time within a PWM cycle can be rendered as a completely black image, such as Figure 3 As shown, the image corresponding to the multiple complete screen-on times (ie, the complete screen-on time corresponding to each PWM cycle in the multiple PWM cycles) to be displayed on the display screen can also be rendered as a completely black image, such as Figure 4 As another example, assuming that n=2, the image to be displayed on the display screen corresponding to 1 / 2 of the screen-on time in one PWM cycle can be rendered as a completely black image, and the image to be displayed on the display screen corresponding to 1 / 2 of multiple screen-on times (that is, 1 / 2 of the screen-on time corresponding to each PWM cycle in multiple PWM cycles) can also be rendered as a completely black image, as shown in FIG. Figure 5 As shown. Of course, when the duty cycle of some PWM cycles is different, the screen-on time in each PWM cycle may be different. In addition, in different PWM cycles, the value of n can also be different, which can be flexibly determined according to the sampling time set by the ambient light sensor.
[0045] After rendering the image to be displayed on the display screen as a completely black image, an extended black screen time can be obtained. The embodiment of the present application also proposes: Step S21, obtaining the display time of the completely black image, wherein the display time of the completely black image is not greater than the time when the user is not looking at the display screen. That is, during the time when the user is not looking at the display screen, the image to be displayed on the display screen is rendered as a completely black image, so that when the user is looking at the display screen, the display screen can display the picture content normally. Step S22, setting the display time of the completely black image to the extended black screen time. In steps S21-S22, directly using the display time of one or more frames of completely black images as the extended black screen time has a higher fault tolerance rate and can be mounted on display screens with different PWM dimming methods. For example, in general PWM dimming, the screen-off time must be at least 333us or longer to ensure the normal operation of the ambient light sensor. However, extending the screen-off time will cause severe flickering. The above steps are not related to the screen-off time of PWM dimming itself in implementation. By rendering a completely black image and then directly setting the display time of the completely black image to the extended black screen time, the normal operation of the ambient light sensor is guaranteed, and the flickering of the display can be reduced to some extent.
[0046] When the image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation PWM dimming mode is rendered as a completely black image, the screen-off time of the display screen is extended by using the completely black image to obtain an extended black screen time, including: step S31, obtaining the screen-on time covered by the completely black image in the PWM dimming mode; step S32, setting the screen-on time covered by the completely black image and the screen-off time in the PWM dimming mode to the extended black screen time.
[0047] In the above PWM dimming method, the screen-on time covered by the all-black image can be 1 / n of the screen-on time in one PWM cycle, or 1 / n of multiple screen-on times in multiple PWM cycles. Then the extended black screen time can be 1 / n of the screen-on time + screen-off time in one PWM cycle, or 1 / n of N*screen-on time + N screen-off times, where N is the number of PWM cycles.
[0048] For example, assuming that in a PWM dimming cycle, the screen is on for 666us, the screen is off for 300us, and the screen is covered by a completely black image for 666us, then the extended black screen time is 666us + 300us. For another example, assuming that in a PWM dimming cycle, the screen is on for 666us, the screen is off for 300us, and the screen is covered by a completely black image for 500us, then the extended black screen time is 500us + 300us. For another example, assuming that in multiple PWM dimming cycles, the screen-on time is 666us, the screen-off time is 300us, and the screen-on time covered by the all-black image is two screen-on times, then the extended black screen time is 666us+300us+666us, or 666us+300us+666us+300us. Of course, in multiple PWM dimming cycles, the screen-on time covered by the all-black image can also be 1 / 2 of the two screen-on times, then the extended black screen time is 1 / 2*666us+300us+1 / 2*666us, or 1 / 2*666us+300us+1 / 2*666us+300us. It can be adjusted according to the specific ambient light detection accuracy requirements and will not be elaborated here.
[0049] Compared to the related art in which the ambient light sensor continues to work during the process of the display screen turning on and off, the embodiment of the present application further proposes: Step S41, setting the number of times the all-black image is displayed as the working frequency of the ambient light sensor for ambient light detection; Step S42, driving the ambient light sensor to perform ambient light detection at the working frequency during the extended black screen time. In this step, the ambient light sensor performs ambient light detection during the extended black screen time using the number of times the all-black image is displayed as the working frequency, which significantly reduces the working time of the ambient light sensor and reduces the power consumption of the ambient light sensor. Figure 6 As shown, in the related art, the ambient light sensor continues to work during the PWM screen-off time. In the embodiment of the present application, after rendering a frame of image to be displayed on the display screen as multiple completely black images (that is, the completely black image is displayed once), the working frequency of the ambient light sensor only needs to be once, instead of multiple working frequencies in the related art, thereby reducing the working frequency of the ambient light sensor and further reducing the power consumption of the ambient light sensor.
[0050] In a possible implementation, the determining that the user is not looking at the display screen at the beginning includes:
[0051] Step S51, collect the user's face photo through the front camera of the electronic device, identify the user's blinking based on the user's face photo, and judge that the user is not looking at the display screen. Specifically, in this step, the user's eyes are open or closed by eye tracking technology. When it is identified that the user's current state is closed, it is judged that the user is not looking at the display screen at the beginning. Alternatively, the relative position of the user's eyelashes is identified based on the user's face photo. If the eyelashes are located at the top, the eyes are open, and if the eyelashes are located at the bottom, the eyes are closed. When it is identified that the eyes are closed, it is judged that the user is not looking at the display screen at the beginning.
[0052] Or in step S52, a user's face photo is collected by a front camera of the electronic device, and the direction of the user's eye gaze is not on the display screen according to the user's face photo, so as to judge that the user is not looking at the display screen. Specifically, in this step, it is possible to estimate whether the line of sight is to the left, right, upward or downward according to the position of the user's pupil in the rectangular area of the eye, and judge that the user is not looking at the display screen according to the detected gaze direction information.
[0053] Or in step S53, when the front camera of the electronic device does not capture the face information and the electronic device is in the screen-on state, it is determined that the user is not looking at the display screen. Optionally, when the front camera cannot capture the face information, the A (accelerometer) + G (gyroscope) sensor can be further combined to detect the state of the electronic device, for example, the electronic device is placed on a table, or the user holds the electronic device while walking or shaking.
[0054] In the above steps S51, S52 or S53, the facial information collected by the front camera of the electronic device can be further judged that the user is not looking at the display screen at the beginning, and the judgment condition for the operation of the ambient light sensor is increased. The ambient light sensor only starts to work when it is judged that the user is not looking at the display screen at the beginning, which further reduces the number of times the ambient light sensor works and reduces the power consumption of the ambient light sensor.
[0055] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides an ambient light detection device, which is applied to an electronic device, the electronic device comprising a display screen and an ambient light sensor located below the display screen. Figure 7 The figure is a structural block diagram of an ambient light detection device according to an embodiment of the present application, comprising:
[0056] A determination module 72, used for determining whether the user is not looking at the display screen at the beginning;
[0057] A rendering module 74, used for rendering the image to be displayed on the display screen as a completely black image;
[0058] An acquisition module 76 is used to use the completely black image to extend the screen-off time of the display screen to obtain an extended black screen time;
[0059] The detection module 78 is used to drive the ambient light sensor to perform ambient light detection during the extended black screen time.
[0060] pass Figure 7 The device shown determines that the user is not looking at the display screen at the beginning; renders the image to be displayed on the display screen as a completely black image; uses the completely black image to extend the screen off time of the display screen to obtain an extended black screen time; and drives the ambient light sensor to perform ambient light detection during the extended black screen time. In other words, the embodiment of the present application utilizes the gap when the user is not looking at the display screen, renders the image to be displayed on the display screen as a completely black image, uses the completely black image to extend the screen off time of the display screen, and drives the ambient light sensor to perform ambient light detection during the extended black screen time, thereby reducing light leakage from the display screen and improving the accuracy of ambient light detection, thereby solving the technical problem of low detection accuracy in the ambient light detection method in the related technology.
[0061] In one possible implementation, the rendering module 74 includes: a first rendering unit, used to render one or more frames of images to be displayed on the display screen as a completely black image; or, a second rendering unit, used to render the image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation PWM dimming method as a completely black image.
[0062] Optionally, the acquisition module 76 includes: a first acquisition unit, used to acquire the display time of the all-black image when rendering one or more frames of images to be displayed on the display screen as an all-black image, wherein the display time of the all-black image is not greater than the time when the user is not looking at the display screen; and a first setting unit, used to set the display time of the all-black image to the extended black screen time.
[0063] Optionally, the above-mentioned acquisition module 76 also includes: a second acquisition unit, used to obtain the screen-on time covered by the all-black image in the pulse modulation PWM dimming mode when the image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation PWM dimming mode is rendered as a completely black image; a second setting unit, used to set the screen-on time covered by the all-black image and the screen-off time in the PWM dimming mode to the extended black screen time.
[0064] Optionally, the detection module 78 includes: a third setting unit, used to set the number of times the all-black image is displayed as the working frequency of the ambient light sensor for ambient light detection; and a driving unit, used to drive the ambient light sensor to perform ambient light detection at the working frequency during the extended black screen time.
[0065] In one possible implementation, the judgment module 72 includes: a first judgment unit, used to collect a user's face photo through the front camera of the electronic device, and recognize that the user blinks based on the user's face photo to thereby determine that the user is not looking at the display screen; or, a second judgment unit, used to collect a user's face photo through the front camera of the electronic device, and recognize that the direction in which the user's eyeballs are looking does not fall on the display screen based on the user's face photo to thereby determine that the user is not looking at the display screen; or, a third judgment unit, used to determine that the user is not looking at the display screen when no facial information is collected by the front camera of the electronic device and the electronic device is in the screen-on state.
[0066] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.
[0067] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a system for ambient light detection. Figure 8 The system structure block diagram of ambient light detection according to an embodiment of the present application is shown, including:
[0068] A control component 82, used to control the front camera, the graphics processing unit (GPU), and the ambient light sensor using the above-mentioned ambient light detection method;
[0069] The front camera 84 is used to capture a user's face photo to determine whether the user is not looking at the display screen at the beginning;
[0070] A graphics processing unit 86, configured to render an image to be displayed on the display screen as a completely black image and input the completely black image to the display screen;
[0071] The ambient light sensor 88 is used to perform ambient light detection within the extended black screen time after obtaining an extended black screen time.
[0072] pass Figure 8 In the system shown, the front camera 84 determines that the user is not looking at the display screen at the beginning; the graphics processing unit 76 renders the image to be displayed on the display screen as a completely black image; the control component 82 uses the completely black image to extend the screen off time of the display screen to obtain an extended black screen time; the control component 82 drives the ambient light sensor to perform ambient light detection during the extended black screen time. In other words, the embodiment of the present application uses the gap when the user is not looking at the display screen to render the image to be displayed on the display screen as a completely black image, uses the completely black image to extend the screen off time of the display screen, and drives the ambient light sensor to perform ambient light detection during the extended black screen time, thereby reducing light leakage from the display screen and improving the accuracy of ambient light detection, thereby solving the technical problem of low detection accuracy in the ambient light detection method in the related technology.
[0073] The functions of each device in the system of the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.
[0074] The embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is used to enable the electronic device to perform the method of the embodiment of the present application when executed by the at least one processor.
[0075] An embodiment of the present application also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.
[0076] The embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.
[0077] refer to Fig. 9 , the structural block diagram of the electronic device that can be used as the server or client of the embodiment of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0078] like Fig. 9 As shown, the electronic device includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 909 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 909. An input / output (I / O) interface 905 is also connected to the bus 909.
[0079] Multiple components in the electronic device are connected to the I / O interface 905, including: an input unit 906, an output unit 909, a storage unit 909, and a communication unit 909. The input unit 906 can be any type of device that can input information to the electronic device, and the input unit 906 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device. The output unit 909 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 909 can include but is not limited to a disk, an optical disk. The communication unit 909 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0080] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present application may be implemented as a computer program, which is tangibly contained in a machine-readable medium, such as a storage unit 909. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via a ROM 902 and / or a communication unit 909. In some embodiments, the computing unit 901 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).
[0081] The computer program for implementing the method of the embodiment of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0082] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable signal medium can include but is not limited to electronic, magnetic, optical, electromagnetic or infrared systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0083] It should be noted that the term "including" and its variations used in the embodiments of the present application are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present application are illustrative and not restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0084] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0085] The various steps described in the method implementation methods provided in the embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present application is not limited in this respect.
[0086] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments refer to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.
[0087] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A method for detecting ambient light, applied to an electronic device, the electronic device comprising a display screen and an ambient light sensor located below the display screen, characterized in that: The method comprises: Determining that the user is not looking at the display screen at the beginning; Rendering the image to be displayed on the display screen as a completely black image; Using the all-black image to extend the screen-off time of the display screen to obtain an extended black screen time; The ambient light sensor is driven to perform ambient light detection during the extended black screen time.
2. The method according to claim 1, characterized in that Rendering the image to be displayed on the display screen as a completely black image, comprising: Rendering one or more frames of images to be displayed on the display screen as completely black images; or, The image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation (PWM) dimming mode is rendered as a completely black image.
3. The method according to claim 2, characterized in that When rendering one or more frames of images to be displayed on the display screen as a completely black image, using the completely black image to extend the screen-off time of the display screen to obtain an extended black screen time includes: Obtaining the display time of the all-black image, wherein the display time of the all-black image is not greater than the time when the user is not looking at the display screen; The display time of the all-black image is set to the extended black screen time.
4. The method according to claim 2, characterized in that: When rendering an image to be displayed on the display screen corresponding to the screen-on time in the pulse modulation (PWM) dimming mode as a full black image, using the full black image to extend the screen-off time of the display screen to obtain an extended black screen time, including: Obtaining the screen-on time covered by the all-black image in the PWM dimming mode; The screen-on time covered by the all-black image and the screen-off time in the PWM dimming mode are set to the extended black screen time.
5. The method according to claim 1, characterized in that Driving the ambient light sensor to perform ambient light detection during the extended black screen time includes: The number of times the all-black image is displayed is set as the working frequency of the ambient light sensor performing ambient light detection; The ambient light sensor is driven to perform ambient light detection at the working frequency during the extended black screen time.
6. The method according to claim 1, characterized in that Determining that the user is not looking at the display screen, including: Collecting a user's face photo by using the front camera of the electronic device, and identifying the user's blinking based on the user's face photo to determine that the user is not looking at the display screen; or, Collecting a user's face photo by the front camera of the electronic device, identifying that the user's eyeballs are not looking at the display screen based on the user's face photo, thereby determining that the user is not looking at the display screen; or, When no facial information is collected by the front camera of the electronic device and the screen of the electronic device is on, it is determined that the user is not looking at the display screen.
7. A system for ambient light detection, characterized in that: include: A control component, used to control a front camera, a graphics processing unit GPU, and an ambient light sensor using the method described in any one of claims 1 to 6; The front camera is used to capture a user's face photo to determine when the user is not looking at the display screen; The GPU is used to render an image to be displayed on a display screen as a completely black image and input the completely black image to the display screen; The ambient light sensor is used to perform ambient light detection within the extended black screen time after obtaining an extended black screen time.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that A computer program is included which, when executed by a processor, implements the method according to any one of claims 1 to 6.