Screen brightness adjusting method and terminal equipment

By using a dual ambient light sensor solution on the terminal device, combining the data of the front and rear sensors, more accurate ambient light recognition and screen brightness adjustment are achieved, solving the problems of inaccurate brightness adjustment and high power consumption in the prior art.

CN120048196APending Publication Date: 2025-05-27HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311541249.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In scenes where existing terminal devices are backlight, dark light or light source dispersed, the ambient light sensors are inaccurate in recognition of ambient light, resulting in the screen brightness adjustment not meeting user requirements and high power consumption.

Method used

Using a dual sensor solution, the front ambient light sensor and the rear ambient light sensor jointly detect ambient light, and decide whether to turn off the rear ambient light sensor based on the detected brightness information to improve the accuracy of brightness adjustment and reduce power consumption.

Benefits of technology

It improves the accuracy of terminal equipment's identification of ambient light, enhances the accuracy of screen brightness adjustment, and reduces the power consumption of terminal equipment, extends the battery life time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120048196A_ABST
    Figure CN120048196A_ABST
Patent Text Reader

Abstract

The invention provides a screen brightness adjusting method, which is applied to the technical field of terminals and is beneficial to improving the accuracy of screen brightness adjustment, reducing power consumption and improving user experience. The method comprises the following steps: at a first moment, detecting ambient light by using a first sensor to obtain first brightness, detecting ambient light by using a second sensor to obtain second brightness, and adjusting the brightness of a display screen based on the first brightness and the second brightness; at a second moment, detecting the ambient light by using the first sensor to obtain third brightness, and adjusting the brightness of the display screen by using the third brightness; at the second moment or before the second moment, the terminal equipment meets a first preset condition, and the first preset condition comprises that the brightness detected by the first sensor is greater than or equal to a first threshold value, and the current screen brightness of the terminal equipment is greater than or equal to preset screen brightness; or, the brightness detected by the second sensor is smaller than the brightness detected by the first sensor, and the posture of the terminal equipment is a static posture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminal devices, and in particular to a screen brightness adjustment method and a terminal device. Background Art

[0002] Terminal devices such as mobile phones have a function of automatically adjusting the screen brightness. When the ambient brightness around the terminal device is high, the terminal device will automatically increase the screen brightness; when the ambient brightness around the terminal device is low, the terminal device will automatically decrease the screen brightness.

[0003] In the related art, an ambient light sensor is provided on the terminal device. Generally, the ambient light sensor is provided on the front (screen surface) of the terminal device. The terminal device uses the ambient light sensor to detect the intensity of the ambient light and realizes automatic adjustment of the screen brightness. However, this way of automatically adjusting the screen brightness cannot well match the usage scenarios of the terminal device. For example, in some usage scenarios such as backlight, low light, or scattered light sources, the ambient light sensor may not accurately identify the ambient light, resulting in the screen brightness adjusted by the terminal device not meeting the user's requirements.

[0004] Currently, there is an urgent need to provide a screen brightness adjustment method that can improve the accuracy of screen brightness adjustment while reducing the power consumption of the terminal device. Summary of the Invention

[0005] This application provides a screen brightness adjustment method and a terminal device, which are beneficial to improving the accuracy of the terminal device's recognition of ambient light, thereby improving the accuracy of screen brightness adjustment, while reducing the power consumption of the terminal device and improving the user experience.

[0006] In a first aspect, a screen brightness adjustment method is provided. This method can be executed by a terminal device. The terminal device includes a first sensor, a second sensor, and a display screen. The first sensor and the display screen are located on the front of the terminal device, and the second sensor is located on the back of the terminal device. The method includes: at a first moment, using the first sensor to detect ambient light to obtain a first brightness, using the second sensor to detect ambient light to obtain a second brightness, and adjusting the brightness of the display screen based on the first brightness and the second brightness; at a second moment, using the first sensor to detect ambient light to obtain a third brightness, and using the third brightness to adjust the brightness of the display screen; at or before the second moment, the terminal device satisfies a first preset condition. The first preset condition includes: the brightness detected by the first sensor is greater than or equal to a first threshold, and the current screen brightness of the terminal device is greater than or equal to a preset screen brightness; or, the brightness detected by the second sensor is less than the brightness detected by the first sensor, and the posture of the terminal device is a static posture.

[0007] The screen brightness adjustment method provided by this application can adjust the screen brightness using the ambient light detected by the first sensor and the second sensor at the first moment, and adjust the screen brightness using the ambient light detected by the first sensor at the second moment after the terminal device meets the condition for turning off the second sensor. Further, based on the brightness detected by the first sensor and the current screen brightness, and / or, the brightness detected by the first sensor and the second sensor and the posture of the terminal device, it is determined whether to turn off the rear ambient light sensor. In this way, the terminal device can turn on the second sensor only in scenarios where the second sensor needs to be activated, and use the light collected by the first sensor and the second sensor to adjust the screen brightness. The adjusted screen brightness is more suitable for the current scenario, that is, more in line with the user's requirements, improving the accuracy of screen brightness adjustment; at the same time, in scenarios where the second sensor does not need to be activated, turning off the second sensor can reduce the power consumption of the terminal device, thereby extending the usage time of the battery of the terminal device and improving the user experience.

[0008] It should be understood that "adjusting the brightness of the display screen" can also be referred to as "adjusting the screen brightness". It should also be understood that the first sensor can be a front ambient light sensor, and the second sensor can be a rear ambient light sensor.

[0009] Optionally, the terminal device may further include a camera module, and the second sensor is the color temperature sensor of the camera module.

[0010] It should be understood that the first moment can be the moment before the screen is powered on when the terminal device responds to the user's screen-on operation. At the first moment, the terminal device registers the first sensor and the second sensor so that the first sensor and the second sensor can report the detected ambient light to the terminal device. The first moment can also be the moment after the terminal device is turned on. At the first moment, both the first sensor and the second sensor of the terminal device are in the open state. That is, the first moment can be the moment when both the first sensor and the second sensor of the terminal device are in the open state, and the terminal device can use the light collected by the first sensor and the second sensor to adjust the screen brightness. This application does not limit the specific time of the first moment. The second moment can be any moment when the terminal device turns off the rear ambient light sensor.

[0011] It should also be understood that the above preset screen brightness can be the maximum brightness that the human eye can accept when the user is using the terminal device. The preset screen brightness is related to the brightness of the environment where the terminal device is located. The brighter the environment, the larger the corresponding preset screen brightness, and the darker the environment, the smaller the corresponding preset screen brightness. For example, when the terminal device is a mobile phone, when a person uses the mobile phone in an outdoor environment with sunlight, the screen brightness is relatively high, and the human eye can see the screen clearly, and the preset screen brightness corresponds to a relatively high value. When a person uses the mobile phone in a dim room, the screen brightness is relatively low, and the human eye will not feel dazzling when looking at the screen and can see the screen clearly, and the preset screen brightness corresponds to a relatively low value.

[0012] It should also be understood that the above first threshold may be a brightness threshold, and this first threshold may also be referred to as the "upper limit of ambient light".

[0013] Optionally, the upper limit of ambient light may include the following two determination methods.

[0014] Method 1: The terminal device determines the upper limit of ambient light based on the location information of the terminal device and the current time information.

[0015] In a possible implementation, when the terminal device is in a preset position and within a preset time range, the upper limit of ambient light is determined as a first preset value. Otherwise, the upper limit of ambient light is a second preset value.

[0016] By determining the upper limit of ambient light through the location information and time information of the terminal device, the determined upper limit value of ambient light is more in line with the scenario where the terminal device is located. In this way, the switching strategy of the rear ambient light sensor based on the upper limit of ambient light by the terminal device is more matched to the current scenario, which is beneficial to improving the accuracy of the terminal device in controlling the switching of the rear ambient light sensor.

[0017] Method 2: The terminal device determines the upper limit of ambient light based on the brightness detected by the front ambient light sensor and a first correspondence relationship, where the first correspondence relationship is used to represent the correspondence between multiple brightness ranges and multiple thresholds.

[0018] By the brightness detected by the front ambient light sensor and the first correspondence relationship, the determined upper limit value of ambient light is more matched to the ambient light of the scenario where the terminal device is located. In this way, the switching strategy of the rear ambient light sensor based on this upper limit value of ambient light by the terminal device is more matched to the current scenario, which is beneficial to improving the accuracy of the terminal device in controlling the switching of the rear ambient light sensor.

[0019] Optionally, the terminal device determining the brightness when the screen is on based on the first brightness and the second brightness may include the following two implementation methods.

[0020] In the first possible implementation, the terminal device compares the first brightness and the second brightness. When the first brightness is less than or equal to the second brightness, the terminal device uses the first brightness and the second brightness to determine the brightness when the screen is on.

[0021] Optionally, the terminal device first determines a target brightness range, a third threshold, and a fourth threshold to which the first brightness belongs based on the first brightness and the second correspondence. The second correspondence is used to represent the correspondence between multiple brightness ranges and multiple thresholds. The third threshold may be the threshold corresponding to the target brightness range, and the fourth threshold may be any threshold less than the third threshold among the multiple thresholds. Then, the terminal device calculates a predicted fusion brightness using the first brightness, the upper limit value and the lower limit value of the target brightness range, the third threshold, and the fourth threshold. Then, the terminal device determines a target fusion brightness using the predicted fusion brightness and the second brightness. Finally, based on the target fusion brightness, the brightness when the screen is lit is determined.

[0022] Optionally, the fourth threshold may be the maximum value among the multiple thresholds that is less than the third threshold.

[0023] It should be understood that the multiple brightness ranges in the second correspondence do not overlap with each other, and the upper limit value of the brightness range corresponding to the fourth threshold is only less than the lower limit value of the target brightness range. It should also be understood that the "brightness range" may also be referred to as a "pre - partition", and the "threshold" may also be referred to as a "post - limit threshold".

[0024] Optionally, the terminal device may calculate the predicted fusion brightness as follows: First, the terminal device calculates the difference between the upper limit value and the lower limit value to obtain a first difference. Then, the terminal device calculates the difference between the third threshold and the fourth threshold to obtain a second difference. Then, the terminal device calculates the difference between the first brightness and the lower limit value to obtain a third difference. Finally, the terminal device obtains the predicted fusion brightness using the fourth threshold, the first difference, the second difference, and the third difference.

