Ambient Light Detection Method and Device, Storage Medium

By detecting the change amount of ambient light brightness data in the mobile electronic device and switching the output level of the signal port, the processing chip is triggered to acquire the brightness data only when the change amount is greater than or equal to the predetermined threshold, the problem of high data processing burden and power consumption in ambient light detection is solved, and more efficient processing and power consumption are achieved.

CN114964482BActive Publication Date: 2025-06-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110212374.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2025-06-24
Estimated Expiration
2041-02-25

AI Technical Summary

Technical Problem

Mobile electronic devices have a large data processing burden in ambient light detection, occupy computing and storage resources, and have high power consumption.

Method used

By detecting the change amount of ambient light brightness data, the output level of the signal port connected to the light sensing sensor and the processing chip is switched, and only when the change amount is greater than or equal to a predetermined threshold is switched to trigger the processing chip to acquire the brightness data.

Benefits of technology

It reduces the data processing burden of the processing chip, reduces the data processing volume and power consumption, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114964482B_ABST
    Figure CN114964482B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an ambient light detection method and device, and a storage medium. An ambient light detection method, which is applied to a terminal having at least one light sensor, includes: switching the output level of the signal port connecting the light sensor of the terminal to the processing chip according to the change amount of the detected ambient light brightness data; when the level value is switched, obtaining the ambient light brightness data through the processing chip; and determining the ambient light brightness value based on the changed ambient light brightness data. Through the technical solution of the embodiments of the present disclosure, when the change of the ambient light brightness data is detected, the output level of the signal port can be switched based on the change amount, and the processing chip is activated to process the ambient light data, thereby reducing the power consumption of the processing chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to electronic technologies, and in particular, to an ambient light detection method, an apparatus, and a storage medium. Background Art

[0002] Mobile electronic devices usually have the function of ambient light detection. Ambient light is obtained by using a sensor for ambient light detection, and then the brightness level of the display screen is adjusted according to the ambient light brightness, so as to achieve a clearer display effect by adjusting the display screen brightness in real time. However, ambient light detection requires the sensor to perform real-time detection, and the processor processes the detected ambient light brightness, and then correspondingly controls the brightness level of the display screen. This method has a large data processing burden, occupies the computing and storage resources of the electronic device, and has a high power consumption. Summary of the Invention

[0003] The present disclosure provides an ambient light detection method, an apparatus, and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an ambient light detection method, which is applied to a terminal having at least one light sensor, and includes:

[0005] According to the change amount of the detected ambient light brightness data, switch the output level of the signal port connecting the light sensor of the terminal to the processing chip;

[0006] When the output level is switched, obtain the ambient light brightness data through the processing chip;

[0007] Based on the changed ambient light brightness data, determine the ambient light brightness value.

[0008] In some embodiments, the method further includes:

[0009] When the light sensor detects a change in ambient light brightness data, update the brightness data cached in the cache unit of the light sensor to the changed ambient light brightness data.

[0010] In some embodiments, the step of switching the output level of the signal port connecting the light sensor of the terminal to the processing chip according to the change amount of the detected ambient light brightness data includes:

[0011] If the change amount of the ambient light brightness data is greater than or equal to a predetermined change threshold, switch the output level of the signal port connecting the light sensor to the processing chip.

[0012] In some embodiments, the step of obtaining the ambient light brightness data through the processing chip when the output level is switched includes:

[0013] When the output level is switched, determine the identifier of the photosensor according to the signal port;

[0014] Send a connection signal carrying the identifier to the photosensor through the processing chip;

[0015] Establish a data connection between the processing chip and the photosensor according to the connection signal and the identifier;

[0016] Obtain the ambient light luminance data through the data connection.

[0017] In some embodiments, determining the ambient light luminance value based on the changed ambient light luminance data includes:

[0018] Based on the voltage value corresponding to the changed ambient light luminance data, convert to obtain the corresponding ambient light luminance value.

[0019] According to a second aspect of the embodiments of the present disclosure, there is provided an ambient light detection device, which is applied to a terminal having at least one photosensor, and includes:

[0020] A switching module, configured to switch the output level of the signal port connecting the photosensor of the terminal and the processing chip according to the change amount of the detected ambient light luminance data;

[0021] An acquisition module, configured to obtain the ambient light luminance data through the processing chip when the output level is switched;

