CN115691416A - Ambient light collection method and device - Google Patents

Ambient light collection method and device Download PDF

Info

Publication number
CN115691416A
CN115691416A CN202211384430.9A CN202211384430A CN115691416A CN 115691416 A CN115691416 A CN 115691416A CN 202211384430 A CN202211384430 A CN 202211384430A CN 115691416 A CN115691416 A CN 115691416A
Authority
CN
China
Prior art keywords
screen
ambient light
pwm dimming
width
frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211384430.9A
Other languages
Chinese (zh)
Inventor
沈瑞超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202211384430.9A priority Critical patent/CN115691416A/en
Publication of CN115691416A publication Critical patent/CN115691416A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

本申请公开了一种环境光采集方法及装置,属于电子设备技术领域。环境光采集方法包括:接收环境光传感器发送的环境光采集请求;响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。

Figure 202211384430

The application discloses a method and a device for collecting ambient light, which belong to the technical field of electronic equipment. The ambient light collection method includes: receiving an ambient light collection request sent by an ambient light sensor; responding to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, The total length of the screen of the electronic device and the first time period during which the PWM dimming signal of the screen is transmitted from the first end of the screen to the second end determine the first frequency of the PWM dimming signal of the screen; wherein the target width is greater than that used for penetrating ambient light The second width of the light-transmitting hole; the PWM dimming signal of the target screen is sent at the first frequency and the second frequency, so that when the ambient light sensor collects ambient light, the width of the PWM dimming off interval is greater than the second width, wherein, the first The second frequency is the frequency of the original screen PWM dimming signal.

Figure 202211384430

Description

环境光采集方法及装置Ambient light collection method and device

技术领域technical field

本申请属于电子设备技术领域,具体涉及一种环境光采集方法及装置。The present application belongs to the technical field of electronic equipment, and in particular relates to a method and device for collecting ambient light.

背景技术Background technique

随着有机发光二极管(Organic Light-Emitting Diode,OLED)技术的不断提升,高频脉冲宽度调制(Pulse width modulation,PWM)调光技术已逐渐应用于各种电子设备(例如,手机、平板、电脑等)。高频PWM调光技术相比低频PWM调光技术可降低屏幕闪烁引起的用眼不适,提升用户体验。With the continuous improvement of Organic Light-Emitting Diode (OLED) technology, high-frequency pulse width modulation (Pulse width modulation, PWM) dimming technology has been gradually applied to various electronic devices (such as mobile phones, tablets, computers, etc.) wait). Compared with low-frequency PWM dimming technology, high-frequency PWM dimming technology can reduce eye discomfort caused by screen flicker and improve user experience.

相关技术中,在进行屏幕亮度调节时,需要利用设置在屏幕下且工作在PWM调光关闭区间的环境光传感器采集环境光。In the related art, when adjusting the brightness of the screen, it is necessary to use the ambient light sensor arranged under the screen and working in the off interval of PWM dimming to collect ambient light.

然而,在某些情况下,例如,利用高频PWM调光技术进行调光或屏幕亮度较高时,PWM调光关闭区间的宽度不足以覆盖屏幕背面遮光泡棉上用于环境光透过的透光孔的宽度,如图1所示,在图1中,①为PWM调光关闭区间,②为透光孔,这就使得环境光传感器在采集环境光时还会采集到屏幕发出的光,采集到的环境光不准确,进而影响环境光照度和色温等计算的准确性,影响屏幕亮度调节的准确性。However, in some cases, for example, when high-frequency PWM dimming technology is used for dimming or when the screen brightness is high, the width of the off-range of PWM dimming is not enough to cover the shading foam on the back of the screen for ambient light transmission. The width of the light transmission hole is shown in Figure 1. In Figure 1, ① is the PWM dimming off interval, and ② is the light transmission hole, which allows the ambient light sensor to collect the light emitted by the screen when collecting ambient light. , the ambient light collected is inaccurate, which in turn affects the accuracy of calculations such as ambient light intensity and color temperature, and affects the accuracy of screen brightness adjustment.

发明内容Contents of the invention

本申请实施例的目的是提供一种环境光采集方法及装置,能够解决环境光采集不准确的问题。The purpose of the embodiments of the present application is to provide a method and device for collecting ambient light, which can solve the problem of inaccurate collection of ambient light.

第一方面,本申请实施例提供了一种环境光采集方法,包括:In the first aspect, the embodiment of the present application provides a method for collecting ambient light, including:

接收环境光传感器发送的环境光采集请求;Receive the ambient light collection request sent by the ambient light sensor;

响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;In response to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, the total screen length of the electronic device, and the PWM dimming signal of the screen from the first The first duration of transmission from the terminal to the second terminal determines the first frequency of the PWM dimming signal of the screen; wherein, the target width is greater than the second width of the light-transmitting hole used to pass through the ambient light;

以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。Send the target screen PWM dimming signal at the first frequency and the second frequency, so that when the ambient light sensor collects ambient light, the width of the PWM dimming off interval is greater than the second width, wherein the second frequency is the original screen PWM dimming the frequency of the signal.

第二方面,本申请实施例提供了一种环境光采集装置,包括:In the second aspect, the embodiment of the present application provides an ambient light collection device, including:

接收模块,用于接收环境光传感器发送的环境光采集请求;The receiving module is configured to receive the ambient light collection request sent by the ambient light sensor;

第一确定模块,用于响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;The first determining module is configured to respond to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, the total length of the screen of the electronic device, and the PWM dimming of the screen. The first duration of the light signal being transmitted from the first end of the screen to the second end determines the first frequency of the PWM dimming signal of the screen; wherein, the target width is greater than the second width of the light-transmitting hole used to pass through the ambient light;

发射模块,用于以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。The transmitting module is configured to send a target screen PWM dimming signal at a first frequency and a second frequency, so that when the ambient light sensor collects ambient light, the width of the PWM dimming off interval is greater than the second width, wherein the second frequency is The frequency of the original screen PWM dimming signal.