[0025] Optionally, the predicted fusion brightness is obtained through the following formula: L = X×Y / Z + m, where L represents the predicted fusion brightness, X represents the third difference, Y represents the second difference, Z represents the first difference, and m represents the fourth threshold.

[0026] Optionally, the terminal device determines the smaller value between the predicted fusion brightness and the second brightness as the target fusion brightness.

[0027] Optionally, when the first brightness is less than or equal to the second brightness, the terminal device may first determine whether the camera flash is currently turned on. When the terminal device has the flash turned on currently, the terminal device adjusts the brightness of the display screen using the first brightness.

[0028] It should be understood that in a possible scenario, the rear flash of the terminal device is set to be turned on. In this case, the brightness detected by the rear ambient light sensor is very strong, and the detected ambient light brightness may not match the real light environment, which may affect the dimming of the screen of the terminal device. Therefore, the terminal device can first determine whether the camera flash is currently turned on. When the flash is turned on, the terminal device can adjust the brightness of the display screen by using the brightness detected by the front ambient light sensor (i.e., the first brightness).

[0029] It should also be understood that the rear flash can be the flash on the back of the terminal device. The rear flash can be the flash turned on through the camera application in the terminal device or the flash turned on through the flashlight application on the terminal device. This application does not make any limitations in this regard.

[0030] Optionally, when the first brightness is greater than the second brightness, the terminal device adjusts the brightness of the display screen by using the first brightness.

[0031] In a second possible implementation manner, the terminal device can obtain a target fusion brightness by weighted summing the first brightness and the second brightness. Then, the terminal device determines the brightness when the screen is turned on based on the target fusion brightness. Among them, the proportion of the first brightness in the target fusion brightness is the first weight, the proportion of the second brightness in the target fusion brightness is the second weight, and the sum of the first weight and the second weight is 1.

[0032] It should be understood that turning off the rear ambient light sensor can be that the terminal device disables the rear ambient light sensor from detecting ambient light. It should also be understood that if the terminal device disables the rear ambient light sensor from detecting ambient light, when other applications on the terminal device (such as the camera application) call the rear light sensor to detect light, the terminal device can activate the rear ambient light sensor, that is, the disabling of the rear ambient light sensor when the terminal device adjusts the screen brightness does not affect the normal call of the rear ambient light sensor by other applications on the terminal device.

[0033] Optionally, the static posture of the terminal device needs to meet the requirement that the terminal device maintains a static posture within a fourth preset duration.

[0034] In combination with the first aspect, in some implementations of the first aspect, before detecting ambient light by using the first sensor to obtain the third brightness, the above method further includes: determining whether the terminal device meets a first preset condition; if the terminal device meets the first preset condition, after a first preset duration, turning off the second sensor.

[0035] By setting the first preset duration, a buffer time can be reserved for the terminal device. When the terminal device meets the opening condition within the first preset duration, the second sensor will not be turned off, which helps to avoid frequent turning on and off of the second sensor by the terminal device in a short period of time and helps to reduce the impact on the performance of the second sensor.

[0036] Combined with the first aspect, in some implementations of the first aspect, the above method further includes: at a third moment, using the first sensor to detect the ambient light to obtain a fourth brightness, using the second sensor to detect the ambient light to obtain a fifth brightness, and adjusting the brightness of the display screen based on the fourth brightness and the fifth brightness; at or before the third moment, the terminal device meets a second preset condition, and the second preset condition includes any one of the following conditions: the brightness detected by the first sensor is less than a first threshold and the current screen brightness of the terminal device is greater than or equal to a preset screen brightness; or, the current screen brightness of the terminal device is less than the preset screen brightness; or, the brightness detected by the first sensor is less than a second threshold and the posture of the terminal device is a motion posture.

[0037] It should be understood that the third moment can be any moment when the terminal device turns on the rear ambient light sensor.

[0038] The terminal device can adjust the screen brightness using the ambient light detected by the first sensor and the second sensor at the third moment after meeting the condition for turning on the second sensor. In this way, the terminal device can turn on the second sensor only in scenarios where the second sensor needs to be activated, and use the light collected by the first sensor and the second sensor to adjust the screen brightness. The adjusted screen brightness is more suitable for the current scenario, that is, more in line with the user's requirements, improving the accuracy of screen brightness adjustment.

[0039] It should be understood that the "second threshold" can also be referred to as the "lower limit of ambient light". This second threshold is similar to the above-mentioned first threshold, and the determination method is also similar, so it will not be elaborated here.

[0040] Optionally, the second threshold can be less than the first threshold or equal to the first threshold. This application does not make any limitations in this regard.

[0041] When the second threshold is less than the first threshold, that is, the lower limit of ambient light is less than the upper limit of ambient light, the discrimination granularity of ambient light is finer, which helps to avoid the brightness detected by the front ambient light sensor of the terminal device fluctuating around the upper limit of ambient light, causing the terminal device to sometimes meet the condition for turning off the rear ambient light sensor and sometimes meet the condition for turning on the rear ambient light, resulting in the terminal device frequently turning on or off the rear ambient light sensor, which helps to reduce the impact on the performance of the rear ambient light sensor.

[0042] In combination with the first aspect, in some implementations of the first aspect, before detecting ambient light using the first sensor to obtain the fourth brightness, the above method further includes: determining whether the terminal device meets a second preset condition; if the terminal device meets the second preset condition, the second sensor is turned on after a second preset duration.

[0043] By setting the second preset duration, the terminal device can be kept closed within the second preset duration, which helps to avoid the terminal device immediately turning on the second sensor when the condition for turning on the second sensor is met, and immediately turning off the second sensor when the condition for turning off the second sensor is met, resulting in intensive on or off actions of the second sensor, and is beneficial to reducing the impact on the second sensor.

[0044] In combination with the first aspect, in some implementations of the first aspect, the above method further includes: determining whether the terminal device meets a third preset condition; when the terminal device meets the third preset condition, setting the posture of the terminal device to a motion posture; the third preset condition includes: the brightness detected by the second sensor is less than the brightness detected by the first sensor, the posture of the terminal device is a static posture, the brightness detected by the first sensor is less than a first threshold, and the current screen brightness of the terminal device is greater than or equal to a preset screen brightness; or, the brightness detected by the second sensor is less than the brightness detected by the first sensor, the posture of the terminal device is a static posture, and the current screen brightness of the terminal device is less than the preset screen brightness.

[0045] It should be understood that any one of the conditions in the third preset condition can be understood as: the terminal device simultaneously meets the conditions for turning off the second sensor and turning on the second sensor. By setting the posture of the terminal device to a motion posture, the terminal device can be made to break the condition for turning off the second sensor, thereby turning on the second sensor. In this way, it helps to avoid the terminal device frequently turning on or off the rear ambient light sensor, thereby reducing the impact on the performance of the rear ambient light sensor.

[0046] Optionally, setting the posture of the terminal device to a motion posture can be: changing the flag bit of the posture of the terminal device to the flag bit corresponding to the motion posture.

[0047] It should be understood that when the terminal device meets any one of the above third preset conditions and the terminal device has not yet set the posture of the terminal device to a motion posture, if the terminal device breaks the establishment of the third preset condition based on the user's operation (for example, manually changing the posture of the terminal device or manually adjusting the current screen brightness of the terminal device), the terminal device does not need to set the posture of the terminal device to a motion posture.

[0048] Optionally, the duration of the motion posture is a third preset duration.

[0049] By maintaining the motion posture of the terminal device for a continuous third preset duration, it can be ensured that the terminal device turns on the rear ambient light sensor within the third preset duration and completes the screen brightness adjustment.

[0050] Optionally, after setting the posture of the terminal device to a motion posture, the terminal device can set the posture of the terminal device to a static posture.

[0051] In one possible implementation, after setting the posture of the terminal device to a motion posture, the terminal device can immediately set the posture of the terminal device to a static posture.

[0052] It should be understood that for the terminal device to determine that its posture is a static posture, it must be satisfied that the terminal device maintains a static posture within a fourth preset duration. Therefore, even if the terminal device immediately sets the posture of the terminal device to a static posture after setting the posture of the terminal device to a motion posture, it can be ensured that the terminal device maintains a motion posture within the fourth preset duration after being set to a motion posture. At this time, the third preset duration is equal to the fourth preset duration.

[0053] It should also be understood that although the posture of the terminal device is set to a motion posture, the actual posture of the terminal device is still a static posture. By immediately setting the posture of the terminal device to a static posture, the current posture of the terminal device can be made to match the actual posture of the terminal device.

[0054] In another possible implementation, after setting the posture of the terminal device to a motion posture, the terminal device can set the posture of the terminal device to a static posture after a fifth preset duration.

[0055] It should be understood that for the terminal device to determine that its posture is a static posture, it must be satisfied that the terminal device maintains a static posture within a fourth preset duration. Therefore, when the terminal device sets the posture of the terminal device to a motion posture and then sets the posture of the terminal device to a static posture after a fifth preset duration, it can be ensured that the terminal device maintains a motion posture within the duration of the sum of the fourth preset duration and the fifth preset duration after being set to a motion posture, that is, the third preset duration is the sum of the fourth preset duration and the fifth preset duration.

[0056] In a second aspect, a terminal device is provided for performing the method in the implementation manner of the first aspect above. Specifically, the terminal device includes a module for performing the method in the implementation manner of the first aspect above.

[0057] In one design, the terminal device may include modules corresponding one by one to the methods / operations / steps / actions described in the first aspect above. The module may be a hardware circuit, software, or a combination of hardware circuit and software.

[0058] Fourthly, a terminal device is provided, including: a processor and a memory, where the processor is configured to read instructions stored in the memory to execute the method according to the first aspect above.

[0059] Optionally, there is one or more processors, and one or more memories.

[0060] Optionally, the memory may be integrated with the processor, or the memory and the processor are separately arranged.

