CN114495862A - Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium - Google Patents

Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN114495862A
CN114495862A CN202210079859.0A CN202210079859A CN114495862A CN 114495862 A CN114495862 A CN 114495862A CN 202210079859 A CN202210079859 A CN 202210079859A CN 114495862 A CN114495862 A CN 114495862A
Authority
CN
China
Prior art keywords
light sensation
value
light
stable
values
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210079859.0A
Other languages
Chinese (zh)
Inventor
朱丽华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wingtech Information Technology Co Ltd
Original Assignee
Shanghai Wingtech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Wingtech Information Technology Co Ltd filed Critical Shanghai Wingtech Information Technology Co Ltd
Priority to CN202210079859.0A priority Critical patent/CN114495862A/en
Publication of CN114495862A publication Critical patent/CN114495862A/en
Priority to PCT/CN2022/098721 priority patent/WO2023137957A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/10Intensity circuits
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/02Details
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0626Adjustment of display parameters for control of overall brightness

Abstract

The embodiment of the application discloses an obtaining method of an environment light sensitivity value, electronic equipment and a computer readable storage medium, which can effectively improve the accuracy of determining the environment light sensitivity value. The method is applied to electronic equipment, the electronic equipment at least comprises a first light-sensing sensor and a second light-sensing sensor, and the method comprises the following steps: determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor; determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor; calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.