第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In the third aspect, the embodiment of the present application provides an electronic device, including a processor and a memory, and the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the electronic device described in the first aspect is implemented. method steps.

第四方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

第五方面,本申请实施例提供了一种芯片,包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面所述的方法的步骤。In the fifth aspect, the embodiment of the present application provides a chip, including a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method described in the first aspect.

第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤。In a sixth aspect, an embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the method described in the first aspect.

在本申请实施例中,在接收到环境光传感器发送的环境光采集请求后,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;然后,以所确定的第一频率和原始屏幕PWM调光信号的第二频率发出目标屏幕PWM调光信号。使得环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于用于透过环境光的透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of the present application, after receiving the ambient light collection request sent by the ambient light sensor, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, and the electronic device's The total length of the screen and the first duration of the screen PWM dimming signal transmitted from the first end of the screen to the second end determine the first frequency of the screen PWM dimming signal; then, the determined first frequency and the original screen PWM dimming The second frequency of the signal sends out the target screen PWM dimming signal. When the ambient light sensor is collecting ambient light, the width of the PWM dimming off interval is greater than the width of the light transmission hole used to pass through the ambient light, and the width of the PWM dimming off interval can cover the width of the light transmission hole. When collecting ambient light, the light emitted by the screen will not be collected, which can ensure the accuracy of the collected ambient light, thereby improving the accuracy of calculations such as ambient light intensity and color temperature, and improving the accuracy of screen brightness adjustment.

附图说明Description of drawings

图1是相关技术中环境光采集时PWM调光关闭区间和透光孔的位置示意图;FIG. 1 is a schematic diagram of the PWM dimming off interval and the position of the light transmission hole when ambient light is collected in the related art;

图2是本申请实施例提供的环境光采集方法的流程示意图;FIG. 2 is a schematic flowchart of an ambient light collection method provided in an embodiment of the present application;

图3是本申请实施例提供的各个对象的宽度示意图;Fig. 3 is a schematic diagram of the width of each object provided by the embodiment of the present application;

图4是本申请实施例提供的发出目标屏幕PWM调光信号的第一种示意图;Fig. 4 is a first schematic diagram of sending a target screen PWM dimming signal provided by an embodiment of the present application;

图5是本申请实施例提供的发出目标屏幕PWM调光信号的第二种示意图;Fig. 5 is a second schematic diagram of sending a target screen PWM dimming signal provided by an embodiment of the present application;

图6是本申请实施例提供的环境光采集装置的结构示意图;6 is a schematic structural diagram of an ambient light collection device provided in an embodiment of the present application;

图7是本申请实施例提供的电子设备的结构示意图;FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

图8是实现本申请实施例的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的环境光采集方法及装置进行详细地说明。The method and device for collecting ambient light provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

图2是本申请实施例提供的环境光采集方法的流程示意图。如图2所示,环境光采集方法可以包括:FIG. 2 is a schematic flowchart of an ambient light collection method provided in an embodiment of the present application. As shown in Figure 2, ambient light collection methods can include:

S201:接收环境光传感器发送的环境光采集请求;S201: Receive an ambient light collection request sent by an ambient light sensor;

S202:响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;S202: In response to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, the total length of the screen of the electronic device, and the PWM dimming signal of the screen from the screen The first duration of transmission from the first end to the second end determines the first frequency of the PWM dimming signal of the screen; wherein, the target width is greater than the second width of the light-transmitting hole for passing ambient light;

S203:以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。S203: Send the target screen PWM dimming signal with the first frequency and the second frequency, so that when the ambient light sensor collects ambient light, the width of the PWM dimming off interval is greater than the second width, wherein the second frequency is the original screen PWM The frequency of the dimming signal.

上述各步骤的具体实现方式将在下文中进行详细描述。The specific implementation of the above steps will be described in detail below.

在本申请实施例中,在接收到环境光传感器发送的环境光采集请求后,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;然后,以所确定的第一频率和原始屏幕PWM调光信号的第二频率发出目标屏幕PWM调光信号。使得环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于用于透过环境光的透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of the present application, after receiving the ambient light collection request sent by the ambient light sensor, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, and the electronic device's The total length of the screen and the first duration of the screen PWM dimming signal transmitted from the first end of the screen to the second end determine the first frequency of the screen PWM dimming signal; then, the determined first frequency and the original screen PWM dimming The second frequency of the signal sends out the target screen PWM dimming signal. When the ambient light sensor is collecting ambient light, the width of the PWM dimming off interval is greater than the width of the light transmission hole used to pass through the ambient light, and the width of the PWM dimming off interval can cover the width of the light transmission hole. When collecting ambient light, the light emitted by the screen will not be collected, which can ensure the accuracy of the collected ambient light, thereby improving the accuracy of calculations such as ambient light intensity and color temperature, and improving the accuracy of screen brightness adjustment.

在本申请实施例的一些可能实现中,本申请实施例中的第一端和第二端可以分别指屏幕的顶端和底端,其中,屏幕的顶端和底端分别为屏幕的上边缘和下边缘。In some possible implementations of the embodiments of the present application, the first end and the second end in the embodiments of the present application may refer to the top and bottom of the screen, respectively, where the top and bottom of the screen are the upper and lower edges of the screen, respectively. edge.

在本申请实施例的一些可能实现中,环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的宽度、透光孔的宽度、屏幕总长度和透光孔到屏幕的顶端的距离等各个对象的宽度如图3所示。In some possible implementations of the embodiments of the present application, the target width of the corresponding PWM dimming off interval, the width of the PWM dimming on interval, the width of the light transmission hole, the total length of the screen, and the distance from the light transmission hole to the screen when collecting ambient light The width of each object such as the distance from the top is shown in Figure 3.