[0061] In a specific implementation process, the memory may be a non-transitory memory, such as a read only memory (ROM), which may be integrated with the processor on the same chip, or may be separately arranged on different chips. The embodiments of the present application do not limit the type of the memory and the arrangement manner of the memory and the processor.

[0062] The terminal device in the third aspect above may be a chip. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor may be a general-purpose processor, which is implemented by reading software code stored in the memory. The memory may be integrated in the processor or may be located outside the processor and exist independently.

[0063] Fifthly, a computer program product is provided. The computer program product includes: a computer program (which may also be referred to as code or instructions). When the computer program is run, it causes the computer to execute the method according to the first aspect above.

[0064] Sixthly, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (which may also be referred to as code or instructions). When it runs on a computer, it causes the computer to execute the method according to the first aspect above. Description of the Drawings

[0065] Figure 1 is a schematic structural diagram of the terminal device according to the embodiment of the present application;

[0066] Figure 2 is a software structure block diagram of the terminal device according to the embodiment of the present application;

[0067] Figure 3 is a schematic diagram showing the front of a mobile phone with an ambient light sensor provided according to the embodiment of the present application;

[0068] Figure 4 is a schematic diagram showing the back of a mobile phone with an ambient light sensor provided according to the embodiment of the present application;

[0069] Figure 5 It is a schematic flowchart of a screen brightness adjustment method provided by an embodiment of the present application;

[0070] Figure 6 It is an internal implementation interaction diagram of a screen brightness adjustment method provided by an embodiment of the present application;

[0071] Figure 7 It is an internal implementation interaction diagram of another screen brightness adjustment method provided by an embodiment of the present application;

[0072] Figure 8 It is a schematic diagram of the change of a mobile phone interface provided by an embodiment of the present application;

[0073] Figure 9 It is a schematic block diagram of a terminal device provided by an embodiment of the present application. Specific embodiments

[0074] Next, the technical solutions in the present application will be described in conjunction with the accompanying drawings.

[0075] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order, and the terms "first" and "second" do not necessarily mean different.

[0076] It should be noted that in the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplarily" or "for example" is intended to present relevant concepts in a specific manner.

[0077] In addition, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item)" or its similar expression below refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, and c can represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0078] In the embodiments of the present application, descriptions such as "when...", "in the case of...", "if", and "when" all refer to the device making corresponding processing under certain objective circumstances, rather than limiting time, and it is not required that the device must have a judgment action when implemented, nor does it mean there are other limitations.

[0079] To better understand the terminal device in the embodiments of the present application, the following Figure 1 will detail the hardware structure of the terminal device in the embodiments of the present application.

[0080] Figure 1 shows a schematic structural diagram of the terminal device 100.

[0081] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a wireless communication module 160, a sensor module 180, a button 190, a motor 191, a camera 193, a display screen 194, etc. Among them, the sensor module 180 may include a gyroscope sensor 180B, a gravity sensor 180D, an acceleration sensor 180E, a proximity light sensor 180G, a touch sensor 180K, an ambient light sensor 180L, etc.

[0082] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0083] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0084] The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0085] A memory can also be set in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the said memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0086] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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, and / or a universal serial bus (USB) interface, etc.

[0087] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also supply power to the terminal device through the power management module 141.

[0088] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0089] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0090] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0091] The mobile communication module 150 can provide wireless communication solutions such as 2G / 3G / 4G / 5G applied to the terminal device 100.

[0092] The wireless communication module 160 can provide wireless communication solutions such as wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the terminal device 100.

[0093] The terminal device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0094] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0095] The terminal device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0096] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB, YUV, etc. In some embodiments, the terminal device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0097] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0098] The video codec is used to compress or decompress digital videos. The terminal device 100 can support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0099] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

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

[0101] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0102] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0103] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device and applied to applications such as horizontal and vertical screen switching and pedometers.

[0104] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The terminal device 100 emits infrared light outward through the light-emitting diode. The terminal device 100 uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 may determine that there is no object near the terminal device 100. The terminal device 100 may use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used in the holster mode and the pocket mode for automatic unlocking and locking of the screen.

[0105] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance during photographing. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in the pocket to prevent accidental touch.

[0106] The touch sensor 180K, also called a "touch control device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the terminal device 100, at a different position from that of the display screen 194.

[0107] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys. They can also be touch keys. The terminal device 100 can receive key inputs and generate key signal inputs related to the user settings and function control of the terminal device 100.

[0108] The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, taking the Android system with a layered architecture as an example, the software structure of the terminal device 200 is exemplarily described.

[0109] Figure 2 It is the software structure block diagram of the terminal device 100 in the embodiments of this application.

[0110] The layered architecture divides software into several layers, and each layer has clear roles and divisions of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0111] The application layer may include a series of application packages.

[0112] As Figure 2 shown, the application packages may include applications such as the camera, gallery, calendar, call, map, Bluetooth, settings, etc.

[0113] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. As Figure 2 shown, the application framework layer may include a power management module, a sensor management module, a window management module, a content provider module, a display framework module, a view system, etc.

[0114] The power management module can be used to manage the power-on or power-off of the display screen.

[0115] The sensor management module may include an ambient light sensor management module, an acceleration sensor management module, a gravity sensor management module, a gyro sensor management module, a direction sensor management module, etc. Among them, the ambient light sensor management module can be used to transfer the brightness value reported by the kernel layer to the application framework layer, so that the application framework layer can calculate the screen brightness according to the reported brightness value. The sensor management module can be used to determine the posture of the terminal device according to one or more of the acceleration data, direction data, gravity data, or angular velocity data reported by the kernel layer. Among them, the acceleration data can be reported by the acceleration sensor driver, the direction data can be reported by the direction sensor driver, the gravity data can be reported by the gravity sensor driver, or the angular velocity data can be reported by the angular velocity sensor driver.

[0116] The window management module is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0117] The content provider module is used to store and obtain data, and make these data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone book, etc.

[0118] The display framework module can be used to determine the display brightness of the display screen according to the ambient light data transmitted by the ambient light sensor module.

[0119] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0120] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0121] The core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0122] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0123] The system libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc.

[0124] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple application programs.

[0125] The media libraries support the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media libraries can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0126] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0127] The 2D graphics engine is a graphics engine for 2D drawing.

[0128] The hardware abstraction layer can include a power interface, an ambient light sensor interface, a display interface, etc.

[0129] The power interface can be used to report the pressing event reported by the power driver to the power management module, so that the power management module can control the power on or off of the display screen.

[0130] The sensor interface may include an ambient light sensor interface, an acceleration sensor interface, a gravity sensor interface, a gyro sensor interface, a direction sensor interface, etc. Among them, the ambient light sensor interface can report the ambient light data reported by the ambient light drive to the ambient light sensor management module, so that the ambient light sensor management module can transfer the ambient data to the display framework module, facilitating the display framework module to calculate the screen display brightness.

[0131] The display interface can transfer the screen display brightness calculated by the display framework module to the display driver, so that the display driver can display at this brightness.

[0132] The kernel layer is the layer between hardware and software. The kernel layer is used to drive the hardware to make it work. The kernel layer at least includes a display driver, a power driver, a sensor driver, a camera driver, etc., and the embodiments of the present application do not limit this. For example, the sensor driver can be an ambient light sensor driver, and the ambient light sensor driver can drive the ambient light sensor to detect the brightness of the light source environment. The display driver can drive the screen to be powered on to light up the screen so that the user can see the display screen. For another example, the camera driver can drive the color temperature sensor to detect the ambient light.

[0133] It should be understood that the above terminal device can be a device equipped with a display screen and an ambient light sensor, such as a mobile phone, a tablet, a computer, etc., and the embodiments of the present application do not limit this.

[0134] The terminal device can detect the surrounding environment brightness according to the ambient light sensor and automatically adjust the screen brightness according to the surrounding environment brightness. In the related art, some manufacturers set an ambient light sensor on the front of the terminal device (which can be called a "front ambient light sensor"), and the terminal device uses the front ambient light sensor to detect the brightness of the ambient light and automatically adjust the screen brightness. For example, taking the terminal device as a mobile phone as an example, Figure 3 shows a schematic diagram of setting an ambient light sensor on the front of a mobile phone. In Figure 3 , the front ambient light sensor is set at a position close to the middle at the top of the front of the mobile phone. However, in some scenarios, such as backlight, low light, or scattered light source scenarios, the front ambient light sensor may not accurately identify the ambient light, resulting in the screen brightness adjusted by the terminal device not meeting the user's requirements.

[0135] Exemplarily, when the user uses the mobile phone in a backlight scenario, the mobile phone screen faces away from the sun, and the ambient light brightness received by the front ambient light sensor is not very strong. The mobile phone will automatically lower the screen brightness, while the actual ambient light brightness received by the human eye is stronger. In this case, the screen brightness adjusted by the mobile phone does not meet the requirements for the user, which results in the human eye not being able to clearly see the content of the screen and the user experience is poor.

[0136] To improve the recognition accuracy of the ambient light sensor for ambient light, some manufacturers also set ambient light sensors on both the front and back of the terminal device (the ambient light sensor set on the back can also be called the "rear ambient light sensor"). For example, still taking the terminal device as a mobile phone, Figure 4 shows a schematic diagram of setting an ambient light sensor on the back of a mobile phone. In Figure 4 , a rear ambient light sensor is set at the lower left corner of the back of the mobile phone near the camera. In this way, the terminal device can use the front ambient light sensor and the rear ambient light sensor to detect the brightness of the ambient light respectively, and perform fusion to obtain the fused ambient light brightness. The terminal device can automatically adjust the screen brightness based on the fused ambient light brightness.

[0137] However, in some scenarios, the terminal device can obtain the brightness close to the real light source environment without enabling the rear ambient light sensor to detect the ambient light. For example, in the scenario where the terminal device is placed face up flat on the desktop, the rear ambient light sensor of the terminal device is blocked, and it may not be able to detect the ambient light or the detected ambient light is inaccurate. At this time, if the terminal device still starts the rear ambient light sensor to detect the ambient light, it will not improve the recognition accuracy of the terminal device for the ambient light, but will increase the power consumption of the terminal device.