Description

Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium
Technical Field
The present disclosure relates to the field of sensor technologies, and in particular, to a method for obtaining an ambient light sensitivity value, an electronic device, and a computer-readable storage medium.
Background
With the development of society, electronic devices have been deeply inserted into people's daily lives, and generally, electronic devices are provided with an automatic display brightness adjustment function. In the process that a user uses the electronic equipment, the electronic equipment can monitor the current ambient light sensitivity value in real time and adjust the screen display brightness of the electronic equipment along with the monitored ambient light sensitivity value.
However, if the brightness of the current ambient light source of the electronic device changes frequently or the electronic device moves rapidly under the condition of multiple light sources, the ambient light sensitivity value monitored by the electronic device in real time is not accurate enough.
Disclosure of Invention
The embodiment of the application provides an obtaining method of an environment light sensitivity value, an electronic device and a computer readable storage medium, which can effectively improve the accuracy of determining the environment light sensitivity value.
A first aspect of the embodiments of the present application provides a method for obtaining an ambient light sensation value, which is applied to an electronic device, where the electronic device at least includes a first light sensation sensor and a second light sensation sensor, and the method may include:
determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor;
determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor;
calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the discrete degree value includes a variance, and if the discrete degree value is smaller than a preset threshold, the first light sensation stable value and the second light sensation stable value are fused to obtain an ambient light sensation value, including: if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value; or the like, or, alternatively,
the discrete degree value includes a standard deviation, and if the discrete degree value is smaller than a preset threshold, the first light sensation stable value and the second light sensation stable value are fused to obtain an ambient light sensation value, including: and if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the calculating a discrete degree value corresponding to the first light sensation stability value and the second light sensation stability value includes: obtaining an average value corresponding to the first light sensation stable value and the second light sensation stable value; calculating a first difference value between the first light sensation stable value and the average value; calculating a second difference value between the second light sensation stability value and the average value; and summing the square of the first difference and the square of the second difference, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
Optionally, the fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value includes: multiplying the first light sensation stability value by a first weight to obtain a first numerical value; multiplying the second light sensation stability value by a second weight to obtain a second numerical value, wherein the sum of the second weight and the first weight is 1; and adding the first value and the second value to obtain an ambient light sensitivity value.
Optionally, the determining a first light sensation stability value according to a plurality of first light sensation values collected by the first light sensation sensor includes: collecting a plurality of first light sensation values through the first light sensation sensor; denoising the plurality of first light sensation values, and taking a first average value corresponding to the denoised first light sensation values as a first light sensation stable value if the number of the denoised first light sensation values reaches a first preset number threshold;
should according to a plurality of second light sensation values of gathering through this second light sensation sensor, confirm the stable value of second light sensation, include: collecting a plurality of second light sensation values through the second light sensation sensor; denoising the plurality of second light sensation values, and taking a second average value corresponding to the denoised second light sensation values as a second light sensation stable value if the number of the denoised second light sensation values reaches a second preset number threshold; the first light sensor is a front light sensor arranged on the front side of the screen of the electronic device, and the second light sensor is a rear light sensor arranged on the back side of the screen of the electronic device.
Optionally, the denoising the plurality of first light sensation values includes: reading first light sensitivity values acquired by the first light sensor one by one from a first acquisition buffer area; the first acquisition buffer area is used for storing a plurality of first light sensation values acquired by the first light sensor; judging whether the read first light sensation value is a noise light sensation value or not, and writing the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value;
should if the quantity of the first light sensation value after removing the noise reaches the first predetermined quantity threshold, regard the first mean value that should remove the noise that corresponds to the first light sensation value after removing the noise as first light sensation steady value, include: if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, taking a first average value corresponding to the first light sensation values of which the number in the first light sensation buffer queue reaches the first preset number threshold as a first light sensation stable value.
Optionally, the determining whether the read first light sensation value is a noise light sensation value includes: acquiring a first head value, wherein the first head value is a first light sensation value written in a first light sensation buffer queue; and when the first head value and the read first light sensation value are both smaller than the first light sensation stable value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stable value determined last time, determining that the read first light sensation value is not the noise point light sensation value.
A second aspect of the embodiments of the present application provides an electronic device, which at least includes a first light-sensing sensor and a second light-sensing sensor, and may further include:
the stable value determining module is used for determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor; determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor;
and the fusion module is used for calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the dispersion degree value includes a variance, and the fusion module is further configured to fuse the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold; or the like, or, alternatively,
the discrete degree value comprises a standard deviation, and the fusion module is further used for fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold value.
Optionally, the fusion module is further configured to obtain an average value corresponding to the first light sensation stable value and the second light sensation stable value; calculating a first difference value between the first light sensation stable value and the average value; calculating a second difference value between the second light sensation stable value and the average value; and summing the square of the first difference and the square of the second difference, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
Optionally, the fusion module is specifically configured to multiply the first light sensation stability value by a first weight to obtain a first numerical value; multiplying the second light sensation stable value by a second weight to obtain a second value, wherein the sum of the second weight and the first weight is 1; and adding the first value and the second value to obtain an ambient light sensitivity value.
Optionally, the stable value determining module includes:
the first acquisition unit is used for acquiring a plurality of first light sensation values through the first light sensation sensor;
the first denoising unit is used for denoising the plurality of first light sensation values;
the first determining unit is used for taking a first mean value corresponding to the denoised first light sensation value as a first light sensation stable value if the number of the denoised first light sensation values reaches a first preset number threshold;
the second acquisition unit is used for acquiring a plurality of second light sensation values through the second light sensation sensor;
the second denoising unit is used for denoising the plurality of second light sensation values;
the second determining unit is used for taking a second average value corresponding to the denoised second light sensation value as a second light sensation stable value if the number of the denoised second light sensation values reaches a second preset number threshold; the first light sensor is a front light sensor arranged on the front side of the screen of the electronic device, and the second light sensor is a rear light sensor arranged on the back side of the screen of the electronic device.
Optionally, the first denoising unit is further configured to read the first light sensitivity values collected by the first light sensor one by one from the first collection buffer area; the first acquisition buffer area is used for storing a plurality of first light sensation values acquired by the first light sensor; judging whether the read first light sensation value is a noise light sensation value or not, and writing the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value;
the first determining unit is further configured to, if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, take a first average value corresponding to the first light sensation values in the first light sensation buffer queue, of which the number reaches the first preset number threshold, as a first light sensation stable value.
Optionally, the first acquisition unit is further configured to acquire a first head value, where the first head value is a first light sensation value written in the first light sensation buffer queue;
the first determining unit is further configured to determine that the read first light sensation value is not a noise point light sensation value when the first head value and the read first light sensation value are both smaller than the first light sensation stability value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stability value determined last time.
A third aspect of the embodiments of the present application provides an electronic device, which includes at least a first optical sensor and a second optical sensor, and may further include:
a memory storing executable program code;
and a processor coupled to the memory;
the processor calls the executable program code stored in the memory, and when executed by the processor, the executable program code causes the processor to implement the method according to the first aspect of the embodiments of the present application.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, on which executable program code is stored, and when the executable program code is executed by a processor, the method according to the first aspect of embodiments of the present application is implemented.
A fifth aspect of embodiments of the present application discloses a computer program product, which, when run on a computer, causes the computer to perform any one of the methods disclosed in the first aspect of embodiments of the present application.
A sixth aspect of the present embodiment discloses an application publishing platform, configured to publish a computer program product, where when the computer program product runs on a computer, the computer is caused to execute any of the methods disclosed in the first aspect of the present embodiment.
According to the technical scheme, the embodiment of the application has the following advantages:
the method in the embodiment of the application is applied to the electronic equipment which at least comprises a first light-sensitive sensor and a second light-sensitive sensor. The electronic equipment determines a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor; after determining a second light sensation stability value according to a plurality of second light sensation values acquired by the second light sensation sensor, if the electronic device selects one of the first light sensation stability value and the second light sensation stability value as the ambient light sensation value, the last determined ambient light sensation value of the electronic device may not be accurate enough due to the fact that the determined first light sensation stability value or the determined second light sensation stability value is not accurate enough, so that the electronic device may calculate a discrete degree value corresponding to the first light sensation stability value and the second light sensation stability value first; if the discrete degree value is smaller than the preset threshold, it indicates that the deviation degree between the first light sensation stable value and the second light sensation stable value and the average value corresponding to the two light sensation stable values is small, and at this time, the electronic device can fuse the first light sensation stable value and the second light sensation stable value to determine the environment light sensation value with higher accuracy.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the embodiments and the drawings used in the description of the prior art, and obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained according to the drawings.
FIG. 1a is a schematic diagram of an embodiment of an electronic device in an embodiment of the present application;
FIG. 1b is a schematic diagram of another embodiment of an electronic device in an embodiment of the present application;
FIG. 2 is a schematic diagram of an embodiment of a method for obtaining an ambient light sensitivity value according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another embodiment of a method for obtaining an ambient light sensitivity value according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another embodiment of an electronic device in an embodiment of the application;
fig. 5 is a schematic diagram of another embodiment of the electronic device in the embodiment of the present application.
Detailed Description
The embodiment of the application provides an obtaining method of an environment light sensitivity value, an electronic device and a computer readable storage medium, which can effectively improve the accuracy of determining the environment light sensitivity value.
For a person skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. The embodiments in the present application shall fall within the protection scope of the present application.
It is understood that the electronic device according to the embodiments of the present application may include, but is not limited to, at least two light-sensitive sensors, i.e., a first light-sensitive sensor and a second light-sensitive sensor.
The light sensor can be used to collect a light sensing value, which refers to the intensity value of light. The unit of the light sensation value is candela/square meter (cd/m)2)。
Alternatively, the first light sensor may be a front light sensor disposed on a front side of the screen of the electronic device, and the second light sensor may be a rear light sensor disposed on a rear side of the screen of the electronic device.
The electronic equipment can store the first light sensation values in a first collection buffer area; the second light sensor can collect a plurality of second light sensing values, namely the second light sensor can collect a plurality of second light sensing values on the back of the screen of the electronic equipment, and the electronic equipment stores the plurality of second light sensing values in the second collecting buffer area.
Optionally, the first acquisition buffer and the second acquisition buffer may be a circular queue.
Exemplarily, as shown in fig. 1a, the embodiment of the present application is a schematic view of an embodiment of an electronic device. In fig. 1a, the electronic device 100 comprises a first light-sensitive sensor 101, the first light-sensitive sensor 101 being arranged on the front side of the screen of the electronic device 100.
Fig. 1b is a schematic diagram of another embodiment of the electronic device in the embodiment of the present application. In fig. 1b, the electronic device 100 comprises a second light-sensitive sensor 102, the second light-sensitive sensor 102 being arranged on the back of the screen of the electronic device 100.
The following further describes the technical solution of the present application by way of an embodiment, as shown in fig. 1, which is a schematic diagram of an embodiment in the present application, and the embodiment may include:
as shown in fig. 2, a schematic diagram of an embodiment of a method for obtaining an ambient light sensitivity value in an embodiment of the present application may include:
201. a first light sensation stability value is determined according to a plurality of first light sensation values acquired by the first light sensation sensor.
In some embodiments, after the electronic device collects a plurality of first light sensation values through the first light sensation sensor, an average value corresponding to the plurality of first light sensation values may be used as the first light sensation stable value.
Illustratively, when the electronic device acquires 5 first light sensation values, 120cd/m respectively, through the first light sensation sensor2、123cd/m2、130cd/m2、146cd/m2And 127cd/m2. The electronic device averages the 5 first light sensitivity values, i.e., (120+123+130+146+127)/5 ═ 129.2cd/m2Then, the electronic device compares the average value to 129.2cd/m2The first light sensation stability value corresponding to the 5 first light sensation values is obtained.
In some embodiments, since a noise light sensation value may exist in the plurality of first light sensation values acquired by the first light sensation sensor, where the noise light sensation value may be a light sensation value acquired under an abnormal condition, for example, the current ambient light source brightness of the electronic device changes frequently or the electronic device acquires light sensation values under multiple light sources, where the noise light sensation value may affect the accuracy of the first light sensation stability value, the electronic device may perform denoising processing on the plurality of acquired first light sensation values to obtain the first light sensation value with the noise light sensation value removed, and then determine the accurate first light sensation stability value according to the denoised first light sensation value.
202. And determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor.
In some embodiments, after the electronic device collects a plurality of second light sensation values through the second light sensation sensor, the electronic device may use a corresponding average of the plurality of second light sensation values as the second light sensation stable value.
In some embodiments, since a noise light sensation value may exist in the plurality of second light sensation values collected by the second light sensation sensor, and the noise light sensation value may affect the accuracy of the second light sensation stable value, the electronic device may perform denoising processing on the plurality of acquired second light sensation values to obtain the second light sensation value from which the noise light sensation value is removed, and then determine the more accurate second light sensation stable value according to the denoised second light sensation value.
It should be noted that, the electronic device may first execute step 201 and then execute step 202, may first execute step 202 and then execute step 201, and may also execute step 201 and step 202 at the same time, which is not limited herein.
203. Calculating the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value.
It is understood that the discrete degree value may represent the first and second light sensation stability values, i.e. the deviation degree between the two light sensation stability values and the average value corresponding to the two light sensation stability values. If the discrete degree value is smaller, the deviation degree between the two light sensation stable values and the average value corresponding to the two light sensation stable values is smaller; if the dispersion degree value is larger, it means that the degree of deviation between the two light sensation stability values and the average value corresponding to the two light sensation stability values is larger.
Alternatively, the discrete degree value may include, but is not limited to, a variance or a standard deviation.
Where the standard deviation is the arithmetic square root of the variance.
204. And if the discrete degree value is smaller than the preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an environment light sensation value.
In some embodiments, when the discrete degree value is smaller than a predetermined threshold, the first light sensation stability value and the second light sensation stability value are described, and the deviation degree between the two light sensation stability values and the average value corresponding to the two light sensation stability values is smaller, at this time, the ambient light sensation value obtained by fusing the first light sensation stability value and the second light sensation stability value by the electronic device is more accurate. In addition, when the discrete degree value is greater than or equal to the preset threshold, it indicates that the deviation degree between the two light-sensation stable values and the average value corresponding to the two light-sensation stable values is large, and indicates that there is a case where the light-sensation value acquired by at least one of the first light-sensation sensor or the second light-sensation sensor is inaccurate, and even if the electronic device fuses the first light-sensation stable value and the second light-sensation stable value, the obtained ambient light-sensation value is not accurate enough.
Optionally, if the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value is greater than or equal to the preset threshold, the first light sensation stable value and the second light sensation stable value determined this time may be directly discarded, the first light sensation stable value is determined again according to the first light sensation value collected by the first light sensor, the second light sensation stable value is determined again according to the second light sensation value collected by the second light sensor, and whether the discrete degree value corresponding to the re-determined first light sensation stable value and the re-obtained second light sensation stable value is smaller than the preset threshold is continuously determined until the re-determined discrete degree value is smaller than the preset threshold.
In some embodiments, due to different habits of users using electronic devices, for example: use the electronic device while sitting, use the electronic device while lying, etc. In the process of using the electronic device by a user, if the user moves the front side of the screen of the electronic device from a position facing away from an ambient light source to a position facing the ambient light source, it indicates that a first light sensation stable value corresponding to a plurality of first light sensation values collected by the first light sensation sensor is closer to the ambient light sensation value than a second light sensation stable value, at this time, if a discrete process value corresponding to the first light sensation stable value and the second light sensation stable value is greater than or equal to the preset threshold value, the first light sensation stable value may be used as the ambient light sensation value, but the first light sensation stable value is not accurate enough compared with an actual ambient light sensation value. If the user moves the front side of the screen of the electronic device from facing the ambient light source to facing away from the ambient light source, it indicates that the second light sensation stable value is closer to the ambient light sensation value than the first light sensation stable value, and at this time, if the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value is greater than or equal to the preset threshold, the second light sensation stable value may be used as the ambient light sensation value, but the second light sensation stable value is not accurate enough compared with the actual ambient light sensation value.
The preset threshold may be set before the electronic device leaves the factory.
Optionally, the discrete degree value includes a variance, and the preset threshold is a preset variance threshold; the discrete degree value comprises a standard deviation, and the preset threshold is a preset standard deviation threshold.
Wherein the preset variance threshold and the preset standard deviation threshold can be set by the electronic device before factory shipment.
In some embodiments, the electronic device may use an average value corresponding to the first light sensation stability value and the second light sensation stability value as the ambient light sensation value, or use a value obtained by weighting and summing the first light sensation stability value and the second light sensation stability value based on different weights as the ambient light sensation value, which is not limited in this respect. In any way, the first light sensation stability value and the second light sensation stability value are accurate, so that the ambient light sensation value obtained by the electronic device is also accurate.
In the embodiment of the application, the electronic equipment determines a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor; after determining a second light sensation stability value according to a plurality of second light sensation values acquired by the second light sensation sensor, if the electronic device selects one of the first light sensation stability value and the second light sensation stability value as the ambient light sensation value, the determined ambient light sensation value finally determined by the electronic device may not be accurate enough due to the fact that the determined first light sensation stability value or the determined second light sensation stability value is not accurate enough, so that the electronic device may calculate a discrete degree value corresponding to the first light sensation stability value and the second light sensation stability value first; if the discrete degree value is smaller than the preset threshold, it indicates that the deviation degree between the first light sensation stable value and the second light sensation stable value and the average value corresponding to the two light sensation stable values is small, and at this time, the electronic device can fuse the first light sensation stable value and the second light sensation stable value to determine the environment light sensation value with higher accuracy.
As shown in fig. 3, a schematic diagram of another embodiment of a method for obtaining an ambient light sensitivity value in an embodiment of the present application may include:
301. a plurality of first light sensation values are collected through a first light sensation sensor.
302. Denoising the plurality of first light sensation values, and taking a first mean value corresponding to the denoised first light sensation values as a first light sensation stable value if the number of the denoised first light sensation values reaches a first preset number threshold.
Optionally, the electronic device performs denoising on the plurality of first light sensation values, and may include: the electronic equipment reads the first light sensitivity values collected by the first light sensor one by one from the first collection buffer area; the electronic equipment judges whether the read first light sensation value is a noise light sensation value or not, and writes the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value.
In some embodiments, after the electronic device collects a plurality of first light sensation values through the first light sensation sensor, the collected first light sensation values may be written into the first collecting buffer, that is, a plurality of first light sensation values are stored in the first collecting buffer, and there may be a noise light sensation value in the first light sensation values, which may affect the accuracy of the first light sensation stability value. Specifically, the electronic device may read the first light sensation values in the first collecting buffer one by one, and determine whether the first light sensation values read each time are noise light sensation values; if the currently read first light sensation value is the noise light sensation value, the electronic device can discard the read first light sensation value without writing the read first light sensation value into the first light sensation buffer queue. If the read first light sensation value is not the noise point light sensation value, the electronic device needs to write the read first light sensation value into a first light sensation buffer queue. Therefore, the fact that no noise light sensation value exists in the plurality of first light sensation values written in the first light sensation buffer queue can be guaranteed, and therefore the obtained first light sensation stable value is accurate.
Optionally, the determining, by the electronic device, whether the read first light sensation value is a noise light sensation value may include: the electronic equipment acquires a first head value, wherein the first head value is a first light sensation value written in a first light sensation buffer queue; when the first head value and the read first light sensation value are both smaller than the first light sensation stable value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stable value determined last time, the electronic equipment determines that the read first light sensation value is not the noise point light sensation value.
In some embodiments, in the process of writing the first light sensation value in the first light sensation buffer queue, if the electronic device determines that the first light sensation value does not exist in the first light sensation buffer queue, that is, if the electronic device determines that the number of the first light sensation values written in the first light sensation buffer queue is 0, the electronic device may directly write the first read first light sensation value in the first light sensation buffer queue, and use the first light sensation value written in the first light sensation buffer queue as the first head value in the first light sensation buffer queue, where the first head value may be used to determine whether the first light sensation value subsequently read is a noise point light sensation value.
Then, the electronic device needs to determine whether the first team head value and the subsequently read first light sensation value are located on the same side of the last determined first light sensation stable value. If the first head value and the first light sensation value are determined to be smaller than the first light sensation stability value determined last time, or the first head value and the first light sensation value are determined to be larger than the first light sensation stability value determined last time, the electronic device may determine that the first light sensation value is not the noise point light sensation value.
If the first team of heads is determined to be greater than the last determined first light sensation stability value and the read first light sensation value is greater than or equal to the last determined first light sensation stability value, or if the first team of heads is determined to be greater than the last determined first light sensation stability value and the read first light sensation value is determined to be less than or equal to the last determined first light sensation stability value, the electronic device determines the read first light sensation value to be the noise point light sensation value.
For example, assume that the last first photo stabilization value corresponding to the first photo buffer queue is 150cd/m2. If the first queue head value obtained by the electronic equipment is 148cd/m2The first light sensitivity value read is 127cd/m2Then, the first head value is 148cd/m2And the first light sensitivity value of the reading is 127cd/m2The first light sensation stability values of both being less than the last time are 150cd/m2At this time, the electronic device may determine that the read first light sensation value is not a noise point light sensation value. If the first queue head value obtained by the electronic equipment is 163cd/m2The first light sensitivity value read is 131cd/m2Then, the first head value is 163d/m2The first light sensation stability value greater than the last time is 150cd/m2And the first light sensitivity value is 131cd/m2The first light sensation stability value less than the last time is 150cd/m2At this time, the electronic device may determine that the read first light sensation value is a noise point light sensation value.
Optionally, if the number of the denoised first light sensation values reaches a first preset number threshold, the electronic device may use a first average value corresponding to the denoised first light sensation values as a first light sensation stable value, which may include: if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, the electronic equipment takes a first average value corresponding to the first light sensation values of which the number in the first light sensation buffer queue reaches the first preset number threshold as a first light sensation stable value.
The first preset number threshold may be set before the electronic device leaves a factory, or may be user-defined according to actual needs, and is not specifically limited here. Optionally, the first preset number threshold may be an integer greater than or equal to 8.
In some embodiments, if the number of the first light sensation values written in the first light sensation buffer queue reaches a first preset number threshold, the electronic device may be triggered to calculate a first average value corresponding to the first light sensation values written in the first light sensation buffer queue, and use the first average value as a first light sensation stable value, and then the electronic device automatically clears the first light sensation values written in the first light sensation buffer queue. If the number of the first photo-sensitivity values written in the first photo-sensing buffer queue does not reach the first preset number threshold, the first photo-sensitivity values in the first collection buffer area are continuously read until the number of the first photo-sensitivity values written in the first photo-sensing buffer queue reaches the first preset number threshold.
Illustratively, assume that the first preset number threshold is 8. When the electronic equipment collects 8 first light sensation values through the first light sensation sensor, the first light sensation values are respectively 120cd/m2、123cd/m2、130cd/m2、146cd/m2、127cd/m2、137cd/m2、142cd/m2And 126cd/m2. When the number of the first light sensation values acquired by the electronic device has reached the first preset number threshold value, the electronic device automatically calculates a first average value corresponding to the 8 first light sensation values, that is, (120+123+130+146+127+137+142+126)/8 ═ 131.375cd/m2Then, the electronic device compares the average value 131.375cd/m2The 8 first light sensation values are used as the corresponding first light sensation stabilization values.
303. A plurality of second senses of light are collected by a second light sense sensor.
304. And denoising the plurality of second light sensation values, and taking a second average value corresponding to the denoised second light sensation values as a second light sensation stable value if the number of the denoised second light sensation values reaches a second preset number threshold.
Optionally, the electronic device performs denoising on the plurality of second light sensation values, and may include: the electronic equipment reads second light sensation values collected by the second light sensors one by one from the second light sensation buffer area queue; the electronic equipment judges whether the read second light sensation value is a noise light sensation value or not, and writes the read second light sensation value into a second light sensation buffer queue if the read second light sensation value is not the noise light sensation value.
In some embodiments, after the electronic device collects the plurality of second light sensation values through the second light sensation sensor, the collected second light sensation values may be written into the second collection buffer, that is, the second collection buffer stores a plurality of second light sensation values, and there may be noise light sensation values in the second light sensation values, which may affect the accuracy of the second light sensation stability value. Specifically, the electronic device may read the second light sensation values in the second collecting buffer one by one, and determine whether the second light sensation value read each time is a noise light sensation value. If the read second light sensation value is the noise light sensation value, the electronic equipment can discard the read second light sensation value without writing the read second light sensation value into a second light sensation buffer queue; if the read second light sensation value is not the noise point light sensation value, the electronic device needs to write the read second light sensation value into a second light sensation buffer queue. Therefore, the second light sensation values written in the second light sensation buffer queue are ensured not to have noise point light sensation values, and the obtained second light sensation stable value is accurate.
Optionally, the determining, by the electronic device, whether the read second light sensation value is a noise light sensation value may include: the electronic equipment acquires a second head value, wherein the second head value is a first second light sensation value written in a second light sensation buffer queue; and when the second head value and the read second light sensation value are both smaller than the second light sensation stable value determined last time, or the second head value and the read second light sensation value are both larger than the second light sensation stable value determined last time, the electronic equipment determines that the read second light sensation value is not the noise point light sensation value.
In some embodiments, if the electronic device determines that the second photo-sensing value does not exist in the second photo-sensing buffer queue during writing of the second photo-sensing value in the second photo-sensing buffer queue, that is, if the electronic device determines that the number of the second photo-sensing values written in the second photo-sensing buffer queue is 0, the electronic device may directly write the first read second photo-sensing value in the second photo-sensing buffer queue, and use the first second photo-sensing value written in the second photo-sensing buffer queue as the second queue head value in the second photo-sensing buffer queue, where the second queue head value may be used to determine whether the subsequently read second photo-sensing value is a noise photo-sensing value.
Then, the electronic device needs to determine whether the second team head value and the subsequently read second light sensation value are located on the same side of the last second light sensation stable value. If the second head value and the read second light sensation value are both determined to be less than the second light sensation stability value determined last time, or the second head value and the read second light sensation value are both determined to be greater than the second light sensation stability value determined last time, the electronic device may determine that the read second light sensation value is not the noise light sensation value.
If the second queue head value is determined to be smaller than the last determined second light sensation stability value and the read second light sensation value is greater than or equal to the last determined second light sensation stability value, or if the second queue head value is determined to be greater than the last determined second light sensation stability value and the read second light sensation value is determined to be smaller than or equal to the last determined second light sensation stability value, the electronic device determines the read second light sensation value to be the point noise light sensation value.
Optionally, if the number of the denoised second light sensation values reaches a second preset number threshold, the electronic device takes a second average value corresponding to the denoised second light sensation values as a second light sensation stable value, which may include: if the number of the second light sensation values written into the second light sensation buffer queue reaches a second preset number threshold, the electronic equipment takes a second average value corresponding to the second light sensation values in the second light sensation buffer queue, the number of which reaches the second preset number threshold, as a second light sensation stable value.
The second preset number threshold may be set before the electronic device leaves a factory, or may be user-defined according to actual needs, and is not specifically limited here. Optionally, the second preset number threshold may be an integer greater than or equal to 8.
In some embodiments, if the number of the second light sensation values written in the second light sensation buffer queue reaches a second preset number threshold, the electronic device may be triggered to calculate a second average value corresponding to the second light sensation values written in the second light sensation buffer queue, and the second average value is used as a second light sensation stable value, and then the electronic device automatically clears the second light sensation values written in the second light sensation buffer queue. If the number of the second photo-sensitivity values written in the second photo-sensing buffer queue does not reach the second preset number threshold, the second photo-sensitivity values in the second collection buffer area are continuously read until the number of the second photo-sensitivity values written in the second photo-sensing buffer queue reaches the second preset number threshold.
It should be noted that, the electronic device may execute steps 301 and 302 first and then execute steps 303 and 304, may execute steps 303 and 304 first and then execute steps 301 and 302, and may also execute steps 301 and 302 and steps 303 and 304 at the same time, which is not limited herein.
305. An average value corresponding to the first light sensation stability value and the second light sensation stability value is obtained.
Optionally, the obtaining, by the electronic device, an average value corresponding to the first light sensation stable value and the second light sensation stable value may include: the electronic device determines an average value corresponding to the first light sensation stability value and the second light sensation stability value according to a first formula.
Wherein the first formula is X ═ a + b)/2; x represents the average value, a represents the first light sensation stability value, and b represents the second light sensation stability value.
Illustratively, assume that the first photo-stability value a is 194cd/m2The second light sensation stability value b is 312cd/m2Then, the average value X ═ a + b)/2 ═ 194+312)/2 ═ 253cd/m corresponding to the first light sensation stability value a and the second light sensation stability value b2
306. A first difference between the first light sensation stability value and the average value is calculated.
Optionally, the electronic device calculates a first difference between the first light sensation stability value and the average value, and may include: the electronic device determines a first difference value between the first light sensation stability value and the average value according to a second formula.
Wherein the second formula is p ═ a-X; p represents the first difference.
Illustratively, assume that the first photo-stability value a is 194cd/m2The average value X corresponding to the first photo-stability value a and the second photo-stability value b is 253cd/m2Then, a first difference p-a-X-194-253-61 cd/m between the first photo-stability value a and the average value X2
307. And calculating a second difference value between the second light sensation stability value and the average value.
Optionally, the electronic device calculates a second difference between the second light sensation stability value and the average value, and may include: the electronic device determines a second difference value between the second light sensation stability value and the average value according to a third formula.
Wherein the third formula is q ═ b-X; q represents the second difference.
For example, assume that the second photo-stability value b is 312cd/m2The average value X corresponding to the first photo-stability value a and the second photo-stability value b is 253cd/m2Then, the second light sensation stability value b is the second difference q-b-X-312-253-59 cd/m from the average value X2
308. And summing the square of the first difference value and the square of the second difference value, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
Optionally, the electronic device may sum the square of the first difference and the square of the second difference to obtain a sum result, and the sum result may include: the electronic device determines a summation result according to a fourth formula.
Wherein the fourth formula is S ═ (p)2+ q 2)/(k-1); s represents the result of the summation, and k represents the number of differences. Since there are only two differences in the embodiment of the present application, i.e., the first difference and the second difference, k is 2, and the fourth formula is S ═ p (p)2+q2)。
Optionally, when the discrete degree value includes a variance, S represents the variance; when the dispersion degree value includes a standard deviation, SqrS denotes the standard deviation, wherein the Sqr denotes a square root.
Illustratively, assume that the first difference p is-61 cd/m2The second difference q is 59cd/m2Then, the variance S of the first photo-stability value a and the second photo-stability value b is equal to (p)2+ q2) — 61 + 2+592 ═ 7202; the standard deviation SqrS of the first light sensation stability value a and the second light sensation stability value b is 84.86.
309. And if the discrete degree value is smaller than the preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an environment light sensation value.
Optionally, if the discrete degree value is smaller than the preset threshold, the electronic device fuses the first light sensation stable value and the second light sensation stable value to obtain the ambient light sensation value, which may include but is not limited to one of the following implementation manners:
implementation mode 1: the discrete degree value comprises a variance, and if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold, the electronic equipment fuses the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the preset variance threshold S' may be any value between 10000 to 22500.
For example, assume that the preset variance threshold S' is 10000. The electronic device obtains a discrete degree value S7202, where the discrete degree value S7202 is smaller than S' 10000, and at this time, the electronic device may fuse the first light sensation stability value and the second light sensation stability value to obtain an ambient light sensation value.
Implementation mode 2: the discrete degree value comprises a standard deviation, and if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold value, the electronic equipment fuses the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the preset standard deviation threshold value SqrS' may be any value between 100 and 150.
As an example, assume that the preset standard deviation threshold SqrS' is 110. The electronic device obtains the discrete magnitude value SqrS-84.86, where the discrete magnitude value SqrS-84.86 is smaller than the S' 110, and at this time, the electronic device may fuse the first light sensation stability value and the second light sensation stability value to obtain the ambient light sensation value.
Optionally, the electronic device fuses the first light-sensation stable value and the second light-sensation stable value to obtain an ambient light-sensation value, which may include: the electronic equipment multiplies the first light sensation stable value by a first weight to obtain a first numerical value; the electronic equipment multiplies the second light sensation stable value by a second weight to obtain a second numerical value; the electronic device adds the first value and the second value to obtain an ambient light sensitivity value.
Wherein the sum of the second weight and the first weight is 1.
Optionally, the electronic device obtains a first numerical value according to the fifth formula; the electronic equipment obtains a second numerical value according to the sixth formula; the electronic equipment obtains an ambient light sensitivity value according to a seventh formula; wherein the fifth formula is Y ═ au, Y represents the first numerical value, and u represents the first weight; the sixth formula is that Z ═ bv, Z represents the second numerical value, and v represents the second weight; a seventh formula H ═ Y + Z, H representing the ambient light sensitivity value; u + v ═ 1.
Exemplarily, assuming that the first weight u is 0.2, then the second weight v-1-u-1-0.2-0.8; the first photostability value a is 194cd/m2The second light sensation stability value b is 312cd/m2. The electronic device obtains a first value Y ═ au ═ 194 × 0.2 ═ 38.4cd/m2The second value Z ═ bv ═ 312 × 0.8 ═ 249.6cd/m2Then, the electronic device may determine that the ambient light sensitivity value H + Y + Z38.4 +249.6 288cd/m2
In the embodiment of the application, the electronic equipment determines the first light sensation stable value more accurately according to the denoised first light sensation value; the second light sensation stable value determined according to the denoised second light sensation value is also relatively accurate, and then the electronic equipment can calculate a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, wherein the discrete degree value is relatively accurate; if the discrete degree value is smaller than the preset threshold, it indicates that the difference between the first light sensation stable value and the second light sensation stable value is small, and at this time, the electronic device can fuse the first light sensation stable value and the second light sensation stable value to obtain the environment light sensation value with higher accuracy.
As shown in fig. 4, which is a schematic view of another embodiment of the electronic device in the embodiment of the present application, the method may include: a stable value determination module 401 and a fusion module 402; wherein, the stable value determining module 401 further includes: the device comprises a first acquisition unit 4011, a first denoising unit 4012, a first determination unit 4013, a second acquisition unit 4014, a second denoising unit 4015 and a second determination unit 4016.
A stable value determining module 401, configured to determine a first light sensation stable value according to a plurality of first light sensation values collected by the first light sensation sensor; determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor;
the fusion module 402 is configured to calculate a discrete degree value corresponding to the first light sensation stability value and the second light sensation stability value, and if the discrete degree value is smaller than a preset threshold, fuse the first light sensation stability value and the second light sensation stability value to obtain an ambient light sensation value.
Alternatively, in some embodiments of the present application,
the dispersion degree value includes a variance, and the fusion module 402 is further configured to fuse the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold; or the like, or, alternatively,
the discrete value includes a standard deviation, and the fusing module 402 further fuses the first light sensation stable value and the second light sensation stable value to obtain the ambient light sensation value if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold.
Alternatively, in some embodiments of the present application,
a fusion module 402, specifically configured to obtain an average value corresponding to the first light sensation stability value and the second light sensation stability value; calculating a first difference value between the first light sensation stable value and the average value; calculating a second difference value between the second light sensation stability value and the average value; and summing the square of the first difference and the square of the second difference, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
Alternatively, in some embodiments of the present application,
a fusion module 402, specifically configured to multiply the first light sensation stability value by a first weight to obtain a first numerical value; multiplying the second light sensation stability value by a second weight to obtain a second numerical value, wherein the sum of the second weight and the first weight is 1; and adding the first value and the second value to obtain an ambient light sensitivity value.
Alternatively, in some embodiments of the present application,
the first collecting unit 4011 is used for collecting a plurality of first light sensation values through the first light sensation sensor;
the first denoising unit 4012 is configured to denoise the plurality of first light sensation values;
the first determining unit 4013 is configured to, if the number of the denoised first light sensation values reaches a first preset number threshold, take a first average value corresponding to the denoised first light sensation values as a first light sensation stable value;
the second collecting unit 4014 is configured to collect a plurality of second light sensation values through the second light sensation sensor;
the second denoising unit 4015 is configured to denoise the plurality of second light sensation values;
the second determining unit 4016 is configured to, if the number of the denoised second light sensation values reaches a second preset number threshold, take a second average value corresponding to the denoised second light sensation values as a second light sensation stable value; the first light sensor is a front light sensor arranged on the front side of the screen of the electronic device, and the second light sensor is a rear light sensor arranged on the back side of the screen of the electronic device.
Alternatively, in some embodiments of the present application,
the first denoising unit 4012 is further configured to read the first light sensitivity values collected by the first light sensor one by one from the first collection buffer area; the first acquisition buffer area is used for storing a plurality of first light sensation values acquired by the first light sensor; judging whether the read first light sensation value is a noise light sensation value or not, and writing the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value;
the first determining unit 4013 is further configured to, if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, take a first average value corresponding to the first light sensation values in the first light sensation buffer queue whose number reaches the first preset number threshold as a first light sensation stable value.
Alternatively, in some embodiments of the present application,
the first collecting unit 4011 is further configured to obtain a first head value, where the first head value is a first light sensation value written in the first light sensation buffer queue;
the first determining unit 4013 is further configured to determine that the read first light sensation value is not a noise-point light sensation value when the first head value and the read first light sensation value are both smaller than the first light sensation stable value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stable value determined last time.
As shown in fig. 5, which is a schematic view of another embodiment of the electronic device in the embodiment of the present application, the method may include: a memory 501 and a processor 502, wherein the memory 501 and the processor 502 are coupled, and the processor 502 can call the executable program codes stored in the memory 501;
the processor 502 has the following functions:
determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor;
determining a second light sensation stable value according to a plurality of second light sensation values acquired by the second light sensation sensor;
calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
Optionally, the processor 502 has the following functions:
the discrete degree value comprises a variance, and if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold, the first light sensation stable value and the second light sensation stable value are fused to obtain an ambient light sensation value; or the like, or, alternatively,
the discrete degree value comprises a standard deviation, and if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold value, the first light sensation stable value and the second light sensation stable value are fused to obtain an ambient light sensation value.
Optionally, the processor 502 has the following functions:
obtaining an average value corresponding to the first light sensation stable value and the second light sensation stable value; calculating a first difference value between the first light sensation stable value and the average value; calculating a second difference value between the second light sensation stability value and the average value; and summing the square of the first difference and the square of the second difference, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
Optionally, the processor 502 has the following functions:
multiplying the first light sensation stability value by a first weight to obtain a first numerical value; multiplying the second light sensation stability value by a second weight to obtain a second numerical value, wherein the sum of the second weight and the first weight is 1; and adding the first value and the second value to obtain an ambient light sensitivity value.
Optionally, the processor 502 has the following functions:
collecting a plurality of first light sensation values through the first light sensation sensor; denoising the plurality of first light sensation values, and taking a first average value corresponding to the denoised first light sensation values as a first light sensation stable value if the number of the denoised first light sensation values reaches a first preset number threshold; collecting a plurality of second light sensation values through the second light sensation sensor; denoising the plurality of second light sensation values, and taking a second average value corresponding to the denoised second light sensation values as a second light sensation stable value if the number of the denoised second light sensation values reaches a second preset number threshold; the first light sensor is a front light sensor arranged on the front side of the screen of the electronic device, and the second light sensor is a rear light sensor arranged on the back side of the screen of the electronic device.
Optionally, the processor 502 has the following functions:
reading first light sensitivity values acquired by the first light sensor one by one from a first acquisition buffer area; the first acquisition buffer area is used for storing a plurality of first light sensation values acquired by the first light sensor; judging whether the read first light sensation value is a noise light sensation value or not, and writing the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value; if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, taking a first average value corresponding to the first light sensation values of which the number in the first light sensation buffer queue reaches the first preset number threshold as a first light sensation stable value.
Optionally, the processor 502 has the following functions:
acquiring a first head value, wherein the first head value is a first light sensation value written in a first light sensation buffer queue; and when the first head value and the read first light sensation value are both smaller than the first light sensation stable value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stable value determined last time, determining that the read first light sensation value is not the noise point light sensation value.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. The method for acquiring the ambient light sensation value is applied to electronic equipment, wherein the electronic equipment at least comprises a first light sensation sensor and a second light sensation sensor, and the method comprises the following steps:
determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor;
determining a second light sensation stability value according to a plurality of second light sensation values acquired by the second light sensation sensor;
calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
2. The method as claimed in claim 1, wherein the discrete degree value comprises a variance, and the fusing the first and second light sensation stability values to obtain the ambient light sensation value if the discrete degree value is smaller than a predetermined threshold comprises:
if the variance corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset variance threshold, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value; or the like, or, alternatively,
the discrete degree value includes a standard deviation, and if the discrete degree value is smaller than a preset threshold, the first light sensation stable value and the second light sensation stable value are fused to obtain an ambient light sensation value, including:
and if the standard deviation corresponding to the first light sensation stable value and the second light sensation stable value is smaller than a preset standard deviation threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
3. The method of claim 1, wherein calculating the discrete degree value of the first and second light sensation stability values comprises:
acquiring an average value corresponding to the first light sensation stable value and the second light sensation stable value;
calculating a first difference value between the first light sensation stability value and the average value;
calculating a second difference value between the second light sensation stability value and the average value;
and summing the square of the first difference and the square of the second difference, and determining the discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value according to the summation result.
4. The method according to any one of claims 1-3, wherein the fusing the first light sensation stability value with the second light sensation stability value to obtain an ambient light sensation value comprises:
multiplying the first light sensation stable value by a first weight to obtain a first numerical value;
multiplying the second light sensation stability value by a second weight to obtain a second numerical value, wherein the sum of the second weight and the first weight is 1;
and adding the first numerical value and the second numerical value to obtain an ambient light sensitivity value.
5. The method of claim 1, wherein determining a first light sensation stability value based on a plurality of first light sensation values collected by the first light sensation sensor comprises:
collecting a plurality of first light sensation values through the first light sensation sensor;
denoising the plurality of first light sensation values, and taking a first average value corresponding to the denoised first light sensation values as a first light sensation stable value if the number of the denoised first light sensation values reaches a first preset number threshold;
determining a second light sensation stability value according to a plurality of second light sensation values collected by the second light sensation sensor, including:
collecting a plurality of second light sensation values through the second light sensation sensor;
denoising the plurality of second light sensation values, and taking a second average value corresponding to the denoised second light sensation values as a second light sensation stable value if the number of the denoised second light sensation values reaches a second preset number threshold;
the first light sensor is a front light sensor arranged on the front side of the screen of the electronic equipment, and the second light sensor is a rear light sensor arranged on the back side of the screen of the electronic equipment.
6. The method of claim 5, wherein denoising the plurality of first perception values comprises:
reading first light sensitivity values acquired by the first light sensor one by one from a first acquisition buffer area; the first acquisition buffer area is used for storing a plurality of first light sensation values acquired by the first light sensor;
judging whether the read first light sensation value is a noise light sensation value or not, and writing the read first light sensation value into a first light sensation buffer queue if the read first light sensation value is not the noise light sensation value;
if the number of the denoised first light sensation values reaches a first preset number threshold, taking a first mean value corresponding to the denoised first light sensation values as a first light sensation stable value, including:
and if the number of the first light sensation values written into the first light sensation buffer queue reaches a first preset number threshold, taking a first average value corresponding to the first light sensation values of which the number in the first light sensation buffer queue reaches the first preset number threshold as a first light sensation stable value.
7. The method as claimed in claim 6, wherein the determining whether the read first light sensation value is a noise light sensation value comprises:
acquiring a first head value, wherein the first head value is a first light sensation value written in a first light sensation buffer queue;
and when the first head value and the read first light sensation value are both smaller than the first light sensation stable value determined last time, or the first head value and the read first light sensation value are both larger than the first light sensation stable value determined last time, determining that the read first light sensation value is not the noise point light sensation value.
8. An electronic device, comprising at least a first light-sensitive sensor and a second light-sensitive sensor, further comprising:
the stable value determining module is used for determining a first light sensation stable value according to a plurality of first light sensation values acquired by the first light sensation sensor; determining a second light sensation stability value according to a plurality of second light sensation values acquired by the second light sensation sensor;
and the fusion module is used for calculating a discrete degree value corresponding to the first light sensation stable value and the second light sensation stable value, and if the discrete degree value is smaller than a preset threshold value, fusing the first light sensation stable value and the second light sensation stable value to obtain an ambient light sensation value.
9. An electronic device, comprising at least a first light-sensitive sensor and a second light-sensitive sensor, further comprising:
a memory storing executable program code;
and a processor coupled to the memory;
the processor calls the executable program code stored in the memory, which when executed by the processor causes the processor to implement the method of any one of claims 1-7.
10. A computer-readable storage medium having executable program code stored thereon, wherein the executable program code, when executed by a processor, implements the method of any of claims 1-7.
CN202210079859.0A 2022-01-24 2022-01-24 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium Pending CN114495862A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210079859.0A CN114495862A (en) 2022-01-24 2022-01-24 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium
PCT/CN2022/098721 WO2023137957A1 (en) 2022-01-24 2022-06-14 Method for acquiring ambient light sensation value, and electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210079859.0A CN114495862A (en) 2022-01-24 2022-01-24 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114495862A true CN114495862A (en) 2022-05-13