其中,在图3中,W1为环境光采集时对应的PWM调光关闭区间的目标宽度,W2为透光孔的宽度、W3为PWM调光开启区间的宽度、W4为屏幕总长度、W0为透光孔到屏幕的顶端的距离。Among them, in Fig. 3, W 1 is the target width of the PWM dimming off interval corresponding to ambient light collection, W 2 is the width of the light transmission hole, W 3 is the width of the PWM dimming on interval, W 4 is the total screen width. Length, W 0 is the distance from the light transmission hole to the top of the screen.

屏幕PWM调光信号的传输速度为W4/T4,其中,T4为屏幕PWM调光信号从屏幕的顶端传输到底端的第一时长。The transmission speed of the PWM dimming signal of the screen is W 4 /T 4 , where T 4 is the first duration of transmission of the PWM dimming signal of the screen from the top to the bottom of the screen.

屏幕PWM调光信号传输W1所使用的时间

Figure BDA0003930105470000051
The time used by the screen PWM dimming signal to transmit W 1
Figure BDA0003930105470000051

屏幕PWM调光信号传输W3所使用的时间

Figure BDA0003930105470000052
The time used by the screen PWM dimming signal to transmit W 3
Figure BDA0003930105470000052

则屏幕PWM调光信号的第一频率:Then the first frequency of the screen PWM dimming signal:

Figure BDA0003930105470000053
Figure BDA0003930105470000053

还可以理解的是,屏幕PWM调光信号传输到W1+W3所使用的时间为(W1+W3)×T4/W4,则屏幕PWM调光信号的第一频率

Figure BDA0003930105470000054
It can also be understood that the time taken for the screen PWM dimming signal to be transmitted to W 1 +W 3 is (W 1 +W 3 )×T 4 /W 4 , then the first frequency of the screen PWM dimming signal
Figure BDA0003930105470000054

因此,可以根据如下公式(1)计算屏幕PWM调光信号的第一频率F:Therefore, the first frequency F of the PWM dimming signal of the screen can be calculated according to the following formula (1):

Figure BDA0003930105470000061
Figure BDA0003930105470000061

当目标屏幕PWM调光信号的传输范围为整个屏幕时,发出目标屏幕PWM调光信号如图4所示,图4是本申请实施例提供的发出目标屏幕PWM调光信号的第一种示意图。When the transmission range of the PWM dimming signal of the target screen is the entire screen, sending the PWM dimming signal of the target screen is shown in FIG. 4 .

可以理解的是,在本实施例中,目标屏幕PWM调光信号包括两个频率(上述第一频率和第二频率),即目标屏幕PWM调光信号为混频PWM调光信号。It can be understood that, in this embodiment, the target screen PWM dimming signal includes two frequencies (the above-mentioned first frequency and the second frequency), that is, the target screen PWM dimming signal is a mixed-frequency PWM dimming signal.

在本申请实施例中,一方面,能够保证在环境光采集时,PWM调光关闭区间的宽度大于透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性。另一方面,在未进行环境光采集时,能够保证高频PWM调光,降低屏幕闪烁引起的用眼不适。In the embodiment of the present application, on the one hand, it can be ensured that when ambient light is collected, the width of the PWM dimming off interval is greater than the width of the light transmission hole, the width of the PWM dimming off interval can cover the width of the light transmission hole, and the ambient light sensor When collecting ambient light, the light emitted by the screen will not be collected, which can ensure the accuracy of the collected ambient light. On the other hand, when ambient light collection is not performed, high-frequency PWM dimming can be guaranteed to reduce eye discomfort caused by screen flicker.

在本申请实施例的一些可能实现中,屏幕可以包括第一区域和第二区域,其中,第一区域包括与透光孔相对的区域,第二区域为除第一区域之外的区域;目标屏幕PWM调光信号包括第一屏幕PWM调光信号和原始屏幕PWM调光信号;S203可以包括:在第一区域中,以第一频率发出第一屏幕PWM调光信号;在第二区域中,以第二频率发出原始屏幕PWM调光信号。In some possible implementations of the embodiments of the present application, the screen may include a first area and a second area, wherein the first area includes an area opposite to the light transmission hole, and the second area is an area other than the first area; the target The screen PWM dimming signal includes a first screen PWM dimming signal and an original screen PWM dimming signal; S203 may include: in the first area, sending the first screen PWM dimming signal at a first frequency; in the second area, Send out the original screen PWM dimming signal with the second frequency.

发出目标屏幕PWM调光信号如图5所示,图5是本申请实施例提供的发出目标屏幕PWM调光信号的第二种示意图。Sending the PWM dimming signal of the target screen is shown in FIG. 5 , which is a second schematic diagram of sending the PWM dimming signal of the target screen provided by the embodiment of the present application.

在图5中,屏幕包括区域1和区域2,第一屏幕PWM调光信号仅在区域1中以第一频率传输,原始屏幕PWM调光信号仅在区域2中以原始屏幕PWM调光信号的频率传输。In Fig. 5, the screen includes area 1 and area 2, the first screen PWM dimming signal is only transmitted in area 1 with the first frequency, and the original screen PWM dimming signal is only transmitted in area 2 with the frequency of the original screen PWM dimming signal frequency transmission.

在本申请实施例中,由于第一屏幕PWM调光信号仅在屏幕包括的与透光孔相对的区域中传输,原始屏幕PWM调光信号仅在屏幕包括的另一个区域中传输,一方面,能够保证在环境光采集时,PWM调光关闭区间的宽度大于透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性。另一方面,在环境光采集时,不会影响其他区域的屏幕PWM调光信号的频率,使得其他区域还能够保证高频PWM调光,降低屏幕闪烁引起的用眼不适。In the embodiment of the present application, since the first screen PWM dimming signal is only transmitted in the area of the screen opposite to the light transmission hole, the original screen PWM dimming signal is only transmitted in another area of the screen. On the one hand, It can ensure that when ambient light is collected, the width of the PWM dimming off interval is greater than the width of the light transmission hole, and the width of the PWM dimming off interval can cover the width of the light transmission hole. The ambient light sensor will not collect the screen when collecting ambient light The emitted light can ensure the accuracy of the collected ambient light. On the other hand, when ambient light is collected, the frequency of the PWM dimming signal of the screen in other areas will not be affected, so that other areas can also ensure high-frequency PWM dimming and reduce eye discomfort caused by screen flicker.