[0022] A determination module, configured to determine the ambient light luminance value based on the changed ambient light luminance data.

[0023] In some embodiments, the device further includes:

[0024] An update module, configured to update the luminance data cached in the cache unit of the photosensor to the changed ambient light luminance data when the photosensor detects a change in the ambient light luminance data.

[0025] In some embodiments, the switching module is specifically configured to:

[0026] If the change amount of the ambient light luminance data is greater than or equal to a predetermined change threshold, switch the output level of the signal port connecting the photosensor and the processing chip.

[0027] In some embodiments, the acquisition module includes:

[0028] A determination sub-module, configured to determine the identifier of the photosensor according to the signal port when the output level is switched;

[0029] A sending sub-module, configured to send a connection signal carrying the identifier to the light sensor through the processing chip;

[0030] An establishing sub-module, configured to establish a data connection between the processing chip and the light sensor according to the connection signal and the identifier;

[0031] A obtaining sub-module, configured to obtain the ambient light luminance data through the data connection.

[0032] In some embodiments, the determining module includes:

[0033] A converting sub-module, configured to convert a corresponding ambient light luminance value based on a voltage value corresponding to the changed ambient light luminance data.

[0034] According to a third aspect of the embodiments of the present disclosure, there is provided an ambient light detection device, where the device at least includes: a processor and a memory for storing executable instructions that can run on the processor, where:

[0035] When the processor is used to run the executable instructions, the executable instructions execute the steps in the ambient light detection method of any one of the above.

[0036] According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, the steps in the ambient light detection method of any one of the above are implemented.

[0037] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: Through the technical solutions in the embodiments of the present disclosure, when the luminance sensor detects a change in the ambient light luminance, the processing chip is triggered to obtain luminance data by switching the output level of the signal port according to the change amount of the ambient light luminance. For example, the output level is switched only when the change amount is greater than a predetermined threshold. Thus, it is not necessary to obtain luminance data in real time, which improves the processing efficiency of the processing chip and reduces the data processing amount and power consumption.

[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.

[0040] Figure 1 is a flowchart of an ambient light detection method shown according to an exemplary embodiment Figure 1 ;

[0041] Figure 2 is a flowchart of an ambient light detection method shown according to an exemplary embodiment Figure 2 ;

[0042] Figure 3 is a structural block diagram of a light sensor shown according to an exemplary embodiment;

[0043] Figure 4 is a schematic circuit connection diagram of a light sensor shown according to an exemplary embodiment;

[0044] Figure 5 is a flowchart of an ambient light detection method shown according to an exemplary embodiment Figure 2 ;

[0045] Figure 6 is a structural block diagram of an ambient light detection device shown according to an exemplary embodiment;

[0046] Figure 7 is a physical structural block diagram of an ambient light detection device shown according to an exemplary embodiment. Detailed Description of the Invention

[0047] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0048] Figure 1 is a flowchart of an ambient light detection method shown according to an exemplary embodiment. The method is applied to a terminal having at least one light sensor and includes:

[0049] Step S101, according to the change amount of the detected ambient light luminance data, switch the output level of the signal port connecting the light sensor of the terminal to the processing chip;

[0050] Step S102, when the output level is switched, obtain the ambient light luminance data;

[0051] Step S103, based on the changed ambient light luminance data, determine the ambient light luminance value.

[0052] In the embodiments of the present disclosure, the light sensor may be composed of photosensitive elements, so it can sense the ambient light in real time and convert the light energy of the ambient light into an electrical signal. Therefore, the light sensor can perform ambient light detection and generate ambient luminance data in real time.

[0053] In the terminal, the processing chip is used to process the ambient light luminance data detected by the light sensor to obtain the corresponding ambient light luminance value, or execute corresponding instructions using the ambient light luminance value. For example, based on the ambient light luminance value, the display screen brightness adjustment is triggered, and the extinguishing and lighting of the display screen are triggered, etc.

[0054] It should be noted that the switching of the output level here can be a high-to-low switching or a low-to-high switching. For example, if there are two cases of the output level of ±5V (volt), when the output level switches from +5V to -5V, the processing chip acquires the ambient light luminance data; or when the output level switches from -5V to +5V, the processing chip acquires the ambient light luminance data. However, when the output level is maintained at +5V or -5V, the processing chip does not perform data acquisition, such as maintaining the sleep state.