Family

ID=81474107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210079859.0A Pending CN114495862A (en) 2022-01-24 2022-01-24 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN114495862A (en)
WO (1) WO2023137957A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023137957A1 (en) * 2022-01-24 2023-07-27 上海闻泰信息技术有限公司 Method for acquiring ambient light sensation value, and electronic device and computer-readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140168288A1 (en) * 2011-08-22 2014-06-19 Apical Ltd Display device control
CN107300417A (en) * 2017-05-25 2017-10-27 广东欧珀移动通信有限公司 Detection method, device, storage medium and the terminal of ambient light
CN111726449A (en) * 2019-03-18 2020-09-29 青岛海信移动通信技术股份有限公司 Method and equipment for determining ambient brightness of terminal
CN111829654A (en) * 2020-07-24 2020-10-27 北京小米移动软件有限公司 Ambient light detection method and device, and computer storage medium
CN112525340A (en) * 2020-12-01 2021-03-19 珠海格力电器股份有限公司 Method and device for acquiring light intensity value, storage medium and electronic equipment
CN112714205A (en) * 2019-10-24 2021-04-27 北京小米移动软件有限公司 Method and device for determining ambient illumination intensity and storage medium
CN113709275A (en) * 2020-05-21 2021-11-26 北京小米移动软件有限公司 Ambient light determination method and device, terminal equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104345876B (en) * 2013-08-07 2017-07-25 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN105280159B (en) * 2014-07-31 2017-11-28 维沃移动通信有限公司 The backlight adjusting method and its display device of a kind of display device
US10446093B2 (en) * 2015-06-18 2019-10-15 Samsung Electronics Co., Ltd. User terminal device and method for adjusting luminance thereof
CN104994315B (en) * 2015-07-17 2018-07-24 青岛海信电器股份有限公司 Backlight adjusting method, display equipment, remote controler and system
CN106558295A (en) * 2015-09-25 2017-04-05 小米科技有限责任公司 Screen brightness regulation method and device
CN109119044A (en) * 2018-10-16 2019-01-01 Oppo(重庆)智能科技有限公司 Electronic equipment
CN109920394A (en) * 2019-04-29 2019-06-21 合肥惠科金扬科技有限公司 A kind of adjusting method of screen intensity, regulating device and display equipment
CN111128092B (en) * 2020-02-11 2021-07-23 北京小米移动软件有限公司 Screen brightness adjusting method, screen brightness adjusting device and computer storage medium
CN111968597B (en) * 2020-08-12 2021-11-09 Oppo(重庆)智能科技有限公司 Screen brightness adjusting method and device, electronic equipment and storage medium
CN112133261B (en) * 2020-11-03 2021-12-28 歌尔科技有限公司 Brightness adjusting method, device and system of display equipment
CN112468656A (en) * 2020-11-17 2021-03-09 惠州Tcl移动通信有限公司 Method, device and equipment for controlling brightness of display screen and computer readable storage medium
CN114495862A (en) * 2022-01-24 2022-05-13 上海闻泰信息技术有限公司 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140168288A1 (en) * 2011-08-22 2014-06-19 Apical Ltd Display device control
CN107300417A (en) * 2017-05-25 2017-10-27 广东欧珀移动通信有限公司 Detection method, device, storage medium and the terminal of ambient light
CN111726449A (en) * 2019-03-18 2020-09-29 青岛海信移动通信技术股份有限公司 Method and equipment for determining ambient brightness of terminal
CN112714205A (en) * 2019-10-24 2021-04-27 北京小米移动软件有限公司 Method and device for determining ambient illumination intensity and storage medium
CN113709275A (en) * 2020-05-21 2021-11-26 北京小米移动软件有限公司 Ambient light determination method and device, terminal equipment and storage medium
CN111829654A (en) * 2020-07-24 2020-10-27 北京小米移动软件有限公司 Ambient light detection method and device, and computer storage medium
CN112525340A (en) * 2020-12-01 2021-03-19 珠海格力电器股份有限公司 Method and device for acquiring light intensity value, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023137957A1 (en) * 2022-01-24 2023-07-27 上海闻泰信息技术有限公司 Method for acquiring ambient light sensation value, and electronic device and computer-readable storage medium