在本申请实施例的一些可能实现中,本申请实施例提供的环境光采集方法还可以包括:根据下述公式(2)计算环境光传感器采集环境光的第二时长T2In some possible implementations of the embodiments of the present application, the ambient light collection method provided in the embodiments of the present application may further include: calculating the second duration T 2 for the ambient light sensor to collect ambient light according to the following formula (2):

T2=W1×T4/W4-W2×T4/W4 (2)T 2 =W 1 ×T 4 /W 4 -W 2 ×T 4 /W 4 (2)

在本申请实施例的一些可能实现中,本申请实施例提供的环境光采集方法还可以包括:根据基于下述公式(3)计算环境光传感器采集环境光的开始时间T0In some possible implementations of the embodiments of the present application, the ambient light collection method provided in the embodiments of the present application may further include: calculating the start time T 0 of collecting ambient light by the ambient light sensor based on the following formula (3):

T0=(W0+W2)×T4/W4 (3)T 0 =(W 0 +W 2 )×T 4 /W 4 (3)

可以理解的是,当环境光传感器发送的环境光采集请求后,屏幕PWM调光信号到达透光孔且PWM调光关闭区间的宽度完全覆盖透光孔的宽度需要一定的时间,因此,需要在PWM调光关闭区间的宽度完全覆盖透光孔的宽度时采集环境光。It can be understood that after the ambient light collection request sent by the ambient light sensor, it will take a certain amount of time for the PWM dimming signal of the screen to reach the light transmission hole and the width of the PWM dimming off interval to completely cover the width of the light transmission hole. Ambient light is collected when the width of the PWM dimming off interval completely covers the width of the light transmission hole.

目标屏幕PWM调光信号传输到透光孔时所使用的时间

Figure BDA0003930105470000071
目标屏幕PWM调光信号传输透光孔W2所使用的时间
Figure BDA0003930105470000072
则环境光传感器采集环境光的开始时间T0=t2+t1=W0×T4/W4+W2×T4/W4=(W0+W2)×T4/W4。The time used when the PWM dimming signal of the target screen is transmitted to the light transmission hole
Figure BDA0003930105470000071
The time it takes for the PWM dimming signal of the target screen to transmit the light transmission hole W 2
Figure BDA0003930105470000072
Then the start time of ambient light sensor collecting ambient light T 0 =t 2 +t 1 =W 0 ×T 4 /W 4 +W 2 ×T 4 /W 4 =(W 0 +W 2 )×T 4 /W 4 .

还可以理解的是,目标屏幕PWM调光信号传输到过透光孔的距离为W0+W2,目标屏幕PWM调光信号传输W0+W2所使用的时间即为环境光传感器采集环境光的开始时间T0=(W0+W2)×T4/W4It can also be understood that the distance from the PWM dimming signal of the target screen to the light transmission hole is W 0 +W 2 , and the time taken for the PWM dimming signal of the target screen to transmit W 0 +W 2 is the ambient light sensor acquisition environment Light start time T 0 =(W 0 +W 2 )×T 4 /W 4 .

在本申请实施例中,能够保证PWM调光关闭区间的宽度完全覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of this application, it can ensure that the width of the PWM dimming off interval completely covers the width of the light transmission hole, and the ambient light sensor will not collect the light emitted by the screen when collecting ambient light, which can ensure the accuracy of the collected ambient light. In turn, it can improve the accuracy of calculations such as ambient light intensity and color temperature, and improve the accuracy of screen brightness adjustment.

需要说明的是,本申请实施例提供的环境光采集方法,执行主体可以为环境光采集装置。本申请实施例中以环境光采集装置执行环境光采集方法为例,说明本申请实施例提供的环境光采集装置。It should be noted that, the ambient light collection method provided in the embodiment of the present application may be executed by an ambient light collection device. In the embodiment of the present application, the ambient light collection method performed by the ambient light collection device is taken as an example to describe the ambient light collection device provided in the embodiment of the present application.

图6是本申请实施例提供的环境光采集装置的结构示意图。如图6所示,环境光采集装置600可以包括:FIG. 6 is a schematic structural diagram of an ambient light collection device provided in an embodiment of the present application. As shown in FIG. 6, the ambient light collection device 600 may include:

接收模块601,用于接收环境光传感器发送的环境光采集请求;The receiving module 601 is configured to receive the ambient light collection request sent by the ambient light sensor;

第一确定模块602,用于响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;The first determination module 602 is configured to respond to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, the total screen length of the electronic device, and the screen PWM The first duration of the dimming signal transmitted from the first end of the screen to the second end determines the first frequency of the PWM dimming signal of the screen; wherein, the target width is greater than the second width of the light-transmitting hole for passing ambient light;

发射模块603,用于以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。The transmitting module 603 is configured to send a target screen PWM dimming signal at a first frequency and a second frequency, so that when the ambient light sensor collects ambient light, the width of the PWM dimming off interval is greater than the second width, wherein the second frequency The frequency of the PWM dimming signal for the original screen.