[0055] In the embodiment of the present disclosure, the terminal switches the output level of the signal port connected to the processing chip based on the change amount of the ambient light luminance data detected by the light sensor. That is to say, the light sensor is connected to the processing chip, and the switching of the output level is transmitted through the signal port. Therefore, only when the ambient light luminance data changes or the change amount is greater than a predetermined threshold, etc., the output level switching will be performed, and the processing chip will be triggered to perform the operation of reading data. Compared with the method in which the processing chip is awakened in real time and reads the ambient light luminance data in real time, the embodiment of the present disclosure can effectively reduce the awakening duration of the processing chip, reduce unnecessary data acquisition and processing, thereby improving the processing efficiency, reducing the processing power consumption and the chip load.

[0056] In some embodiments, as Figure 2 shown, the method further includes:

[0057] Step S201, when the light sensor detects a change in the ambient light luminance data, update the luminance data cached in the cache unit of the light sensor to the changed ambient light luminance data.

[0058] In the embodiment of the present disclosure, the light sensor includes a cache unit, and this cache unit can store only one ambient light luminance data. The light sensor can compare the ambient light luminance data detected in real time with the stored ambient light luminance data. If the detected ambient light luminance data changes, the stored ambient light luminance data can be updated, and the currently detected ambient light luminance data is used to replace the stored ambient light luminance data.

[0059] When comparing to determine whether the ambient light brightness has changed, the determination criterion can be the magnitude of the difference between ambient light brightness data. For example, if it is set that an update is triggered when the difference in ambient light brightness data is greater than 0, then even a slight change in ambient light brightness (which can be recognized by the sensitivity of the light sensor) will trigger an update of the ambient light brightness data in the cache. Another example is that if it is set that the difference in ambient light brightness data is greater than a preset threshold (this threshold can be greater than 0), then when there is a large change in ambient light brightness, it will trigger an update of the ambient light brightness data in the cache.

[0060] Here, the brightness data cached in the cache unit can be used for the processing chip to read. Therefore, when the ambient light brightness data changes, on the one hand, the data in the cache unit is updated, and on the other hand, the processing chip is notified to read the data by switching the output level of the signal port, so that the processing chip can quickly obtain the ambient light brightness data.

[0061] In some embodiments, switching the output level of the signal port connecting the light sensor of the terminal to the processing chip according to the detected change amount of the ambient light brightness data includes:

[0062] If the change amount of the ambient light brightness data is greater than or equal to a predetermined change threshold, then switch the output level of the signal port connecting the light sensor to the processing chip.

[0063] It should be noted that since the detection of the ambient light brightness is a real-time detection by the light sensor and runs through the entire detection process, further confirming whether the change amount of the ambient light brightness data is greater than the preset threshold is also carried out in real time based on the detection of the ambient light brightness. When it is determined that the change amount between the detected ambient light brightness data and the stored ambient light brightness data is greater than the preset threshold, in fact, during the process of detecting the ambient light brightness, the ambient light has changed greatly. At this time, an interrupt signal is sent to the processing chip by switching the level value of the signal port, thereby triggering the processing chip to read the brightness data. Therefore, in essence, there is no sequential execution order among the above steps, and it can be understood as steps that are repeatedly carried out during the process of the brightness sensor detecting the ambient light brightness.

[0064] Through the above process, during the process of the brightness sensor detecting the ambient light, the processing chip is triggered to obtain the brightness value only when there is a large change in the ambient light brightness, which can effectively reduce the data processing burden of the processing chip, reduce redundant data, improve the processing effect of the processing chip, and reduce the overall power consumption of the brightness sensor and the processing chip.

[0065] In an embodiment of the present disclosure, the process of switching the output level value may include: if the change amount of the ambient light luminance data is greater than a predetermined change threshold, the light sensor switches the first level of the signal port connected to the processing chip to a second level different from the first level.

[0066] Here, the level values of the first level and the second level are different. For example, the positive and negative polarities are different. It may not be limited to the difference in positive and negative polarities. For example, the first level is a positive level value and the second level is 0; or, the first level is +10v and the second level is +5v, etc. The light sensor sends an interrupt signal to the processing chip by switching the level value of the signal port, thereby triggering the processing chip to read the data cached by the light sensor.

