[go: up one dir, main page]

CN113781959B - Interface processing method and device - Google Patents

Interface processing method and device Download PDF

Info

Publication number
CN113781959B
CN113781959B CN202111116933.3A CN202111116933A CN113781959B CN 113781959 B CN113781959 B CN 113781959B CN 202111116933 A CN202111116933 A CN 202111116933A CN 113781959 B CN113781959 B CN 113781959B
Authority
CN
China
Prior art keywords
gray scale
value
image
interface
original image
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.)
Active
Application number
CN202111116933.3A
Other languages
Chinese (zh)
Other versions
CN113781959A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111116933.3A priority Critical patent/CN113781959B/en
Publication of CN113781959A publication Critical patent/CN113781959A/en
Application granted granted Critical
Publication of CN113781959B publication Critical patent/CN113781959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/22Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters using controlled light sources
    • G09G3/30Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters using controlled light sources using electroluminescent panels
    • G09G3/32Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters using controlled light sources using electroluminescent panels semiconductive, e.g. using light-emitting diodes [LED]
    • G09G3/3208Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters using controlled light sources using electroluminescent panels semiconductive, e.g. using light-emitting diodes [LED] organic, e.g. using organic light-emitting diodes [OLED]
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/066Adjustment of display parameters for control of contrast

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The application discloses an interface processing method and device, and the method comprises the following steps: firstly, when a dark mode is detected to be started, an original image is obtained, wherein the original image is an image of a current interface of the electronic equipment; then obtaining a target gray scale of the original image, wherein the target gray scale is a font gray scale and/or a background gray scale; and finally, adjusting the value of the target gray scale, improving the display effect of the interface contrast in a dark mode, enabling the picture of the interface to tend to be soft, preventing the user from feeling unhappy and improving the user experience.

Description

界面处理方法及装置Interface processing method and device

技术领域technical field

本申请涉及电子技术领域,尤其涉及一种界面处理方法及装置。The present application relates to the field of electronic technology, and in particular, to an interface processing method and device.

背景技术Background technique

暗色模式,也称深色模式,是对电子设备的界面文字前景与深色背景对比度以及文字和系统图标的颜色进行优化处理,确保人眼观看感受一致、舒适和易读的一种模式。暗色模式可以在确保电子设备界面正常显示的同时降低屏幕的亮度,节省电子设备的电量,从而提高电子设备的续航能力。Dark mode, also known as dark mode, is a mode that optimizes the contrast between the foreground and dark background of the interface text of an electronic device, as well as the color of text and system icons, to ensure a consistent, comfortable and easy-to-read viewing experience for the human eye. The dark mode can reduce the brightness of the screen while ensuring the normal display of the interface of the electronic device, save the power of the electronic device, and thereby improve the battery life of the electronic device.

然而,由于有机发光二极管(OrganicLight-Emitting Diode,OLED)屏幕的压降(IR_DROP)现象会使得白色字体出现非常高亮的状态,比如在全白的画面为500nit时,在压降现象下字体可能会达到600nit,从而使得界面的对比度会非常高,长时间观看会使用户眼睛受不了。However, due to the voltage drop (IR_DROP) phenomenon of the organic light-emitting diode (Organic Light-Emitting Diode, OLED) screen, the white font will appear very bright. It will reach 600nit, so that the contrast of the interface will be very high, and the user's eyes will be unbearable for long-term viewing.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种界面处理方法及装置,能够提高在暗色模式下的界面对比度的显示效果,改进用户体验。Embodiments of the present application provide an interface processing method and device, which can improve the display effect of interface contrast in dark mode and improve user experience.

第一方面,本申请实施例提供一种界面处理方法,应用于电子设备,所述方法包括:In a first aspect, an embodiment of the present application provides an interface processing method, which is applied to an electronic device, and the method includes:

在检测到开启暗色模式时,获取原始图像,所述原始图像为所述电子设备当前界面的图像;When it is detected that the dark mode is turned on, an original image is obtained, where the original image is an image of the current interface of the electronic device;

获取所述原始图像的目标灰阶,所述目标灰阶为字体的灰阶和/或背景的灰阶;acquiring the target grayscale of the original image, where the target grayscale is the grayscale of the font and/or the grayscale of the background;

调整所述目标灰阶的值。Adjust the value of the target grayscale.

第二方面,本申请实施例提供一种界面处理装置,应用于电子设备,所述装置包括:In a second aspect, an embodiment of the present application provides an interface processing apparatus, which is applied to an electronic device, and the apparatus includes:

获取单元,用于在检测到开启暗色模式时,获取原始图像,所述原始图像为所述电子设备当前界面的图像;an acquisition unit, configured to acquire an original image when it is detected that the dark mode is turned on, where the original image is an image of the current interface of the electronic device;

所述获取单元,还用于获取所述原始图像的目标灰阶,所述目标灰阶为字体的灰阶和/或背景的灰阶;The acquiring unit is further configured to acquire the target grayscale of the original image, where the target grayscale is the grayscale of the font and/or the grayscale of the background;

调整单元,用于调整所述目标灰阶的值。The adjustment unit is used to adjust the value of the target gray scale.

第三方面,本申请实施例提供一种电子设备,包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面任一方法中的步骤的指令。In a third aspect, embodiments of the present application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be processed by the above-mentioned processing The above program includes instructions for executing steps in any method of the first aspect of the embodiments of the present application.

第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes a computer to execute the computer program as described in the first embodiment of the present application. In one aspect some or all of the steps described in any method.

第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute as implemented in the present application. Examples include some or all of the steps described in any method of the first aspect. The computer program product may be a software installation package.

在本申请实施例中,首先在检测到开启暗色模式时获取原始图像,该原始图像为电子设备当前界面的图像;然后获取原始图像的目标灰阶,目标灰阶为字体的灰阶和/或背景的灰阶;最后调整目标灰阶的值,提高在暗色模式下的界面的显示效果,使得界面的画面趋于柔和,不会使用户感到不刺眼,改进了用户体验。In the embodiment of the present application, first, when it is detected that the dark mode is turned on, an original image is obtained, and the original image is an image of the current interface of the electronic device; then the target grayscale of the original image is obtained, and the target grayscale is the grayscale of the font and/or The grayscale of the background; finally adjust the value of the target grayscale to improve the display effect of the interface in the dark mode, so that the interface picture tends to be soft, which will not make the user feel less dazzling, and improve the user experience.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that are used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

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