在本申请实施例中,在接收到环境光传感器发送的环境光采集请求后,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;然后,以所确定的第一频率和原始屏幕PWM调光信号的第二频率发出目标屏幕PWM调光信号。使得环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于用于透过环境光的透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of the present application, after receiving the ambient light collection request sent by the ambient light sensor, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, and the electronic device's The total length of the screen and the first duration of the screen PWM dimming signal transmitted from the first end of the screen to the second end determine the first frequency of the screen PWM dimming signal; then, the determined first frequency and the original screen PWM dimming The second frequency of the signal sends out the target screen PWM dimming signal. When the ambient light sensor is collecting ambient light, the width of the PWM dimming off interval is greater than the width of the light transmission hole used to pass through the ambient light, and the width of the PWM dimming off interval can cover the width of the light transmission hole. When collecting ambient light, the light emitted by the screen will not be collected, which can ensure the accuracy of the collected ambient light, thereby improving the accuracy of calculations such as ambient light intensity and color temperature, and improving the accuracy of screen brightness adjustment.

在本申请实施例的一些可能实现中,屏幕包括第一区域和第二区域,其中,第一区域包括与透光孔相对的区域,第二区域为除第一区域之外的区域;目标屏幕PWM调光信号包括第一屏幕PWM调光信号和原始屏幕PWM调光信号;In some possible implementations of the embodiments of the present application, the screen includes a first area and a second area, wherein the first area includes an area opposite to the light transmission hole, and the second area is an area other than the first area; the target screen The PWM dimming signal includes the first screen PWM dimming signal and the original screen PWM dimming signal;

发射模块603可以包括:The transmitting module 603 may include:

第一发出子模块,用于在第一区域中,以第一频率发出第一屏幕PWM调光信号;The first sending sub-module is configured to send a first screen PWM dimming signal at a first frequency in the first area;

第二发出子模块,用于在第二区域中,以第二频率发出原始屏幕PWM调光信号。The second sending sub-module is used to send out the original screen PWM dimming signal at the second frequency in the second area.

在本申请实施例中,由于第一屏幕PWM调光信号仅在屏幕包括的与透光孔相对的区域中传输,原始屏幕PWM调光信号仅在屏幕包括的另一个区域中传输,一方面,能够保证在环境光采集时,PWM调光关闭区间的宽度大于透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性。另一方面,在环境光采集时,不会影响其他区域的屏幕PWM调光信号的频率,使得其他区域还能够保证高频PWM调光,降低屏幕闪烁引起的用眼不适。In the embodiment of the present application, since the first screen PWM dimming signal is only transmitted in the area of the screen opposite to the light transmission hole, the original screen PWM dimming signal is only transmitted in another area of the screen. On the one hand, It can ensure that when ambient light is collected, the width of the PWM dimming off interval is greater than the width of the light transmission hole, and the width of the PWM dimming off interval can cover the width of the light transmission hole. The ambient light sensor will not collect the screen when collecting ambient light The emitted light can ensure the accuracy of the collected ambient light. On the other hand, when ambient light is collected, the frequency of the PWM dimming signal of the screen in other areas will not be affected, so that other areas can also ensure high-frequency PWM dimming and reduce eye discomfort caused by screen flicker.

在本申请实施例的一些可能实现中,第一确定模块具体可以用于:In some possible implementations of the embodiments of this application, the first determination module may be specifically configured to:

根据上述公式(1)计算屏幕PWM调光信号的第一频率。The first frequency of the PWM dimming signal of the screen is calculated according to the above formula (1).

在本申请实施例的一些可能实现中,环境光采集装置600还可以包括:In some possible implementations of the embodiments of the present application, the ambient light collection device 600 may further include:

第二确定模块,用于根据上述公式(2)计算环境光传感器采集环境光的第二时长。The second determining module is configured to calculate the second duration for the ambient light sensor to collect ambient light according to the above formula (2).

在本申请实施例的一些可能实现中,环境光采集装置600还可以包括:In some possible implementations of the embodiments of the present application, the ambient light collection device 600 may further include:

第三确定模块,用于根据上述公式(3)计算环境光传感器采集环境光的开始时间。The third determining module is configured to calculate the start time of collecting ambient light by the ambient light sensor according to the above formula (3).

在本申请实施例中,能够保证PWM调光关闭区间的宽度完全覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of this application, it can ensure that the width of the PWM dimming off interval completely covers the width of the light transmission hole, and the ambient light sensor will not collect the light emitted by the screen when collecting ambient light, which can ensure the accuracy of the collected ambient light. In turn, it can improve the accuracy of calculations such as ambient light intensity and color temperature, and improve the accuracy of screen brightness adjustment.

本申请实施例中的环境光采集装置可以是电子设备,也可以是电子设备中的部件,例如集成电路、或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The ambient light collection device in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR ) equipment, robots, wearable devices, ultra-mobile personal computer (ultra-mobilepersonal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc. ), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which are not specifically limited in this embodiment of the present application.

本申请实施例中的环境光采集装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The ambient light collection device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.

本申请实施例提供的环境光采集装置能够实现图2至图5的环境光采集方法实施例中的各个过程,为避免重复,这里不再赘述。The ambient light collection device provided in the embodiment of the present application can realize each process in the embodiments of the ambient light collection method shown in FIG. 2 to FIG. 5 , and details are not repeated here to avoid repetition.

可选的,如图7所示,本申请实施例还提供一种电子设备700,包括处理器701和存储器702,存储器702存储有可在处理器701上运行的程序或指令,该程序或指令被处理器701执行时实现上述环境光采集方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 7 , the embodiment of the present application also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores programs or instructions that can run on the processor 701. The program or instructions When executed by the processor 701, each step of the above ambient light collection method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.

在本申请实施例的一些可能实现中,处理器701可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。In some possible implementations of the embodiments of the present application, the processor 701 may include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more of the embodiments of the present application. an integrated circuit.

在本申请实施例的一些可能实现中,存储器702可以包括只读存储器(Read-OnlyMemory,ROM),随机存取存储器(Random Access Memory,RAM),磁盘存储介质设备,光存储介质设备,闪存设备,电气、光学或其他物理/有形的存储器存储设备。因此,通常,存储器702包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本申请实施例的环境光采集方法所描述的操作。In some possible implementations of the embodiments of the present application, the memory 702 may include a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a disk storage medium device, an optical storage medium device, a flash memory device , electrical, optical, or other physical/tangible memory storage devices. Thus, in general, memory 702 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions, and when the software is executed (e.g., by a or a plurality of processors), it is operable to perform the operations described with reference to the ambient light collection method according to the embodiments of the present application.