[0067] In some embodiments, obtaining the ambient light luminance data by the processing chip when the output level is switched includes:

[0068] When the output level is switched, determining the identifier of the light sensor according to the signal port;

[0069] Sending a connection signal carrying the identifier to the light sensor by the processing chip;

[0070] Establishing a data connection between the processing chip and the light sensor according to the connection signal and the identifier;

[0071] Obtaining the ambient light luminance data through the data connection.

[0072] When detecting the level value switching, the above-mentioned processing chip can perform the action of data acquisition. Since the signal port is only used to transmit the interrupt signal of the above-mentioned level value switching, the processing chip also needs to establish a data communication connection with the light sensor to obtain the data of the light sensor.

[0073] In an embodiment of the present disclosure, there may be one or more light sensors, and each light sensor may have its own identifier. The processing chip determines the light sensor whose level is switched through the signal port corresponding to each light sensor, so as to establish a data connection with the corresponding light sensor.

[0074] In this way, the processing chip does not need to monitor all the light sensors in real time, but performs corresponding data reading according to the trigger of the level switching of the signal port of the light sensor, thereby reducing the power consumption of the processing chip and reducing the burden of data processing.

[0075] In some embodiments, determining the ambient light luminance value based on the changed ambient light luminance data includes:

[0076] Based on the voltage value corresponding to the changed ambient light luminance data, the corresponding ambient light luminance value is converted.

[0077] Since the light sensor is a photoelectric conversion device composed of photosensitive elements, when the light sensor detects the ambient light luminance, it will be correspondingly converted into an electrical signal, so that corresponding data are generated for different ambient light luminances. Therefore, different ambient light luminance data can correspond to different voltage values.

[0078] After the processing chip reads the ambient light luminance data, data processing can be performed according to the voltage value corresponding to the ambient light luminance data, so as to convert the ambient light luminance data into a luminance value in luminance units, which is convenient for use in other applications or directly input for user use.

[0079] Figure 3 FIG. is a schematic structural diagram of a light sensor shown according to an exemplary embodiment, as Figure 3 shown, the light sensor 100 includes:

[0080] A luminance sensing circuit 110, configured to detect the ambient light luminance to obtain first luminance data;

[0081] A cache queue 120, configured to store the luminance data of the ambient light luminance;

[0082] A sensing chip 130, connected to the luminance sensing circuit 110 and the cache unit 120, and configured to update the second luminance value stored in the cache queue 120 to the first luminance value and trigger the generation of an interrupt signal when the difference between the first luminance value and the second luminance value stored in the cache queue 120 is greater than a preset threshold;

[0083] An interrupt pin 140, connected to the sensing chip 130, and configured to report the interrupt signal to a processing chip 200 connected to the interrupt pin 140.

[0084] Here, the luminance sensing circuit includes sensors for realizing luminance detection, such as photodiodes, photoresistors, etc. The luminance sensing circuit can sense the ambient light luminance and convert the luminance into an electrical signal representing the first luminance value, which is convenient for storage and transmission.

[0085] After the luminance sensing circuit detects the first luminance value, the first luminance value can be stored in the cache queue. The sensing chip is a chip connected to the luminance sensing circuit, that is, the chip of the light sensor in the embodiment of the present disclosure, and is configured to perform preliminary processing on the signal detected by the luminance sensing circuit, including: storing the luminance value data detected by the luminance sensing circuit in the cache queue.

[0086] Since the brightness sensing circuit is a sensor that senses the ambient light brightness in real time, it will generate corresponding electrical signals of brightness values in real time during the detection process. Therefore, in the embodiments of the present disclosure, a sensing chip is used to process the brightness data detected by the brightness sensing circuit and store the brightness values that meet the conditions in a cache queue. Specifically, the sensing chip can store the brightness value detected when the brightness sensing circuit is initially powered on or a preset initial brightness value in the cache queue. In the subsequent detection process, according to the magnitude relationship between the detected brightness value and the brightness value already stored in the cache queue, it is determined whether to update the brightness value in the cache queue.

[0087] In the embodiments of the present disclosure, the second brightness value detected in the previous time period or the second brightness value as the initial value detected by the brightness sensing circuit is cached in the cache queue. The brightness sensing circuit continues to detect and transmits the detected brightness value to the sensing chip. When the first brightness value detected by the brightness sensing circuit has a difference greater than a preset threshold compared with the second brightness value stored in the current cache queue, the second brightness value stored in the cache queue is updated to the above-mentioned first brightness value.