[0138] Therefore, the present application provides a method for adjusting the screen brightness, which can use the front ambient light sensor and the rear ambient light sensor of the terminal device to detect the ambient light respectively, and determine the control strategy of the rear ambient light sensor of the terminal device based on the ambient light detected by the front ambient light sensor and the rear ambient light sensor. Further, based on the brightness detected by the front ambient light sensor and the current screen brightness, and / or, the brightness detected by the front ambient light sensor and the rear ambient light sensor and the posture of the terminal device, it is determined whether to turn off the rear ambient light sensor. In this way, the terminal device can turn on the rear ambient light sensor only in the scenarios where the rear light sensor needs to be started, and use the light collected by the rear ambient light sensor and the front ambient light sensor to adjust the screen brightness. The adjusted screen brightness is more suitable for the current scenario, that is, more in line with the user's requirements, and improves the accuracy of screen brightness adjustment; at the same time, in the scenarios where the rear light sensor does not need to be turned on, turning off the rear ambient light sensor can reduce the power consumption of the terminal device, thereby extending the usage time of the battery of the terminal device and improving the user experience.

[0139] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These several specific embodiments below can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0140] Figure 5 Shown is a screen brightness adjustment method 500 provided by an embodiment of the present application. Below, in combination with the user's usage process of the terminal device, the method 500 will be described in detail. The hardware structure of the terminal device involved in the method 500 can be as Figure 1 shown, and the software architecture of the terminal device involved can be as Figure 2 shown. The method 500 may include the following steps.

[0141] S501, in response to the user's screen-on operation, the terminal device turns on the front ambient light sensor and the rear ambient light sensor.

[0142] It should be understood that the "user's screen-on operation" can be the user's pressing operation on the power button of the terminal device, or the user's double-click operation on the screen of the terminal device, or the user's operation of waking up the terminal device by voice. It should be understood that the screen-on operation can also be other user operations that can turn on the screen, and the present application does not limit this.

[0143] It should also be understood that the initial state of the display screen of the terminal device can be the screen-off state. After the terminal device responds to the user's screen-on operation, it registers the front ambient light sensor and the rear ambient light sensor, so that the front ambient light sensor and the rear ambient light sensor can report the detected ambient light to the terminal device.

[0144] Optionally, the terminal device may further include a camera module. The rear ambient light sensor can be the correlated color temperature (CCT) sensor of the camera module, or the rear ambient light sensor can be the flicker sensor of the camera module

[0145] By setting the rear ambient light sensor as a sensor within the camera module, there is no need to additionally layout a new ambient light sensor on the terminal device, which can save hardware costs.

[0146] S502, the terminal device obtains the brightness detected by the front ambient light sensor, the brightness detected by the rear ambient light sensor, the current screen brightness, and the posture of the terminal device.

[0147] Optionally, the terminal device can detect the brightness of the surrounding ambient light through the front ambient light sensor and the rear ambient light sensor to obtain the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor. The terminal device can obtain the current screen brightness and the posture of the terminal device by listening to the brightness change of the screen and the posture of the terminal device.

[0148] Optionally, the terminal device may perform real-time detection of the ambient light brightness through the front ambient light sensor and the rear ambient light sensor, or detect it at preset intervals, or detect it only when the terminal device detects that its posture is a motion posture. This application does not limit this.

[0149] S503. The terminal device determines whether to turn off the rear ambient light sensor.

[0150] It should be understood that the terminal device can determine whether to turn off the rear ambient light sensor based on the brightness detected by the front ambient light sensor, the brightness detected by the rear ambient light sensor, the current screen brightness, and the posture of the terminal device.

[0151] Optionally, in S504, the terminal device adjusts the screen brightness based on the brightness detected by the acquired front ambient light sensor and the brightness detected by the rear ambient light sensor.

[0152] It should be understood that "adjusting the screen brightness" can also be referred to as "adjusting the brightness of the display screen".

[0153] Before S504, the terminal device first needs to determine whether the screen brightness needs to be adjusted currently. If the terminal device needs to adjust the screen brightness currently, the terminal device needs to execute S504. Otherwise, the terminal device does not need to execute S504. For different situations, the execution methods of S503 and S504 are different.

[0154] Case 1. The terminal device needs to execute S504.

[0155] If the terminal device needs to execute S504, the execution order of S503 can be simultaneous with S504, or after S503, or before S503. This application does not limit this.

[0156] For example, after the terminal device executes S502 and determines that the screen brightness needs to be automatically adjusted currently, the terminal device can execute S503 and S504 simultaneously, or after the terminal device executes S502, it first executes S504, and then executes S503 when the closing judgment of the rear ambient light sensor is required subsequently.

[0157] For another example, after the terminal device executes S502, it first executes S503. After the terminal device executes S503, it determines not to turn off the rear ambient light sensor. The terminal device determines that the screen brightness needs to be automatically adjusted currently, then the terminal device executes S504 after executing S503.

[0158] Case 2. The terminal device does not need to execute S504.

[0159] Optionally, the terminal device sequentially executes S502 and S503 and does not execute S504.

[0160] For example, after the terminal device executes S502, the terminal device determines that automatic adjustment of the screen brightness is not required currently. Then, after the terminal device executes S502, after the sixth preset duration at the moment of the screen-on operation, the terminal device executes S503. Further, after the terminal device executes S503, the terminal device determines that automatic adjustment of the screen brightness is still not required currently. At this time, the terminal device executes S503 and does not need to execute S504.

[0161] Optionally, the manner in which the terminal device determines whether screen brightness adjustment is required currently may be: The terminal device determines the pre-adjustment brightness of the screen based on the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor. The terminal device compares the current screen brightness with the pre-adjustment brightness. If the difference between the current screen brightness and the pre-adjustment brightness is greater than the adjustment threshold, the terminal device determines that automatic adjustment for brightening the screen is required and determines the screen brightness of the terminal device based on the pre-adjustment brightness. Otherwise, the terminal device determines that screen brightness adjustment is not required.

[0162] It should be understood that the current screen brightness matching the current scene may also be understood as the difference between the current screen brightness and the pre-adjustment brightness being less than or equal to the adjustment threshold.

[0163] Optionally, the terminal device may first determine the target fusion brightness based on the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor. Then, the terminal device determines the pre-adjustment brightness of the screen based on the target fusion brightness.

[0164] Further, the above adjustment threshold may include a dimming threshold and a brightening threshold. If the pre-adjustment brightness is lower than the current screen brightness and the difference between the current screen brightness and the pre-adjustment brightness is greater than the dimming threshold, the terminal device determines to dim the screen and determines the pre-adjustment brightness as the dimmed screen brightness. If the pre-adjustment brightness is higher than the current screen brightness and the difference between the current screen brightness and the pre-adjustment brightness is greater than the brightening threshold, the terminal device determines to brighten the screen and determines the pre-adjustment brightness as the brightened screen brightness.

[0165] Optionally, the terminal device may determine multiple target fusion brightnesses based on the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor. Then, the terminal device determines the final target fusion brightness through a filtering algorithm. Finally, the terminal device determines the pre-adjustment brightness of the display screen based on the final target fusion brightness. The filtering algorithm may be to calculate the weighted average of multiple target fusion brightnesses or other calculation methods, which are not limited in this application.

[0166] It should be understood that when the terminal device determines to turn off the rear ambient light sensor in S503, the terminal device executes S505.

[0167] In S505, the terminal device turns off the rear ambient light sensor.

[0168] In S506, the terminal device obtains the brightness detected by the front ambient light sensor, the current screen brightness, and the posture of the terminal device.

[0169] In S507, the terminal device determines whether to turn on the rear ambient light sensor.

[0170] It should be understood that the terminal device can determine whether to turn on the rear ambient light sensor based on the brightness detected by the front ambient light sensor, the current screen brightness, and the posture of the terminal device.

[0171] Optionally, in S508, the terminal device adjusts the screen brightness based on the brightness detected by the front ambient light sensor.

[0172] It should be understood that the execution logics of S507 and S508 are similar to those of S503 and S504 described above, and will not be elaborated here.

[0173] It should be understood that when the terminal device determines to turn on the rear ambient light sensor in S507, the terminal device executes S509.

[0174] In S509, the terminal device turns on the rear ambient light sensor.

[0175] In a possible implementation, after the terminal device turns on the rear ambient light sensor, the scene where the terminal device is located, the posture of the terminal device, etc. may all change, which may cause the ambient light detected by the terminal device to change. The terminal device can determine whether to turn off the rear ambient light sensor again based on the changed ambient light and / or the changed posture of the terminal device, that is, after the terminal device executes S509, the terminal device may also execute S502 and the steps after S502 again, so that the terminal device can control the rear ambient light sensor and automatically adjust the screen brightness in the screen-on state. The specific execution order of the screen brightness adjustment method provided in this application depends on the actual service logic, and this application does not limit this order.

[0176] Optionally, if the screen of the terminal device becomes the screen-off state in any step of the above method 500, the terminal device cancels the registration of the front ambient light sensor and the rear ambient light sensor, that is, the front ambient light sensor and the rear ambient light sensor no longer report the ambient light, and the terminal device no longer performs automatic adjustment of the screen brightness.

[0177] Next, the above steps will be described in detail.

[0178] In the above S501, the screen state of the terminal device can be the screen-off state. In response to the user's screen-on operation, the terminal device turns on the front ambient light sensor and the rear ambient light sensor. The terminal device can use the front ambient light sensor to detect the ambient light to obtain a first brightness, use the rear ambient light sensor to detect the ambient light to obtain a second brightness, and determine the brightness when the screen is on based on the first brightness and the second brightness.

[0179] The terminal device determining the brightness when the screen is on based on the first brightness and the second brightness can include the following two implementation manners.

[0180] In the first possible implementation manner, the terminal device compares the first brightness and the second brightness. When the first brightness is less than or equal to the second brightness, the terminal device uses the first brightness and the second brightness to determine the brightness when the screen is on.