图8是实现本申请实施例的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809、以及处理器810等部件。The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810, etc. part.

本领域技术人员可以理解,电子设备800还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器810逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图8中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 800 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 810 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 8 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .

其中,处理器810用于:接收环境光传感器发送的环境光采集请求;响应于环境光采集请求,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备800的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;其中,目标宽度大于用于透过环境光的透光孔的第二宽度;以第一频率和第二频率发出目标屏幕PWM调光信号,以使环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于第二宽度,其中,第二频率为原始屏幕PWM调光信号的频率。Wherein, the processor 810 is used to: receive the ambient light collection request sent by the ambient light sensor; respond to the ambient light collection request, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first PWM dimming on interval Width, the total length of the screen of the electronic device 800 and the first duration of the screen PWM dimming signal transmitted from the first end to the second end of the screen determine the first frequency of the screen PWM dimming signal; The second width of the light-transmitting hole of the ambient light; the PWM dimming signal of the target screen is sent at the first frequency and the second frequency, so that when the ambient light sensor collects the ambient light, the width of the PWM dimming off interval is greater than the second width, Wherein, the second frequency is the frequency of the original screen PWM dimming signal.

在本申请实施例中,在接收到环境光传感器发送的环境光采集请求后,根据环境光采集时对应的PWM调光关闭区间的目标宽度、PWM调光开启区间的第一宽度、电子设备的屏幕总长度和屏幕PWM调光信号从屏幕的第一端传输到第二端的第一时长,确定屏幕PWM调光信号的第一频率;然后,以所确定的第一频率和原始屏幕PWM调光信号的第二频率发出目标屏幕PWM调光信号。使得环境光传感器在采集环境光时,PWM调光关闭区间的宽度大于用于透过环境光的透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of the present application, after receiving the ambient light collection request sent by the ambient light sensor, according to the target width of the PWM dimming off interval corresponding to the ambient light collection, the first width of the PWM dimming on interval, and the electronic device's The total length of the screen and the first duration of the screen PWM dimming signal transmitted from the first end of the screen to the second end determine the first frequency of the screen PWM dimming signal; then, the determined first frequency and the original screen PWM dimming The second frequency of the signal sends out the target screen PWM dimming signal. When the ambient light sensor is collecting ambient light, the width of the PWM dimming off interval is greater than the width of the light transmission hole used to pass through the ambient light, and the width of the PWM dimming off interval can cover the width of the light transmission hole. When collecting ambient light, the light emitted by the screen will not be collected, which can ensure the accuracy of the collected ambient light, thereby improving the accuracy of calculations such as ambient light intensity and color temperature, and improving the accuracy of screen brightness adjustment.

在本申请实施例的一些可能实现中,屏幕包括第一区域和第二区域,其中,第一区域包括与透光孔相对的区域,第二区域为除第一区域之外的区域;目标屏幕PWM调光信号包括第一屏幕PWM调光信号和原始屏幕PWM调光信号;处理器810具体可以用于:In some possible implementations of the embodiments of the present application, the screen includes a first area and a second area, wherein the first area includes an area opposite to the light transmission hole, and the second area is an area other than the first area; the target screen The PWM dimming signal includes the first screen PWM dimming signal and the original screen PWM dimming signal; the processor 810 can be specifically used for:

在第一区域中,以第一频率发出第一屏幕PWM调光信号;In the first area, sending a first screen PWM dimming signal with a first frequency;

在第二区域中,以第二频率发出原始屏幕PWM调光信号。In the second area, the original screen PWM dimming signal is sent out at the second frequency.

在本申请实施例中,由于第一屏幕PWM调光信号仅在屏幕包括的与透光孔相对的区域中传输,原始屏幕PWM调光信号仅在屏幕包括的另一个区域中传输,一方面,能够保证在环境光采集时,PWM调光关闭区间的宽度大于透光孔的宽度,PWM调光关闭区间的宽度能够覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性。另一方面,在环境光采集时,不会影响其他区域的屏幕PWM调光信号的频率,使得其他区域还能够保证高频PWM调光,降低屏幕闪烁引起的用眼不适。In the embodiment of the present application, since the first screen PWM dimming signal is only transmitted in the area of the screen opposite to the light transmission hole, the original screen PWM dimming signal is only transmitted in another area of the screen. On the one hand, It can ensure that when ambient light is collected, the width of the PWM dimming off interval is greater than the width of the light transmission hole, and the width of the PWM dimming off interval can cover the width of the light transmission hole. The ambient light sensor will not collect the screen when collecting ambient light The emitted light can ensure the accuracy of the collected ambient light. On the other hand, when ambient light is collected, the frequency of the PWM dimming signal of the screen in other areas will not be affected, so that other areas can also ensure high-frequency PWM dimming and reduce eye discomfort caused by screen flicker.

在本申请实施例的一些可能实现中,处理器810具体可以用于:In some possible implementations of the embodiments of this application, the processor 810 may be specifically configured to:

根据上述公式(1)计算屏幕PWM调光信号的第一频率。The first frequency of the PWM dimming signal of the screen is calculated according to the above formula (1).

在本申请实施例的一些可能实现中,处理器810还可以用于:In some possible implementations of the embodiments of this application, the processor 810 may also be used to:

根据上述公式(2)计算环境光传感器采集环境光的第二时长。The second time period for the ambient light sensor to collect ambient light is calculated according to the above formula (2).

在本申请实施例的一些可能实现中,处理器810还可以用于:In some possible implementations of the embodiments of this application, the processor 810 may also be used to:

根据上述公式(3)计算环境光传感器采集环境光的开始时间。The start time of collecting ambient light by the ambient light sensor is calculated according to the above formula (3).