[0088] It can be understood that the moment when the brightness value in the cache queue is updated is the moment when the brightness value detected by the brightness sensing circuit changes and the change amount is greater than the preset threshold. That is to say, the sensing chip makes a preliminary judgment on the brightness value detected by the brightness sensing circuit and is responsible for updating the brightness value stored in the cache queue.

[0089] In addition, in the embodiments of the present disclosure, the sensing chip is further used to trigger the generation of an interrupt signal when updating the cache queue. After the interrupt terminal signal is generated, it is transmitted to the processing chip outside the light sensor through the interrupt pin of the light sensor. This processing chip can be the processor of the terminal where the light sensor is located or the processor of an external device, etc.

[0090] Since in the embodiments of the present disclosure, the sensing chip controls the light sensor to inform the processing chip to obtain the detected brightness value data from the cache queue only when the detected brightness value changes and the change amount is greater than the preset threshold, the processing chip does not need to maintain data communication with the light sensor in real time, nor does it need to obtain the brightness value in real time and further adjust the brightness level of the display screen of the terminal, etc. Therefore, the data processing amount of the processing chip can be effectively reduced, the data interaction efficiency between the light sensor and the processing chip can be improved, and the overall power consumption can be reduced.

[0091] In some embodiments, the light sensor further includes: an interrupt circuit;

[0092] The interrupt circuit includes:

[0093] A power supply;

[0094] Controlled switch; the controlled switch includes:

[0095] An input terminal, connected to the power supply;

[0096] An output terminal, connected to the ground;

[0097] A control terminal, connected to the interrupt pin and the sensing chip; wherein, the control terminal is used to control the switching between conduction and disconnection of the input terminal and the output terminal when the difference between the first brightness value and the second brightness value stored in the buffer queue is greater than a preset threshold, so as to generate the interrupt signal acting on the interrupt pin.

[0098] In the embodiment of the present disclosure, the light sensor further includes an interrupt circuit for generating an interrupt signal. When the sensing chip updates the buffer queue, it triggers the interrupt circuit to generate an interrupt signal. Therefore, the interrupt circuit can be located inside the sensing chip as a part of the sensing chip, or can be located outside the sensing chip and connected to the sensing chip.

[0099] In the embodiment of the present disclosure, the interrupt circuit includes a power supply for providing a pull-up signal. Here, the power supply can be an independent power supply device, or can be a power supply interface connected to an external power supply device or a battery in the interrupt, etc. The interrupt circuit further includes a controlled switch, and the switching state of the controlled switch determines whether to generate an interrupt signal. Therefore, the control terminal of the controlled switch is connected to the above-mentioned sensing chip, and the switching state of the switch is switched through the trigger signal provided by the sensing chip.

[0100] In this way, through the switching of the controlled switch, the level state of the interrupt pin can be cut off, so as to trigger the sensing chip to obtain the brightness value stored in the buffer queue of the light sensor. In this way, the processing chip and the light sensor switch the state of the data connection through the change of the signal on the interrupt pin. The processing chip and the light sensor do not need to maintain real-time data interaction, so the data processing volume can be effectively reduced and the power consumption can be reduced.

[0101] In some embodiments, the control terminal controls the input terminal and the output terminal to be disconnected, and the first level provided by the power supply is conducted to the interrupt pin through the input terminal and the control terminal in sequence;

[0102] The control terminal controls the input terminal and the output terminal to be conducted, and the first level provided by the power supply is grounded through the input terminal and the output terminal in sequence, and the level of the interrupt pin is pulled down to the second level corresponding to the ground point. The switching between the first level and the second level forms the interrupt signal.

[0103] In an embodiment of the present disclosure, when the control terminal controls the input terminal and the output terminal to switch from conduction to disconnection, the first level provided by the power supply is conducted to the interrupt pin through the input terminal and the control terminal, and the signal on the interrupt pin switches from the second level to the first level, thereby forming an interrupt signal;