[0181] Optionally, the terminal device first determines the target brightness interval, the third threshold, and the fourth threshold to which the first brightness belongs based on the first brightness and the second correspondence. The second correspondence is used to represent the correspondence between multiple brightness intervals and multiple thresholds. The third threshold can be the threshold corresponding to the target brightness interval, and the fourth threshold can be any one of the thresholds less than the third threshold among the multiple thresholds. Then, the terminal device calculates the predicted fusion brightness using the first brightness, the upper limit value and the lower limit value of the target brightness interval, the third threshold, and the fourth threshold. Then, the terminal device uses the predicted fusion brightness and the second brightness to determine the target fusion brightness. Finally, based on the target fusion brightness, the brightness when the screen is on is determined.

[0182] Optionally, the fourth threshold can be the maximum value among the multiple thresholds less than the third threshold.

[0183] It should be understood that the multiple brightness intervals in the second correspondence do not overlap, and the upper limit value of the brightness interval corresponding to the fourth threshold is only less than the lower limit value of the target brightness interval. It should also be understood that the "brightness interval" can also be referred to as the "front partition", and the "threshold" can also be referred to as the "rear limit threshold".

[0184] Optionally, the terminal device determines the smaller value between the predicted fusion brightness and the second brightness as the target fusion brightness.

[0185] Optionally, the terminal device can calculate the predicted fusion brightness in the following manner.

[0186] First, the terminal device calculates the difference between the upper limit value and the lower limit value to obtain a first difference. Next, the terminal device calculates the difference between the third threshold and the fourth threshold to obtain a second difference. Then, the terminal device calculates the difference between the first brightness and the lower limit value to obtain a third difference. Finally, the terminal device adds the quotient obtained by dividing the product of the third difference and the second difference by the first difference to the fourth threshold to obtain the predicted fusion brightness.

[0187] Exemplarily, the first brightness is A x , the first post - brightness is H x , and the second corresponding relationship can be as shown in Table 1. The terminal device obtains A by looking up the table 1 <A x <A 2 , that is, it determines that the target brightness interval is brightness interval B, and further determines that the third - sex threshold is a 2 , and the fourth threshold is a 1 . Among them, the lower limit value of the target brightness interval is A 1 , and the upper limit value of the target brightness interval is A 2 , and the terminal device calculates the predicted fusion brightness a through the following formula x .

[0188] a x =(A x - A 1 )×(a 2 - a 1 ) / (A 2 - A 1 )+a 1 .

[0189] Finally, the terminal device can determine that the target fusion brightness = min{a x , H x}.

[0190] Table 1

[0191]

[0192]

[0193] It should be understood that the range of the brightness interval in Table 1 is only exemplary, and the range of the brightness interval can also be other interval ranges, and the present application does not limit this.

[0194] Optionally, when the first brightness is less than or equal to the second brightness, the terminal device can first determine whether the camera flash is currently turned on. When the terminal device has the flash turned on currently, the terminal device uses the first brightness to determine the brightness when the screen is lit.

[0195] It should be understood that in a possible scenario, the terminal device is set to turn on the rear flash. In this case, the brightness detected by the rear ambient light sensor is very strong, and the detected ambient light brightness may not match the real light environment, which may affect the dimming of the screen of the terminal device. Therefore, the terminal device can first determine whether the camera flash is currently turned on. When the flash is turned on, the terminal device can use the brightness detected by the front ambient light sensor (i.e., the first brightness) to determine the brightness when the screen is lit.

[0196] It should also be understood that the rear flash can be the flash on the back of the terminal device. The rear flash can be the flash turned on through the camera application in the terminal device, or the flash turned on through the flashlight application on the terminal device. This application does not make any limitations in this regard.

[0197] Optionally, when the first brightness is greater than the second brightness, the terminal device uses the first brightness to determine the brightness when the screen is lit.

[0198] In a second possible implementation, the terminal device can obtain the target fusion brightness by weighted summing the first brightness and the second brightness. Then, the terminal device determines the brightness when the screen is lit based on the target fusion brightness. Among them, the proportion of the first brightness in the target fusion brightness is the first weight, the proportion of the second brightness in the target fusion brightness is the second weight, and the sum of the first weight and the second weight is 1.

[0199] Exemplarily, the first brightness is A x , the first weight is R 1 , the second brightness is H x , the second weight is R 2 , the terminal device can determine that the target fusion brightness = A x ×R 1+ H x ×R 2 .

[0200] In S503 above, the terminal device can determine whether to turn off the rear ambient light sensor based on the obtained current screen brightness, the brightness detected by the front ambient light sensor, the brightness detected by the rear ambient light sensor, the preset screen brightness, and the ambient light upper limit of the current scene.

[0201] Optionally, when the terminal device meets the following Condition 1 and / or Condition 2, the terminal device determines that the rear ambient light sensor can be turned off. Condition 1 may include: the brightness detected by the front ambient light sensor is greater than or equal to the ambient light upper limit of the current scene, and the current screen brightness is greater than or equal to the preset screen brightness. Condition 2 may include: the brightness detected by the rear ambient light sensor is less than the brightness detected by the front ambient light sensor, and the posture of the terminal device is a static posture. Otherwise, the terminal device may keep the rear ambient light sensor turned on.

[0202] It should be understood that turning off the rear ambient light sensor may mean that the terminal device disables the rear ambient light sensor from detecting ambient light. It should also be understood that if the terminal device disables the rear ambient light sensor from detecting ambient light, when other application programs (such as the camera application program) on the terminal device call the rear light sensor to detect ambient light, the terminal device may start the rear ambient light sensor, that is, the disabling of the rear ambient light sensor during the screen brightness adjustment of the terminal device does not affect the normal call of the rear ambient light sensor by other application programs on the terminal device.

[0203] Optionally, for the posture of the terminal device to be a static posture, it is required that the terminal device maintains a static posture within a fourth preset duration. For example, when the fourth preset duration is 10s, the terminal device needs to remain in a static posture from 0 to 10s. If within 10s, the posture of the terminal device changes to a moving posture for an instant, then the posture of the terminal device is not a static posture.

[0204] It should be understood that in some scenarios, the brightness detected by the front ambient light sensor of the terminal device is bright enough (the current is not a low-light scene), and the screen brightness of the terminal device has been adjusted bright enough. At this time, the terminal device only needs to use the brightness detected by the front ambient light sensor to adjust the screen brightness, and a relatively accurate screen brightness adjustment result can be obtained. For example, the ambient light of the current scene is relatively dim, and the maximum brightness value is 50 lux (the ambient light upper limit of this scene can be set to 50 lux), while the brightness detected by the front ambient light sensor is 60 lux, and the current screen brightness of the terminal device is already too bright. Subsequently, even if the terminal device adjusts the screen brightness based on the brightness value of "60 lux", the adjusted screen brightness will also be relatively high, and there is no need for the rear ambient light sensor to participate in the screen brightness adjustment.

[0205] Alternatively, when the terminal device is stationary in a certain scenario and the brightness detected by the front ambient light sensor of the terminal device is greater than the brightness detected by the rear ambient light sensor. At this time, the terminal device only needs to use the brightness detected by the front ambient light sensor to adjust the screen brightness, and a relatively accurate screen brightness adjustment result can also be obtained. For example, when the terminal device is placed face up on the desktop, the brightness detected by the front ambient light sensor of the terminal device is strong, and the rear ambient light sensor is blocked, and the detected brightness may be 0. At this time, only using the brightness detected by the front ambient light sensor to adjust the screen brightness can obtain a relatively accurate screen brightness adjustment result. Another example is that the terminal device is placed on the bracket at an angle of 45° with the desktop, and the light is in the front of the terminal device. In this way, the brightness detected by the front ambient light sensor of the terminal device will be strong, while the brightness detected by the rear ambient light sensor will be weak. At this time, only using the brightness detected by the front ambient light sensor to adjust the screen brightness can obtain a relatively accurate screen brightness adjustment result.

[0206] By setting the above Condition 1 and / or Condition 2, when the terminal device can accurately adjust the screen brightness relying on the front ambient light sensor, the rear ambient light sensor can be turned off. In this way, the rear ambient light sensor does not need to perform ambient light detection, which is beneficial to reducing the power consumption of the terminal device.

[0207] Optionally, when the terminal device meets Condition 1 and / or Condition 2, the terminal device turns off the rear ambient light sensor after a first preset duration.

[0208] By setting the first preset duration, a buffer time can be reserved for the terminal device, so that when the terminal device meets the opening condition within the first preset duration, the rear ambient light sensor is not turned off, which is beneficial to avoiding frequent turning on and off of the rear ambient light sensor by the terminal device in a short time and is beneficial to reducing the impact on the performance of the rear ambient light sensor.

[0209] It should be understood that the above preset screen brightness can be the maximum brightness acceptable to the human eye when the user uses the terminal device. The preset screen brightness is related to the brightness of the environment where the terminal device is located. The brighter the environment, the larger the corresponding preset screen brightness, and the darker the environment, the smaller the corresponding preset screen brightness. For example, when the terminal device is a mobile phone and a person uses the mobile phone in an outdoor environment with sunlight, only when the screen brightness is relatively high can the person see the screen clearly, and the preset screen brightness corresponds to a relatively high value. When a person uses the mobile phone in a dim room, when the screen brightness is relatively dim, the person can see the screen clearly without feeling dazzling, and the preset screen brightness corresponds to a relatively low value.

[0210] It should also be understood that the above environmental light upper limit of the current scenario can be a brightness threshold, and there are the following two determination methods for this environmental light upper limit.

[0211] Method 1: The terminal device determines the upper limit of the ambient light based on the location information and current time information of the terminal device.

[0212] In a possible implementation, when the terminal device is at a preset position and within a preset time range, the upper limit of the ambient light is determined to be a first preset value. Otherwise, the upper limit of the ambient light is a second preset value.

[0213] For example, the preset location may be indoors, the preset time range may be between 11:00 p.m. and 07:00 a.m. the next day, and the first preset value may be "50 lux". The terminal device may determine that the terminal device is currently in the room based on the positioning information, and determine that the current time is within the preset time range based on the current time information "12:00 a.m." on the terminal device. Therefore, the terminal device may determine that the upper limit of the ambient light in the current scene is 50 lux.

[0214] In another possible implementation, the terminal device determines the third correspondence based on the location information of the terminal device. Then, the terminal device can determine the upper limit of ambient light based on the current time information and the third correspondence, where the third correspondence is used to represent the correspondence between multiple time information and multiple upper limits of ambient light.