在本申请实施例中,能够保证PWM调光关闭区间的宽度完全覆盖透光孔的宽度,环境光传感器在采集环境光时不会采集到屏幕发出的光,能够保证采集到的环境光的准确性,进而能够提高环境光照度和色温等计算的准确性,提高屏幕亮度调节的准确性。In the embodiment of this application, it can ensure that the width of the PWM dimming off interval completely covers the width of the light transmission hole, and the ambient light sensor will not collect the light emitted by the screen when collecting ambient light, which can ensure the accuracy of the collected ambient light. In turn, it can improve the accuracy of calculations such as ambient light intensity and color temperature, and improve the accuracy of screen brightness adjustment.

应理解的是,本申请实施例中,输入单元804可以包括图形处理器(GraphicsProcessing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元806可包括显示面板8061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板8061。用户输入单元807包括触控面板8071以及其他输入设备8072中的至少一种。触控面板8071,也称为触摸屏。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that, in the embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 is compatible with the image capture device (such as Camera) to process the image data of still pictures or videos. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072 . The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts, a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.

存储器809可用于存储软件程序以及各种数据。存储器809可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器809可以包括易失性存储器或非易失性存储器,或者,存储器809可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器809包括但不限于这些和任意其它适合类型的存储器。The memory 809 can be used to store software programs as well as various data. The memory 809 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required by at least one function (such as a sound playing function, image playback function, etc.), etc. Furthermore, memory 809 may include volatile memory or nonvolatile memory, or, memory 809 may include both volatile and nonvolatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synch link DRAM , SLDRAM) and Direct Memory Bus Random Access Memory (Direct Rambus RAM, DRRAM). The memory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

处理器810可包括一个或多个处理单元;可选的,处理器810集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。The processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the foregoing modem processor may not be integrated into the processor 810 .

本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述环境光采集方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of the above-mentioned embodiment of the ambient light collection method can be achieved, and can achieve the same Technical effects, in order to avoid repetition, will not be repeated here.

其中,处理器为上述实施例中的电子设备中的处理器。可读存储介质包括计算机可读存储介质,计算机可读存储介质的示例包括非暂态计算机可读存储介质,如ROM、RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device in the foregoing embodiments. The readable storage medium includes a computer-readable storage medium, and examples of the computer-readable storage medium include non-transitory computer-readable storage media, such as ROM, RAM, magnetic disks, or optical disks.

本申请实施例还提供了一种芯片,包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述环境光采集方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a chip, including a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to realize the various processes of the above-mentioned ambient light collection method embodiments, and can achieve the same Technical effects, in order to avoid repetition, will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.

本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述环境光采集方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above-mentioned embodiment of the ambient light collection method, and can achieve the same technology Effect, in order to avoid repetition, will not repeat them here.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the essence of the technical solution of this application or the part that contributes to related technologies can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (10)

1. An ambient light collection method, the method comprising:
receiving an ambient light acquisition request sent by an ambient light sensor;
responding to the ambient light acquisition request, and determining a first frequency of a screen PWM dimming signal according to a target width of a PWM dimming off interval, a first width of a PWM dimming on interval, a total screen length of the electronic equipment and a first duration of transmission of the screen PWM dimming signal from a first end to a second end of the screen corresponding to the ambient light acquisition; wherein the target width is greater than a second width of a light transmission hole for transmitting ambient light;
and sending a target screen PWM dimming signal by using the first frequency and the second frequency so that the width of a PWM dimming off interval is greater than the second width when an ambient light sensor collects ambient light, wherein the second frequency is the frequency of an original screen PWM dimming signal.
2. The method of claim 1, wherein the screen comprises a first area and a second area, wherein the first area comprises an area opposite to the light-transmissive hole, and the second area is an area other than the first area; the target screen PWM dimming signal comprises a first screen PWM dimming signal and the original screen PWM dimming signal;
the sending out the target screen PWM dimming signal at the first frequency and the second frequency comprises:
in the first region, emitting the first screen PWM dimming signal at the first frequency;
in the second region, the original screen PWM dimming signal is emitted at the second frequency.
3. The method of claim 1, wherein determining the first frequency of the screen PWM dimming signal according to the target width of the PWM dimming off interval, the first width of the PWM dimming on interval, the total screen length of the electronic device, and the first duration of the screen PWM dimming signal transmitted from the first end to the second end of the screen when the ambient light is collected comprises:
calculating the first frequency according to the following formula:
Figure FDA0003930105460000011
wherein F is the first frequency, W 1 Is the target width, W 3 Is the first width, W 4 Is the total length of the screen, T 4 Is the first duration.
4. The method of claim 1, further comprising:
calculating a second time period for the ambient light sensor to collect the ambient light according to the following formula:
T 2 =W 1 ×T 4 /W 4 -W 2 ×T 4 /W 4
wherein, T 2 Is the second duration, W 1 Is the target width, W 2 Is the second width, W 4 Is the total length of the screen, T 4 Is the first duration.
5. The method of claim 1, further comprising:
calculating a start time for the ambient light sensor to collect the ambient light according to the following formula:
T 0 =(W 0 +W 2 )×T 4 /W 4
wherein, T 0 Is the start time, W 0 Is the first distance, W 2 Is the second width, W 4 Is the total length of the screen, T 4 Is the first duration.
6. An ambient light collection device, the device comprising:
the receiving module is used for receiving an ambient light acquisition request sent by an ambient light sensor;
the first determining module is used for responding to the ambient light acquisition request, and determining a first frequency of a screen PWM dimming signal according to a target width of a PWM dimming off interval, a first width of a PWM dimming on interval, a total screen length of the electronic equipment and a first duration of transmission of the screen PWM dimming signal from a first end to a second end of the screen corresponding to the ambient light acquisition; wherein the target width is greater than a second width of a light-transmitting aperture for transmitting ambient light;
and the transmitting module is used for transmitting a target screen PWM dimming signal at the first frequency and the second frequency so that the width of a PWM dimming off interval is greater than the second width when the ambient light sensor collects ambient light, wherein the second frequency is the frequency of an original screen PWM dimming signal.
7. The apparatus of claim 6, wherein the screen comprises a first area and a second area, wherein the first area comprises an area opposite to the light-transmissive hole, and the second area is an area other than the first area; the target screen PWM dimming signal comprises a first screen PWM dimming signal and the original screen PWM dimming signal;
the transmission module includes:
the first sending submodule is used for sending the first screen PWM dimming signal at the first frequency in the first area;
a second emitting submodule for emitting the original screen PWM dimming signal at the second frequency in the second region.
8. The apparatus of claim 6, wherein the first determining module is specifically configured to:
calculating the first frequency according to the following formula:
Figure FDA0003930105460000031
wherein F is the first frequency, W 1 Is the target width, W 3 Is the first width, W 4 Is the total length of the screen, T 4 Is the first duration.
9. The apparatus of claim 6, further comprising:
a second determining module, configured to calculate a second time period for the ambient light sensor to collect the ambient light according to the following formula:
T 2 =W 1 ×T 4 /W 4 -W 2 ×T 4 /W 4
wherein, T 2 Is the second duration, W 1 Is the target width, W 2 Is the second width, W 4 Is the total length of the screen, T 4 Is the first duration.
10. The apparatus of claim 6, further comprising:
a third determining module, configured to calculate a starting time for the ambient light sensor to collect the ambient light according to the following formula:
T 0 =(W 0 +W 2 )×T 4 /W 4
wherein, T 0 Is the start time, W 0 Is the first distance, W 2 Is the second width, W 4 Is the total length of the screen, T 4 Is the first duration.
CN202211384430.9A 2022-11-07 2022-11-07 Ambient light collection method and device Pending CN115691416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211384430.9A CN115691416A (en) 2022-11-07 2022-11-07 Ambient light collection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211384430.9A CN115691416A (en) 2022-11-07 2022-11-07 Ambient light collection method and device