图2是本申请实施例提供的一种电子设备的软件结构示意图;2 is a schematic diagram of a software structure of an electronic device provided by an embodiment of the present application;

图3是本申请实施例提供的一种暗色模式下界面处理方法的示意图;3 is a schematic diagram of an interface processing method in a dark mode provided by an embodiment of the present application;

图4是本申请实施例提供的一种界面处理方法的流程示意图;4 is a schematic flowchart of an interface processing method provided by an embodiment of the present application;

图5是本申请实施例提供的另一种界面处理方法的流程示意图;5 is a schematic flowchart of another interface processing method provided by an embodiment of the present application;

图6是本申请实施例提供的一种界面处理装置的示意图。FIG. 6 is a schematic diagram of an interface processing apparatus provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

为了更好地理解本申请实施例的方案,下面先对本申请实施例可能涉及的相关术语和概念进行介绍。In order to better understand the solutions of the embodiments of the present application, related terms and concepts that may be involved in the embodiments of the present application are first introduced below.

本申请中涉及的电子设备可以是还包含其它功能诸如个人数字助理和/或音乐播放器功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表)等。便携式电子设备的示例性实施例包括但不限于搭载IOS系统、Android系统、Microsoft系统或者其它操作系统的便携式电子设备。上述便携式电子设备也可以是其它便携式电子设备,诸如膝上型计算机(Laptop)等。还应当理解的是,在其他一些实施例中,上述电子设备也可以不是便携式电子设备,而是台式计算机。The electronic devices involved in this application may be portable electronic devices that also include other functions such as personal digital assistants and/or music player functions, such as mobile phones, tablet computers, wearable electronic devices with wireless communication functions (such as smart watches), etc. . Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices powered by IOS systems, Android systems, Microsoft systems, or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop) or the like. It should also be understood that, in some other embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer.

示例性的,图1示出了电子设备100的结构示意图。电子设备100可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、指南针190、马达191、指示器192、摄像头193、显示屏194以及用户标识模块(subscriber identification module,SIM)卡接口195等。Exemplarily, FIG. 1 shows a schematic structural diagram of an electronic device 100 . The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, compass 190, motor 191, indicator 192, camera 193, display screen 194 and user A subscriber identification module (SIM) card interface 195 and the like.

可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备100也可以包括一个或多个处理器110。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。在其他一些实施例中,处理器110中还可以设置存储器,用于存储指令和数据。示例性地,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。这样就避免了重复存取,减少了处理器110的等待时间,因而提高了电子设备100处理数据或执行指令的效率。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent components, or may be integrated in one or more processors. In some embodiments, electronic device 100 may also include one or more processors 110 . The controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data. Illustratively, the memory in the processor 110 may be a cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. In this way, repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the electronic device 100 in processing data or executing instructions.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口、集成电路间音频(inter-integrated circuitsound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、用输入输出(general-purpose input/output,GPIO)接口、SIM卡接口和/或USB接口等。其中,USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口、Micro USB接口、USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。该USB接口130也可以用于连接耳机,通过耳机播放音频。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuitsound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (GPIO) interface, SIM card interface and/or USB interface, etc. The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. The USB interface 130 can also be used to connect an earphone, and play audio through the earphone.

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.

充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .

电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、外部存储器、显示屏194、摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量、电池循环次数、电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.

电子设备100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .

无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络)、蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)、UWB等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and UWB. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏194用于显示图像、视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emittingdiode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED)、柔性发光二极管(flex light-emittingdiode,FLED)、迷你发光二极管(mini light-emitting diode,miniled)、MicroLed、Micro-oLed、量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或多个显示屏194。The display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), mini light-emitting diode (mini light-emitting diode, miniLED), MicroLed, Micro-oLed, quantum dot light emitting diode (quantum dot light emitting diode, QLED), etc. . In some embodiments, electronic device 100 may include one or more display screens 194 .

电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.

ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点、亮度、肤色进行算法优化。ISP还可以对拍摄场景的曝光、色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或多个摄像头193。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include one or more cameras 193 .

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.

视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3、MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别、人脸识别、语音识别、文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information, and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.