[0104] When the control terminal controls the input terminal and the output terminal to switch from disconnection to conduction, the first level provided by the power supply is conducted to the output terminal through the input terminal and the control terminal, and the signal on the interrupt pin is pulled low by the ground connection, thereby switching from the first level to the second level, thereby forming an interrupt signal. That is to say, when the control terminal controls the state of the controlled switch to switch, the signal on the interrupt pin is converted, thereby forming the above-mentioned interrupt signal. In this way, using the switching between levels as the interrupt signal, even if there are errors in the signal magnitude, it is not easy to miss reporting.

[0105] In some embodiments, the interrupt pin is used to connect to the general-purpose input / output GPIO interface of the processing chip; wherein, the interrupt signal is used to trigger the processing chip to read the brightness value stored in the buffer queue.

[0106] In an embodiment of the present disclosure, the processing chip has a GPIO interface. Therefore, the light sensor can use the connection between the interrupt pin and the GPIO interface to transmit the interrupt signal to the processing chip. When the processing chip detects the interrupt signal, it can establish a data connection with the light sensor and obtain the data stored in the buffer queue.

[0107] In some embodiments, the buffer queue is a first-in-first-out FIFO queue.

[0108] Here, the above buffer queue can be a FIFO queue. Since the light sensor needs to update the buffer queue when the difference between the detected first brightness value and the second brightness value stored in the FIFO queue is greater than a preset threshold. Therefore, the updated first brightness value can be stored only in the buffer queue, and the existing second brightness value in the FIFO queue is dequeued, and the dequeued second brightness value can be discarded at this time.

[0109] When the processing chip obtains the brightness value data in the FIFO queue, since only the updated first brightness value is stored in the queue, the FIFO queue can be directly read to obtain the first brightness value.

[0110] The embodiment of the present disclosure also provides the following examples:

[0111] Mobile intelligent electronic devices such as mobile phones and tablet computers can use ambient light detection to automatically adjust the brightness of the display screen. However, during the process of real-time detecting ambient light and adjusting the display screen brightness, the light sensor for ambient light detection needs to continuously wake up the processing chip through the light sensor and continuously obtain the detection configuration parameters from the processing chip, thus consuming a large amount of system power. For terminals with multiple front and rear light sensors, that is, front and rear light sensing functions, it will bring greater system power consumption.

[0112] Therefore, in the embodiments of the present disclosure, an interrupt circuit is used to enable the light sensor to wake up the processing chip only when a large change in ambient light brightness is detected, and trigger the processing chip to obtain the detected brightness value data, thereby achieving the purpose of saving power.

[0113] In the embodiments of the present disclosure, as Figure 4 shown, the GPIO of the processing chip 200 is connected to the interrupt pin (int) of the light sensor 100, and the light sensor detects the external ambient light according to the configured detection parameters such as integration time and gain. When the detected brightness value changes and the change amount is greater than the preset threshold, the processing chip is informed through the interrupt signal of the interrupt pin.

[0114] The processing chip can establish a data connection with the corresponding light sensor by sending a sensor identifier, and then read data from the FIFO of the light sensor based on a predetermined communication protocol.

[0115] In this way, by waking up the processing chip when the data changes, the increase in system power consumption caused by the light sensor for brightness detection can be reduced.

[0116] In the embodiments of the present disclosure, the power supply of the light sensor always provides a high-level voltage signal vdd to detect the ambient light brightness value. When the detection starts, the light sensor discards the original data in the pre-configured or cached queue. The first piece of data can be used to determine the detection parameters such as the pre-configured integration time and gain size.

[0117] As Figure 5 shown, the detection process can be represented by the following steps:

[0118] Step S301: The light sensor detects the change in the ambient light brightness value;

[0119] Step S302: When the change value of the detected ambient light brightness value is greater than the predetermined threshold, go to step S303, otherwise continue the detection;

[0120] Here, the change value is the difference between the detected ambient light brightness value and the brightness value stored in the FIFO; if the change value is less than or equal to the above preset threshold, the newly detected brightness value can be directly discarded.

[0121] Step S303: Update the luminance value data stored in the FIFO. At this time, the luminance values already stored in the FIFO can be discarded, and then the luminance values detected by the light sensor are stored in the FIFO.

[0122] Step S304: Configure the interrupt pin of the sensor using the sensing chip of the light sensor.

[0123] Here, the level of the interrupt pin can be pulled high or low by the interrupt circuit to notify the processing chip by setting the interrupt flag bit in the interrupt register to 1.