Publications (1)

Publication Number Publication Date
CN115691416A true CN115691416A (en) 2023-02-03

Family

ID=85050908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211384430.9A Pending CN115691416A (en) 2022-11-07 2022-11-07 Ambient light collection method and device

Country Status (1)

Country Link
CN (1) CN115691416A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090167676A1 (en) * 2007-12-26 2009-07-02 Tpo Displays Corp. Display devices with ambient light sensing
CN112242119A (en) * 2019-07-16 2021-01-19 北京小米移动软件有限公司 Terminal, display parameter control method and device, and storage medium
CN113096614A (en) * 2021-04-15 2021-07-09 展讯通信(上海)有限公司 Method and device for determining brightness of light-sensitive environment under screen and terminal equipment
CN113889055A (en) * 2021-09-30 2022-01-04 荣耀终端有限公司 Screen brightness adjusting method, electronic equipment and storage medium
CN114613317A (en) * 2022-02-18 2022-06-10 深圳市汇顶科技股份有限公司 Method for calculating ambient light intensity of electronic equipment, related electronic equipment and chip
CN115130062A (en) * 2022-06-30 2022-09-30 青岛海信移动通信技术股份有限公司 A light sensor data processing method, device, terminal equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090167676A1 (en) * 2007-12-26 2009-07-02 Tpo Displays Corp. Display devices with ambient light sensing
CN112242119A (en) * 2019-07-16 2021-01-19 北京小米移动软件有限公司 Terminal, display parameter control method and device, and storage medium
CN113096614A (en) * 2021-04-15 2021-07-09 展讯通信(上海)有限公司 Method and device for determining brightness of light-sensitive environment under screen and terminal equipment
CN113889055A (en) * 2021-09-30 2022-01-04 荣耀终端有限公司 Screen brightness adjusting method, electronic equipment and storage medium
CN114613317A (en) * 2022-02-18 2022-06-10 深圳市汇顶科技股份有限公司 Method for calculating ambient light intensity of electronic equipment, related electronic equipment and chip
CN115130062A (en) * 2022-06-30 2022-09-30 青岛海信移动通信技术股份有限公司 A light sensor data processing method, device, terminal equipment and medium

Similar Documents

Publication Publication Date Title
CN111782102B (en) Window display method and related device
CN108762954B (en) Object sharing method and mobile terminal
US10033920B2 (en) Method for controlling cameras, non-transitory storage medium and terminal
KR102476976B1 (en) Image processing method and flexible screen terminal
WO2021135601A1 (en) Auxiliary photographing method and apparatus, terminal device, and storage medium
CN107943390B (en) Character copying method and mobile terminal
AU2017440899B2 (en) Photographing method and terminal
CN105187930A (en) Video live broadcasting-based interaction method and device
WO2018205847A1 (en) Fingerprint collection method and relevant product
CN108984066B (en) Application icon display method and mobile terminal
CN108307106B (en) Image processing method and device and mobile terminal
CN107193451B (en) Information display method and device, computer equipment and computer readable storage medium
CN109753202B (en) Screen capturing method and mobile terminal
TW201512865A (en) Method for searching web page digital data, device and system thereof
CN112162684A (en) Parameter adjusting method and device and electronic equipment
US20240080572A1 (en) Photographing method and apparatus, and electronic device
CN105635553B (en) Image shooting method and device
CN108121486A (en) A kind of image display method and mobile terminal
CN111522613B (en) Screen capturing method and electronic equipment
CN110221741B (en) Icon management method and terminal equipment
CN105513098B (en) Image processing method and device
US11513671B2 (en) Split-screen display method for terminal and apparatus
KR20230061519A (en) Screen capture methods, devices and electronics
CN112416172A (en) Electronic equipment control method and device and electronic equipment
WO2022253086A1 (en) Application function searching method and apparatus, and electronic device

Legal Events

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