Screen brightness adjusting method and device, electronic equipment and storage medium
By using a dual light sensor design and combining current and historical light sensing data analysis, the problem of inaccurate light sensing data caused by light sensor obstruction or changes in the position of the light source is solved, enabling more accurate screen brightness adjustment and improving the user experience.
Patent Information
- Application Number
- CN202211430271.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-15
AI Technical Summary
In existing technologies, the light sensor being blocked or the position of the light source changing can lead to inaccurate light sensing data, affecting the screen brightness adjustment effect.
It adopts a dual light sensor design, which acquires the current and historical light sensing data of the first and second light sensors, combines the data analysis to determine the target light sensing data, and adjusts the screen brightness.
It improves the accuracy of screen brightness adjustment and user experience, ensuring that the accuracy of light sensing data is not affected by light sensor obstruction or changes in the position of the light source.
Smart Images

Figure CN115731902B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of electronic information technology, and in particular, to a screen brightness adjustment method and device, an electronic device, and a storage medium. BACKGROUND
[0002] A light sensor is a kind of light-digital converter, which can collect the intensity of light in the surrounding environment. Therefore, the intensity of ambient light is often obtained by setting a light sensor in a terminal, so as to adjust the screen brightness according to the intensity of ambient light at the current time obtained in real time.
[0003] However, the method for determining light sensing data for adjusting screen brightness by the above-mentioned manner is too single. If the light sensor of the terminal is blocked, or the position of the light source is moved, the light sensing data will fluctuate greatly, so that the light sensing data collected by the light sensor in real time cannot accurately reflect the intensity of the current ambient light, and further affect the adjustment effect of the screen brightness. SUMMARY
[0004] To overcome the problems in the related art, the present disclosure provides a screen brightness adjustment method and device, an electronic device, and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a screen brightness adjustment method is provided, applied to a terminal, the terminal comprising at least a first light sensor and a second light sensor, the terminal having a first surface and a second surface arranged oppositely, the first surface being a plane where a screen of the terminal is located, the first light sensor being arranged on the first surface, and the second light sensor being arranged on the second surface; the method comprising: obtaining first light sensing data collected by the first light sensor at a current time and first historical light sensing data collected in a preset historical time period; obtaining second light sensing data collected by the second light sensor at the current time and second historical light sensing data collected in the preset historical time period; determining target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data, and the second historical light sensing data; and adjusting the screen brightness of the terminal according to the target light sensing data.
[0006] Optionally, the determining of the target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data, and the second historical light sensing data comprises: determining third light sensing data according to the second light sensing data and the second historical light sensing data; and determining the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data, and the second historical light sensing data.
[0007] Optionally, the determining the third light sensing data according to the second light sensing data and the second historical light sensing data comprises: determining a first average value of the second historical light sensing data collected by the second light sensor in the preset historical time period; determining whether the second light sensing data jumps according to the second light sensing data and the first average value; and in a case where it is determined that the second light sensing data jumps, taking the first average value as the third light sensing data.
[0008] Optionally, the method further comprises: in a case where it is determined that the second light sensing data does not jump, taking the second light sensing data as the third light sensing data.
[0009] Optionally, the determining whether the second light sensing data jumps according to the second light sensing data and the first average value comprises: determining a first difference value between the second light sensing data and the first average value; in a case where an absolute value of the first difference value is greater than or equal to a first preset difference threshold, determining that the second light sensing data jumps; or in a case where the absolute value of the first difference value is less than the first preset difference threshold, determining that the second light sensing data does not jump.
[0010] Optionally, the determining the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a first ratio value of the first light sensing data and the third light sensing data; and determining the target light sensing data according to the first ratio value, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0011] Optionally, in a case where the first ratio value is within a preset ratio range, the determining the target light sensing data according to the first ratio value, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a first change trend of data collected by the first light sensor according to the first light sensing data and the first historical light sensing data; determining a second change trend of data collected by the second light sensor according to the third light sensing data and the second historical light sensing data; and determining the target light sensing data according to the first change trend and the second change trend.
[0012] Optionally, the determining the target light sensing data according to the first change trend and the second change trend comprises: in a case that the first change trend represents that a change range of the data collected by the first light sensor is less than or equal to a first preset change range threshold, and the second change trend represents that a change range of the data collected by the second light sensor is less than or equal to a second preset change range threshold, obtaining third historical light sensing data used by the terminal to adjust the screen brightness at a latest time; and taking the third historical light sensing data as the target light sensing data.
[0013] Optionally, in a case that the first ratio is greater than a maximum value in a preset ratio range, the determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a first change trend of the data collected by the first light sensor according to the first light sensing data and the first historical light sensing data; determining a first ratio of the first light sensing data and the third light sensing data, and a second ratio of the first historical light sensing data and the second historical light sensing data; determining a third change trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; and determining the target light sensing data according to the first change trend and the third change trend.
[0014] Optionally, the determining the target light sensing data according to the first change trend and the third change trend comprises: in a case that the first change trend and the third change trend are same, obtaining third historical light sensing data used by the terminal to adjust the screen brightness at a latest time; and taking the third historical light sensing data as the target light sensing data.
[0015] Optionally, in a case that the first ratio is less than a minimum value in a preset ratio range, the determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a second change trend of the data collected by the second light sensor according to the third light sensing data and the second historical light sensing data; determining a first ratio of the first light sensing data and the third light sensing data, and a second ratio of the first historical light sensing data and the second historical light sensing data; determining a third change trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; and determining the target light sensing data according to the second change trend and the third change trend.
[0016] Optionally, the determining the target light sensing data according to the second change trend and the third change trend comprises: in a case where the second change trend and the third change trend are same, obtaining third historical light sensing data used by the terminal for adjusting screen brightness at a latest time; and taking the third historical light sensing data as the target light sensing data.
[0017] Optionally, the method further comprises: in a case where a preset execution condition is met, taking a maximum value in the first light sensing data and the third light sensing data as the target light sensing data; wherein the preset execution condition comprises: in a case where the first ratio is within a preset ratio range, the first change trend represents that a change amplitude of data collected by the first light sensor is greater than the first preset change amplitude threshold, and / or the second change trend represents that a change amplitude of data collected by the second light sensor is greater than the second preset change amplitude threshold; or in a case where the first ratio is greater than a maximum value in the preset ratio range, the first change trend and the third change trend are not same; or in a case where the first ratio is less than a minimum value in the preset ratio range, the second change trend and the third change trend are not same.
[0018] According to a second aspect of the embodiments of the present disclosure, a device for adjusting screen brightness is provided, which is applied to a terminal, the terminal comprising at least a first light sensor and a second light sensor, the terminal having a first surface and a second surface arranged oppositely, the first surface being a plane where a screen of the terminal is located, the first light sensor being arranged on the first surface, and the second light sensor being arranged on the second surface; the device comprising: a first obtaining module configured to obtain first light sensing data collected by the first light sensor at a current time and first historical light sensing data collected in a preset historical time period; a second obtaining module configured to obtain second light sensing data collected by the second light sensor at the current time and second historical light sensing data collected in the preset historical time period; a determining module configured to determine target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data; and an adjusting module configured to adjust screen brightness of the terminal according to the target light sensing data.
[0019] Optionally, the determining module is configured to determine third light sensing data according to the second light sensing data and the second historical light sensing data, and determine the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0020] Optionally, the determining module is configured to determine a first average value of the second historical light sensing data collected by the second light sensor in the preset historical time period; determine whether the second light sensing data jumps according to the second light sensing data and the first average value; and in a case where it is determined that the second light sensing data jumps, take the first average value as the third light sensing data.
[0021] Optionally, the determining module is further configured to, in a case where it is determined that the second light sensing data does not jump, take the second light sensing data as the third light sensing data.
[0022] Optionally, the determining module is configured to determine a first difference value between the second light sensing data and the first average value; in a case where an absolute value of the first difference value is greater than or equal to a first preset difference threshold, determine that the second light sensing data jumps; or in a case where the absolute value of the first difference value is less than the first preset difference threshold, determine that the second light sensing data does not jump.
[0023] Optionally, the determining module is configured to determine a first ratio of the first light sensing data and the third light sensing data; and determine the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0024] Optionally, in a case where the first ratio is within a preset ratio range, the determining module is configured to determine a first change trend of data collected by the first light sensor according to the first light sensing data and the first historical light sensing data; determine a second change trend of data collected by the second light sensor according to the third light sensing data and the second historical light sensing data; and determine the target light sensing data according to the first change trend and the second change trend.
[0025] Optionally, the determining module is configured to, in a case where the first change trend indicates that a change amplitude of the data collected by the first light sensor is less than or equal to a first preset change amplitude threshold, and the second change trend indicates that a change amplitude of the data collected by the second light sensor is less than or equal to a second preset change amplitude threshold, acquire third historical light sensing data used by the terminal to adjust screen brightness at a most recent time; and take the third historical light sensing data as the target light sensing data.
[0026] Optionally, in the case that the first ratio is greater than the maximum value in the preset ratio range, the determining module is configured to determine a first change trend of the data collected by the first light sensor according to the first light sensor data and the first historical light sensor data; determine a first ratio of the first light sensor data and the third light sensor data, and a second ratio of the first historical light sensor data and the second historical light sensor data; determine a third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; and determine the target light sensor data according to the first change trend and the third change trend.
[0027] Optionally, the determining module is configured to, in the case that the first change trend and the third change trend are the same, acquire third historical light sensor data used by the terminal to adjust the screen brightness at the last time; and take the third historical light sensor data as the target light sensor data.
[0028] Optionally, in the case that the first ratio is less than the minimum value in the preset ratio range, the determining module is configured to determine a second change trend of the data collected by the second light sensor according to the third light sensor data and the second historical light sensor data; determine a first ratio of the first light sensor data and the third light sensor data, and a second ratio of the first historical light sensor data and the second historical light sensor data; determine a third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; and determine the target light sensor data according to the second change trend and the third change trend.
[0029] Optionally, the determining module is configured to, in the case that the second change trend and the third change trend are the same, acquire third historical light sensor data used by the terminal to adjust the screen brightness at the last time; and take the third historical light sensor data as the target light sensor data.
[0030] Optionally, the determining module is further configured to, in a case where a preset execution condition is met, take the maximum value of the first light sensing data and the third light sensing data as the target light sensing data; the preset execution condition comprises: in a case where the first ratio is within a preset ratio range, the first change trend indicates that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold, and / or the second change trend indicates that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold; or, in a case where the first ratio is greater than the maximum value in the preset ratio range, the first change trend and the third change trend are different; or, in a case where the first ratio is less than the minimum value in the preset ratio range, the second change trend and the third change trend are different.
[0031] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method for adjusting screen brightness provided by the first aspect of the present disclosure when invoking the executable instructions stored on the memory.
[0032] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores computer program instructions, and the program instructions are executed by a processor to implement the steps of the method for adjusting screen brightness provided by the first aspect of the present disclosure.
[0033] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: first, the first light sensing data collected by the first light sensor at the current time and the first historical light sensing data collected in a preset historical time period are obtained; second, the second light sensing data collected by the second light sensor at the current time and the second historical light sensing data collected in a preset historical time period are obtained; then, the target light sensing data is determined according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data; and the screen brightness of the terminal is adjusted according to the target light sensing data. Through the above method, the target light sensing data for adjusting the screen brightness can be determined according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data. In this way, the target light sensing data for adjusting the screen brightness can be more accurately determined by comparing the current data and the historical data, thereby improving the adjustment effect of the screen brightness and improving the user experience.
[0034] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0035] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure.
[0036] Figure 1 is a flowchart of a method of adjusting screen brightness according to an exemplary embodiment;
[0037] Figure 2 is a flowchart of another method of adjusting screen brightness according to an exemplary embodiment;
[0038] Figure 3 is a flowchart of a method of adjusting screen brightness according to an exemplary embodiment;
[0039] Figure 4 is a block diagram of an apparatus for adjusting screen brightness according to an exemplary embodiment;
[0040] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0041] The exemplary embodiments will be described in detail with reference to the accompanying drawings. The following description is with reference to the drawings, in which like numerals represent like elements, unless the context dictates otherwise. The following description of exemplary embodiments is not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0042] The terms "first", "second", and the like, as used in the description and the claims of the present specification and the aforementioned drawings, are used to distinguish between similar objects, not to imply a specific order or sequence. Also, the same reference numerals are used in different drawings to represent the same or similar elements.
[0043] In the description of the present disclosure, unless otherwise stated, "and / or" is a description of an associative relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural.
[0044] The specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0045] Figure 1is a flowchart of a screen brightness adjustment method according to an exemplary embodiment, which is applied to a terminal, the terminal comprising at least a first light sensor and a second light sensor, the terminal having a first face and a second face arranged oppositely, the first face being a plane where a screen of the terminal is located, the first light sensor being arranged at the first face, and the second light sensor being arranged at the second face. It can be understood that the first face is a front face of the terminal, and the second face is a back face of the terminal. The terminal can be a mobile terminal such as a smartphone, a tablet computer, a smart television, a smart watch, a PDA (English: Personal Digital Assistant, Chinese: Personal Digital Assistant), a portable computer, etc., or can be a smart home device such as a sweeping robot, an air purifier, an air conditioner, a lighting lamp, a sound box, a robot, etc. The present disclosure does not limit this. Figure 1 As shown in the figure, the method comprises the following steps:
[0046] In step S101, first light sensing data of a current time and first historical light sensing data collected in a preset historical time period are obtained by the first light sensor.
[0047] The data collected by the first light sensor can be stored in a first data array set in advance, and the first data array type can be, for example, a FIFO (English: First Input First Output; Chinese: First Input First Output) array, so as to store a certain amount of data without occupying more storage space. The first historical light sensing data collected in the preset historical time period can be historical data collected by the first light sensor in all historical times stored in the first data array, or historical data collected in a certain historical time period.
[0048] In step S102, second light sensing data of a current time and second historical light sensing data collected in a preset historical time period are obtained by the second light sensor.
[0049] The data collected by the second light sensor can be stored in a second data array set in advance, and the second data array type can be, for example, a FIFO array, so as to store a certain amount of data without occupying more storage space. The second historical light sensing data collected in the preset historical time period can be historical data collected by the second light sensor in all historical times stored in the second data array, or historical data collected in a certain historical time period.
[0050] In step S103, target light sensing data is determined according to the first light sensing data, the second light sensing data, the first historical light sensing data, and the second historical light sensing data.
[0051] The target light sensing data is used for adjusting the screen brightness of the terminal.
[0052] In actual application scenarios, if the second light sensor is blocked, the second light sensing data collected by the second light sensor will be much smaller than the actual data. Therefore, in order to ensure the accuracy of the second light sensing data, in some embodiments, first, whether the second light sensing data jumps or not can be determined according to the second light sensing data and the second historical light sensing data. Then, third light sensing data of the second light sensor can be determined according to the second light sensing data and the second historical light sensing data. Then, the target light sensing data can be determined according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0053] In step S104, the screen brightness of the terminal is adjusted according to the target light sensing data.
[0054] Wherein, adjusting the screen brightness of the terminal according to the target light sensing data can refer to the related method in the prior art, which will not be repeated here.
[0055] By using the above method, the target light sensing data used for adjusting the screen brightness can be determined according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data. In this way, the target light sensing data used for adjusting the screen brightness can be more accurately determined by comparing the current data and the historical data, thereby improving the adjustment effect of the screen brightness and improving the user experience.
[0056] Figure 2 is a flow chart of another screen brightness adjustment method according to an example embodiment, as shown in Figure 2 The step S103 of determining the target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data can include the following steps:
[0057] In step S1031, third light sensing data is determined according to the second light sensing data and the second historical light sensing data.
[0058] For example, first, whether the second light sensing data jumps or not can be determined according to the second light sensing data and the second historical data. If it is determined that the second light sensing data jumps, it means that the second light sensing data is inaccurate and deviates from the actual data, and the second light sensor may be blocked. Further, the third light sensing data can be determined according to the second historical light sensing data. If it is determined that the second light sensing data does not jump, it means that the second light sensing data is accurate, and the second light sensing data can be used as the third light sensing data at this time.
[0059] Specifically, the determining the third light-sensing data according to the second light-sensing data and the second historical light-sensing data in step S1031 can include the following steps.
[0060] In step S1031a, a first average value of the second historical light-sensing data collected by the second light sensor in the preset historical time period is determined.
[0061] In step S1031b, whether the second light-sensing data jumps is determined according to the second light-sensing data and the first average value.
[0062] In one possible implementation, first, a first difference value between the second light-sensing data and the first average value of the second historical light-sensing data can be determined. Second, in a case where an absolute value of the first difference value is greater than or equal to a first preset difference threshold, it is determined that the second light-sensing data jumps; or in a case where the absolute value of the first difference value is less than the first preset difference threshold, it is determined that the second light-sensing data does not jump.
[0063] In another possible implementation, first, a second average value between the second light-sensing data and the first average value of the second historical light-sensing data can be determined. Second, a second difference value between the first average value and the second average value is determined. Then, in a case where the second difference value is greater than or equal to a second preset difference threshold, it is determined that the second light-sensing data jumps; or in a case where the second difference value is less than the second preset difference threshold, it is determined that the second light-sensing data does not jump.
[0064] In step S1031c, in a case where it is determined that the second light-sensing data jumps, the first average value is taken as the third light-sensing data.
[0065] In this step, in a case where it is determined that the second light-sensing data jumps, it is indicated that the second light-sensing data is inaccurate and cannot accurately reflect the intensity of the current ambient light. The case can be caused by the second light sensor being blocked, that is, the intensity of the ambient light actually can not have a large change. Therefore, in this embodiment, in a case where it is determined that the second light-sensing data jumps, the first average value of the second historical light-sensing data can be taken as the third light-sensing data.
[0066] In addition, in a case where it is determined that the second light-sensing data does not jump, the second light-sensing data can be taken as the third light-sensing data.
[0067] In a case where it is determined that the second light-sensing data does not jump, it is indicated that the second light-sensing data is accurate and can accurately reflect the intensity of the current ambient light. Therefore, in this embodiment, in a case where it is determined that the second light-sensing data does not jump, the second light-sensing data can be taken as the third light-sensing data.
[0068] In step S1032, the target light sensing data is determined according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0069] Specifically, step S1032 can include the following steps:
[0070] In step S1032a, a first ratio of the first light sensing data and the third light sensing data is determined.
[0071] Wherein, the relative position of the external light source relative to the terminal at the current moment is determined according to the first ratio.
[0072] For example, the first ratio can be represented as m = front_als / back_als. Wherein, m represents the first ratio, front_als represents the first light sensing data, and back_als represents the third light sensing data.
[0073] For example, in the case that the first ratio is within a preset ratio range, it can be determined that the external light source at the current moment is located at a first side, which is a side close to a third face of the terminal. The third face is a plane in the terminal perpendicular to the first face and the second face, and can also be understood as a plane in which the middle frame of the terminal is located. In other words, if the first ratio is within the preset ratio range, it can be determined that the external light source at the current moment is located at the side of the terminal. In the case that the first ratio is greater than the maximum value in the preset ratio range, it can be determined that the external light source at the current moment is located at a second side, which is a side close to the first face of the terminal. That is, if the first ratio is greater than the maximum value in the preset ratio range, it can be determined that the external light source at the current moment is located at the front end of the terminal. In the case that the first ratio is less than the minimum value in the preset ratio range, it can be determined that the external light source at the current moment is located at a third side, which is a side close to the second face of the terminal. That is, if the first ratio is less than the minimum value in the preset ratio range, it can be determined that the external light source at the current moment is located at the rear end of the terminal.
[0074] It should be noted that if the first ratio is equal to the maximum value in the preset ratio range or the first ratio is equal to the minimum value in the preset ratio range, it can be determined that the first ratio is within the preset ratio range, that is, the external light source at the current moment is located at the first side.
[0075] In step S1032b, the target light sensing data is determined according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0076] Specifically, it can be known from the above analysis that there are three possible cases for the first ratio, such as the first ratio being in a preset ratio range, the first ratio being greater than a maximum value in the preset ratio range, and the first ratio being less than a minimum value in the preset ratio range. Therefore, determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data, and the second historical light sensing data can include the following three possible implementation manners.
[0077] In a first possible implementation manner, in a case where the first ratio is in the preset ratio range, it can be determined that the external light source is located at the first side at this time. Further, determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data, and the second historical light sensing data in the step S1032b can be implemented in the following manner.
[0078] First, a first change trend of data collected by the first light sensor is determined according to the first light sensing data and the first historical light sensing data. Second, a second change trend of data collected by the second light sensor is determined according to the third light sensing data and the second historical light sensing data. Then, the target light sensing data is determined according to the first change trend and the second change trend.
[0079] The first change trend is used to represent a change amplitude and a change rule of the data collected by the first light sensor, and the second change trend is used to represent a change amplitude and a change rule of the data collected by the second light sensor.
[0080] Specifically, determining the target light sensing data according to the first change trend and the second change trend can include: in a case where the first change trend represents that a change amplitude of the data collected by the first light sensor is less than or equal to a first preset change amplitude threshold, and the second change trend represents that a change amplitude of the data collected by the second light sensor is less than or equal to a second preset change amplitude threshold, obtaining third historical light sensing data used by the terminal to adjust the screen brightness at a latest time, and taking the third historical light sensing data as the target light sensing data.
[0081] In other words, in the case that the first change trend indicates that the change amplitude of the data collected by the first light sensor is less than or equal to the first preset change amplitude threshold, it indicates that the data collected by the first light sensor is slowly increasing or slowly decreasing. Similarly, in the case that the second change trend indicates that the change amplitude of the data collected by the second light sensor is less than or equal to the second preset change amplitude threshold, it indicates that the data collected by the second light sensor is slowly increasing or slowly decreasing. If the above two conditions are met simultaneously, it can be determined that the illumination intensity of the external light source is unchanged in a period of time, and at this time, the third historical light sensing data used by the terminal for adjusting the screen brightness last time can be taken as the target light sensing data.
[0082] In addition, in the case that the first change trend indicates that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold, and / or the second change trend indicates that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold, the maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0083] That is, in the case that the first change trend indicates that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold, it indicates that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold, and it indicates that the data collected by the second light sensor is not slowly increasing or not slowly decreasing. If at least one of the above conditions is met, it is considered that the illumination intensity of the current external light source has changed. At this time, in order to ensure the accuracy of the target light sensing data, the maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0084] In the second possible implementation, in the case that the first ratio is greater than the maximum value in the preset ratio range, it can be determined that the external light source is located at the second side at this time. Further, the step S1032b of determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data can be implemented in the following manner:
[0085] Firstly, the first change trend of the data collected by the first light sensor is determined according to the first light sensing data and the first historical light sensing data. Secondly, the first ratio of the first light sensing data and the third light sensing data and the second ratio of the first historical light sensing data and the second historical light sensing data are determined. Then, the third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor is determined according to the first ratio and the second ratio. Finally, the target light sensing data is determined according to the first change trend and the third change trend.
[0086] The third change trend is used to represent a change range and a change rule of a ratio between the data collected by the first light sensor and the data collected by the second light sensor.
[0087] Specifically, according to the first change trend and the third change trend, the target light sensing data can be determined as follows: in a case where the first change trend and the third change trend are the same, third historical light sensing data used by the terminal to adjust screen brightness at a latest time is obtained, and the third historical light sensing data is taken as the target light sensing data.
[0088] If the first change trend and the third change trend are the same, it indicates that the data collected by the first light sensor and the ratio between the data collected by the first light sensor and the data collected by the second light sensor change synchronously, that is, decrease simultaneously or increase simultaneously. If the above condition is met, it can be determined that the external light source moves towards the plane where the terminal is located or moves in a plane perpendicular to the plane where the terminal is located, that is, the illumination intensity of the external light source itself does not change. At this time, the third historical light sensing data used by the terminal to adjust screen brightness at a latest time can be taken as the target light sensing data.
[0089] In addition, in a case where the first change trend and the third change trend are different, a maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0090] That is, in a case where the first change trend and the third change trend are different, it indicates that the data collected by the first light sensor and the ratio between the data collected by the first light sensor and the data collected by the second light sensor do not change synchronously, that is, one decreases and the other increases. If the above condition is met, it can be determined that the illumination intensity of the external light source changes. At this time, a maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0091] In a third possible implementation, in a case where the first ratio is less than a minimum value in a preset ratio range, it can be determined that the terminal is located at the third side at this time. Further, the step S1032b of determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data can be implemented as follows:
[0092] Firstly, a second change trend of the data collected by the second light sensor is determined according to the third light sensing data and the second historical light sensing data. Secondly, a first ratio of the first light sensing data and the third light sensing data and a second ratio of the first historical light sensing data and the second historical light sensing data are determined. Then, a third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor is determined according to the first ratio and the second ratio. Finally, the target light sensing data is determined according to the second change trend and the third change trend.
[0093] Specifically, the target light sensing data can be determined according to the second change trend and the third change trend, including: in the case that the second change trend and the third change trend are the same, obtaining third historical light sensing data used by the terminal to adjust the screen brightness last time, and taking the third historical light sensing data as the target light sensing data.
[0094] If the second change trend and the third change trend are the same, it indicates that the data collected by the second light sensor and the ratio between the data collected by the first light sensor and the data collected by the second light sensor change synchronously, that is, decrease simultaneously or increase simultaneously. If the above condition is met, it can be determined that the external light source moves towards the plane where the terminal is located or moves in the plane perpendicular to the plane where the terminal is located, that is, the illumination intensity of the external light source itself does not change. At this time, the third historical light sensing data used by the terminal to adjust the screen brightness last time can be taken as the target light sensing data.
[0095] In addition, in the case that the second change trend and the third change trend are not the same, the maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0096] That is, in the case that the second change trend and the third change trend are not the same, it indicates that the data collected by the second light sensor and the ratio between the data collected by the first light sensor and the data collected by the second light sensor do not change synchronously, that is, one decreases and the other increases. If the above condition is met, it can be determined that the illumination intensity of the external light source changes. At this time, the maximum value of the first light sensing data and the third light sensing data can be taken as the target light sensing data.
[0097] By using the above method, the target light sensing data used to adjust the screen brightness can be determined according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data. In this way, the target light sensing data used to adjust the screen brightness can be more accurately determined by comparing the current data and the historical data, and the adjustment effect of the screen brightness is improved, and the user experience is improved.
[0098] Figure 3 is a flowchart of a screen brightness adjusting method according to an exemplary embodiment, as shown in Figure 3 The method can include the following steps:
[0099] In step S201, the first light sensor acquires the first light data at the current time and the first historical light data in a preset historical time period, and the second light sensor acquires the second light data at the current time and the second historical light data in the preset historical time period.
[0100] In step S202, it is determined whether the second light data jumps according to the second light data and the second historical light data.
[0101] If it is determined that the second light data jumps, step S203 is performed;
[0102] If it is determined that the second light data does not jump, step S204 is performed.
[0103] For example, in a possible implementation, the first average value of the second historical light data collected by the second light sensor in the preset historical time period can be determined first. Then, it is determined whether the second light data jumps according to the second light data and the first average value of the second historical light data. In another possible implementation, the second average value between the first average value of the second light data and the second historical light data can also be determined. Then, it is determined whether the second light data jumps according to the second light data and the second average value. For specific implementation, please refer to the description in step S1031b above, which will not be repeated here.
[0104] In step S203, the first average value of the second historical light data is taken as the third light data.
[0105] In step S204, the second light data is taken as the third light data.
[0106] In step S205, the first ratio of the first light data and the third light data is determined.
[0107] In step S206, it is determined whether the first ratio is within a preset ratio range.
[0108] If it is determined that the first ratio is within the preset range, step S207 is performed;
[0109] If it is determined that the first ratio is outside the preset range, step S208 is performed.
[0110] In step S207, a first change trend of the data collected by the first light sensor and a second change trend of the data collected by the second light sensor are determined.
[0111] In step S208, it is determined whether the first ratio is greater than a maximum value in the preset ratio range.
[0112] In a case where it is determined that the first ratio is greater than the maximum value in the preset ratio range, step S210 is performed.
[0113] In a case where it is determined that the first ratio is not greater than the maximum value in the preset ratio range, step S212 is performed.
[0114] In other words, in a case where it is determined that the first ratio is outside the preset range and it is determined that the first ratio is not greater than the maximum value in the preset ratio range, it is indicated that the first ratio is less than a minimum value in the preset ratio range, and step S212 is performed.
[0115] In step S209, it is determined whether the first change trend indicates that a change amplitude of the data collected by the first light sensor is less than or equal to a first preset change amplitude threshold and whether the second change trend indicates that a change amplitude of the data collected by the second light sensor is less than or equal to a second preset change amplitude threshold.
[0116] In a case where the first change trend indicates that the change amplitude of the data collected by the first light sensor is less than or equal to the first preset change amplitude threshold and the second change trend indicates that the change amplitude of the data collected by the second light sensor is less than or equal to the second preset change amplitude threshold, step S214 is performed.
[0117] In a case where the first change trend indicates that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold and / or the second change trend indicates that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold, step S215 is performed.
[0118] In step S210, a first change trend of the data collected by the first light sensor and a third change trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor are determined.
[0119] In step S211, it is determined whether the first change trend and the third change trend are the same.
[0120] In a case where it is determined that the first change trend and the third change trend are the same, step S214 is performed.
[0121] In a case where it is determined that the first change trend and the third change trend are not the same, step S215 is performed.
[0122] In step S212, a second variation trend of the data collected by the second light sensor and a third variation trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor are determined.
[0123] In step S213, it is determined whether the second variation trend and the third variation trend are the same.
[0124] In a case where it is determined that the second variation trend and the third variation trend are the same, step S214 is performed.
[0125] In a case where it is determined that the second variation trend and the third variation trend are not the same, step S215 is performed.
[0126] In step S214, a third historical light-sensing data used by the terminal to adjust the screen brightness at the last time is taken as the target light-sensing data.
[0127] In step S215, a maximum value between the first light-sensing data and the third light-sensing data is taken as the target light-sensing data.
[0128] In step S216, the screen brightness of the terminal is adjusted according to the target light-sensing data.
[0129] With the above method, firstly, it can be determined whether the data collected by the second light sensor has a large fluctuation according to the second light-sensing data and the second historical light-sensing data, so that the third light-sensing data of the second light sensor can be determined more accurately. Secondly, the target light-sensing data used to adjust the screen brightness is determined according to the first light-sensing data, the third light-sensing data, the first historical light-sensing data and the second historical light-sensing data. In this way, the target light-sensing data used to adjust the screen brightness can be determined more accurately by comparing the current data and the historical data, so that the adjustment effect of the screen brightness is improved and the user experience is improved.
[0130] Figure 4 is a block diagram of a screen brightness adjustment device according to an example embodiment, applied to a terminal, the terminal comprising at least a first light sensor and a second light sensor, the terminal having a first face and a second face arranged oppositely, the first face being a plane where a screen of the terminal is located, the first light sensor being arranged on the first face, and the second light sensor being arranged on the second face; as shown in the figure, the device 300 comprises: Figure 4
[0131] a first acquisition module 301, configured to acquire first light-sensing data of a current time collected by the first light sensor and first historical light-sensing data collected in a preset historical time period;
[0132] The second acquisition module 302 is configured to acquire second light sensing data of a current moment collected by the second light sensor and second historical light sensing data collected in a preset historical time period;
[0133] The determination module 303 is configured to determine target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data.
[0134] The adjustment module 304 is configured to adjust the screen brightness of the terminal according to the target light sensing data.
[0135] Optionally, the determination module 303 is configured to determine third light sensing data according to the second light sensing data and the second historical light sensing data, and determine the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0136] Optionally, the determination module 303 is configured to determine a first average value of the second historical light sensing data collected by the second light sensor in the preset historical time period, and determine whether the second light sensing data jumps according to the second light sensing data and the first average value; in a case where it is determined that the second light sensing data jumps, take the first average value as the third light sensing data.
[0137] Optionally, the determination module 303 is further configured to, in a case where it is determined that the second light sensing data does not jump, take the second light sensing data as the third light sensing data.
[0138] Optionally, the determination module 303 is configured to determine a first difference value between the second light sensing data and the first average value, and determine that the second light sensing data jumps in a case where an absolute value of the first difference value is greater than or equal to a first preset difference threshold, or determine that the second light sensing data does not jump in a case where the absolute value of the first difference value is less than the first preset difference threshold.
[0139] Optionally, the determination module 303 is configured to determine a first ratio of the first light sensing data and the third light sensing data, and determine the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
[0140] Optionally, when the first ratio is within a preset ratio range, the determining module 303 is configured to determine, according to the first light sensing data and the first historical light sensing data, a first change trend of the data collected by the first light sensor; determine, according to the third light sensing data and the second historical light sensing data, a second change trend of the data collected by the second light sensor; and determine the target light sensing data according to the first change trend and the second change trend.
[0141] Optionally, when the first change trend indicates that the change amplitude of the data collected by the first light sensor is less than or equal to a first preset change amplitude threshold, and the second change trend indicates that the change amplitude of the data collected by the second light sensor is less than or equal to a second preset change amplitude threshold, the determining module 303 is configured to acquire third historical light sensing data used by the terminal to adjust the screen brightness at the last time; and take the third historical light sensing data as the target light sensing data.
[0142] Optionally, when the first ratio is greater than a maximum value in a preset ratio range, the determining module 303 is configured to determine, according to the first light sensing data and the first historical light sensing data, a first change trend of the data collected by the first light sensor; determine a first ratio of the first light sensing data and the third light sensing data and a second ratio of the first historical light sensing data and the second historical light sensing data; determine, according to the first ratio and the second ratio, a third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor; and determine the target light sensing data according to the first change trend and the third change trend.
[0143] Optionally, when the first change trend and the third change trend are the same, the determining module 303 is configured to acquire third historical light sensing data used by the terminal to adjust the screen brightness at the last time; and take the third historical light sensing data as the target light sensing data.
[0144] Optionally, when the first ratio is less than a minimum value in a preset ratio range, the determining module 303 is configured to determine, according to the third light sensing data and the second historical light sensing data, a second change trend of the data collected by the second light sensor; determine a first ratio of the first light sensing data and the third light sensing data and a second ratio of the first historical light sensing data and the second historical light sensing data; determine, according to the first ratio and the second ratio, a third change trend of the ratio between the data collected by the first light sensor and the data collected by the second light sensor; and determine the target light sensing data according to the second change trend and the third change trend.
[0145] Optionally, the determining module 303 is configured to, in the case that the second change trend and the third change trend are the same, acquire third historical light sensing data used by the terminal to adjust the screen brightness last time; and take the third historical light sensing data as the target light sensing data.
[0146] Optionally, the determining module 303 is further configured to, in the case that a preset execution condition is met, take the maximum value of the first light sensing data and the third light sensing data as the target light sensing data.
[0147] The preset execution condition comprises:
[0148] In the case that the first ratio is within a preset ratio range, the first change trend indicates that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold, and / or the second change trend indicates that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold; or,
[0149] In the case that the first ratio is greater than the maximum value in the preset ratio range, the first change trend and the third change trend are not the same; or,
[0150] In the case that the first ratio is less than the minimum value in the preset ratio range, the second change trend and the third change trend are not the same.
[0151] With the above device, firstly, whether the data collected by the second light sensor has a large fluctuation can be determined according to the second light sensing data and the second historical light sensing data, so that the third light sensing data of the second light sensor can be determined more accurately. Secondly, the target light sensing data used to adjust the screen brightness can be determined according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data. In this way, the target light sensing data used to adjust the screen brightness can be determined more accurately by comparing the current data and the historical data, so as to improve the adjustment effect of the screen brightness and improve the user experience.
[0152] As to the device in the above embodiments, specific manners in which various modules perform operations have been described in details in the embodiments of the method, and will not be described in details here.
[0153] The present disclosure further provides a computer readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the steps of the method for adjusting the screen brightness provided by the present disclosure.
[0154] Figure 5is a block diagram of an electronic device 400 according to an exemplary embodiment. The electronic device 400 can be, for example, a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0155] Referring to Figure 5 The electronic device 400 can include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, a multimedia component 408, an audio component 410, an input / output (I / O) interface 412, a sensor component 414, and a communication component 416.
[0156] The processing component 402 usually controls overall operations of the electronic device 400, such as operations associated with displaying, making phone calls, data communications, camera operations, and recording operations. The processing component 402 can include one or more processors 420 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 402 can include one or more modules to facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0157] The memory 404 is configured to store various types of data to support operations of the electronic device 400. Examples of these data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, pictures, videos, and the like. The memory 404 can be implemented by any type of volatile or non-volatile memory devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc or optical disc.
[0158] The power supply component 406 supplies electric power for the various components of the electronic device 400. The power supply component 406 can include a power supply management system, one or more power supplies, and other components associated with generating, managing and distributing electric power for the electronic device 400.
[0159] The multimedia component 408 includes a screen to provide an output interface between the electronic device 400 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and intensity of the touching or sliding action. In some embodiments, the multimedia component 408 includes a front camera and / or a back camera. When the electronic device 400 is in an operating mode, such as a camera mode or a video mode, the front camera and / or the back camera can receive external multimedia data. Each of the front camera and the back camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0160] The audio component 410 is configured to output and / or input an audio signal. For example, the audio component 410 includes a microphone (MIC) to receive an external audio signal when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 404 or transmitted via the communication component 416. In some embodiments, the audio component 410 also includes a speaker to output an audio signal.
[0161] The input / output interface 412 provides an interface between the processing component 402 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0162] The sensor component 414 includes one or more sensors to provide various state assessments for the electronic device 400. For example, the sensor component 414 can detect an open / closed state of the electronic device 400, relative positioning of components, such as a display and a keypad of the electronic device 400, a change in position of the electronic device 400 or a component of the electronic device 400, presence or absence of user contact with the electronic device 400, orientation or acceleration / deceleration of the electronic device 400, and a temperature change of the electronic device 400. The sensor component 414 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 414 can also include a light sensor such as a CMOS or CCD image sensor for use in an imaging application. In some embodiments, the sensor component 414 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0163] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate close proximity communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technology.
[0164] In an exemplary embodiment, the electronic device 400 can be implemented with one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described method of adjusting screen brightness.
[0165] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 404 including instructions, is also provided, which can be executed by the processor 420 of the electronic device 400 to complete the above-described method of adjusting screen brightness. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0166] In another exemplary embodiment, a computer program product is also provided, which contains a computer program capable of being executed by a programmable device, and the computer program has code portions for executing the above-described method of adjusting screen brightness when executed by the programmable device.
[0167] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the present disclosure. It is intended that the present disclosure cover any and all variations of the present disclosure including those variations which can be incorporated into the above detailed description and making use of the general principles of the present disclosure. It is intended that the present disclosure include all such as fall within the scope of the appended claims and their equivalents. The specification and examples given are intended as illustrative only and not limiting of the true scope and spirit of the present disclosure.
[0168] It should be understood that the present disclosure is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method of adjusting the brightness of a screen, characterized in that, The method is applied to a terminal, the terminal comprising at least a first light sensor and a second light sensor, the terminal having a first face and a second face arranged oppositely, the first face being a plane where a screen of the terminal is located, the first light sensor being arranged on the first face, and the second light sensor being arranged on the second face; the method comprising: obtaining first light sensing data of a current moment collected by the first light sensor and first historical light sensing data collected in a preset historical time period; obtaining second light sensing data of the current moment collected by the second light sensor and second historical light sensing data collected in the preset historical time period; determining target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data; adjusting screen brightness of the terminal according to the target light sensing data; the determining target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data comprising: determining third light sensing data according to the second light sensing data and the second historical light sensing data; determining the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data; the determining the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprising: determining a first ratio of the first light sensing data and the third light sensing data; the first ratio being used to determine a relative position of an external light source relative to the terminal at the current moment; determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
2. The method of claim 1, wherein, the determining third light sensing data according to the second light sensing data and the second historical light sensing data comprising: determining a first average value of the second historical light sensing data collected by the second light sensor in the preset historical time period; determining whether the second light sensing data jumps according to the second light sensing data and the first average value; in a case where it is determined that the second light sensing data jumps, taking the first average value as the third light sensing data.
3. The method of claim 2, wherein, the method further comprising: in a case where it is determined that the second light sensing data does not jump, taking the second light sensing data as the third light sensing data.
4. The method of claim 2, wherein, the determining whether the second light sensing data jumps according to the second light sensing data and the first average value comprising: determining a first difference value between the second light sensing data and the first average value; in a case where an absolute value of the first difference value is greater than or equal to a first preset difference threshold, determining that the second light sensing data jumps; or in a case where the absolute value of the first difference value is less than the first preset difference threshold, determining that the second light sensing data does not jump.
5. The method of claim 1, wherein, In a case where the first ratio is within a preset ratio range, the determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a first change trend of data collected by the first light sensor according to the first light sensing data and the first historical light sensing data; determining a second change trend of data collected by the second light sensor according to the third light sensing data and the second historical light sensing data; determining the target light sensing data according to the first change trend and the second change trend.
6. The method of claim 5, wherein, The determining the target light sensing data according to the first change trend and the second change trend comprises: in a case where the first change trend represents that a change amplitude of the data collected by the first light sensor is less than or equal to a first preset change amplitude threshold, and the second change trend represents that a change amplitude of the data collected by the second light sensor is less than or equal to a second preset change amplitude threshold, obtaining third historical light sensing data used by the terminal to adjust screen brightness at a latest time; taking the third historical light sensing data as the target light sensing data.
7. The method of claim 6, wherein, The method further comprises: in a case where the first ratio is within the preset ratio range, if the first change trend represents that the change amplitude of the data collected by the first light sensor is greater than the first preset change amplitude threshold, and / or the second change trend represents that the change amplitude of the data collected by the second light sensor is greater than the second preset change amplitude threshold, taking a maximum value of the first light sensing data and the third light sensing data as the target light sensing data.
8. The method of claim 1, wherein, In a case where the first ratio is greater than a maximum value in the preset ratio range, the determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a first change trend of data collected by the first light sensor according to the first light sensing data and the first historical light sensing data; determining a first ratio of the first light sensing data and the third light sensing data, and a second ratio of the first historical light sensing data and the second historical light sensing data; determining a third change trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; determining the target light sensing data according to the first change trend and the third change trend.
9. The method of claim 8, wherein, The determining the target light sensing data according to the first change trend and the third change trend comprises: in a case where the first change trend and the third change trend are same, obtaining third historical light sensing data used by the terminal to adjust screen brightness at a latest time; taking the third historical light sensing data as the target light sensing data.
10. The method of claim 9, wherein, The method comprises: In a case where the first ratio is greater than a maximum value in a preset ratio range, if the first change trend and the third change trend are different, a maximum value in the first light sensing data and the third light sensing data is taken as the target light sensing data.
11. The method of claim 1, wherein, In a case where the first ratio is less than a minimum value in the preset ratio range, the determining the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data comprises: determining a second change trend of data collected by the second light sensor according to the third light sensing data and the second historical light sensing data; determining a first ratio of the first light sensing data and the third light sensing data, and a second ratio of the first historical light sensing data and the second historical light sensing data; determining a third change trend of a ratio between the data collected by the first light sensor and the data collected by the second light sensor according to the first ratio and the second ratio; determining the target light sensing data according to the second change trend and the third change trend.
12. The method of claim 11, wherein, The determining the target light sensing data according to the second change trend and the third change trend comprises: in a case where the second change trend and the third change trend are the same, obtaining third historical light sensing data used by the terminal to adjust screen brightness at a most recent time; taking the third historical light sensing data as the target light sensing data.
13. The method of claim 12, wherein, The method further comprises: in a case where the first ratio is less than the minimum value in the preset ratio range, if the second change trend and the third change trend are different, taking a maximum value in the first light sensing data and the third light sensing data as the target light sensing data.
14. An apparatus for adjusting the brightness of a screen, characterized by The method is applied to a terminal, the terminal at least comprising a first light sensor and a second light sensor, the terminal having a first face and a second face arranged oppositely, the first face being a plane where a screen of the terminal is located, the first light sensor being arranged on the first face, and the second light sensor being arranged on the second face; the apparatus comprises: a first obtaining module configured to obtain first light sensing data collected by the first light sensor at a current time and first historical light sensing data collected in a preset historical time period; a second obtaining module configured to obtain second light sensing data collected by the second light sensor at the current time and second historical light sensing data collected in the preset historical time period; a determining module configured to determine target light sensing data according to the first light sensing data, the second light sensing data, the first historical light sensing data and the second historical light sensing data; an adjusting module configured to adjust screen brightness of the terminal according to the target light sensing data; the determining module is configured to determine third light sensing data according to the second light sensing data and the second historical light sensing data, and determine the target light sensing data according to the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data; The determining module is configured to determine a first ratio of the first light sensing data and the third light sensing data, the first ratio being used to determine a relative position of an external light source relative to the terminal at a current time; and determine the target light sensing data according to the first ratio, the first light sensing data, the third light sensing data, the first historical light sensing data and the second historical light sensing data.
15. An electronic device, comprising: Comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method of any one of claims 1 to 13 when invoking the executable instructions stored on the memory.
16. A computer-readable storage medium having stored thereon computer program instructions, wherein, The program instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 13.
Citation Information
Patent Citations
Ambient light detection method and mobile terminal
CN108600546A
Screen brightness adjusting method, screen brightness adjusting device and computer storage medium
CN111128092A