[0124] Step S305: Trigger the processing chip to read the data in the FIFO based on the interrupt signal on the interrupt pin.

[0125] Here, the processing chip can set the GPIO interface connected to the interrupt pin of the light sensor to the query state to obtain the level change of the interrupt pin in real time. When the level change of the interrupt pin is detected, the processing chip is triggered to establish a data connection with the light sensor. The processing chip can send the sensor identifier to the light sensor through the driving circuit to establish a data connection with the corresponding light sensor and obtain the data stored in the FIFO.

[0126] After the processing chip reads the luminance data, data conversion can be performed to obtain the light intensity data.

[0127] In this way, even when the processing chip is in the sleep state, it can detect the value of the external ambient light. When the ambient light changes significantly, the processing chip is awakened to obtain and process the data. Therefore, the frequency of waking up the processing chip can be reduced, the amount of data processing can be reduced, the processing efficiency can be improved, and the power consumption can be reduced.

[0128] As Figure 6 shown, an embodiment of the present disclosure further provides an ambient light detection device 600, which is applied to a terminal having at least one light sensor and includes:

[0129] A switching module 601, configured to switch the output level of the signal port connecting the light sensor of the terminal to the processing chip according to the change amount of the detected ambient light luminance data;

[0130] An acquisition module 602, configured to acquire the ambient light luminance data through the processing chip when the output level is switched;

[0131] A determination module 603, configured to determine the ambient light luminance value based on the changed ambient light luminance data.

[0132] In some embodiments, the device further includes:

[0133] An update module, configured to update the luminance data cached in the cache unit of the light sensor to the changed ambient light luminance data when the light sensor detects a change in the ambient light luminance data.

[0134] In some embodiments, the switching module is specifically configured to:

[0135] If the change amount of the ambient light luminance data is greater than or equal to a predetermined change threshold, switch the output level of the signal port through which the light sensor is connected to the processing chip.

[0136] In some embodiments, the obtaining module includes:

[0137] A determination sub-module, configured to determine the identifier of the light sensor according to the signal port when the output level is switched;

[0138] A sending sub-module, configured to send a connection signal carrying the identifier to the light sensor through the processing chip;

[0139] An establishing sub-module, configured to establish a data connection between the processing chip and the light sensor according to the connection signal and the identifier;

[0140] An obtaining sub-module, configured to obtain the ambient light luminance data through the data connection.

[0141] In some embodiments, the determining module includes:

[0142] A conversion sub-module, configured to convert a corresponding ambient light luminance value based on the voltage value corresponding to the changed ambient light luminance data.

[0143] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0144] Figure 7 is a block diagram of an ambient light detection device 700 shown according to an exemplary embodiment. For example, the device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0145] Referring to Figure 7 , the device 700 may include one or more of the following components: a processing component 701, a memory 702, a power component 703, a multimedia component 704, an audio component 705, an input / output (I / O) interface 706, a sensor component 707, and a communication component 708.

[0146] The processing component 701 generally controls the overall operation of the device 700, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 701 may include one or more processors 710 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 701 may further include one or more modules to facilitate the interaction between the processing component 701 and other components. For example, the processing component 701 may include a multimedia module to facilitate the interaction between the multimedia component 704 and the processing component 701.

[0147] The memory 710 is configured to store various types of data to support the operation of the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 702 may 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 memory, flash memory, magnetic disk, or optical disk.

[0148] The power component 703 provides power to various components of the device 700. The power component 703 may include: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 700.

[0149] The multimedia component 704 includes a screen that provides an output interface between the device 700 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 touch screen 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 actions, but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 704 includes a front camera and / or a rear camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and / or rear camera may be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0150] The audio component 705 is configured to output and / or input audio signals. For example, the audio component 705 includes a microphone (MIC), which is configured to receive external audio signals when the device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be stored in the memory 710 or transmitted via the communication component 708. In some embodiments, the audio component 705 further includes a speaker for outputting audio signals.

[0151] The I / O interface 706 provides an interface between the processing component 701 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0152] The sensor component 707 includes one or more sensors for providing an assessment of the status of various aspects of the device 700. For example, the sensor component 707 can detect the on / off state of the device 700, the relative positioning of components, such as the display and keypad of the device 700. The sensor component 707 can also detect a change in the position of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the device 700. The sensor component 707 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 707 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 707 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0153] The communication component 708 is configured to facilitate communication between the device 700 and other devices in a wired or wireless manner. The device 700 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 708 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 708 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, or other technologies.