[0215] It should be understood that different position information may correspond to different third corresponding relationships.

[0216] For example, the terminal device is currently indoors, and the current time information on the terminal device is "12:00 am". The terminal device determines that the terminal device is located indoors based on the current location information, and the third corresponding relationship corresponding to the indoor location can be as shown in Table 2. Based on the current time information, the terminal device obtains through a table lookup that the upper limit of ambient light corresponding to the current time information "12:00 am" is 50 lux.

[0217] Table 2

[0218] Time information Ambient light upper limit 07:00~11:00 70 11:00~17:00 80 17:00~23:00 60 23:00 to 07:00 the next day 50

[0219] The upper limit of ambient light is determined by the location information and time information of the terminal device, and the determined upper limit of ambient light is more in line with the scene the terminal device is in. In this way, the switching strategy of the rear ambient light sensor made by the terminal device based on the upper limit of ambient light is more in line with the current scene, which is conducive to improving the accuracy of the terminal device in controlling the switching of the rear ambient light sensor.

[0220] Mode 2: The terminal device determines the upper limit of the ambient light based on the brightness detected by the front ambient light sensor and the first corresponding relationship, where the first corresponding relationship is used to represent the corresponding relationship between multiple brightness ranges and multiple thresholds.

[0221] Exemplarily, the first correspondence relationship can be as shown in Table 3. The brightness detected by the front ambient light sensor is 49 lux, and the terminal device obtains through looking up the table that the ambient light upper limit is 50 lux.

[0222] Based on the brightness detected by the front ambient light sensor and the first correspondence relationship, the determined ambient light upper limit value is more matched with the ambient light of the scene where the terminal device is located. In this way, the switching strategy of the rear ambient light sensor made by the terminal device based on this ambient light upper limit value is more matched with the current scene, which is beneficial to improving the accuracy of the terminal device to control the switching of the rear ambient light sensor.

[0223] Table 3

[0224] Brightness range Threshold 20~50 50 51~70 70

[0225] It should be understood that in a possible scenario, although the terminal device is not in a stationary state, the terminal device may be placed in a pocket, that is, in the pocket mode. In this scenario, the terminal device does not need to turn on the rear ambient light sensor to adjust the screen brightness. In this case, the terminal device can also turn off the rear ambient light sensor.

[0226] In the above S507, the terminal device can determine whether to turn on the rear ambient light sensor based on the obtained current screen brightness, the brightness detected by the front ambient light sensor, the preset screen brightness, the ambient light upper limit of the current scene, and the ambient light lower limit of the current scene.

[0227] The terminal device determines whether to turn on the rear ambient light sensor, including the following two possible scenarios.

[0228] Scenario 1, when the terminal device determines that conditions 3, 4, or 5 are met, it can determine to turn on the rear ambient light sensor. Condition 3 may include: the brightness detected by the front ambient light sensor is less than the ambient light upper limit, and the current screen brightness of the terminal device is greater than or equal to the preset screen brightness. Condition 4 may include: the current screen brightness of the terminal device is less than the preset screen brightness. Condition 5 may include: the brightness detected by the front ambient light sensor is less than the ambient light lower limit, and the posture of the terminal device is a motion posture. Otherwise, the terminal device can determine to keep the rear ambient light sensor off.

[0229] It should be understood that in some scenarios, although the screen brightness of the terminal device has been adjusted to be bright enough, the brightness detected by the front ambient light sensor of the terminal device is insufficient (dark light scenario). At this time, the terminal device needs to supplement light through the rear ambient light sensor to improve the accuracy of screen brightness adjustment. For example, in the current scenario, the ambient light is relatively dim, and the maximum brightness value is 50 lux (the upper limit of the ambient light in this scenario can be set to 50 lux). The brightness detected by the front ambient light sensor is 30 lux. The terminal device may adjust the screen brightness to be bright enough based on the user's manual adjustment. However, when the terminal device subsequently adjusts the screen brightness based on the brightness value detected by the front ambient light sensor (i.e., "30 lux"), the adjusted screen brightness may be relatively low and does not meet the user's eye requirements. At this time, the terminal device needs to supplement light through the rear ambient light sensor to improve the accuracy of screen brightness adjustment.

[0230] Or, the screen brightness of the terminal device is too dim. For example, the brightness detected by the front ambient light sensor may be relatively low. After the terminal device automatically adjusts the screen based on the brightness detected by the front ambient light sensor, the screen brightness is too dim and does not meet the user's eye requirements. At this time, the terminal device needs to turn on the rear ambient light sensor to supplement light to improve the accuracy of screen brightness adjustment.

[0231] Or, the brightness detected by the front ambient light sensor of the terminal device is insufficient (the brightness detected by the front ambient light sensor is darker than the actual ambient light brightness), and the terminal device is in a dynamic change situation. For example, in the current scenario, the ambient light is relatively dim, and the maximum brightness value is 50 lux (the upper limit of the ambient light in this scenario can be set to 50 lux). The brightness detected by the front ambient light sensor is 30 lux, and the terminal device is in a dynamic change situation. At this time, the brightness detected by the front ambient light sensor may be changing, and it is necessary to turn on the rear ambient light sensor to supplement light to improve the accuracy of screen brightness adjustment.

[0232] Through the settings of the above Conditions 3 to 5, when the ambient light recognized by the front ambient light sensor of the terminal device is inaccurate, the terminal device can combine the ambient light recognized by the rear ambient light sensor, which is beneficial to improving the accuracy of ambient light recognition and further improving the accuracy of screen brightness adjustment.

[0233] It should also be understood that the ambient light lower limit is similar to the above ambient light upper limit, and the determination method is also similar, so it will not be elaborated here.

[0234] Optionally, the ambient light lower limit can be less than the ambient light upper limit or equal to the ambient light upper limit. This application does not make any limitations on this.

[0235] When the lower limit of the ambient light is less than the upper limit of the ambient light, the discrimination granularity of the ambient light is finer, which helps to avoid the brightness detected by the front ambient light sensor of the terminal device fluctuating around the upper limit of the ambient light, causing the terminal device to sometimes meet the above condition 1 and sometimes meet the above condition 5, resulting in the terminal device frequently turning on or off the rear ambient light sensor, which is beneficial to reducing the performance impact on the rear ambient light sensor.

[0236] Optionally, the terminal device may turn on the rear ambient light sensor after a second preset duration from when the condition for turning on the rear ambient light sensor is met.

[0237] It should be understood that within the second preset duration, if the terminal device meets the condition for turning off the rear ambient light sensor, the terminal device keeps the rear ambient light sensor off based on the met turning-off condition. When the terminal device meets the condition for turning on the rear ambient light sensor again, it turns on the rear ambient light sensor after the second preset duration from the moment when the condition is met again.

[0238] Exemplarily, the second preset duration may be 2s. The rear ambient light sensor of the terminal device is in the off state. The terminal device determines at 12:00:00 that the condition for turning on the rear ambient light sensor is met. If the terminal device keeps meeting the condition for turning on the rear ambient light sensor between 12:00:00 and 12:00:02, the terminal device turns on the rear ambient light sensor at 12:00:02. If at 12:00:01, the terminal device meets the condition for turning off the rear ambient light sensor, the terminal device keeps the rear ambient light sensor off (it will not turn on the rear ambient light sensor at 12:00:02). If at 12:00:02, the terminal device meets the condition for turning on the rear ambient light sensor again, and the terminal device keeps meeting the condition for turning on the rear ambient light sensor between 12:00:02 and 12:00:04, the terminal device turns on the rear ambient light sensor at 12:00:04.

[0239] By setting the second preset duration, the terminal device can be kept off within the second preset duration, which helps to avoid the terminal device immediately turning on the rear ambient light sensor when the condition for turning on the rear ambient light sensor is met and immediately turning off the rear ambient light sensor when the condition for turning off the rear ambient light sensor is met, resulting in intensive on / off actions of the rear ambient light sensor, which is beneficial to reducing the impact on the rear ambient light sensor.

[0240] Scenario 2: When the terminal device meets Condition 6 or Condition 7, set the posture of the terminal device to a motion posture to turn on the rear ambient light sensor. Condition 6 may include: the brightness detected by the rear ambient light sensor is less than the brightness detected by the front ambient light sensor, the posture of the terminal device is a static posture, the brightness detected by the front ambient light sensor is less than the ambient light upper limit, and the current screen brightness of the terminal device is greater than or equal to the preset screen brightness. Condition 7 may include: the brightness detected by the rear ambient light sensor is less than the brightness detected by the front ambient light sensor, the posture of the terminal device is a static posture, and the current screen brightness of the terminal device is less than the preset screen brightness.

[0241] It should be understood that the terminal device may meet the above Condition 2 and the above Condition 3 at the same time, or meet the above Condition 2 and the above Condition 4 at the same time. That is, the terminal device meets the above Condition 6 or Condition 7. Since when the terminal device meets Condition 2, the terminal device will turn off the rear ambient light sensor, and when it meets Condition 3 or Condition 4, the terminal device will turn on the rear sensor. Therefore, when meeting Condition 6 or Condition 7, the terminal device may frequently turn on or off the rear ambient light sensor, affecting the performance of the rear ambient light sensor.

[0242] It should be understood that the above "frequently turning on or off the rear ambient light sensor" can also be referred to as the "ping-pong effect".

[0243] By setting the posture of the terminal device to a motion posture, the terminal device can break the condition for turning off the rear ambient sensor in Condition 6 or Condition 7 (i.e., the above Condition 2) and meet the condition for turning on the rear ambient sensor (i.e., the above Condition 3 or Condition 4), thereby turning on the rear ambient light sensor. In this way, it is beneficial to avoid the terminal device from frequently turning on or off the rear ambient light sensor, thereby reducing the impact on the performance of the rear ambient light sensor.

[0244] Optionally, setting the posture of the terminal device to a motion posture can be: changing the flag bit of the posture of the terminal device to the flag bit corresponding to the motion posture.