Also Published As

Publication number Publication date
WO2023137957A1 (en) 2023-07-27

Similar Documents

Publication Publication Date Title
CN110390584B (en) Abnormal user identification method, identification device and readable storage medium
CN114495862A (en) Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium
CN108600736B (en) Terminal light sensation calibration method and device, terminal and storage medium
US9619707B2 (en) Gaze position estimation system, control method for gaze position estimation system, gaze position estimation device, control method for gaze position estimation device, program, and information storage medium
KR20180036463A (en) Method for Processing Image and the Electronic Device supporting the same
CN110765182B (en) Data statistical method and device, electronic equipment and storage medium
JP3054708B1 (en) Stress measurement device
CN112525340B (en) Method and device for acquiring light intensity value, storage medium and electronic equipment
Wagner et al. Radiation monitoring for the masses
CN110264333B (en) Risk rule determining method and apparatus
WO2021218403A1 (en) Data display method and apparatus, terminal device and storage medium
CN111956198B (en) Equipment state determination method and device
CN114298403A (en) Method and device for predicting attention degree of work
JP6855386B2 (en) Systems and methods for measuring path lengths using handheld electronic devices
CN114061791A (en) Body temperature detection method, system and medium
TW201812263A (en) Temperature estimation system, temperature estimation method, and recording medium having recorded therein temperature estimation program
CN111953935A (en) Body temperature monitoring method and device, intelligent screen and computer readable storage medium
CN111159244A (en) Data query method and device
CN110032488B (en) Monitoring system, method and device for specific nodes in cluster and service server
CN110046167A (en) Data-updating method and system
JP7323235B2 (en) Image tracking device, image tracking method, and program
CN114038443B (en) Brightness adjusting method and related device
CN114739536A (en) Health monitoring system and terminal equipment
KR102299520B1 (en) Computer system having the hazard protection, and method thereof
JP6676217B2 (en) Stress estimation system

Legal Events

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