[0154] In an exemplary embodiment, the apparatus 700 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 for performing the above method.

[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 702 including instructions, is also provided. The above instructions may be executed by a processor 710 of the apparatus 700 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0156] An embodiment of the present disclosure also provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal can execute the method provided in any of the above embodiments.

[0157] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common general knowledge or conventional technical means in the technical field not disclosed in this disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.

[0158] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. An ambient light detection method, characterized in that, The method includes: According to the change amount of the ambient light luminance data detected by the light sensor of the terminal, switching the output level of the signal port where the light sensor is connected to the processing chip; the terminal includes at least one such light sensor; When the output level is switched, sending an interrupt signal to the processing chip through the light sensor to trigger the processing chip to obtain the ambient light luminance data; Based on the changed ambient light luminance data, determining the ambient light luminance value.

2. The method according to claim 1, characterized in that, The method further includes: When the light sensor detects a change in the ambient light luminance data, updating the luminance data cached in the cache unit of the light sensor to the changed ambient light luminance data.

3. The method according to claim 2, wherein The switching the output level of the signal port where the light sensor of the terminal is connected to the processing chip according to the detected change amount of the ambient light luminance data includes: If the change amount of the ambient light luminance data is greater than or equal to a predetermined change threshold, switching the output level of the signal port where the light sensor is connected to the processing chip.

4. The method according to any one of claims 1 to 3, characterized in that The obtaining the ambient light luminance data by the processing chip when the output level is switched includes: When the output level is switched, determining the identifier of the light sensor according to the signal port; Sending a connection signal carrying the identifier to the light sensor through the processing chip; Establishing a data connection between the processing chip and the light sensor according to the connection signal and the identifier; Obtaining the ambient light luminance data through the data connection.

5. The method according to any one of claims 1 to 3, characterized in that The determining the ambient light luminance value based on the changed ambient light luminance data includes: Based on the voltage value corresponding to the changed ambient light luminance data, converting to obtain the corresponding ambient light luminance value.

6. An ambient light detection device, characterized in that, The device includes: A switching module, configured to switch the output level of the signal port where the light sensor of the terminal is connected to the processing chip according to the change amount of the ambient light luminance data detected by the light sensor; the terminal includes at least one such light sensor; An obtaining module, configured to send an interrupt signal to the processing chip through the light sensor when the output level is switched to trigger the processing chip to obtain the ambient light luminance data; A determining module, configured to determine the ambient light luminance value based on the changed ambient light luminance data.

7. The device according to claim 6, characterized in that, The device further includes: An updating module, configured to update the luminance data cached in the cache unit of the light sensor to the changed ambient light luminance data when the light sensor detects a change in the ambient light luminance data.

8. The device according to claim 7, wherein The switching module is specifically configured to: If the change amount of the ambient light luminance data is greater than or equal to a predetermined change threshold, switch the output level of the signal port where the light sensor is connected to the processing chip.

9. The device according to any one of claims 6 to 8, characterized in that, The obtaining module includes: A determining sub-module, configured to determine the identifier of the light sensor according to the signal port when the output level is switched; A sending sub-module, configured to send a connection signal carrying the identifier to the light sensor through the processing chip; An establishing sub-module, configured to establish a data connection between the processing chip and the light sensor according to the connection signal and the identifier; An acquisition sub-module, configured to acquire the ambient light luminance data through the data connection.

10. The device according to any one of claims 6 to 8, characterized in that The determination module includes: A conversion sub-module, configured to convert, based on the voltage value corresponding to the changed ambient light luminance data, to obtain a corresponding ambient light luminance value.

11. An ambient light detection device, characterized in that, The apparatus at least includes: a processor and a memory for storing executable instructions that can run on the processor, wherein: When the processor is used to run the executable instructions, the executable instructions execute the steps in the ambient light detection method provided in any one of claims 1 to 5 above.

12. A non-transitory computer-readable storage medium, characterized in that, Computer executable instructions are stored in the computer-readable storage medium, and when the computer executable instructions are executed by the processor, the steps in the ambient light detection method provided in any one of claims 1 to 5 above are implemented.

Citation Information

Patent Citations

  • Method and device for mode switching

    IN201627005044A