Method for detecting ambient light and electronic device
By setting multiple ambient light sensors on different sides of the electronic device and fusing them according to the weights determined by the sampled values, the problem of inaccurate ambient light detection is solved, and the accuracy of optical parameters and human eye comfort are improved.
Patent Information
- Application Number
- CN202110594826.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-28
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2041-05-28
AI Technical Summary
In the existing technology, the field of view of the ambient light sensor of electronic devices is limited, which leads to inaccurate ambient light detection and fails to meet the comfort requirements of the human eye.
At least two ambient light sensors are placed on different sides of the electronic device, with one sensor located on the same side as the display screen. By acquiring the optical parameter sampling values of each sensor, their respective weights are determined and fused to obtain the target value of the optical parameters of the ambient light.
It improves the accuracy of ambient light optical parameter detection, ensuring that screen dimming better meets the comfort requirements of the human eye.
Smart Images

Figure CN115406528B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of terminal devices, and in particular, to a method for detecting ambient light and an electronic device. BACKGROUND
[0002] In the related art, electronic devices with display functions, such as smart phones, tablet computers, notebook computers, and televisions, usually have an automatic light adjustment function to avoid uncomfortable stimulation to the eyes of users. The implementation method of automatic light adjustment is usually as follows: an ambient light sensor is arranged on one side of the screen of the electronic device to detect the optical parameters of the environment in which the electronic device is located, and then the screen is adjusted according to the detected optical parameters according to a predetermined strategy.
[0003] However, due to the limited field of view angle of the ambient light sensor, only a part of the environment in which the electronic device and the user are located can be detected for ambient light, that is, the detected optical parameters of the ambient light are inaccurate, which further leads to inaccurate screen light adjustment and cannot meet the expected eye comfort requirements. SUMMARY
[0004] To overcome the problems in the related art, the embodiments of the present disclosure provide a method for detecting ambient light and an electronic device to improve the accuracy of detecting the optical parameters of ambient light.
[0005] According to a first aspect of the embodiments of the present disclosure, a method for detecting ambient light is provided, which is applied to an electronic device including a display screen and at least two ambient light sensors, the at least two ambient light sensors are respectively located on different sides of the electronic device, one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen, and the method includes:
[0006] Obtaining sampling values of optical parameters of ambient light collected by the at least two ambient light sensors respectively to obtain at least two sampling values;
[0007] Determining weights of the at least two sampling values respectively according to the at least two sampling values;
[0008] Fusing the at least two sampling values according to the weights of the at least two sampling values respectively to obtain a first target value of the optical parameters of the ambient light.
[0009] In one embodiment, the sampling values include sampling value identifiers, and the determination of the weights of the at least two sampling values respectively according to the at least two sampling values includes:
[0010] Determining a maximum value of the at least two sampling values;
[0011] determining a target optical parameter value range to which the maximum value belongs from at least two preset optical parameter value ranges;
[0012] determining a corresponding target weight distribution strategy according to the target optical parameter value range and a first correspondence relationship between optical parameter value ranges and weight distribution strategies, wherein each of the weight distribution strategies comprises a second correspondence relationship between sample value identifiers and weights;
[0013] determining weights of the at least two sample values respectively according to the target weight distribution strategy and the sample value identifiers of the at least two sample values.
[0014] In one embodiment, the determining of the weights of the at least two sample values respectively comprises:
[0015] when there is a zero in the at least two sample values, setting the weight of the sample value being zero to zero;
[0016] determining ratios of the sample values other than zero in the at least two sample values;
[0017] determining the weights of the sample values other than zero in the at least two sample values according to the ratios of the sample values other than zero in the at least two sample values.
[0018] In one embodiment, the determining of the weights of the at least two sample values respectively comprises:
[0019] determining ratios between the at least two sample values;
[0020] determining the weights of the at least two sample values respectively according to the ratios.
[0021] In one embodiment, the determining of the weights of the at least two sample values respectively comprises:
[0022] inputting the at least two sample values into a trained data fusion model;
[0023] the data fusion model outputs the weights of the at least two sample values respectively, wherein the data fusion model comprises a third correspondence relationship between sample values and weights.
[0024] In one embodiment, the data fusion model is trained by the following steps:
[0025] placing the electronic device in different ambient light conditions, and training the data fusion model, wherein for each ambient light condition, at least two calibration values of sample values of optical parameters of the at least two ambient light sensors are calibrated by a luxmeter;
[0026] Determine the target display brightness for a display screen that meets the comfort requirements of the human eye;
[0027] Based on the target display brightness and the fourth correspondence between the display brightness and the optical parameters of ambient light, a second target value for the optical parameters of ambient light is determined;
[0028] The weights of the at least two calibration values are determined based on the at least two calibration values and the second target value.
[0029] The third correspondence is obtained by associating at least two of the calibration values with their respective weights.
[0030] In one embodiment, the optical parameters include illuminance and / or color temperature.
[0031] In one embodiment, the optical parameters include illuminance and color temperature; the sampled values include illuminance sampled values and color temperature sampled values; the first target value includes a first illuminance target value and a first color temperature target value;
[0032] Determining the weights of at least two sampled values based on at least two sampled values includes:
[0033] The weights of at least two illuminance sample values are determined based on at least two illuminance sample values.
[0034] The step of fusing at least two sampled values according to their respective weights to obtain a first target value for the optical parameters of ambient light includes:
[0035] The at least two illuminance sample values are fused according to their respective weights to obtain a first target illuminance value for ambient light;
[0036] The first color temperature target value of the ambient light is obtained by fusing at least two color temperature sample values according to the respective weights of the at least two illuminance sample values.
[0037] In one embodiment, the optical parameter includes color temperature; the sampled value includes a color temperature sampled value; and the first target value includes a first color temperature target value.
[0038] Determining the weights of at least two sampled values based on at least two sampled values includes:
[0039] When there is an abnormal color temperature sample value among at least two color temperature sample values, the weight of the abnormal color temperature sample value is reset to zero. The abnormal color temperature sample value is much smaller than the other color temperature sample values among the at least two color temperature sample values. When there are substantially equal color temperature sample values among at least two color temperature sample values, the weights of the substantially equal color temperature sample values are determined. The substantially equal color temperature sample values have the same weight.
[0040] The step of fusing at least two sampled values according to their respective weights to obtain a first target value for the optical parameters of ambient light includes:
[0041] The first color temperature target value of the ambient light is obtained by fusing at least two color temperature sample values according to their respective weights.
[0042] According to a second aspect of the present disclosure, an electronic device is provided, comprising: a display screen and at least two ambient light sensors, wherein the at least two ambient light sensors are respectively located on different sides of the electronic device, and one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen; the electronic device further comprises:
[0043] The acquisition module is configured to acquire sampled values of the optical parameters of the ambient light collected by each of the at least two ambient light sensors, and obtain at least two sampled values;
[0044] The determination module is configured to determine the weights of at least two of the sampled values based on at least two of the sampled values.
[0045] The fusion module is configured to fuse at least two sampled values according to their respective weights to obtain a first target value of the optical parameters of the ambient light.
[0046] According to a third aspect of the present disclosure, an electronic device is provided, including a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement the method described above.
[0047] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the above-described method.
[0048] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: Since the electronic device includes at least two ambient light sensors, and the at least two ambient light sensors are located on different sides of the electronic device, the at least two ambient light sensors can detect the optical parameters of ambient light from different angles, thus obtaining more information about the optical parameters of ambient light. Moreover, one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen, so this ambient light sensor is not easily blocked in most cases, which is beneficial to improving the accuracy of detecting the optical parameters of ambient light. Further, in this ambient light detection method, the sampled values of the optical parameters of ambient light collected by each of the at least two ambient light sensors are first acquired, resulting in at least two sampled values. Then, the weights of the at least two sampled values are determined according to their respective weights. Then, the at least two sampled values are fused according to their respective weights to obtain a first target value of the optical parameters of ambient light. In this way, the sampled values of the optical parameters collected by each ambient light sensor can be comprehensively considered to obtain a value of the optical parameters of ambient light that approximates the true ambient light, thereby improving the accuracy of detecting the optical parameters of ambient light.
[0049] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0051] Figure 1 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment.
[0052] Figure 2 This is a flowchart illustrating an ambient light detection method according to an exemplary embodiment.
[0053] Figure 3 This is a flowchart illustrating an ambient light detection method according to another exemplary embodiment.
[0054] Figure 4 This is a flowchart illustrating an ambient light detection method according to another exemplary embodiment.
[0055] Figure 5 This is a schematic diagram of the structure of an electronic device according to another exemplary embodiment.
[0056] Figure 6 This is a flowchart illustrating an ambient light detection method according to another exemplary embodiment.
[0057] Figure 7This is a flowchart illustrating an ambient light detection method according to another exemplary embodiment.
[0058] Figure 8 This is a flowchart illustrating an ambient light detection method according to another exemplary embodiment.
[0059] Figure 9 This is a block diagram illustrating an electronic device according to an exemplary embodiment.
[0060] Figure 10 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0062] In related technologies, electronic devices with display functions typically only have one ambient light sensor on the side where the display screen is located. Because the field of view of this ambient light sensor is less than 120° in both the horizontal and vertical directions, it can only detect ambient light in a portion of the environment surrounding the electronic device and the user. It cannot effectively and accurately detect the optical parameters of ambient light in specific directions (located on the back or sides of the electronic device). Specifically, the horizontal direction is the direction of the short side of the electronic device, and the vertical direction is the direction of the long side. Furthermore, especially when the ambient light sensor is located in a narrow slit at the top of the electronic device, the field of view is even smaller, leading to even less accurate detection of the optical parameters of ambient light. This, in turn, results in inaccurate screen dimming and fails to meet the expected human eye comfort requirements.
[0063] To address the aforementioned technical problems, this disclosure provides an ambient light detection method and electronic device, which can improve the accuracy of detecting the optical parameters of ambient light.
[0064] Figure 1 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. Figure 2 This is a flowchart illustrating an ambient light detection method according to an exemplary embodiment, the ambient light detection method being applied to... Figure 1 The electronic device shown.
[0065] In this embodiment, as Figure 1As shown, the electronic device 1 includes a display screen 11, a first ambient light sensor 12, and a second ambient light sensor 13. The first ambient light sensor 12 and the second ambient light sensor 13 are located on different sides of the electronic device 1. For example, the first ambient light sensor 12 is located on the first side F1 of the electronic device 1, and the second ambient light sensor 13 is located on the second side F2 of the electronic device 1. The first side F1 and the second side F2 are opposite to each other. The display screen 11 is located on the first side F1 of the electronic device 1, that is, the first ambient light sensor 12 and the display screen 11 are located on the same side of the electronic device 1.
[0066] In this embodiment, as Figure 1 As shown, the first ambient light sensor 12 is located on the second side F2 of the display screen 11 facing the electronic device, that is, the first ambient light sensor 12 is located below the display screen 11. Due to the influence of the display screen, the first ambient light sensor 12 has lower accuracy in detecting ambient light. The accuracy of the first ambient light sensor 12 in detecting ambient light is lower than that of the second ambient light sensor 13.
[0067] like Figure 2 As shown, the method for detecting ambient light includes the following steps S201 to S203:
[0068] In step S201, the sampled values of the optical parameters of the ambient light collected by the first ambient light sensor 12 and the second ambient light sensor 13 are obtained, resulting in two sampled values.
[0069] In this embodiment, the optical parameters include illuminance and color temperature. The sampled values of the optical parameters of ambient light include illuminance sample values and color temperature sample values. In this embodiment, the method for detecting the color temperature of ambient light is similar to the method for detecting the illuminance of ambient light. To avoid redundancy, the following description focuses on the detection method for ambient light illuminance. Of course, in other embodiments, the optical parameters may include either illuminance or color temperature. For example, in another embodiment, the optical parameters may include illuminance. In yet another embodiment, the optical parameters may include color temperature.
[0070] In this embodiment, the illuminance sampling values of ambient light collected by the first ambient light sensor 12 and the second ambient light sensor 13 are obtained to obtain a first illuminance sampling value and a second illuminance sampling value. The first illuminance sampling value is the illuminance sampling value of ambient light collected by the first ambient light sensor 12, and the second illuminance sampling value is the illuminance sampling value of ambient light collected by the second ambient light sensor 13.
[0071] In step S202, the weights of the two sampled values are determined based on the two sampled values.
[0072] In this embodiment, as Figure 3As shown, step S202 may include the following steps S2021 to S2022.
[0073] In step S2021, the maximum value between the first illuminance sample value and the second illuminance sample value is determined.
[0074] In step S2022, the target illuminance range to which the maximum value belongs is determined from the preset first illuminance range, second illuminance range, third illuminance range and fourth illuminance range.
[0075] In step S2023, the corresponding target weight allocation strategy is determined based on the target illuminance value range and the first correspondence between the illuminance value range and the weight allocation strategy. Each weight allocation strategy includes a second correspondence between the sampled value identifier and the weight.
[0076] In step S2024, the weights of the first illuminance sample value and the second illuminance sample value are determined according to their respective sample value identifiers and target weight allocation strategies.
[0077] In this embodiment, the first illuminance sample value and the second illuminance sample value may not be the same. When they are different, the maximum value is selected from the first illuminance sample value and the second illuminance sample value.
[0078] In this embodiment, the preset optical parameter value range includes the preset illuminance value range and the preset color temperature value range.
[0079] In this embodiment, the maximum illuminance range of ambient light is 0–100,000 lux. This maximum illuminance range can be pre-divided into a first illuminance range, a second illuminance range, a third illuminance range, and a fourth illuminance range. These four ranges do not overlap. The first illuminance range is 0–9 lux, the second is 10–50 lux, the third is 51–999 lux, and the fourth is 100–100,000 lux. Therefore, the electronic device pre-stores these four illuminance ranges.
[0080] Similarly, in this embodiment, the maximum color temperature range of ambient light is 2000–8000K. Alternatively, the maximum color temperature range can be pre-divided into a first color temperature range, a second color temperature range, a third color temperature range, and a fourth color temperature range, but this is not a limitation. Since the method for detecting the color temperature of ambient light is similar to the method for detecting the illuminance of ambient light, it will not be described further here to avoid redundancy.
[0081] In this embodiment, the target illuminance range to which the maximum value belongs can be determined from a preset first illuminance range, a second illuminance range, a third illuminance range, and a fourth illuminance range. In an exemplary embodiment, the first illuminance sample value is 2000 lux, and the second illuminance sample value is 800 lux. The maximum value can be determined from 2000 lux and 800 lux, and the maximum value is 2000 lux. Then, the target illuminance range to which 2000 lux belongs is determined from 0–9 lux, 10–50 lux, 51–999 lux, and 1000–100000 lux, and the target illuminance range is 1000–100000 lux.
[0082] In this embodiment, the electronic device pre-stores a first correspondence between illuminance value ranges and weight allocation strategies. In this first correspondence, different illuminance value ranges correspond to different weight allocation strategies, and the weights of the first illuminance sample value and the second illuminance sample value differ in each weight allocation strategy. Each weight allocation strategy includes a second correspondence between a sample value identifier and a weight. The sample value includes a sample value identifier, which includes an identity identifier for the illuminance sample value, used to uniquely identify the illuminance sample value and also to indicate the identity of the ambient light sensor that collects the illuminance sample value. For example, the sample value identifier for the first illuminance sample value is S1, and the sample value identifier for the second illuminance sample value is S2. Of course, the sample value identifier may also include an identity identifier for the color temperature sample value.
[0083] In an exemplary embodiment, in the first correspondence, the first illuminance value range corresponds to the first weight allocation strategy, the second illuminance value range corresponds to the second weight allocation strategy, the third illuminance value range corresponds to the third weight allocation strategy, and the fourth illuminance value range corresponds to the fourth weight allocation strategy. In the first weight allocation strategy, the weight of the first illuminance sample value is 25%, and the weight of the second illuminance sample value is 75%. In the second weight allocation strategy, the weight of the first illuminance sample value is 50%, and the weight of the second illuminance sample value is 50%. In the fourth weight allocation strategy, the weight of the first illuminance sample value is 80%, and the weight of the second illuminance sample value is 20%. In the third weight allocation strategy, the weight of the first illuminance sample value can be a first exponential function, where the first exponential function is...
[0084] W1 = 0.5 + 7.5 * 10 -8 *S 2.2 (1)
[0085] In equation (1), W1 is the weight of the first illuminance sample value, and S is the illuminance. When S is 50 lux, W1 is 50%, and when S is 1000 lux, W1 is 80%. The value of S ranges from 51 to 999 lux.
[0086] In the exemplary embodiment described above, in the third weighting strategy, the weight of the second illuminance sample value is a second exponential function, which is:
[0087] W2 = 0.5 - 7.5 * 10 -8 *S 2.2 (2)
[0088] In equation (2), W2 is the weight of the second illuminance sample value, and S is the illuminance. When S is 50 lux, W2 is 50%, and when S is 1000 lux, W2 is 20%. The value of S ranges from 51 to 999 lux.
[0089] It should be noted that the weights of the first illuminance sample value and the second illuminance sample value can also be linear functions, but are not limited to this.
[0090] In this embodiment, the electronic device can determine the corresponding target weight allocation strategy based on the target illuminance range and the first correspondence between the illuminance range and the weight allocation strategy. Continuing with the exemplary embodiment described above, the target weight allocation strategy determined based on 1000 to 100000 lux is the fourth weight allocation strategy.
[0091] Continuing with the exemplary embodiments described above, the electronic device can determine that the weight of the first illuminance sample value is 80% and the weight of the second illuminance sample value is 20% based on the respective sample value identifiers and target weight allocation strategies of the first and second illuminance sample values.
[0092] In this embodiment, when the maximum value between the first illuminance sample value and the second illuminance sample value falls within the range of the first illuminance value, the illuminance within the range of the first illuminance value is relatively small, indicating that the ambient light illuminance is relatively small. Under this ambient light condition, since the accuracy of the first ambient light sensor 12 is relatively low, the weight of the second illuminance sample value can be appropriately increased, so that the weight of the first illuminance sample value is 25% and the weight of the second illuminance sample value is 75%.
[0093] In this embodiment, when the maximum value between the first illuminance sample value and the second illuminance sample value falls within the range of the second illuminance value, the illuminance within the range of the second illuminance value is relatively small, indicating that the ambient light illuminance is relatively small. Under this ambient light condition, since the accuracy of the first ambient light sensor 12 is relatively low, the weight of the second illuminance sample value can be appropriately increased so that the weight of the first illuminance sample value is the same as the weight of the second illuminance sample value.
[0094] In this embodiment, when the maximum value between the first and second illuminance sample values falls within the range of the third illuminance value, the illuminance is moderate, indicating that the ambient light illuminance is moderate. Under this ambient light condition, the weight of the first illuminance sample value can be determined using the first exponential function described above, and the weight of the second illuminance sample value can be determined using the second exponential function. Alternatively, the weight of the second illuminance sample value can be calculated using the formula W2 = 1 - W1.
[0095] In this embodiment, when the maximum value between the first and second illuminance sample values falls within the range of the fourth illuminance value, the illuminance is relatively high, indicating that the ambient light illuminance is relatively high. Under this ambient light condition, the first illuminance sample value detected by the first ambient light sensor 12 can be mainly referenced, with the second illuminance sample value detected by the second ambient light sensor 13 as a secondary reference. Therefore, the weight of the first illuminance sample value is 80%, and the weight of the second illuminance sample value is 20%.
[0096] In step S203, the two sampled values are fused according to their respective weights to obtain the first target value of the optical parameters of the ambient light.
[0097] In this embodiment, the first target value includes a first illuminance target value and a first color temperature target value. The electronic device can fuse the first illuminance sample value and the second illuminance sample value according to their respective weights to obtain the first illuminance target value for ambient light. Specifically, the first illuminance target value can be equal to the weighted sum of the first illuminance sample value and the second illuminance sample value; that is, the first illuminance target value can be equal to the sum of the product of the weights of the first illuminance sample value and the product of the weights of the second illuminance sample value.
[0098] In this embodiment, the electronic device can fuse the first color temperature sample value collected by the first ambient light sensor 12 and the second color temperature sample value collected by the second ambient light sensor 13 according to their respective weights to obtain the first color temperature target value of the ambient light.
[0099] In this embodiment, since the electronic device includes two ambient light sensors located on different sides of the device, the two sensors can detect the optical parameters of ambient light from different angles, obtaining more information about these parameters. Furthermore, one of the ambient light sensors is located on the same side of the device as the display screen, making it less prone to obstruction in most situations, which improves the accuracy of detecting the optical parameters. Further, in this ambient light detection method, sampled values of the optical parameters of the ambient light collected by each of the two sensors are first obtained, resulting in two sampled values. Then, the weights of the two sampled values are determined, and finally, the two sampled values are fused according to their respective weights to obtain a first target value for the optical parameters of the ambient light. This allows for a comprehensive consideration of the sampled values of the optical parameters collected by each ambient light sensor, resulting in a value that approximates the true optical parameters of the ambient light, thus improving the accuracy of detecting these parameters.
[0100] In this embodiment, when the optical parameters only include illuminance, since the electronic device includes two ambient light sensors located on different sides of the device, the two sensors can detect ambient light illuminance from different angles, obtaining more information about the ambient light illuminance. Furthermore, one of the ambient light sensors is located on the same side of the electronic device as the display screen, making it less prone to obstruction in most cases, which helps improve the accuracy of detecting ambient light illuminance. Further, in this ambient light detection method, the sampled values of ambient light illuminance collected by each of the two ambient light sensors are first acquired, resulting in two sampled values. Then, the weights of the two sampled values are determined based on their respective weights. Finally, the two sampled values are fused according to their respective weights to obtain a first target value for ambient light illuminance. This allows for a comprehensive consideration of the illuminance sampled values collected by each ambient light sensor, resulting in an illuminance value that approximates the true ambient light illuminance, thus improving the accuracy of ambient light illuminance detection.
[0101] In this embodiment, when the optical parameters only include color temperature, since the electronic device includes two ambient light sensors located on different sides of the device, the two sensors can detect the color temperature of the ambient light from different angles, thus obtaining more information about the ambient light color temperature. Furthermore, one of the ambient light sensors is located on the same side of the electronic device as the display screen, making it less prone to obstruction in most cases, which helps improve the accuracy of detecting the ambient light color temperature. Further, in this ambient light detection method, the sampled values of the ambient light color temperature collected by each of the two ambient light sensors are first obtained, resulting in two sampled values. Then, the weights of the two sampled values are determined based on their respective weights. Finally, the two sampled values are fused according to their respective weights to obtain a first target value for the ambient light color temperature. This allows for a comprehensive consideration of the color temperature sampled values collected by each ambient light sensor, resulting in a value that approximates the true ambient light color temperature, thereby improving the accuracy of detecting the ambient light color temperature.
[0102] Figure 4 This is a flowchart illustrating a method for detecting ambient light according to another exemplary embodiment. Figure 2 Based on the illustrated embodiment, step S202 above includes the following steps S2025 to S2027:
[0103] In step S2025, when it is determined that there is a zero in either the first illuminance sample value or the second illuminance sample value, the weight of the zero illuminance sample value is reset to zero.
[0104] In step S2026, the ratio of the first illuminance sample value to the remaining illuminance sample values of the second illuminance sample value, excluding zero, is determined.
[0105] In step S2027, the weights of the first illuminance sample value and the remaining illuminance sample values (excluding zero) in the second illuminance sample value are determined based on the ratio of the first illuminance sample value to the remaining illuminance sample values in the second illuminance sample value.
[0106] In an exemplary embodiment, the electronic device 1 faces away from the light source. The first illuminance sample value of the first ambient light sensor 12 is 0 lux, and the second illuminance sample value of the second ambient light sensor 13 is 9 lux. When the electronic device determines that there is a zero among the first and second illuminance sample values, it resets the weight of the first illuminance sample value to zero. Since there is only one illuminance sample value other than zero among the first and second illuminance sample values (i.e., the second illuminance sample value), the ratio of the first illuminance sample value to the second illuminance sample value (excluding zero) is 1. Since there is only one illuminance sample value other than the first illuminance sample value (i.e., the second illuminance sample value), the weight of the second illuminance sample value determined based on the ratio of the second illuminance sample values is 100%.
[0107] In another exemplary embodiment, such as Figure 5 As shown, the electronic device 1 includes a first ambient light sensor 12, a second ambient light sensor 13, and a third ambient light sensor 14. The first ambient light sensor 12, the second ambient light sensor 13, and the third ambient light sensor 14 are located on different sides of the electronic device 1. For example, the first ambient light sensor 12 is located on the first side F1 of the electronic device 1, the second ambient light sensor 13 is located on the second side F2 of the electronic device 1, and the third ambient light sensor 14 is located on the third side F3 of the electronic device 1. The third side F3 of the electronic device 1 can be the top of the electronic device, that is, the top of the electronic device is the end of the electronic device that is furthest from the ground when the electronic device is held upright.
[0108] exist Figure 5 In the exemplary embodiment shown, the first illuminance sample value of the first ambient light sensor 12 is 0 lux, the second illuminance sample value of the second ambient light sensor 13 is 6 lux, and the third illuminance sample value of the third ambient light sensor 14 is 4 lux. When the electronic device determines that the first illuminance sample value among the first, second, and third illuminance sample values is zero, it resets the weight of the first illuminance sample value to zero. Then, the electronic device determines the ratio of the second to the third illuminance sample value, wherein the ratio is 3:2. Then, based on the ratio of the second to the third illuminance sample value, the weights of the second and third illuminance sample values are determined, wherein the ratio of the weights of the second and third illuminance sample values is 3:2, meaning the weight of the second illuminance sample value is 60% and the weight of the third illuminance sample value is 40%.
[0109] In this embodiment, the weights of illuminance sample values that are zero can be reset to zero, providing a method for detecting ambient light under specific ambient light conditions.
[0110] Figure 6 This is a flowchart illustrating a method for detecting ambient light according to another exemplary embodiment. Figure 2 Based on the illustrated embodiment, step S202 above includes the following steps S2028 to S2029:
[0111] In step S2028, the ratio between at least two illuminance sample values is determined.
[0112] In step S2029, the weights of at least two illuminance sample values are determined based on the ratio.
[0113] exist Figure 5 In the exemplary embodiment shown, the first illuminance sample value of the first ambient light sensor 12 is 1000 lux, the second illuminance sample value of the second ambient light sensor 13 is 4000 lux, and the third illuminance sample value of the third ambient light sensor 14 is 5000 lux. The electronic device can determine the ratio of the first illuminance sample value, the second illuminance sample value, and the third illuminance sample value, wherein the ratio is 5:4:1. Then, the electronic device determines the weights of the first, second, and third illuminance sample values based on the ratio, wherein the ratio of the weights of the first, second, and third illuminance sample values is equal to the ratio of the first, second, and third illuminance sample values, which is 5:4:1. That is, the weight of the first illuminance sample value is 50%, the weight of the second illuminance sample value is 40%, and the weight of the third illuminance sample value is 10%.
[0114] In this embodiment, when an abnormal color temperature sample value exists among at least two color temperature sample values, the weight of the abnormal color temperature sample value is reset to zero. The abnormal color temperature sample value is significantly smaller than the other color temperature sample values among the at least two color temperature sample values. Specifically, the abnormal color temperature sample value is determined to be significantly smaller than the other color temperature sample values among the at least two color temperature sample values when the ratio of the abnormal color temperature sample value to the other color temperature sample values is less than a preset ratio. For example, the preset ratio could be 0.4, but it is not limited to this. When at least two color temperature sample values contain substantially equal color temperature sample values, the weights of the substantially equal color temperature sample values are determined, wherein the substantially equal color temperature sample values each have the same weight. Simultaneously, the weights of the color temperature sample values other than the substantially equal color temperature sample values among the at least two color temperature sample values can be reset to zero.
[0115] In the above exemplary embodiment, the first color temperature sampling value of the first ambient light sensor 12 is 1000K, the second color temperature sampling value of the second ambient light sensor 13 is 2800K, and the third color temperature sampling value of the third ambient light sensor 14 is 3000K. The second and third color temperature sampling values are approximately equal, while the first color temperature sampling value differs significantly from both the second and third color temperature sampling values. The ratio of the first to the second color temperature sampling value is 0.36, and the ratio of the first to the third color temperature sampling value is 0.33, both less than 0.4. Therefore, it can be determined that the first color temperature sampling value is much smaller than the second and third color temperature sampling values, and the first color temperature sampling value is an abnormal color temperature sampling value. The weight of the first color temperature sampling value is then reset to zero.
[0116] In the exemplary embodiment described above, since the second color temperature sample value and the third color temperature sample value are substantially equal, it can be determined that the weight of the second color temperature sample value is the same as the weight of the third color temperature sample value. That is, the weight of the second color temperature sample value and the weight of the third color temperature sample value are both 50%.
[0117] In the exemplary embodiment described above, the first color temperature sample value, the second color temperature sample value, and the third color temperature sample value can be fused according to their respective weights to obtain the first color temperature target value of the ambient light. The first color temperature target value is the weighted sum of the first color temperature sample value, the second color temperature sample value, and the third color temperature sample value; that is, the sum of the product of the weights of the first color temperature sample value and the first color temperature sample value, the product of the weights of the second color temperature sample value and the third color temperature sample value and the third color temperature sample value.
[0118] Figure 7 This is a flowchart illustrating a method for detecting ambient light according to another exemplary embodiment. Figure 2 Based on the illustrated embodiment, step S202 above includes the following steps S20210 to S20211:
[0119] In step S20210, at least two sampled values are input into the trained data fusion model.
[0120] In step S20211, the data fusion model outputs the weights of at least two sampled values, wherein the data fusion model includes a third correspondence between sampled values and weights.
[0121] In this embodiment, at least two sampled values collected by at least two ambient light sensors can be input into a trained data fusion model. The data fusion model includes a third correspondence between the sampled values and their weights. The data fusion model outputs the weights of each of the at least two input sampled values.
[0122] In this embodiment, the optical parameters include illuminance and color temperature. The sampled values include illuminance sampled values and color temperature sampled values, and the weights of at least two sampled values output by the data fusion model include the weights of at least two illuminance sampled values and the weights of at least two color temperature sampled values.
[0123] In this embodiment, before step S20210, the electronic device 1 can be placed under different ambient light conditions to train the data fusion model, thereby obtaining a trained data fusion model. For example... Figure 8 As shown, the above data fusion model is trained through the following steps S801 to S806:
[0124] In step S801, for each ambient light condition, the sampling values of the optical parameters of at least two ambient light sensors are calibrated using an illuminance meter to obtain at least two training sampling values and at least two calibration values.
[0125] exist Figure 1 In the exemplary embodiment shown, the electronic device 1 includes a first ambient light sensor 12 and a second ambient light sensor 13. In each ambient light condition, the same illuminance meter can be used to calibrate the sampled values of the first ambient light sensor 12 and the second ambient light sensor 13, respectively. This allows the calibration value collected by the illuminance meter to be closer to the sampled values of the optical parameters of the ambient light sensor. For example, the illuminance meter is first placed near the first ambient light sensor 12, and the sampled value of the first ambient light sensor 12 and the first calibration value of the illuminance meter are read respectively to obtain the sampled value and the first calibration value of the first ambient light sensor 12 during training, wherein the first calibration value is the illuminance value of the ambient light collected by the illuminance meter. Then, the illuminance meter is placed near the second ambient light sensor 13, and the sampled value of the second ambient light sensor 13 during training and the second calibration value of the illuminance meter are read respectively to obtain the sampled value and the second calibration value of the second ambient light sensor 13 during training.
[0126] exist Figure 1 In the exemplary embodiment shown, for each ambient light condition, the sampled value of the first ambient light sensor 12 during training, the sampled value of the second ambient light sensor 13 during training, the first calibration value, and the second calibration value are obtained.
[0127] Continuing with the exemplary embodiments described above, the first calibration value includes a first illuminance calibration value and a first color temperature calibration value, and the second calibration value includes a second illuminance calibration value and a second color temperature calibration value.
[0128] Continuing with the exemplary embodiments described above, the sampling values of the first ambient light sensor 12 during training include the illuminance sampling value and the color temperature sampling value of the first ambient light sensor 12 during training, and the sampling values of the second ambient light sensor 13 during training include the illuminance sampling value and the color temperature sampling value of the second ambient light sensor 13 during training.
[0129] In step S802, target values for the optical parameters of the display screen that meet the requirements of human eye comfort are determined.
[0130] In this embodiment, the optical parameters of the display screen include display brightness and screen color temperature. Display brightness and screen color temperature refer to the brightness of the screen's emitted light. Screen color temperature refers to the color temperature of the screen's emitted light. The target values of the display screen's optical parameters include target values for display brightness and screen color temperature.
[0131] exist Figure 1 In the exemplary embodiment shown, the user's optimal display brightness requirement can be obtained through subjective experimentation. When the display brightness of the electronic device's screen meets the user's optimal display brightness requirement, the display brightness of the screen is determined as the target value of the display brightness.
[0132] Similarly, the user's optimal screen color temperature requirement can be obtained through subjective experiments. When the screen color temperature of the electronic device's display meets the user's optimal screen color temperature requirement, the screen color temperature of that display is determined as the target value of the display's screen color temperature.
[0133] In step S803, a second target value for the optical parameters of the ambient light is determined based on the target value of the optical parameters and the fourth correspondence between the optical parameters of the display screen and the optical parameters of the ambient light.
[0134] In this embodiment, the fourth correspondence includes the correspondence between the display brightness of the display screen and the illuminance of the ambient light, and the correspondence between the screen color temperature of the display screen and the color temperature of the ambient light. The second target value of the optical parameters of the ambient light includes a second target illuminance value and a second target color temperature value.
[0135] In this embodiment, a second target value for ambient light illuminance can be determined based on the target value for display brightness of the display screen and the correspondence between display brightness of the display screen and illuminance of ambient light. Similarly, a second target value for ambient light color temperature can be determined based on the target value for screen color temperature of the display screen and the correspondence between screen color temperature of the display screen and color temperature of ambient light.
[0136] In step S804, the weights of the at least two calibration values are determined based on the at least two calibration values and the second target value.
[0137] Continuing with the exemplary embodiment described above, the weights of the first illuminance calibration value and the second illuminance calibration value can be determined based on the first illuminance calibration value, the second illuminance calibration value, and the second illuminance target value. The second illuminance target value is the weighted sum of the first illuminance calibration value and the second illuminance calibration value.
[0138] Continuing with the exemplary embodiments described above, the weights of the first color temperature calibration value and the second color temperature calibration value can be determined based on the first color temperature calibration value, the second color temperature calibration value, and the second color temperature target value. The second color temperature target value is the weighted sum of the first color temperature calibration value and the second color temperature calibration value.
[0139] In step S805, the weights of at least two sampled values during training are associated with the weights of at least two calibration values to obtain a third correspondence.
[0140] In this embodiment, the third correspondence includes the correspondence between illuminance sample values and weights, and the correspondence between color temperature sample values and weights.
[0141] Continuing with the exemplary embodiment described above, the illuminance sampling values of the first ambient light sensor 12 during training, the sampling values of the second ambient light sensor 13 during training, and the weights of the first and second illuminance calibration values are respectively correlated to obtain the correspondence between illuminance sampling values and weights. Specifically, in the correspondence between illuminance sampling values and weights, the weight corresponding to the illuminance sampling value of the first ambient light sensor 12 during training is the weight of the first illuminance calibration value, and the weight corresponding to the sampling value of the second ambient light sensor 13 during training is the weight of the second illuminance calibration value.
[0142] Continuing with the exemplary embodiment described above, the color temperature sampling values of the first ambient light sensor 12 during training, the color temperature sampling values of the second ambient light sensor 13 during training, and the weights of the first and second color temperature calibration values are respectively associated to obtain the correspondence between color temperature sampling values and weights. Specifically, in the correspondence between color temperature sampling values and weights, the weight corresponding to the color temperature sampling value of the first ambient light sensor 12 during training is the weight of the first color temperature calibration value, and the weight corresponding to the color temperature sampling value of the second ambient light sensor 13 during training is the weight of the second color temperature calibration value.
[0143] In this embodiment, under the same ambient light conditions, the angle of the electronic device can also be adjusted to train the data fusion model.
[0144] In this embodiment, since the data fusion model is trained under a large number of ambient light conditions, the weights of the at least two output sampled values are more accurate, thereby making the optical parameters for detecting ambient light more accurate.
[0145] In this embodiment of the disclosure, the electronic device can adjust the brightness of the display screen according to the detected ambient light illuminance and a preset relationship curve between ambient light illuminance and display brightness, so as to provide the user with a display screen brightness suitable for human eyes under the current ambient light conditions. The electronic device can also adjust the color temperature of the display screen according to the detected ambient light color temperature and a preset relationship curve between ambient light color temperature and display color temperature, so as to provide the user with a display screen color temperature suitable for human eyes under the current ambient light conditions.
[0146] Figure 9 This is a block diagram illustrating an electronic device according to an exemplary embodiment. In this embodiment, the electronic device includes: a display screen and at least two ambient light sensors, wherein the at least two ambient light sensors are respectively located on different sides of the electronic device, and one of the at least two ambient light sensors is located on the same side of the electronic device as the display screen. The electronic device further includes:
[0147] The acquisition module 91 is configured to acquire sampled values of the optical parameters of the ambient light collected by each of the at least two ambient light sensors, and obtain at least two sampled values;
[0148] The determination module 92 is configured to determine the weights of at least two of the sampled values based on at least two of the sampled values.
[0149] The fusion module 93 is configured to fuse at least two sampled values according to their respective weights to obtain a first target value of the optical parameters of the ambient light.
[0150] In one embodiment, determining module 92 includes:
[0151] The first determining submodule is configured to determine the maximum value among at least two of the sampled values;
[0152] The second determining submodule is configured to determine the target optical parameter value range to which the maximum value belongs from at least two preset optical parameter value ranges;
[0153] The third determining submodule is configured to determine the corresponding target weight allocation strategy based on the target optical parameter value range and the first correspondence between the optical parameter value range and the weight allocation strategy, wherein each weight allocation strategy includes a second correspondence between the sampled value identifier and the weight;
[0154] The fourth determination submodule is configured to determine the weights of at least two sampled values based on the sampled value identifiers of each of the at least two sampled values and the target weight allocation strategy.
[0155] In another embodiment, the determining module 92 includes:
[0156] The first setting submodule is configured to reset the weight of the zero sample value to zero when it is determined that at least two of the sample values are zero;
[0157] The fifth determining submodule is configured to determine the ratio of at least two of the sampled values, excluding zero.
[0158] The sixth determining submodule is configured to determine the weights of the remaining sample values (excluding zero) among the at least two sample values based on the ratio of the remaining sample values among the at least two sample values.
[0159] In another embodiment, the determining module 92 includes:
[0160] The seventh determining submodule is configured to determine the ratio between at least two of the sampled values;
[0161] The eighth determining submodule is configured to determine the weights of at least two of the sampled values based on the ratio.
[0162] In another embodiment, the determining module 92 includes:
[0163] The input submodule is configured to input at least two of the sampled values into a trained data fusion model;
[0164] The output submodule is configured to output the weights of at least two of the sampled values from the data fusion model, wherein the data fusion model includes a third correspondence between the sampled values and the weights.
[0165] In another embodiment, the electronic device is placed under different ambient light conditions to train the data fusion model. The data fusion model is trained using a training module, which includes:
[0166] The calibration submodule is configured to calibrate the sampled values of the optical parameters of at least two ambient light sensors using an illuminance meter for each ambient light condition, thereby obtaining at least two training sampled values and at least two calibration values.
[0167] The ninth determining submodule is configured to determine target values for the optical parameters of the display screen that meet the requirements of human eye comfort;
[0168] The tenth determining submodule is configured to determine a second target value for the optical parameters of the ambient light based on the target value of the optical parameters and a fourth correspondence between the optical parameters of the display screen and the optical parameters of the ambient light.
[0169] The eleventh determination submodule is configured to determine the weights of at least two calibration values based on at least two calibration values and the second target value.
[0170] The association submodule is configured to associate at least two sampled values from training with the weights of at least two calibration values to obtain the third correspondence.
[0171] In another embodiment, the optical parameters include illuminance and color temperature; the sampled values include illuminance sampled values and color temperature sampled values; the first target value includes a first illuminance target value and a first color temperature target value; the determining module 92 is further configured to determine the weights of at least two of the illuminance sampled values based on at least two illuminance sampled values. The fusion module 93 includes:
[0172] The first fusion submodule is configured to fuse at least two illuminance sample values according to the respective weights of the at least two illuminance sample values to obtain a first illuminance target value for ambient light;
[0173] The second fusion submodule is configured to fuse at least two color temperature sample values according to the respective weights of at least two illuminance sample values to obtain a first color temperature target value for ambient light.
[0174] In another embodiment, the optical parameters include color temperature; the sampled values include color temperature sampled values; and the first target value includes a first color temperature target value. The determining module 92 is further configured to reset the weight of the abnormal color temperature sampled value to zero when an abnormal color temperature sampled value exists among at least two color temperature sampled values, the abnormal color temperature sampled value being significantly smaller than the remaining color temperature sampled values among the at least two color temperature sampled values; and to determine the weights of the substantially equal color temperature sampled values when substantially equal color temperature sampled values exist among the at least two color temperature sampled values, wherein the substantially equal color temperature sampled values have the same weight. The fusing module 93 is further configured to fuse the at least two color temperature sampled values according to their respective weights to obtain a first color temperature target value for ambient light.
[0175] Figure 10 This is a block diagram illustrating an electronic device according to an exemplary embodiment. For example, device 1000 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0176] Reference Figure 10 The device 1000 may include one or more of the following components: a processing component 1002, a memory 1004, a power supply component 1006, a multimedia component 1008, an audio component 1010, an input / output (I / O) interface 1012, a sensor component 1014, and a communication component 1016.
[0177] Processing component 1002 typically controls the overall operation of device 1000, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 1002 may include one or more processors 1020 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1002 may include one or more modules to facilitate interaction between processing component 1002 and other components. For example, processing component 1002 may include a multimedia module to facilitate interaction between multimedia component 1008 and processing component 1002.
[0178] Memory 1004 is configured to store various types of data to support the operation of device 1000. Examples of this data include instructions for any application or method operating on device 1000, contact data, phonebook data, messages, pictures, videos, etc. Memory 1004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0179] The power supply component 1006 provides power to the various components of the device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1000.
[0180] Multimedia component 1008 includes a screen that provides an output interface between the device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1008 includes a front-facing camera and / or a rear-facing camera. When the device 1000 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0181] Audio component 1010 is configured to output and / or input audio signals. For example, audio component 1010 includes a microphone (MIC) configured to receive external audio signals when device 1000 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1004 or transmitted via communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
[0182] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0183] Sensor assembly 1014 includes one or more sensors for providing state assessments of various aspects of device 1000. For example, sensor assembly 1014 may detect the on / off state of device 1000, the relative positioning of components such as the display and keypad of device 1000, changes in the position of device 1000 or a component of device 1000, the presence or absence of user contact with device 1000, the orientation or acceleration / deceleration of device 1000, and temperature changes of device 1000. Sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1014 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0184] Communication component 1016 is configured to facilitate wired or wireless communication between device 1000 and other devices. Device 1000 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or combinations thereof. In one exemplary embodiment, communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1016 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0185] In an exemplary embodiment, device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0186] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, which can be executed by a processor 1020 of device 1000 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0187] Regarding the apparatus in the above embodiments, the specific manner in which the processor performs the operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0188] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0189] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its range. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for detecting ambient light, characterized in that, An electronic device is applied to the electronic device, the electronic device including a display screen and at least two ambient light sensors, the at least two ambient light sensors being located on different sides of the electronic device, and one of the at least two ambient light sensors being located on the same side of the electronic device as the display screen, the method comprising: Obtain sampled values of the optical parameters of the ambient light collected by at least two of the ambient light sensors, and obtain at least two sampled values; Determine the weights of at least two of the sampled values based on at least two of the sampled values; The at least two sampled values are fused according to their respective weights to obtain a first target value of the optical parameters of the ambient light; The sampled value includes a sampled value identifier, and determining the weight of each of the at least two sampled values based on the at least two sampled values includes: Determine the maximum value among at least two of the sampled values; The target optical parameter range to which the maximum value belongs is determined from at least two preset optical parameter value ranges; The target weight allocation strategy is determined based on the target optical parameter value range and the first correspondence between the optical parameter value range and the weight allocation strategy, wherein each weight allocation strategy includes a second correspondence between the sampled value identifier and the weight; The weights of at least two sampled values are determined based on their respective sampled value identifiers and the target weight allocation strategy.
2. The method according to claim 1, characterized in that, Determining the weights of at least two sampled values based on at least two sampled values includes: When it is determined that at least two of the sampled values are zero, the weight of the sampled value that is zero is reset to zero; Determine the ratio of at least two of the sampled values, excluding zero; The weights of the remaining sampled values (excluding zero) among the at least two sampled values are determined based on the ratio of the remaining sampled values among the at least two sampled values.
3. The method according to claim 1, characterized in that, Determining the weights of at least two sampled values based on at least two sampled values includes: Determine the ratio between at least two of the sampled values; The weights of at least two of the sampled values are determined based on the ratio.
4. The method according to claim 1, characterized in that, Determining the weights of at least two sampled values based on at least two sampled values includes: Input at least two of the sampled values into the trained data fusion model; The data fusion model outputs weights for at least two of the sampled values, wherein the data fusion model includes a third correspondence between the sampled values and the weights.
5. The method according to claim 4, characterized in that, The data fusion model is trained through the following steps: The electronic device is placed under different ambient light conditions to train the data fusion model. For each ambient light condition, the sampling values of the optical parameters of at least two ambient light sensors are calibrated using an illuminance meter to obtain at least two training sampling values and at least two calibration values. Determine the target values for the optical parameters of the display screen that meet the requirements of human eye comfort; Based on the target values of the optical parameters and the fourth correspondence between the optical parameters of the display screen and the optical parameters of the ambient light, a second target value for the optical parameters of the ambient light is determined. The weights of the at least two calibration values are determined based on the at least two calibration values and the second target value. The third correspondence is obtained by associating at least two sampled values from training with the weights of at least two calibration values.
6. The method according to claim 1, characterized in that, The optical parameters include illuminance and / or color temperature.
7. The method according to claim 1, characterized in that, The optical parameters include illuminance and color temperature; the sampled values include illuminance sampled values and color temperature sampled values; the first target value includes a first illuminance target value and a first color temperature target value. Determining the weights of at least two sampled values based on at least two sampled values includes: The weights of at least two illuminance sample values are determined based on at least two illuminance sample values. The weights of at least two color temperature sample values are determined based on at least two color temperature sample values. The step of fusing at least two sampled values according to their respective weights to obtain a first target value for the optical parameters of ambient light includes: The at least two illuminance sample values are fused according to their respective weights to obtain a first target illuminance value for ambient light; The first color temperature target value of the ambient light is obtained by fusing at least two color temperature sample values according to their respective weights.
8. The method according to claim 1, characterized in that, The optical parameters include color temperature; the sampled values include color temperature sampled values; the first target value includes a first color temperature target value; Determining the weights of at least two sampled values based on at least two sampled values includes: When an abnormal color temperature sample value exists among at least two color temperature sample values, the weight of the abnormal color temperature sample value is reset to zero, wherein the ratio of the abnormal color temperature sample value to the remaining color temperature sample values among the at least two color temperature sample values is less than a preset ratio; when at least two color temperature sample values exist as substantially equal color temperature sample values, the weights of the substantially equal color temperature sample values are determined, wherein the weights of the substantially equal color temperature sample values are equal. The step of fusing at least two sampled values according to their respective weights to obtain a first target value for the optical parameters of ambient light includes: The first color temperature target value of the ambient light is obtained by fusing at least two color temperature sample values according to their respective weights.
9. An electronic device, characterized in that, Used to implement the method according to any one of claims 1 to 8.
10. An electronic device, characterized in that, It includes a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to implement the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.
Citation Information
Patent Citations
Information processing method and electronic device
CN105425905A
User terminal device and method for adjusting luminance thereof
CN106257581A