[0245] Exemplarily, the postures of the terminal device may include a static posture and a motion posture. The flag bit of the static posture may be "0", and the flag bit of the motion posture may be "1". When the terminal device meets the above Condition 6 or Condition 7, the posture flag bit of the terminal device can be set to "1".

[0246] It should be understood that when the terminal device meets the above condition 6 or condition 7 and the terminal device has not yet set the posture of the terminal device to a motion posture, if the terminal device breaks condition 6 or condition 7 based on the user's operation (for example, manually changing the posture of the terminal device or manually adjusting the current screen brightness of the terminal device), the terminal device does not need to set the posture of the terminal device to a motion posture.

[0247] Optionally, the duration of the motion posture of the terminal device can be a third preset duration.

[0248] By making the motion posture of the terminal device last for the third preset duration, it can be ensured that the terminal device turns on the rear ambient light sensor within the third preset duration and completes the screen brightness adjustment.

[0249] Optionally, after setting the posture of the terminal device to a motion posture, the terminal device can set the posture of the terminal device to a stationary posture.

[0250] In a possible implementation, after setting the posture of the terminal device to a motion posture, the terminal device can immediately set the posture of the terminal device to a stationary posture.

[0251] It should be understood that for the terminal device to determine that the posture of the terminal device is a stationary posture, it must be satisfied that the terminal device maintains a stationary posture within a fourth preset duration. Therefore, even if the terminal device immediately sets the posture of the terminal device to a stationary posture after setting the posture of the terminal device to a motion posture, it can be ensured that the terminal device maintains a motion posture within the fourth preset duration after being set to a motion posture. At this time, the third preset duration is equal to the fourth preset duration.

[0252] Exemplarily, the fourth preset duration is 10s. The flag bit for the stationary posture can be "0", and the flag bit for the motion posture can be "1". When the terminal device meets the above condition 6 or condition 7, the terminal device can set the flag bit of the posture of the terminal device to "1" at the 1st second, and then immediately set the flag bit of the posture of the terminal device to "0" so that the current posture of the terminal device matches the actual posture of the current terminal device. At the same time, the terminal device can turn on the rear ambient light sensor within the fourth preset duration of "10s" and perform screen brightness adjustment.

[0253] It should also be understood that although the posture of the terminal device is set to a motion posture, the actual posture of the terminal device is still a stationary posture. By immediately setting the posture of the terminal device to a stationary posture, the current posture of the terminal device can be made to match the actual posture of the terminal device.

[0254] In another possible implementation, after setting the posture of the terminal device to a motion posture, the terminal device may set the posture of the terminal device to a stationary posture after a fifth preset duration.

[0255] It should be understood that for the terminal device to determine that the posture of the terminal device is a stationary posture, it must be satisfied that the terminal device remains in a stationary posture within a fourth preset duration. Therefore, after setting the posture of the terminal device to a motion posture and then setting the posture of the terminal device to a stationary posture after a fifth preset duration, it can be ensured that the terminal device remains in a motion posture within the duration of the sum of the fourth preset duration and the fifth preset duration after being set to a motion posture, that is, the third preset duration is the sum of the fourth preset duration and the fifth preset duration.

[0256] It should be noted that in the embodiments of the present application, the "equal" in "greater than or equal to" and "less than or equal to" corresponds to a critical value, which is used to divide two intervals, and this critical value can belong to any of the two intervals. That is, "greater than" in the embodiments of the present application can also be "greater than or equal to", or "less than" can be "less than or equal to", and the present application does not make any limitations in this regard.

[0257] Exemplarily, in one possible design, condition 3 may include: the brightness detected by the front ambient light sensor is less than the ambient light upper limit, and the current screen brightness of the terminal device is greater than or equal to the preset screen brightness. Condition 4 may include: the current screen brightness of the terminal device is less than the preset screen brightness.

[0258] Exemplarily, in another possible design, condition 3 may include: the brightness detected by the front ambient light sensor is less than the ambient light upper limit, and the current screen brightness of the terminal device is greater than the preset screen brightness. Condition 4 may include: the current screen brightness of the terminal device is less than or equal to the preset screen brightness.

[0259] Above, in combination with the user's usage process, the screen brightness adjustment method provided in the embodiments of the present application has been described in detail. Next, in combination with the interaction process between the software structure and the hardware structure of the terminal device, Figure 6 and Figure 7 the internal implementation process of the screen brightness adjustment method provided in the embodiments of the present application will be described.

[0260] Figure 6 Illustrates the internal implementation process of the screen brightness adjustment method when the terminal device lights up the display screen.

[0261] S601, the power driver generates a press event in response to the user's pressing operation on the power button, and the power driver reports the press event to the power management module through the power interface.

[0262] It should be understood that the power button can be as described aboveFigure 1 the button 190 in

[0263] S602, based on the pressing event, the power management module generates a screen-on request and passes the screen-on request to the display framework module.

[0264] S603, based on the screen-on request, the display framework module obtains ambient light brightness information from the ambient light sensor management module.

[0265] It should be understood that the ambient light brightness information includes the ambient light brightness detected by the front ambient light sensor and the ambient light brightness detected by the rear ambient light sensor respectively. It should also be understood that the display framework module can, based on the screen-on request, register to listen to the front ambient light sensor and the rear ambient light sensor. Then, the display framework module obtains the ambient light brightness information detected by the front ambient light sensor and the rear ambient light sensor respectively based on the screen-on request.

[0266] S604, the ambient light sensor management module sends a request to obtain ambient light brightness information to the ambient light sensor driver through the ambient light sensor interface.

[0267] S605, based on the request to obtain ambient light brightness information, the ambient light sensor driver drives the ambient light sensor to detect the ambient light.

[0268] It should be understood that the ambient light sensor can be like Figure 1 the ambient light sensor 180L in

[0269] S606, after the ambient light sensor detects the ambient light, it reports the detected ambient light brightness to the ambient light sensor driver, and the ambient light sensor driver passes the ambient light brightness to the display framework module through the ambient light sensor interface and the ambient light sensor management module.

[0270] S607, based on the obtained ambient light brightness information, the display framework module calculates the brightness when the screen is on.

[0271] It should be understood that the display framework module can calculate the target fusion brightness based on the obtained ambient light brightness information. Then, based on the target fusion brightness, it determines the brightness when the screen is on.

[0272] It should be understood that the way the display framework module calculates the target fusion brightness is the same as the way the above terminal device calculates the target fusion brightness based on the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor, which will not be elaborated here.

[0273] S608, the display framework module passes the brightness when the screen is on to the power management module.

[0274] S609, the power management module sends a power-on request to the display driver through the display interface, and the power-on request carries the brightness information when the screen is lit.

[0275] S610, the display driver powers on the display screen with the brightness information when the screen is lit.

[0276] It should be understood that the display screen can be like Figure 1 the display screen 194 therein.

[0277] Figure 7 It shows the internal implementation process of the screen brightness adjustment method after the terminal device's screen is lit.

[0278] S701, after the ambient light sensor detects the ambient light, it reports the detected ambient light brightness to the ambient light sensor driver, and the ambient light sensor driver transfers the ambient light brightness to the display framework module through the ambient light sensor interface and the ambient light sensor management module.

[0279] S702, after the acceleration sensor detects the acceleration data of the terminal device, it reports the detected acceleration data of the terminal device to the acceleration sensor driver, and the acceleration sensor driver transfers the acceleration data to the acceleration sensor management module through the acceleration sensor interface.

[0280] It should be understood that the acceleration sensor can be like the acceleration sensor 180E above Figure 1 therein.

[0281] S703, the acceleration sensor management module determines the attitude of the terminal device based on the acceleration data.

[0282] S704, the acceleration sensor management module transfers the attitude of the terminal device to the display framework module.

[0283] S705, the display framework module determines the screen brightness based on the obtained ambient light brightness; and determines the control instruction for the rear ambient light sensor based on the attitude of the terminal device and the obtained ambient light brightness, and the control instruction for the rear ambient light sensor can be to turn on the rear ambient light sensor or turn off the rear ambient light sensor.

[0284] It should be understood that the ambient light brightness obtained by the terminal device is first used to determine whether screen brightness adjustment is required. In the case where the terminal device needs to perform screen brightness adjustment, the terminal device determines the screen brightness based on the brightness detected by the ambient light sensor. It should also be understood that the method by which the terminal device determines the screen brightness based on the brightness detected by the ambient light sensor is the same as the method by which the terminal device performs brightness adjustment based on the brightness detected by the front ambient light sensor, or the method by which the terminal device performs brightness adjustment based on the brightness detected by the front ambient light sensor and the brightness detected by the rear ambient light sensor, and will not be elaborated here.

[0285] S706, the display framework module transmits the screen brightness to the power management module.

[0286] S707, the power management module transmits the screen brightness to the display driver through the display interface.

[0287] S708, the display driver drives the display screen to display with this screen brightness.

[0288] S709, the display framework module transmits the control instruction to the ambient light sensor driver through the ambient light sensor management module and the ambient light sensor interface.

[0289] S710, the ambient light sensor driver turns on or off the rear ambient light sensor according to the control instruction.

[0290] It should be understood that turning on the rear ambient light sensor can be that the ambient light sensor driver can drive the rear ambient light sensor to detect ambient light, and turning off the rear ambient light sensor can be that the ambient light sensor driver is prohibited from driving the rear ambient light sensor to detect ambient light.

[0291] Optionally, in the case where the rear ambient light sensor is a color temperature sensor, turning on the rear ambient light sensor can be that the camera driver can drive the color temperature sensor to detect ambient light, and turning off the rear ambient light sensor can be that the camera driver is prohibited from driving the color temperature sensor to detect ambient light.

[0292] It should be understood that the terminal device can also determine the posture of the terminal device through one or more of a gyro sensor, a gravity sensor, a direction sensor, etc. Only the acceleration sensor is used for exemplary illustration in the above method 700, which does not constitute a limitation to this application.

[0293] It should also be understood that the magnitudes of the sequence numbers of the various processes in the above methods 600 and 700 do not indicate the order of execution. The order of execution of each process should be determined by its function and internal logic. For example, in method 700, S701 and S702 can be carried out simultaneously or successively, and S706 and S709 can be carried out simultaneously or successively. This application does not make a limitation on this.