内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备100执行本申请一些实施例中所提供的显示页面元素的方法,以及各种应用以及数据处理等。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统;该存储程序区还可以存储一个或多个应用(比如图库、联系人等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如照片,联系人等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器110可以通过运行存储在内部存储器121的指令,和/或存储在设置于处理器110中的存储器的指令,来使得电子设备100执行本申请实施例中所提供的显示页面元素的方法,以及其他应用及数据处理。电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、以及应用处理器等实现音频功能。例如音乐播放、录音等。Internal memory 121 may be used to store one or more computer programs including instructions. The processor 110 may execute the above-mentioned instructions stored in the internal memory 121, thereby causing the electronic device 100 to execute the method for displaying page elements, various applications and data processing provided in some embodiments of the present application. The internal memory 121 may include a storage program area and a storage data area. Wherein, the stored program area may store the operating system; the stored program area may also store one or more applications (such as gallery, contacts, etc.) and the like. The storage data area may store data (such as photos, contacts, etc.) created during the use of the electronic device 100 and the like. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage components, flash memory components, universal flash storage (UFS), and the like. In some embodiments, the processor 110 may cause the electronic device 100 to execute the instructions provided in the embodiments of the present application by executing the instructions stored in the internal memory 121 and/or the instructions stored in the memory provided in the processor 110 . Methods for displaying page elements, as well as other applications and data processing. The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.

传感器模块180可以包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、磁传感器180D、加速度传感器180E、距离传感器180F、接近光传感器180G、指纹传感器180H、温度传感器180J、触摸传感器180K、环境光传感器180L、骨传导传感器180M等。The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L, bone conduction sensor 180M, etc.

其中,压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即X、Y和Z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 . In some embodiments, the angular velocity of the electronic device 100 about three axes (ie, the X, Y, and Z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenarios.

加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.

环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.

指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.

温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect the temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.

示例性的,图2示出了电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。Exemplarily, FIG. 2 shows a software structural block diagram of the electronic device 100 . The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and system libraries, and a kernel layer. The application layer can include a series of application packages.

如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 2, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.

如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 2, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.

内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.

视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.

电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.

系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.

表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.

目前人们对显示功能的要求越来越高,会在显示屏进行显示时执行很多显示效果的处理,但这样大大增加了手机的功耗,并且用户在黑暗环境中使用电子设备的频率也越来越高,因此各大厂商纷纷推出了暗色模式,对电子设备的界面文字前景与深色背景对比度以及文字和系统图标的颜色进行优化处理。其一方面可以降低OLED屏幕的手机功耗,另一方面可以使用户在夜晚使用时不会有明显的刺眼。目前暗色模式下背景为纯黑灰阶,即使用0灰阶作为背景;字体为纯白灰阶,即使用255灰阶作为字体,但是由于OLED屏幕的压降(IR_DROP)现象会使得白色字体出现非常高亮的状态,比如在全白的画面为500nit时,在压降现象下字体可能会达到600nit,从而使得界面的对比度会非常高,从而使得暗色模式下的字体比较刺眼,长时间观看手机屏幕,会使用户眼睛不舒服。At present, people have higher and higher requirements for display functions, and many display effects are processed when the display screen is displayed, but this greatly increases the power consumption of the mobile phone, and the frequency of users using electronic devices in a dark environment is also increasing. Therefore, major manufacturers have launched dark mode to optimize the contrast between the foreground and dark background of the interface text of electronic devices, as well as the color of text and system icons. On the one hand, it can reduce the power consumption of the OLED screen of the mobile phone, and on the other hand, it can make the user not have obvious glare when using it at night. At present, the background in dark mode is pure black grayscale, that is, 0 grayscale is used as the background; the font is pure white grayscale, that is, 255 grayscale is used as the font, but due to the pressure drop (IR_DROP) phenomenon of the OLED screen, the white font will appear very In the highlighted state, for example, when the all-white screen is 500nit, the font may reach 600nit under the pressure drop phenomenon, so that the contrast of the interface will be very high, so that the font in the dark mode is more dazzling, and the mobile phone screen is viewed for a long time. , it will make the user's eyes uncomfortable.

为了解决上述问题,本申请提出了一种界面处理方法,如图3所示,电子设备可以通过降低电子设备界面的字体的灰阶可以提高在暗色模式下的界面对比度的显示效果,也可以通过提高背景的灰阶来提高在暗色模式下的界面对比度的显示效果,还可以通过增加调试画面的百分比提高在暗色模式下的界面对比度的显示效果,从而使得显示界面的画面趋于柔和、不刺眼,改进用户体验。In order to solve the above problems, the present application proposes an interface processing method. As shown in FIG. 3 , the electronic device can improve the display effect of the interface contrast in the dark mode by reducing the gray scale of the font of the electronic device interface. Increase the gray level of the background to improve the display effect of the interface contrast in the dark mode, and also improve the display effect of the interface contrast in the dark mode by increasing the percentage of the debugging screen, so that the screen of the display interface tends to be soft and not dazzling. , to improve the user experience.

请参阅图4,图4是本申请实施例提供了一种界面处理方法的流程示意图,应用于电子设备,如图4所示,本界面处理方法包括以下操作。Please refer to FIG. 4 , which is a schematic flowchart of an interface processing method provided by an embodiment of the present application, which is applied to an electronic device. As shown in FIG. 4 , the interface processing method includes the following operations.

S410、在检测到开启暗色模式时,获取原始图像,所述原始图像为所述电子设备当前界面的图像。S410. When it is detected that the dark mode is turned on, obtain an original image, where the original image is an image of the current interface of the electronic device.

在本申请实施例中,暗色模式可以是指界面上所有视图的背景亮度小于预设亮度的模式,即界面色彩偏暗的模式。其中,亮度是指LAB(Lab color space)色彩空间中的L分量,范围是0至100,表示从纯黑到纯白。LAB色彩空间还包括A分量和B分量,A分量表示从洋红色至绿色的范围,B分量表示从黄色至蓝色的范围。当前界面可以是指电子设备的屏幕上当前显示的界面。界面通常是由多个视图按照一定规律组合而成,例如在一个界面视图(即整个界面的基础视图,在界面视图上可添加其他视图)上添加文本框、图片、对话框等视图。视图(即View)也可以称之为控件。In this embodiment of the present application, the dark mode may refer to a mode in which the background brightness of all views on the interface is lower than the preset brightness, that is, a mode in which the interface color is darker. Among them, brightness refers to the L component in the LAB (Lab color space) color space, ranging from 0 to 100, representing from pure black to pure white. The LAB color space also includes an A component and a B component, the A component representing the range from magenta to green, and the B component representing the range from yellow to blue. The current interface may refer to the interface currently displayed on the screen of the electronic device. The interface is usually composed of multiple views according to certain rules, for example, adding views such as text boxes, pictures, and dialog boxes to an interface view (that is, the basic view of the entire interface, and other views can be added to the interface view). Views (ie Views) can also be called controls.

其中,当电子设备开启暗色模式时,在将当前画面显示于屏幕上之前,先获取该当前画面的图像(原始图像),对原始图像进行图像处理后,在显示于屏幕上,提高暗色模式下的界面对比度的显示效果,使得显示界面的画面趋于柔和、不刺眼,改进用户体验。Wherein, when the electronic device turns on the dark mode, before displaying the current image on the screen, the image (original image) of the current image is obtained first, and after image processing is performed on the original image, the image is displayed on the screen to improve the dark mode. The display effect of high interface contrast makes the picture of the display interface tend to be soft and not dazzling, and improves the user experience.

S420、获取所述原始图像的目标灰阶,所述目标灰阶为字体的灰阶和/或背景的灰阶。S420. Acquire a target grayscale of the original image, where the target grayscale is the grayscale of the font and/or the grayscale of the background.

其中,一张图像中的每一个像素可以呈现出许多不同的颜色,它是由红、绿、蓝(RGB)三个子像素组成的。每一个子像素,其背后的光源都可以显现出不同的亮度级别。而灰阶代表了由最暗到最亮之间不同亮度的层次级别。以8bit panel为例,能表现2的8次方,等于256个亮度层次,其中灰阶为255表示其颜色为纯白,灰阶为0的表示其颜色为纯黑。Among them, each pixel in an image can present many different colors, and it is composed of three sub-pixels of red, green, and blue (RGB). For each sub-pixel, the light source behind it can exhibit a different brightness level. The gray scales represent different levels of brightness from the darkest to the brightest. Taking an 8bit panel as an example, it can express 2 to the 8th power, which is equal to 256 brightness levels. A grayscale of 255 indicates that the color is pure white, and a grayscale of 0 indicates that the color is pure black.

在本申请实施例中,在获取到当前界面的原始图像后,由于电子设备开启了暗色模式,为了提高用户体验,可以调整原始图像中字体或背景图像的灰阶,使得处理后的画面趋于柔和,不会是用户感到刺眼。In the embodiment of the present application, after the original image of the current interface is acquired, since the electronic device has turned on the dark mode, in order to improve the user experience, the gray scale of the font or background image in the original image may be adjusted, so that the processed image tends to be Soft and not dazzling for users.

在一种可能的示例中,所述获取所述原始图像的目标灰阶,包括:获取所述原始图像中每一像素的灰阶,将大于第一值的灰阶确定为所述字体的灰阶,将小于第二值的灰阶确定为所述背景的灰阶。In a possible example, the acquiring the target gray level of the original image includes: acquiring the gray level of each pixel in the original image, and determining a gray level greater than a first value as the gray level of the font level, and a gray level smaller than the second value is determined as the gray level of the background.

目前暗色模式下的背景为纯黑灰阶,即将0灰阶作为背景,字体为255灰阶。其中黑色的背景会使得白色字体出现非常高亮的,因此为了降低显示画面的对比度,本申请可以通过降低字体的灰阶,使得画面上的字体的颜色变暗,从而使得显示画面趋于柔和。At present, the background in dark mode is pure black grayscale, that is, 0 grayscale is used as the background, and the font is 255 grayscale. The black background will make the white font appear very bright. Therefore, in order to reduce the contrast of the display screen, the present application can reduce the gray scale of the font to make the color of the font on the screen darker, so that the display screen tends to be softer.

具体地,电子设备获取原始图像中每一像素的灰阶,由于字体的灰阶最大,因此可以将大于第一值的灰阶确定为字体的灰阶。而由于背景的灰阶最小,因此可以将小于第二值的灰阶确定为背景的灰阶。其中第一值远远大于第二值。示例的,所述第一值可以为255、252、250等;第二值可以为0、4、6等。Specifically, the electronic device acquires the gray level of each pixel in the original image, and since the gray level of the font is the largest, the gray level greater than the first value can be determined as the gray level of the font. Since the gray level of the background is the smallest, the gray level smaller than the second value may be determined as the gray level of the background. where the first value is much larger than the second value. For example, the first value may be 255, 252, 250, etc.; the second value may be 0, 4, 6, and so on.

在一种可能的示例中,所述获取所述原始图像的目标灰阶,包括:获取所述原始图像的灰度直方图;将所述灰度直方图中横坐标大于第一值的灰阶确定所述字体的灰阶,将所述灰度直方图中横坐标小于第二值的灰阶确定为所述背景的灰阶。In a possible example, the acquiring the target grayscale of the original image includes: acquiring a grayscale histogram of the original image; converting a grayscale whose abscissa in the grayscale histogram is greater than a first value The gray level of the font is determined, and the gray level whose abscissa in the gray level histogram is smaller than the second value is determined as the gray level of the background.

示例的,本申请还可以通过获取原始图像的灰度直方图来确定字体的灰阶或背景的灰阶。其中灰度直方图的横坐标为灰阶(也可以叫做灰度值或灰度级),纵坐标为出现的频率,因此可以将横坐标大于第一值的灰阶确定为字体的灰阶,将小于第二值的灰阶确定为背景的灰阶。For example, the present application can also determine the grayscale of the font or the grayscale of the background by acquiring the grayscale histogram of the original image. The abscissa of the gray histogram is the gray level (also called gray value or gray level), and the ordinate is the frequency of occurrence. Therefore, the gray level with the abscissa greater than the first value can be determined as the gray level of the font. A grayscale smaller than the second value is determined as the grayscale of the background.

S430、调整所述目标灰阶的值。S430. Adjust the value of the target gray scale.

其中,在获取到字体的灰阶或背景的灰阶后,通过调整字体的灰阶和/或背景的灰阶,使得显示画面的对比度降低,从而可以是显示画面变得柔和。Wherein, after obtaining the grayscale of the font or the grayscale of the background, by adjusting the grayscale of the font and/or the grayscale of the background, the contrast of the display screen is reduced, so that the display screen can be softened.

在一种可能的示例中,所述调整所述目标灰阶的值,包括:在所述目标灰阶为字体的灰阶时,将所述字体的灰阶降低至第一预设值。In a possible example, the adjusting the value of the target grayscale includes: when the target grayscale is the grayscale of a font, reducing the grayscale of the font to a first preset value.

具体地,在根据原始图像中的像素的灰阶确定原始图像中的字体时,可以直接将灰阶大于第一值的像素的灰阶降低至第一预设值,即将字体的灰阶降低至第一预设值。在根据灰度直方图确定原始图像中的字体时,可以在进行灰度直方图的统计时,直接将大于第一值的灰阶降低至第一预设值来降低高灰阶的亮度,即将字体的灰阶降低至第一预设值。降低了显示画面的对比度,从而使得字体不那么高亮、刺眼。Specifically, when the font in the original image is determined according to the gray level of the pixels in the original image, the gray level of the pixel whose gray level is greater than the first value can be directly reduced to the first preset value, that is, the gray level of the font can be reduced to The first preset value. When determining the font in the original image according to the grayscale histogram, it is possible to directly reduce the grayscale greater than the first value to the first preset value to reduce the brightness of the high grayscale during the statistics of the grayscale histogram, that is, to reduce the brightness of the high grayscale. The grayscale of the font is reduced to the first preset value. Reduces the contrast of the display, making fonts less bright and harsh.

其中所述第一预设值可以由用户自主在电子设备上进行设置,也可以为系统设置的默认值,例如240、230、220、210等。The first preset value may be independently set by the user on the electronic device, or may be a default value set by the system, such as 240, 230, 220, 210, and the like.

在一种可能的示例中,所述调整所述目标灰阶的值,包括:在所述目标灰阶为背景的灰阶时,将所述背景的灰阶调高至第二预设值,所述第二预设值小于第一预设值。In a possible example, the adjusting the value of the target grayscale includes: when the target grayscale is the grayscale of the background, increasing the grayscale of the background to a second preset value, The second preset value is smaller than the first preset value.

其中,本申请还可以通过调高背景的灰阶来降低了显示画面的对比度,如将背景的灰阶调高至第二预设值,其中所述第二预设值也远远小于第一预设值。因为背景亮度升高,OLED屏幕的负载变大,字体的亮度也不会被抬高的很厉害。最后,都会使得画面变得稍微柔和。Wherein, the present application can also reduce the contrast of the display screen by increasing the gray level of the background, such as increasing the gray level of the background to a second preset value, where the second preset value is also far smaller than the first default value. Because the brightness of the background increases, the load of the OLED screen becomes larger, and the brightness of the font will not be raised very much. In the end, it will make the picture slightly softer.

具体地,在根据原始图像中的像素的灰阶确定原始图像中的背景时,可以直接将灰阶小于第二值的像素的灰阶调高至第二预设值,即将背景的灰阶调高至第二预设值。在根据灰度直方图确定原始图像中的背景时,可以在进行灰度直方图的统计时,直接将小于第二值的灰阶调高至第二预设值来提高低灰阶的亮度,即将背景的灰阶调高至第二预设值。Specifically, when the background in the original image is determined according to the gray level of the pixels in the original image, the gray level of the pixels whose gray level is smaller than the second value can be directly adjusted to the second preset value, that is, the gray level of the background can be adjusted to up to the second preset value. When the background in the original image is determined according to the grayscale histogram, the grayscale that is smaller than the second value can be directly increased to the second preset value to improve the brightness of the low grayscale when the statistics of the grayscale histogram are performed. That is, adjust the gray level of the background to the second preset value.

需要说明的是,所述第二预设值可以由用户自主在电子设备上进行设置,也可以为系统设置的默认值,例如20、30、40、50等。It should be noted that the second preset value may be set by the user on the electronic device independently, or may be a default value set by the system, such as 20, 30, 40, 50, and so on.

可以看出,本申请实施例提出的界面处理方法,在检测到开启暗色模式时获取原始图像,该原始图像为电子设备当前界面的图像;然后获取原始图像的目标灰阶,目标灰阶为字体的灰阶和/或背景的灰阶;最后调整目标灰阶的值,提高在暗色模式下的界面对比度的显示效果,使得界面的画面趋于柔和,不会使用户感到不刺眼,改进了用户体验。It can be seen that, in the interface processing method proposed in the embodiment of the present application, when it is detected that the dark mode is turned on, an original image is obtained, and the original image is an image of the current interface of the electronic device; then the target grayscale of the original image is obtained, and the target grayscale is a font The grayscale and/or the background grayscale; finally adjust the value of the target grayscale to improve the display effect of the interface contrast in the dark mode, so that the interface screen tends to be soft, and the user will not feel dazzling, which improves the user experience. experience.

请参阅图5,图5是本申请实施例提供了一种界面处理方法的流程示意图,应用于电子设备,如图5所示,本界面处理方法包括以下操作。Please refer to FIG. 5 . FIG. 5 is a schematic flowchart of an interface processing method provided by an embodiment of the present application, which is applied to an electronic device. As shown in FIG. 5 , the interface processing method includes the following operations.

S510、在检测到开启暗色模式时,获取原始图像,所述原始图像为所述电子设备当前界面的图像。S510. When it is detected that the dark mode is turned on, acquire an original image, where the original image is an image of the current interface of the electronic device.

其中,当电子设备开启暗色模式时,在将当前画面显示于屏幕上之前,先获取该当前画面的图像(原始图像),对原始图像进行图像处理后,在显示于屏幕上,提高暗色模式下的界面对比度的显示效果,使得显示界面的画面趋于柔和、不刺眼,改进用户体验。Wherein, when the electronic device turns on the dark mode, before displaying the current image on the screen, the image (original image) of the current image is obtained first, and after image processing is performed on the original image, the image is displayed on the screen to improve the dark mode. The display effect of high interface contrast makes the picture of the display interface tend to be soft and not dazzling, and improves the user experience.

S520、获取所述原始图像中字体的灰阶和/或背景的灰阶。S520. Obtain the grayscale of the font and/or the grayscale of the background in the original image.

目前暗色模式下的背景为纯黑灰阶,即将0灰阶作为背景,字体为255灰阶。其中黑色的背景会使得白色字体出现非常高亮的,因此为了降低显示画面的对比度,本申请可以通过降低字体的灰阶,使得画面上的字体的颜色变暗,从而使得显示画面趋于柔和。At present, the background in dark mode is pure black grayscale, that is, 0 grayscale is used as the background, and the font is 255 grayscale. The black background will make the white font appear very bright. Therefore, in order to reduce the contrast of the display screen, the present application can reduce the gray scale of the font to make the color of the font on the screen darker, so that the display screen tends to be softer.

具体地,电子设备获取原始图像中每一像素的灰阶,由于字体的灰阶最大,因此可以将大于第一值的灰阶确定为字体的灰阶。而由于背景的灰阶最小,因此可以将小于第二值的灰阶确定为背景的灰阶。其中第一值远远大于第二值。示例的,所述第一值可以为255、252、250等;第二值可以为0、4、6等。Specifically, the electronic device acquires the gray level of each pixel in the original image, and since the gray level of the font is the largest, the gray level greater than the first value can be determined as the gray level of the font. Since the gray level of the background is the smallest, the gray level smaller than the second value may be determined as the gray level of the background. where the first value is much larger than the second value. For example, the first value may be 255, 252, 250, etc.; the second value may be 0, 4, 6, and so on.

进一步地,本申请还可以通过获取原始图像的灰度直方图来确定字体的灰阶或背景的灰阶。其中灰度直方图的横坐标为灰阶(也可以叫做灰度值或灰度级),纵坐标为出现的频率,因此可以将横坐标大于第一值的灰阶确定为字体的灰阶,将小于第二值的灰阶确定为背景的灰阶。Further, the present application can also determine the grayscale of the font or the grayscale of the background by acquiring the grayscale histogram of the original image. The abscissa of the gray histogram is the gray level (also called gray value or gray level), and the ordinate is the frequency of occurrence. Therefore, the gray level with the abscissa greater than the first value can be determined as the gray level of the font. A grayscale smaller than the second value is determined as the grayscale of the background.

S530、降低所述字体的灰阶和/或提高所述背景的灰阶。S530. Decrease the gray level of the font and/or increase the gray level of the background.

其中,在获取到字体的灰阶或背景的灰阶后,通过调整字体的灰阶和/或背景的灰阶,使得显示画面的对比度降低,从而可以是显示画面变得柔和。Wherein, after obtaining the grayscale of the font or the grayscale of the background, by adjusting the grayscale of the font and/or the grayscale of the background, the contrast of the display screen is reduced, so that the display screen can be softened.

具体地,在根据原始图像中的像素的灰阶确定原始图像中的字体和/或背景时,可以直接将灰阶大于第一值的像素的灰阶降低至第一预设值和/或将灰阶小于第二值的像素的灰阶调高至第二预设值。在根据灰度直方图确定原始图像中的字体和/或背景时,可以在进行灰度直方图的统计时,直接将大于第一值的灰阶降低至第一预设值来降低高灰阶的亮度和/或将小于第二值的灰阶调高至第二预设值来提高低灰阶的亮度。从而降低了显示画面的对比度,使得字体不那么高亮、刺眼。Specifically, when determining the font and/or background in the original image according to the gray level of the pixels in the original image, the gray level of the pixel whose gray level is greater than the first value may be directly reduced to the first preset value and/or the The gray level of the pixel whose gray level is smaller than the second value is increased to the second predetermined value. When determining the font and/or background in the original image according to the grayscale histogram, the grayscale level greater than the first value can be directly reduced to the first preset value to reduce the high grayscale level when the statistics of the grayscale histogram are performed. and/or increasing the gray level smaller than the second value to the second preset value to improve the brightness of the low gray level. As a result, the contrast of the display screen is reduced, making the fonts less bright and dazzling.

需要说明的是,所述第一预设值和所述第二预设值可以由用户自主在电子设备上进行设置,也可以为系统设置的默认值。It should be noted that the first preset value and the second preset value may be set by the user on the electronic device independently, or may be default values set by the system.

S540、将所述原始图像的调试画面从第一百分比增加至第二百分比。S540. Increase the debugging screen of the original image from the first percentage to the second percentage.

其中,在对原始图像进行界面显示的处理时,其最终显示的效果会根据画面大小的百分比进行调试。而目前电子设备是在25%的画面大小进行调试,其中调试的画面大小百分比越小,gamma参数变小,画面的对比度越高,即画面的亮度越高。gamma参数是用来表征显示器亮度响应特性的一个参数,Gamma偏大时整体图像偏暗,Gamma偏小时整体图像偏亮。因此本申请在调整了字体和/或背景的灰阶后,还可以提高原始图像的调试画面的百分比。Among them, when the original image is processed for interface display, the final display effect will be debugged according to the percentage of the screen size. At present, electronic equipment is debugged at 25% of the screen size. The smaller the screen size percentage is, the smaller the gamma parameter, and the higher the contrast of the screen, that is, the higher the brightness of the screen. The gamma parameter is a parameter used to characterize the brightness response characteristics of the display. When the Gamma is too large, the overall image is darker, and when the Gamma is too small, the overall image is brighter. Therefore, after adjusting the gray scale of the font and/or background, the application can also increase the percentage of the debugging screen of the original image.

进一步地,所述第二百分比大于所述第一百分比,所述第二百分比可以为100%、80%、70%、60%、50%等。Further, the second percentage is greater than the first percentage, and the second percentage may be 100%, 80%, 70%, 60%, 50%, and the like.

例如,在25%的画面大小进行调试时,会使得画面在100%状态下的gamma参数变小,使得屏幕偏亮;这时候如果采用50%的画面大小进行调试或者用100%的画面大小进行调试,则会使得画面的gamma参数接近2.2,画面变得柔和,不刺眼。For example, when debugging at 25% of the screen size, the gamma parameter of the screen at 100% will become smaller, making the screen brighter; at this time, if you use 50% of the screen size for debugging or use 100% of the screen size for debugging Debugging will make the gamma parameter of the picture close to 2.2, and the picture will become soft and not dazzling.

在一可能的示例中,所述将所述原始图像的调试画面从第一百分比增加至第二百分比,包括:获取第一图像,所述第一图像为在所述第一百分比调试画面下显示的界面图像;获取所述第一图像的第一灰阶和第二灰阶,所述第一灰阶为所述第一图像中字体的灰阶,所述第二灰阶为所述第一图像中背景的灰阶;分别计算第一差值和第二差值,所述第一差值为所述第一灰阶与所述第一预设值之间的差值,所述第二差值为所述第二灰阶与所述第二预设值之间的差值;根据差值与系数之间的映射关系,确定所述第一差值对应的第一调整系数以及所述第二差值对应的第二调整系数;根据所述第一调整系数、第一灰阶、第二灰阶和所述第二调整系数,计算目标伽玛值;根据伽玛值与百分比的映射关系,确定所述目标伽玛值对应的所述第二百分比。In a possible example, the increasing the debugging screen of the original image from a first percentage to a second percentage includes: acquiring a first image, the first image being at the hundredth The interface image displayed under the debug screen of the ratio; obtain the first grayscale and the second grayscale of the first image, the first grayscale is the grayscale of the font in the first image, and the second grayscale level is the gray level of the background in the first image; the first difference value and the second difference value are calculated respectively, and the first difference value is the difference between the first gray level and the first preset value value, the second difference value is the difference value between the second gray scale and the second preset value; according to the mapping relationship between the difference value and the coefficient, the first difference value corresponding to the first difference value is determined an adjustment coefficient and a second adjustment coefficient corresponding to the second difference; calculate a target gamma value according to the first adjustment coefficient, the first grayscale, the second grayscale and the second adjustment coefficient; according to the gamma The mapping relationship between the gamma value and the percentage is used to determine the second percentage corresponding to the target gamma value.

其中,所述电子设备可以预先存储差值与系数之间的映射关系,以及伽玛值(gamma)与百分比的映射关系。本申请通过比较第一百分比调试画面场景下显示图像的字体的灰阶和背景的灰阶分别与预设灰阶之间的差值,来确定第一图像中字体的灰阶和背景的灰阶的调整系数,然后根据调整系数计算调整后第一图像中的背景部分与字体部分的亮度,所述字体亮度等于第一灰阶与第一调整系数的值,所述背景亮度等于第二灰阶与第二调整系数的值,进而可以计算出调整后第一图像的对比度,其为字体亮度与背景亮度的差。根据屏幕输出电压与对应亮度的转换关系曲线(伽玛曲线)确定所述目标伽玛值,进而根据目标伽玛值确定第二百分比。Wherein, the electronic device may pre-store the mapping relationship between the difference value and the coefficient, and the mapping relationship between the gamma value (gamma) and the percentage. The present application determines the difference between the gray level of the font and the background in the first image by comparing the difference between the gray level of the font and the gray level of the background of the displayed image and the preset gray level in the first percentage debugging screen scene. The adjustment coefficient of the gray scale, and then calculate the brightness of the background part and the font part in the adjusted first image according to the adjustment coefficient, the font brightness is equal to the value of the first gray scale and the first adjustment coefficient, and the background brightness is equal to the second The value of the gray scale and the second adjustment coefficient can be used to calculate the contrast of the first image after adjustment, which is the difference between the brightness of the font and the brightness of the background. The target gamma value is determined according to the conversion relationship curve (gamma curve) between the screen output voltage and the corresponding brightness, and then the second percentage is determined according to the target gamma value.

可以看出,本申请实施例,通过降低字体的灰阶和/或提高背景的灰阶,以及调高调试画面的百分比,可以提高在暗色模式下的界面对比度的显示效果,使得界面的画面趋于柔和,不会使用户感到不刺眼,改进了用户体验。It can be seen that, in the embodiment of the present application, by reducing the gray level of the font and/or increasing the gray level of the background, and increasing the percentage of the debugging screen, the display effect of the interface contrast in the dark mode can be improved, so that the interface picture tends to be more It is soft and does not make the user feel less dazzling, which improves the user experience.

可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above-mentioned functions, the electronic device includes corresponding hardware and/or software modules for executing each function. The present application can be implemented in hardware or in the form of a combination of hardware and computer software in conjunction with the algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functionality for each particular application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.

本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the electronic device may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.

在采用对应各个功能划分各个功能模块的情况下,图6示出了界面处理装置的示意图,如图6所示,该界面处理装置600应用于电子设备,该界面处理装置600可以包括:获取单元601和调整单元602。In the case where each functional module is divided corresponding to each function, FIG. 6 shows a schematic diagram of an interface processing apparatus. As shown in FIG. 6 , the interface processing apparatus 600 is applied to an electronic device, and the interface processing apparatus 600 may include: an obtaining unit 601 and adjustment unit 602.

其中,获取单元601可以用于支持电子设备执行上述S410、S420等,和/或用于本文所描述的技术的其他过程。Wherein, the obtaining unit 601 may be used to support the electronic device to perform the above-mentioned S410, S420, etc., and/or other processes for the techniques described herein.

调整单元602可以用于支持电子设备执行上述S430等,和/或用于本文所描述的技术的其他过程。The adjustment unit 602 may be used to support the electronic device to perform the above-described S430, etc., and/or other processes for the techniques described herein.

需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that, all relevant contents of the steps involved in the above method embodiments can be cited in the functional description of the corresponding functional module, which will not be repeated here.

本实施例提供的电子设备,用于执行上述界面处理方法,因此可以达到与上述实现方法相同的效果。The electronic device provided in this embodiment is used to execute the above interface processing method, so the same effect as the above implementation method can be achieved.

在采用集成的单元的情况下,电子设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理,例如,可以用于支持电子设备执行上述获取单元601和调整单元602执行的步骤。存储模块可以用于支持电子设备执行存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。Where an integrated unit is employed, the electronic device may include a processing module, a memory module and a communication module. The processing module may be used to control and manage the actions of the electronic device, for example, may be used to support the electronic device to perform the steps performed by the acquisition unit 601 and the adjustment unit 602 above. The storage module may be used to support the electronic device to execute stored program codes and data, and the like. The communication module can be used to support the communication between the electronic device and other devices.

其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。The processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processor may also be a combination that implements computing functions, such as a combination comprising one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and the like. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.

在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图1所示结构的设备。In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device having the structure shown in FIG. 1 .

本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的界面处理方法。This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned relevant method steps to implement the interface processing method in the above-mentioned embodiment.

本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的界面处理方法。This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the interface processing method in the above-mentioned embodiment.

另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的界面处理方法。In addition, the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the interface processing methods in the foregoing method embodiments.

其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference can be made to the corresponding provided above. The beneficial effects in the method will not be repeated here.

通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different The function module is completed, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and other media that can store program codes.

以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above content is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. An interface processing method is applied to an electronic device, and the method comprises the following steps:
when a dark mode is detected to be started, acquiring an original image, wherein the original image is an image of a current interface of the electronic equipment;
acquiring a target gray scale of the original image, wherein the target gray scale is a font gray scale and/or a background gray scale;
adjusting the value of the target gray scale;
increasing the debug screen of the original image from a first percentage to a second percentage, comprising: acquiring a first image, wherein the first image is an interface image displayed under the first percentage debugging picture; acquiring a first gray scale and a second gray scale of the first image, wherein the first gray scale is the gray scale of a font in the first image, and the second gray scale is the gray scale of a background in the first image; respectively calculating a first difference value and a second difference value, wherein the first difference value is a difference value between the first gray scale and a first preset value, and the second difference value is a difference value between the second gray scale and a second preset value; determining a first adjusting coefficient corresponding to the first difference value and a second adjusting coefficient corresponding to the second difference value according to a mapping relation between the difference values and the coefficients; calculating a target gamma value according to the first adjusting coefficient, the first gray scale, the second gray scale and the second adjusting coefficient; and determining the second percentage corresponding to the target gamma value according to the mapping relation between the gamma value and the percentage.
2. The method of claim 1, wherein obtaining the target gray level of the original image comprises:
and acquiring the gray scale of each pixel in the original image, determining the gray scale larger than a first value as the gray scale of the font, and determining the gray scale smaller than a second value as the gray scale of the background.
3. The method of claim 1, wherein said obtaining a target gray level of said original image comprises:
acquiring a gray level histogram of the original image;
determining the gray scale of the font according to the gray scale of which the abscissa in the gray scale histogram is larger than a first value, and determining the gray scale of which the abscissa in the gray scale histogram is smaller than a second value as the gray scale of the background.
4. The method of claim 2 or 3, wherein said adjusting the value of the target gray level comprises:
and when the target gray scale is the gray scale of the font, reducing the gray scale of the font to a first preset value.
5. The method of claim 2 or 3, wherein said adjusting the value of the target gray level comprises:
and when the target gray scale is the gray scale of the background, increasing the gray scale of the background to a second preset value, wherein the second preset value is smaller than the first preset value.
6. An interface processing apparatus applied to an electronic device, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring an original image when a dark color mode is detected to be started, and the original image is an image of a current interface of the electronic equipment;
the acquisition unit is further used for acquiring a target gray scale of the original image, wherein the target gray scale is a font gray scale and/or a background gray scale;
an adjusting unit for adjusting the value of the target gray scale;
the adjusting unit is further configured to increase the debugging picture of the original image from a first percentage to a second percentage, and includes: acquiring a first image, wherein the first image is an interface image displayed under the first percentage debugging picture; acquiring a first gray scale and a second gray scale of the first image, wherein the first gray scale is the gray scale of a font in the first image, and the second gray scale is the gray scale of a background in the first image; respectively calculating a first difference value and a second difference value, wherein the first difference value is a difference value between the first gray scale and a first preset value, and the second difference value is a difference value between the second gray scale and a second preset value; determining a first adjusting coefficient corresponding to the first difference value and a second adjusting coefficient corresponding to the second difference value according to a mapping relation between the difference values and the coefficients; calculating a target gamma value according to the first adjusting coefficient, the first gray scale, the second gray scale and the second adjusting coefficient; and determining the second percentage corresponding to the target gamma value according to the mapping relation between the gamma value and the percentage.
7. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
8. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-5.
CN202111116933.3A 2021-09-23 2021-09-23 Interface processing method and device Active CN113781959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111116933.3A CN113781959B (en) 2021-09-23 2021-09-23 Interface processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111116933.3A CN113781959B (en) 2021-09-23 2021-09-23 Interface processing method and device

Publications (2)

Publication Number Publication Date
CN113781959A CN113781959A (en) 2021-12-10
CN113781959B true CN113781959B (en) 2022-10-21

Family

ID=78852866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111116933.3A Active CN113781959B (en) 2021-09-23 2021-09-23 Interface processing method and device

Country Status (1)

Country Link
CN (1) CN113781959B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114449242B (en) * 2022-01-25 2025-06-27 北京小米移动软件有限公司 Display control method, device and storage medium
CN118941482A (en) * 2023-05-10 2024-11-12 北京字跳网络技术有限公司 Shadow elimination method, device, storage medium and program product

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9536325B2 (en) * 2013-06-09 2017-01-03 Apple Inc. Night mode
US10186209B1 (en) * 2015-11-09 2019-01-22 Amazon Technologies, Inc. Night time control of brightness and blue light emission in device displays
CN110609722B (en) * 2019-08-09 2021-07-20 华为技术有限公司 A kind of dark mode display interface processing method, electronic device and storage medium
CN110618852B (en) * 2019-09-24 2023-12-29 Oppo广东移动通信有限公司 View processing method, view processing device and terminal equipment
CN113157357B (en) * 2020-01-23 2024-10-11 华为技术有限公司 A method, device, terminal and storage medium for page display
CN112116670B (en) * 2020-09-04 2024-07-30 北京小米移动软件有限公司 Information processing method and device, electronic equipment and storage medium
CN112507256A (en) * 2020-12-01 2021-03-16 努比亚技术有限公司 Background adjusting method, terminal and computer readable storage medium
CN113377479A (en) * 2021-06-25 2021-09-10 展讯通信(天津)有限公司 Switching method and device of application visual theme, storage medium and terminal

Also Published As

Publication number Publication date
CN113781959A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN110045908B (en) Control method and electronic equipment
CN111768416B (en) Photo cutting method and device
CN111553846B (en) Super-resolution processing method and device
CN114816210A (en) A full-screen display method and device for a mobile terminal
CN111882642B (en) Texture filling method and device for three-dimensional model
CN111768352B (en) Image processing method and device
WO2021147396A1 (en) Icon management method and smart terminal
CN112598594A (en) Color consistency correction method and related device
CN111783375A (en) Chip system and related devices
CN114596819B (en) Brightness adjusting method and related device
CN110780929B (en) Method for calling hardware interface and electronic device
WO2023030168A1 (en) Interface display method and electronic device
CN113781959B (en) Interface processing method and device
CN111381996A (en) Memory exception handling method and device
CN111612723B (en) Image restoration method and device
CN114422686B (en) Parameter adjustment method and related device
WO2022001383A1 (en) Display processing method and apparatus
CN114172596A (en) Channel noise detection method and related device
CN111880661A (en) Gesture recognition method and device
WO2023000745A1 (en) Display control method and related device
CN111581119B (en) Page recovery method and device
CN111836226A (en) Data transmission control method, device and storage medium
CN113805830A (en) Distribution display method and related equipment
CN112770002B (en) Method and electronic device for heartbeat control
CN111459271B (en) Gaze offset error determination method and 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
GR01 Patent grant
GR01 Patent grant