[0294] Optionally, the application layer of the terminal device includes a first application that can adjust the screen brightness. The terminal device can adjust the screen brightness of the terminal device based on the user's operation on the first application. Specifically, when the first application is set to automatically adjust the screen brightness, the display framework module of the terminal device can pass the calculation result of the screen brightness to the first application after calculating the calculation result of the screen brightness, so that the first application determines the display interface of the first application according to the calculation result, and the display framework module also passes the calculation result of the screen brightness to the display driver to drive the display screen to display the display interface of the first application.

[0295] Optionally, the brightness change of the display interface of the first application program may be presented through an animation effect.

[0296] The above describes the internal implementation process of the terminal device to adjust the screen brightness. Figure 8 , taking a mobile phone as an example, the interface changes of automatic adjustment of the screen brightness of the terminal device are briefly described.

[0297] Figure 8 The figure shows the interface change of the mobile phone from a dark scene to a bright scene. Figure 8 The interface a shown in Figure 8 In the interface a shown, the upper part of the interface displays a shortcut box, which includes time information, shortcut function icons and text, and brightness bar information. Among them, the word "Auto" and a checkbox are displayed behind the brightness bar. The checkbox is in a selected state, indicating that the phone is in a state where it can automatically adjust the brightness. The position information of the solid circle on the brightness bar indicates the brightness of the phone interface. The closer the solid circle is to the left side of the brightness bar, the darker the brightness of the phone interface; the closer the solid circle is to the right side of the brightness bar, the brighter the brightness of the phone interface. Move the phone to a brighter scene, and after the screen brightness adjustment stabilizes, the phone displays Figure 8 Interface b shown. Figure 8 In the interface b shown, other information in the interface has not changed compared with interface a, only the position of the solid circle on the brightness bar has moved to the right side of the brightness bar, indicating that the brightness of interface b is stronger.

[0298] It should be understood that the change of the solid circle on the brightness bar in the mobile phone interface from the position on interface a to the position on interface b is a smooth and gradual change process, and this smooth and gradual change process can be the above-mentioned animation effect.

[0299] Combination of the above Figures 3 to 8 , describes in detail the screen brightness adjustment method of the embodiment of the present application, and below, in combination withFigure 9 , and details the terminal device according to the embodiments of the present application.

[0300] Figure 9 FIG. 5 shows a terminal device 900 provided by an embodiment of the present application. The terminal device 900 includes a processor 901, a communication interface 902, and a memory 903. Among them, the processor 901, the communication interface 902, and the memory 903 communicate with each other through an internal connection path. The memory 903 is used to store instructions, the processor 901 is used to execute the instructions stored in the memory 903, and the communication interface 902 can be used to receive signals from other modules (for example, the memory 903), and the communication interface 902 can also be used to send signals to other modules.

[0301] It should be understood that the terminal device 900 can specifically be the terminal device in the above embodiment, and can be used to execute the respective steps and / or processes corresponding to the terminal device in the above method embodiment. Optionally, the memory 903 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor 901 can be used to execute the instructions stored in the memory, and when the processor 901 executes the instructions stored in the memory, the processor 901 is used to execute the respective steps and / or processes of the above method embodiment corresponding to the terminal device. Exemplarily, the communication interface 902 can read the instructions stored in the memory 903 and send the instructions to the processor 901. When the instructions shown are executed by the processor 901, the terminal device can be made to execute the respective steps executed by the terminal device in the above embodiment.

[0302] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0303] In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory, and the processor executes the instructions in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0304] The present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to implement the method corresponding to the terminal device in the above embodiments.

[0305] The present application also provides a computer program product, which includes a computer program (which can also be called code or instructions). When the computer program runs on a computer, the computer can execute the method corresponding to the terminal device shown in the above embodiments.

[0306] Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians 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.

[0307] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0308] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces, and the indirect coupling or communication connection of the devices or modules can be in an electrical, mechanical, or other form.

[0309] The module described as a separation component may or may not be physically separated. The component shown as a module may or may not be a physical module, that is, it may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0310] In addition, in each embodiment of the present application, each functional module can be integrated into a processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.

[0311] If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0312] The above is only the specific implementation manner of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the embodiments of the present application, and all should be covered by the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims

1. A method for adjusting screen brightness, characterized in that, it is applied to a terminal device, the terminal device includes a first sensor, a second sensor, and a display screen, the first sensor and the display screen are located on the front of the terminal device, the second sensor is located on the back of the terminal device, and the method includes: At a first moment, use the first sensor to detect ambient light to obtain a first brightness, use the second sensor to detect ambient light to obtain a second brightness, and based on the first brightness and the second brightness, adjust the brightness of the display screen; At a second moment, use the first sensor to detect ambient light to obtain a third brightness, and use the third brightness to adjust the brightness of the display screen; At or before the second moment, the terminal device satisfies a first preset condition, and the first preset condition includes: The brightness detected by the first sensor is greater than or equal to a first threshold, and the current screen brightness of the terminal device is greater than or equal to a preset screen brightness; and / or, The brightness detected by the second sensor is less than the brightness detected by the first sensor, and the posture of the terminal device is a static posture.

2. The method according to claim 1, characterized in that, the method further includes: At a third moment, use the first sensor to detect ambient light to obtain a fourth brightness, use the second sensor to detect ambient light to obtain a fifth brightness, and based on the fourth brightness and the fifth brightness, adjust the brightness of the display screen; At or before the third moment, the terminal device satisfies a second preset condition, and the second preset condition includes any one of the following conditions: The brightness detected by the first sensor is less than the first threshold, and the current screen brightness of the terminal device is greater than or equal to the preset screen brightness; or, The current screen brightness of the terminal device is less than the preset screen brightness; or, The brightness detected by the first sensor is less than a second threshold, and the posture of the terminal device is a moving posture.

3. The method according to claim 2, characterized in that, Before using the first sensor to detect ambient light to obtain a fourth brightness, the method further includes: Judge whether the terminal device satisfies the second preset condition; If the terminal device satisfies the second preset condition, turn on the second sensor after a second preset duration.

4. The method according to claim 2 or 3, characterized in that, The second threshold is less than the first threshold.

5. The method according to any one of claims 1 to 4, characterized in that, Before using the first sensor to detect ambient light to obtain a third brightness, the method further includes: Judge whether the terminal device satisfies the first preset condition; If the terminal device satisfies the first preset condition, turn off the second sensor after a first preset duration.

6. The method according to any one of claims 1 to 5, characterized in that, The first threshold is determined based on the location information and time information of the terminal device.

7. The method according to any one of claims 1 to 5, It is characterized in that the first threshold is determined based on the brightness detected by the first sensor and a first correspondence relationship, and the first correspondence relationship is used to represent the correspondence relationship between multiple brightness ranges and multiple thresholds.

8. The method according to any one of claims 1 to 7, It is characterized in that the method further includes: judging whether the terminal device meets a third preset condition; when the terminal device meets the third preset condition, setting the posture of the terminal device to a motion posture; The third preset condition includes: the brightness detected by the second sensor is less than the brightness detected by the first sensor, the posture of the terminal device is a stationary posture, the brightness detected by the first sensor is less than the first threshold, and the current screen brightness of the terminal device is greater than or equal to the preset screen brightness; or the brightness detected by the second sensor is less than the brightness detected by the first sensor, the posture of the terminal device is a stationary posture, and the current screen brightness of the terminal device is less than the preset screen brightness.

9. The method according to claim 8, It is characterized in that the duration of the motion posture is a third preset duration.

10. The method according to any one of claims 1 to 9, It is characterized in that adjusting the brightness of the display screen based on the first brightness and the second brightness includes: when the first brightness is less than the second brightness, using the first brightness and the second brightness to adjust the brightness of the display screen.

11. The method according to claim 10, It is characterized in that using the first brightness and the second brightness to adjust the brightness of the display screen includes: based on the first brightness and a second correspondence relationship, determining the target brightness interval, a third threshold, and a fourth threshold to which the first brightness belongs, the second correspondence relationship being used to represent the correspondence relationship between multiple brightness intervals and multiple thresholds, the third threshold being the threshold corresponding to the target brightness interval, and the fourth threshold being the maximum value less than the third threshold among the multiple thresholds; using the first brightness, the upper limit value and the lower limit value of the target brightness interval, the third threshold, and the fourth threshold to calculate a predicted fusion brightness; using the predicted fusion brightness and the second brightness to determine a target fusion brightness; using the target fusion brightness to adjust the brightness of the display screen.

12. The method according to claim 11, It is characterized in that calculating the predicted fusion brightness includes: calculating the difference between the upper limit value and the lower limit value to obtain a first difference; calculating the difference between the third threshold and the fourth threshold to obtain a second difference; calculating the difference between the first brightness and the lower limit value to obtain a third difference; using the fourth threshold, the first difference, the second difference, and the third difference to obtain the predicted fusion brightness.

13. The method according to claim 12, It is characterized in that the predicted fusion brightness is obtained through the following formula: L = X × Y / Z + m Wherein, L represents the predicted fusion brightness, X represents the third difference, Y represents the second difference, Z represents the first difference, and m represents the fourth threshold.

14. The method according to any one of claims 11 to 13, characterized in that determining the target fusion brightness by using the predicted fusion brightness and the second brightness includes: determining the smaller value between the predicted fusion brightness and the second brightness as the target fusion brightness.

15. The method according to any one of claims 1 to 9, characterized in that adjusting the brightness of the display screen based on the first brightness and the second brightness includes: when the first brightness is greater than or equal to the second brightness, adjusting the brightness of the display screen by using the first brightness.

16. The method according to any one of claims 1 to 15, characterized in that the terminal device further includes a camera module, and the second sensor is a color temperature sensor of the camera module.

17. A terminal device, characterized in that it includes: a processor, the processor is coupled with a memory, the memory is used for storing a computer program, and when the processor calls the computer program, the terminal device executes the method according to any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that it is used for storing a computer program, and the computer program includes instructions for implementing the method according to any one of claims 1 to 16.

19. A computer program product, characterized in that the computer program product includes computer program code, and when the computer program code runs on a computer, the computer implements the method according to any one of claims 1 to 16.