WO2021238469A1 - 第三方应用程序的页面展示方法、装置、电子设备 - Google Patents

第三方应用程序的页面展示方法、装置、电子设备 Download PDF

Info

Publication number
WO2021238469A1
WO2021238469A1 PCT/CN2021/086887 CN2021086887W WO2021238469A1 WO 2021238469 A1 WO2021238469 A1 WO 2021238469A1 CN 2021086887 W CN2021086887 W CN 2021086887W WO 2021238469 A1 WO2021238469 A1 WO 2021238469A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
party application
refresh rate
brightness
foreground
Prior art date
Application number
PCT/CN2021/086887
Other languages
English (en)
French (fr)
Inventor
曾开发
徐林杰
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to EP21813529.1A priority Critical patent/EP4145248A4/en
Publication of WO2021238469A1 publication Critical patent/WO2021238469A1/zh
Priority to US17/983,836 priority patent/US20230071987A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/363Graphics controllers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3265Power saving in display device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/147Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/02Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed
    • G09G5/024Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed using colour registers, e.g. to control background, foreground, surface filling
    • 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
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2330/00Aspects of power supply; Aspects of display protection and defect management
    • G09G2330/02Details of power systems and of start or stop of display operation
    • G09G2330/021Power management, e.g. power saving
    • G09G2330/022Power management, e.g. power saving in absence of operation, e.g. no data being entered during a predetermined time
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/04Changes in size, position or resolution of an image
    • G09G2340/0407Resolution change, inclusive of the use of different resolutions for different screen areas
    • G09G2340/0435Change or adaptation of the frame rate of the video stream
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/06Colour space transformation
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2360/00Aspects of the architecture of display systems
    • G09G2360/14Detecting light within display terminals, e.g. using a single or a plurality of photosensors
    • G09G2360/144Detecting light within display terminals, e.g. using a single or a plurality of photosensors the light being ambient light
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of computer technology, and in particular to a method, device, electronic device, and computer-readable storage medium for displaying a page of a third-party application program.
  • Turning on the power saving mode in an electronic device is usually to process the built-in system applications or functions in the electronic device, such as turning off the built-in system application in the electronic device, turning off the positioning function, turning off the vibration function, etc., so as to save
  • the power consumption of electronic equipment extends the battery usage time of electronic equipment.
  • the traditional third-party application page display method has the problem of high power consumption.
  • a method, device, electronic device, and computer-readable storage medium for displaying a page of a third-party application program are provided.
  • a page display of a third-party application including:
  • Adjusting the background color to a first color and adjusting the foreground color to a second color the brightness value of the first color is less than a first brightness threshold, and the brightness value of the second color is greater than a second brightness threshold, The first brightness threshold is less than or equal to the second brightness threshold;
  • a page display device of a third-party application program including:
  • the color obtaining module is used to obtain the background color and the foreground color in the script of the third-party application in response to the opening instruction to the third-party application when the electronic device enters the power-saving mode;
  • the color adjustment module is configured to adjust the background color to a first color and adjust the foreground color to a second color; the brightness value of the first color is less than a first brightness threshold, and the brightness value of the second color Greater than a second brightness threshold, and the first brightness threshold is less than or equal to the second brightness threshold;
  • a rendering module configured to render the background area of the third-party application in the first color, and render the foreground area of the third-party application in the second color to obtain a page of the third-party application;
  • the display module is used to display the rendered page of the third-party application.
  • An electronic device including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to execute the page display method of the third-party application as described above. operate.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the operation of the above-mentioned method is realized.
  • the above-mentioned third-party application page display method, device, electronic device, and computer-readable storage medium when the electronic device enters the power-saving mode, in response to the opening instruction of the third-party application, obtain the script of the third-party application Background color and foreground color; adjust the background color to the first color, and adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, the first The brightness threshold is less than or equal to the second brightness threshold; that is, the background color of the third-party application is darkened, and the foreground color of the third-party application is brighter, and the background area where the background color is located occupies a large area of the page of the third-party application. In some areas, the rendered page of the third-party application enters the dark mode, and the rendered page of the third-party application is displayed, which can reduce the power consumption of the screen.
  • the electronic device enters the power-saving mode, and the built-in system applications in the electronic device, such as the system desktop and phone book, also enter the dark mode, and when the electronic device starts the third-party application, the rendered third party is displayed
  • the application page which also enters the dark mode, improves the coordination between the page displayed by the third-party application and the page displayed by the system application.
  • Fig. 1 is a frame diagram of a method for displaying a page of a third-party application in an embodiment.
  • Fig. 2 is a flowchart of a method for displaying a page of a third-party application in an embodiment.
  • Figure 3a is a schematic diagram of entering a power saving mode in an embodiment.
  • Figure 3b is a schematic diagram of entering the power saving mode in another embodiment.
  • Fig. 3c is a schematic diagram of entering the power saving mode in another embodiment.
  • Fig. 4 is a flowchart of a method for displaying a page of a third-party application in another embodiment.
  • Fig. 5 is a flowchart of a method for displaying a page of a third-party application in another embodiment.
  • Fig. 6 is a flowchart of a method for displaying a page of a third-party application in another embodiment.
  • FIG. 7 is a flowchart of obtaining the first color and the second color according to the brightness of the ambient light in an embodiment.
  • FIG. 8 is a frame diagram showing a page of a third-party application program according to the ambient light brightness in an embodiment.
  • Fig. 9 is a flowchart of a method for adjusting the screen refresh rate in an embodiment.
  • Fig. 10 is a structural block diagram of a page display device of a third-party application in an embodiment.
  • Fig. 11 is a schematic diagram of the internal structure of an electronic device in an embodiment.
  • first, second, etc. used in this application can be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
  • the first color may be referred to as the second color, and similarly, the second color may be referred to as the first color. Both the first color and the second color are colors, but they are not the same color.
  • Fig. 1 is a frame diagram of a method for displaying a page of a third-party application in an embodiment.
  • the power saving control module calls the third-party dark color control module, obtains the third-party application page through the third-party dark color control module, and displays the obtained third-party application page.
  • the electronic device before the electronic device enters the power saving mode, obtain the status of the third-party application and the status of the system application through the file system, and store data such as the status of the third-party application and the status of the system application in the storage medium Medium; after the electronic device exits the power saving mode, data such as the state of the third-party application and the state of the system application can be obtained from the storage medium, and the data can be restored.
  • Fig. 2 is a flowchart of a method for displaying a page of a third-party application in an embodiment. As shown in FIG. 2, the method for displaying a page of a third-party application includes operations 202 to 208.
  • the power saving mode of the electronic device can make the electronic device more power-saving and extend the battery power usage time.
  • the number of applications that can be used is limited, and some power-consuming functions or features will be turned off or disabled, such as turning off the navigation function, turning off the Bluetooth function, turning off the vibration function, etc.; non-core applications It will be cleared and restricted from self-starting and associated starting, and the CPU (central processing unit, central processing unit) parameters will be adjusted to reduce the energy consumption of the CPU during operation; electronic devices can also reduce the refresh rate of the screen.
  • the power saving mode is received to start the power saving mode, and the power saving mode is entered.
  • the user clicks the switch in the power saving mode control 302 that is, the electronic device receives an instruction to turn on the power saving mode and enters the power saving mode.
  • an opening instruction of the third-party application 306 is generated, and in response to the opening instruction of the third-party application, the background color and foreground color in the script of the third-party application are obtained; the background color is adjusted For the first color, adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, and the first brightness threshold is less than or equal to the second brightness threshold;
  • the background area of the third-party application is rendered in the first color, and the foreground area of the third-party application is rendered in the second color to obtain the page of the third-party application; the rendered page 308 of the third-party application is displayed.
  • the power of the electronic device is detected; when the power is less than the power threshold, a power-saving mode pop-up window is generated, and the power-saving mode pop-up window is displayed on the display interface of the screen; receiving a response to the power-saving mode pop-up window Enter the power-saving mode by turning on the command in.
  • the power-saving mode pop-up window 310 when the power is less than the power threshold, the power-saving mode pop-up window 310 is generated, and the power-saving mode pop-up window is displayed on the display interface of the screen, prompting the current low power and recommending the user to turn on the power-saving mode;
  • the power mode pop-up window includes two buttons: open and cancel.
  • the open button that is, the electronic device receives an instruction to open the power-saving mode pop-up window and enters the power-saving mode.
  • the user can click the exit control 304 to exit the power saving mode.
  • an opening instruction of the third-party application 306 is generated, and in response to the opening instruction of the third-party application, the background color and foreground color in the script of the third-party application are obtained; the background color is adjusted For the first color, adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, and the first brightness threshold is less than or equal to the second brightness threshold;
  • the background area of the third-party application is rendered in the first color, and the foreground area of the third-party application is rendered in the second color to obtain the page of the third-party application; the rendered page 308 of the third-party application is displayed.
  • the voice is received, and the voice is analyzed to obtain the analysis result; when there is an instruction to turn on the power saving mode in the analysis result, the power saving mode is entered.
  • the voice is received, and the voice is analyzed to obtain an analysis result 312.
  • the analysis result 312 there is a power-saving mode activation instruction "help me turn on the power-saving mode", and the power-saving mode is entered.
  • the user can click the exit control of 304 to exit the power saving mode.
  • the 306 is a third-party application.
  • an opening instruction of the third-party application 306 is generated, and in response to the opening instruction of the third-party application, the background color and background color in the script of the third-party application are obtained.
  • Foreground color adjust the background color to the first color, and adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, and the first brightness threshold is less than Or equal to the second brightness threshold; the background area of the third-party application is rendered in the first color, and the foreground area of the third-party application is rendered in the second color to obtain the page of the third-party application; the rendered third-party application is displayed Page 308.
  • the electronic device has its own system applications, such as system desktop, settings, browser, software store, calculator, camera, phone book and other applications, the system application can realize the basic functions of the electronic device , Such as displaying the system desktop, setting functions, browsing web pages, downloading applications from software stores, computing, shooting, calling, etc.
  • Third-party applications are developed by third-party application developers and uploaded to the server; electronic devices can download third-party applications from the server through the network. Third-party applications such as WeChat, Mobile QQ, Toutiao, AutoNavi Maps, Weibo, Taobao, etc.
  • the script of the third-party application includes the code of the page displayed by the third-party application, and the code includes information such as the background color and foreground color of the page displayed by the third-party application.
  • the background color refers to the color of the background area of the page displayed by the third-party application
  • the foreground color refers to the color of the foreground area of the page displayed by the third-party application.
  • the page displayed by the third-party application includes a navigation bar and a contact list
  • the page displayed by the third-party application includes a background area of the navigation bar and a background area of the contact list.
  • the foreground area includes various elements, such as text, icons, photos, videos, audio, and so on.
  • the foreground color can refer to the color of each element in the foreground area, such as the color of the text, the color of the icon, the color of the photo frame, the color of the video frame, and the color of the control where the audio is located.
  • the script of the third-party application can also include the size and style of the background area where the background color is located, and the size and style of the foreground area where the foreground color is located.
  • the electronic device when receiving an opening instruction for a third-party application, in response to the opening instruction for the third-party application, search for the background label and the foreground label from the script of the third-party application , Get the background color corresponding to the background label, and the foreground color corresponding to the foreground label.
  • the View is divided into two parts by default, the background and content.
  • the background label is "background", and the background label can be set according to user needs.
  • the foreground label may be a label other than the background label. In the background label or foreground label, you can set the color (color) or drawable, and the draw method in the drawable can customize the style.
  • content is the content drawn in the draw and onDraw methods of the View. The drawText method can be called when the background and content are drawn.
  • the picture is sampled to obtain the color value of at least two pixels; each color value of at least two pixels is counted to obtain the number of pixels belonging to the same color value; The maximum number of pixels of the same color value is divided by the number of at least two pixels to obtain the number ratio; when the number ratio is greater than or equal to the ratio threshold, the picture is a pure color picture; when the number ratio is less than the ratio threshold, the picture is not Solid color picture.
  • the electronic device samples the picture to obtain the color value of 100 pixels, and count the color values of 100 pixels. Among them, there are 98 for white, 1 for black, and 1 for blue, which means they belong to the same color. The maximum number of pixels of the value is 98. Divide 98 by 100 to get a number ratio of 0.98. When the ratio threshold is 0.95, the picture is a pure color picture.
  • the picture when the picture is a pure color picture, it is detected whether the brightness value of the pure color picture is greater than the specified brightness threshold; when the brightness value of the pure color picture is greater than the specified brightness threshold, the picture is a pure color bright picture, and the picture is inverted .
  • the electronic device can obtain the RGB value of the color of the pure color picture; convert the RGB value into a LAB value; and use the L channel value in the LAB value as the brightness value of the pure color picture.
  • the RGB (Red, Green, Blue, red, green, blue) value refers to the three channel values in the foreground, which are the red channel, the green channel and the blue channel.
  • the front can be obtained by fusion of the three RGB channel values. view.
  • LAB is a color mode, including three channel values, namely the brightness L, and two color channels A and B.
  • A represents the component from green to red
  • B represents the component from blue to yellow.
  • the background color is adjusted to the first color
  • the foreground color is adjusted to the second color
  • the brightness value of the first color is less than the first brightness threshold
  • the brightness value of the second color is greater than the second brightness threshold
  • the first brightness threshold is less than Or equal to the second brightness threshold.
  • the brightness value indicates the value of the brightness of the color. The higher the brightness value, the brighter the color; the lower the brightness value, the darker the color. Both the first brightness threshold and the second brightness threshold can be set according to user needs.
  • the electronic device can preset the first color and the second color.
  • the brightness value of the first color is less than the first brightness threshold, which means that the brightness of the first color is dark, that is, the background color is adjusted to a color with a darker brightness.
  • the brightness value of the second color is greater than the second brightness threshold, indicating that the brightness of the second color is brighter, that is, the foreground color is adjusted to a brighter color.
  • the first brightness threshold is 50
  • the second brightness threshold is also 50
  • the first color is black
  • the second color is white
  • the brightness value of black is 0,
  • the brightness value of white is 100, that is, the background color is adjusted to black
  • Adjust the foreground color to white and the rendered page of the third-party application enters the dark mode.
  • the electronic device judges the drawing command through the HWUI (hardware accelerated drawing UI) layer, and then injects the inverse color algorithm.
  • the background color and the foreground color are processed based on the native Force Dark (forced dark mode) inverse color rule.
  • the background color is adjusted to the first color
  • the foreground color is adjusted to the second color. Adjust the background color and foreground color from the hardware (HWUI layer) and software (the original Force Dark anti-color rule), and the first color and the second color can be obtained more quickly and accurately.
  • the HWUI layer mainly uses OpenGL ES (OpenGL for Embedded Systems) to perform GPU (Graphics Processing Unit, graphics processor) hardware drawing to improve the drawing performance of the entire system.
  • OpenGL ES OpenGL for Embedded Systems
  • GPU Graphics Processing Unit, graphics processor
  • the background area of the third-party application is rendered in the first color
  • the foreground area of the third-party application is rendered in the second color to obtain a page of the third-party application.
  • Rendering refers to the process of generating visual views based on code.
  • the electronic device renders the background area of the third-party application in the first color, that is, coloring the first color in the background area.
  • the electronic device renders the foreground area of the third-party application in the second color, that is, coloring the second color in the foreground area.
  • the brightness of the rendered background area will be darker; if the brightness value of the second color is greater than the second brightness threshold, the brightness of the rendered foreground area will be brighter.
  • the application page enters dark mode.
  • the rendering of the first color and the second color in the web page is completed in the browser kernel.
  • the screen of the electronic device may be an OLED (Organic Light-Emitting Diode, organic light-emitting diode) screen.
  • the electronic device displays the page of the third-party application based on the OLED screen rendering.
  • the background area in the page of the third-party application is the first color whose brightness value is less than the first brightness threshold
  • the background area corresponding to the OLED screen The area provides the brightness value corresponding to the first color, and the brightness of the first color is relatively dark, and the power consumption of the OLED screen to provide the brightness is low, so that the power consumption of the screen of the electronic device can be saved.
  • the first color is black
  • the background area in the page of the third-party application is black
  • the area in the OLED screen corresponding to the background area does not need to emit light, and the black of the background area can be displayed, thereby further saving The power consumption of electronic device screens.
  • the electronic device in response to the opening instruction of the third-party application, obtain the background color and foreground color in the script of the third-party application; adjust the background color to For the first color, adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, and the first brightness threshold is less than or equal to the second brightness threshold; also That is to say, the background color of the third-party application is darkened, and the foreground color of the third-party application is brighter, and the background area where the background color is located occupies most of the page of the third-party application, so that the third-party application is rendered
  • the page enters dark mode to display the rendered page of a third-party application, which can reduce the power consumption of the screen.
  • the electronic device enters the power-saving mode, and the built-in system applications in the electronic device, such as the system desktop and phone book, also enter the dark mode, and when the electronic device starts the third-party application, the rendered third party is displayed
  • the application page which also enters the dark mode, improves the coordination between the page displayed by the third-party application and the page displayed by the system application.
  • adjusting the background color to the first color and adjusting the foreground color to the second color includes:
  • a third brightness threshold is obtained, and the brightness value of the background color and the brightness value of the foreground color are respectively compared with the third brightness threshold.
  • the third brightness threshold may be set according to user needs, for example, the third brightness threshold may be 50.
  • the part of the background color that is greater than or equal to the third brightness threshold is adjusted to the first color, and the part of the foreground color that is less than the third brightness threshold is adjusted to the second color.
  • the electronic device uses a color greater than or equal to the third brightness threshold as a bright color, and uses a color less than the third brightness threshold as a dark color.
  • each background color there can be one or at least two background colors. Similarly, there can be one or at least two foreground colors.
  • the part greater than or equal to the third brightness threshold is adjusted to the first color, and the part less than the third brightness threshold remains unchanged; the brightness value of the first color is less than the third brightness threshold. That is, the part of the background color belonging to the bright color category is adjusted to a dark color, while the part belonging to the dark color category remains unchanged.
  • each foreground color adjusts the part less than the third brightness threshold to the second color, while the part greater than or equal to the third brightness threshold remains unchanged; the brightness value of the second color is greater than or equal to the third brightness threshold .
  • the part of the foreground color that belongs to the dark color category is adjusted to the light color, while the part that belongs to the light color category remains unchanged.
  • the background area corresponding to the third-party application is rendered in the first color and the part of the background color that is less than the third brightness threshold, and the third-party application is rendered in the second color and the part of the foreground color that is greater than or equal to the third brightness threshold.
  • the page of the third-party application is obtained.
  • the part of the background color that is greater than or equal to the third brightness threshold is adjusted to the first color, and the part of the background color that is less than the third brightness threshold remains unchanged, that is, no adjustment is required, and the foreground color is less than the third brightness threshold.
  • the part of the brightness threshold is adjusted to the second color, and the part of the foreground color greater than or equal to the third brightness threshold remains unchanged, that is, no adjustment is required.
  • the method before obtaining the third brightness threshold and comparing the brightness value of the background color and the brightness value of the foreground color with the third brightness threshold, the method further includes: obtaining the RGB value of the foreground color and obtaining the RGB value of the background color ; Convert the RGB value of the foreground color and the RGB value of the background color into LAB values respectively; use the L channel value in the LAB value of the foreground color as the brightness value of the foreground color, and the L channel value in the LAB value of the background color as the background The brightness value of the color.
  • the RGB (Red, Green, Blue, red, green, blue) value refers to the three channel values in the foreground, which are the red channel, the green channel and the blue channel.
  • the front can be obtained by fusion of the three RGB channel values. view.
  • LAB is a color mode, including three channel values, namely the brightness L, and two color channels A and B.
  • A represents the component from green to red
  • B represents the component from blue to yellow.
  • the electronic device obtains the RGB value of the foreground color and the RGB value of the background color, converts the RGB value of the foreground color and the RGB value of the background color into LAB values, and then uses the L channel value in the LAB value of the foreground color as the brightness of the foreground color Value, the L channel value in the LAB value of the background color is used as the brightness value of the background color, and the brightness value of the foreground color and the brightness value of the background color can be accurately obtained.
  • the above method further includes: when the electronic device enters the power saving mode, in response to the opening instruction of the third-party application, and the third-party application has a dark mode, turning on the dark mode of the third-party application; When the electronic device enters the power saving mode, in response to the opening instruction of the third-party application, and the third-party application does not have a dark mode, the background color and foreground color operations in the script for obtaining the third-party application are executed.
  • the electronic device enters the power saving mode, in response to the third-party application's opening instruction, and the third-party application has a dark mode, turn on the dark mode of the third-party application, that is, turn on the dark mode of the third-party application to adapt to the electronic device
  • the power saving mode improves the compatibility between third-party applications and electronic devices.
  • the electronic device When the electronic device enters the power saving mode, in response to the third-party application opening instruction, and the third-party application does not have a dark mode, execute the background color and foreground color operations in the script to obtain the third-party application to realize the third-party application
  • the application enters the dark mode, thereby saving the power consumption of the screen of the electronic device, and improving the coordination between the page displayed by the third-party application and the page displayed by the system application.
  • after acquiring the background color and foreground color in the script of the third-party application it further includes: saving the background color and foreground color in the script of the third-party application; when the electronic device exits the power saving mode, acquiring Save the background color and foreground color in the script of the third-party application; render the background area of the third-party application with the background color, render the foreground area of the third-party application with the foreground color, update the page of the third-party application; display the updated Pages of third-party applications.
  • the obtained background color and foreground color may be saved in a storage medium (such as a flash memory) of the electronic device.
  • a storage medium such as a flash memory
  • the electronic device exits the power saving mode, it obtains the background color and foreground color in the script of the third-party application saved from the storage medium (such as flash memory), and then renders the background area of the third-party application with the background color, the foreground color Render the foreground area of the third-party application, update the page of the third-party application, display the page of the updated third-party application, and restore the page of the third-party application to the state before entering the power saving mode.
  • the electronic device performs operation 502 to enter the power saving mode; performs operation 504 to save the state of the third-party application and the state of the system application before entering the power saving mode.
  • the electronic device executes operation 506 to determine whether the system application has turned on the dark mode. When the determination is yes, no operation is required, that is, operation 508; when the determination is no, operation 510 is executed. Operation 510, the dark mode of the system application is turned on.
  • Electronic equipment comes with system applications, such as system desktop, settings, browser, software store, calculator, camera, phone book and other applications.
  • This system application can realize the basic functions of electronic equipment, such as display system desktop, Setting up functions, browsing the web, downloading applications from software stores, computing, shooting, calling, etc.
  • the electronic device performs operation 512 to determine whether the third-party application has a dark mode; when the determination is yes, perform operation 514 to turn on the dark mode of the third-party application itself; when the determination is no, perform operation 516.
  • Operation 516 rendering the dark color effect of the third-party application, specifically includes: obtaining the background color and foreground color in the script of the third-party application; adjusting the background color to the first color, and adjusting the foreground color to the second color; first The brightness value of the color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, the first brightness threshold is less than or equal to the second brightness threshold; the background area of the third-party application is rendered in the first color, and the second Color rendering the foreground area of the third-party application to obtain the page of the third-party application; display the rendered page of the third-party application.
  • the electronic device When the electronic device performs operation 518 to exit the power saving mode, it performs operation 520 to restore both the third-party application and the system application to the state before entering the power saving mode.
  • the above method further includes:
  • Operation 602 Obtain the focus element in the foreground area from the script of the third-party application; the focus element is an element whose priority is higher than the priority threshold in the page of the third-party application.
  • the foreground area there are various elements, such as text, icons, photos, video, audio, etc., and the importance of each element in the foreground area is different. According to the importance of each element in the foreground area, the corresponding priority can be set for each element. The higher the priority, the more important the element is.
  • the foreground area contains elements such as navigation bar, contact’s chat information, volume adjustment control, shooting control, etc.
  • the volume adjustment control and shooting control are the function controls that users often use, so you can set the volume adjustment control and shooting control.
  • the priority is four levels, the priority of the navigation bar is two, the priority of the contact's chat information is three, and the priority threshold is three, then the two elements of the volume adjustment control and the shooting control are the focus elements.
  • the color of the focus element is adjusted to the focus color; the contrast between the focus color and the first color is higher than the contrast threshold.
  • the contrast between the focus color and the first color refers to the measurement of different brightness levels between the focus color and the first color.
  • the first color is the color of the background area
  • the focus color is the color of the focus element in the foreground area.
  • the contrast between the focus color and the first color is higher than the contrast threshold, and the focus element can be more prominent from the color of the background area. Show focus elements more clearly.
  • the first color is black
  • the second color is white
  • the focus color is blue
  • the color of the background area is black
  • the area of elements other than the focus element in the foreground area is white
  • the focus element is Blue can highlight the focus element and show the focus element more clearly.
  • the background area of the third-party application is rendered in the first color
  • the focus element is rendered in the focus color
  • other areas in the foreground area of the third-party application except the focus element are rendered in the second color to obtain the third-party application Page.
  • the focus element is obtained from the foreground area, and the color of the focus element is adjusted to the focus color, and the contrast between the focus color and the first color of the background area is higher than the contrast threshold, then the page of the third-party application is displayed
  • the focus element can be more prominent, and the focus element can be displayed more clearly; based on the borderless design concept, the all-weather dark mode distinguishes the page level, which effectively improves the contrast in the dark mode and reduces the possibility of visual fatigue.
  • Third-party applications The screen of the program has been fully adapted under the system optimization to ensure that there will be no unclear interface elements or visual conflicts.
  • the all-weather dark mode can meet any scene and use it at any time, plus the intelligent brightness adjustment function, so that the dark mode can work in strong or low light environments. Even if it is used during the day, the reading experience is not compromised.
  • adjusting the background color to the first color and adjusting the foreground color to the second color includes:
  • the ambient light brightness refers to the brightness of the environment where the electronic device is located.
  • Operation 704 According to the current ambient light brightness, matching is performed from the corresponding relationship between the ambient light brightness and the contrast to determine the corresponding first contrast; the corresponding relationship between the ambient light brightness and the contrast is a positive correlation.
  • the electronic device can preset the corresponding relationship between ambient light brightness and contrast.
  • the first contrast refers to the contrast between the first color and the second color.
  • the corresponding relationship between ambient light brightness and contrast is a positive correlation, that is, the greater the value of ambient light brightness, the greater the value of contrast; the smaller the value of ambient light brightness, the smaller the value of contrast.
  • the contrast in the relationship between ambient light brightness and contrast can be set according to user needs, such as the maximum brightness of the background, the minimum brightness of the dialog/floating layer background, and the minimum brightness of the foreground.
  • the first contrast is determined to be high, so that the user can see Clear the content on the page.
  • the value of the ambient light brightness is small, it means that the ambient light brightness is low, and the human eyes are more sensitive to the brightness of the screen of the electronic device, and it can be determined that the lower first contrast is higher.
  • the first color and the second color are determined based on the first contrast, the background color is adjusted to the first color, and the foreground color is adjusted to the second color.
  • the electronic device may first determine that the first color is black, and then determine the second color based on the first contrast. In another implementation manner, the electronic device may first determine that the second color is white, and then determine the first color through the first contrast. In other embodiments, the electronic device may also determine multiple combinations of the first color and the second color based on the first contrast, and select one of the multiple combinations.
  • the current ambient light brightness is acquired, the first contrast is determined according to the current ambient light brightness, and then the first color and the second color are determined, so that the page of the third-party application can be combined with the current ambient light brightness , So as to display the pages of third-party applications more accurately.
  • the light perception smoothing calculation brightness fitting module in the electronic device monitors the ambient light through the light perception, obtains the current ambient light brightness, and then sends the current ambient light brightness to the contrast control module .
  • the contrast control module matches the corresponding relationship between the ambient light brightness and the contrast according to the current ambient light brightness, and determines the corresponding first contrast; the corresponding relationship between the ambient light brightness and the contrast is a positive correlation; the electronic device is based on the first contrast Determine the first color and the second color, adjust the background color to the first color, and adjust the foreground color to the second color; render the background area of the third-party application in the first color, and render the third-party application in the second color In the foreground area, get the page of the third-party application.
  • after displaying the rendered page of the third-party application it further includes: when the current ambient light brightness change is detected, according to the new ambient light brightness from the correspondence between the ambient light brightness and the contrast The relationship is matched to determine the new first contrast; the new first color and the new second color are determined based on the new first contrast; the background area of the third-party application is rendered with the new first color, and the new second The color renders the foreground area of the third-party application, updates the page of the third-party application, and displays the page of the updated third-party application.
  • the electronic device When detecting a change in the current ambient light brightness, the electronic device determines a new first contrast according to the new ambient light brightness, thereby determining a new first color and a second color, and then rendering the third-party application with the new first color
  • the background area of the third-party application is rendered in the new second color, and the page of the new third-party application is displayed, and the page of the third-party application is updated.
  • the electronic device detects whether the current ambient light brightness has changed, and when it detects that the current ambient light brightness has changed, it determines the new first color and second color, and displays the updated third-party application. Display the pages of third-party applications in real time and more accurately.
  • the method further includes: in response to an instruction to start the system application in the electronic device, obtaining the foreground and background colors in the script of the system application; and applying the system application
  • the foreground color of the program is adjusted to the third color
  • the background color of the system application is adjusted to the fourth color
  • the brightness value of the third color is less than the fourth brightness threshold
  • the brightness value of the fourth color is greater than the fifth brightness threshold
  • the fourth brightness The threshold is less than or equal to the fifth brightness threshold
  • the background area of the system application is rendered in the third color
  • the foreground area of the system application is rendered in the fourth color to obtain the page of the system application
  • the page of the system application obtained by rendering is displayed.
  • the electronic device has its own system applications, such as system desktop, settings, browser, software store, calculator, camera, phone book and other applications.
  • the system application can realize the basic functions of the electronic device, such as displaying the system desktop , Setting functions, browsing the web, downloading applications from software stores, computing, shooting, calling, etc.
  • Both the fourth brightness threshold and the fifth brightness threshold can be set according to user needs.
  • the electronic device can preset the third color and the fourth color.
  • the brightness value of the third color is less than the fourth brightness threshold, indicating that the brightness of the third color is dark, that is, the background color of the system application is adjusted to a color with a darker brightness.
  • the brightness value of the fourth color is greater than the fifth brightness threshold, indicating that the brightness of the fourth color is brighter, that is, the foreground color of the system application is adjusted to a brighter color.
  • the fourth brightness threshold is 50
  • the fifth brightness threshold is also 50
  • the third color is black
  • the fourth color is white
  • the brightness value of black is 0,
  • the brightness value of white is 100, which is the background color of the system application Adjust to black, adjust the foreground color of the system application to white, and the rendered page of the system application enters the dark mode.
  • the system application when the electronic device enters the power-saving mode, in response to the start instruction of the system application, the system application is rendered to obtain the page of the system application in the dark mode, and then the electronic device enters the power-saving mode.
  • switching between a third-party application and a system application it can improve the coordination between the displayed page of the third-party application and the interface of the system application, and prevent one of the third-party application and the system application from being in the normal mode.
  • the other one is in the dark mode (that is, one is brighter and the other is darker), which causes the page inconsistency.
  • the normal mode refers to a mode in which the brightness of the background area is brighter, and the brightness of each element in the foreground area is darker.
  • the above method further includes:
  • Operation 902 when the electronic device enters the power saving mode, adjust the refresh rate of the screen of the electronic device to a first refresh rate; the first refresh rate is within the refresh rate range of the screen and is less than the refresh rate threshold.
  • the refresh rate refers to the number of times the electron beam repeatedly scans the image on the screen. The higher the refresh rate, the better the stability of the image (picture) displayed on the screen.
  • the screen refresh rate can be 60HZ, 90HZ, 120HZ, 144HZ; and the image displayed at the 120HZ screen refresh rate is more stable than the 60HZ screen refresh rate.
  • the refresh rate of the screen needs to be greater than or equal to the lower limit; and in order to make the battery power of the electronic device can be used for a longer time, the refresh of the screen
  • the rate needs to be less than or equal to the upper limit, and the range between the upper limit and the lower limit is the refresh rate range of the screen.
  • the upper limit and the lower limit may be empirical values.
  • the first refresh rate is within the refresh rate range of the screen, and when the refresh rate of the screen of the electronic device is adjusted to the first refresh rate, the screen can be guaranteed to be in normal use; and the first refresh rate is less than the refresh rate threshold, which limits the first refresh rate.
  • a maximum refresh rate can save screen power.
  • the first refresh rate may also be a specific gear, such as one of 60HZ, 90HZ, 120HZ, 144HZ and so on.
  • the first refresh rate may be the lower limit of the refresh rate range of the screen, that is, the minimum value in the refresh rate range, which can save the power of the screen to the utmost extent.
  • the refresh rate threshold can be set according to user needs. Further, the electronic device obtains the refresh rate before entering the power saving mode, and sets the refresh rate threshold to be smaller than the refresh rate before entering the power saving mode. After the electronic device enters the power saving mode, the refresh rate of the screen of the electronic device is adjusted to the first refresh rate, the first refresh rate is less than the refresh rate threshold, and the refresh rate threshold is less than the refresh rate before entering the power saving mode, then power saving is entered The first refresh rate after the mode is lower than the refresh rate before entering the power saving mode, which reduces the refresh rate of the screen and saves the power consumption of the screen.
  • the current system status refers to the current system status of the electronic device.
  • the current system status can be one of game status, video playback status, application switching status, animation playback status, running specified application status, social chat status, music playback status, etc.
  • the current system status can be one of the system statuses that require high screen refresh rate, such as game status, video playback status, application switching status, animation playback status, or running specified application status; it can also be the screen refresh rate Low-demand system status, such as social chat status, music playback status, etc.
  • the current system status is different, the corresponding screen refresh rate requirements can be different.
  • the electronic device uses at least one of a polling read mechanism and a registered callback monitoring to detect the current system state.
  • the electronic device detects the application program in the current screen display interface and each element in the screen display interface, and determines the current system state based on the application program in the current screen display interface and each element in the screen display interface .
  • the application program in the current screen display interface refers to the application program currently in the screen display interface.
  • WeChat is the application in the current screen display interface
  • WeChat and uses the lyrics floating window function of the music application at the same time the lyrics of the song are displayed on the screen display interface
  • Both WeChat and music applications are applications in the current screen display interface.
  • the number of applications in the current screen display interface can be one or multiple.
  • the currently used application program may be the application program that comes with the system of the electronic device, such as camera, music, photo album, etc., or may include the application program downloaded by the user, such as WeChat, Alipay, etc.
  • the various elements in the screen display interface can include pictures, videos, audios, texts, and can also include the brightness of the screen, the size of the screen, and so on.
  • the application currently used by the electronic device is WeChat, and the screen display interface includes a video
  • it can be determined that the current system state is the video playback state.
  • the application currently used by the electronic device is a game
  • the screen display interface includes game element defense towers, enemy minions, etc.
  • the current system state is the game state.
  • the application currently used by the electronic device includes WeChat, which is running at the front end, and each element in the screen display interface includes text and pictures, and it can be determined that the current system state is the social chat state.
  • the target refresh rate is determined based on the current system state, and the refresh rate of the screen is adjusted from the first refresh rate to the target refresh rate.
  • the current system status is different, the corresponding screen refresh rate requirements can be different, and the target refresh rate determined based on the current system status can also be different.
  • the determined target refresh rate can be higher;
  • the current system state is a social chat state, a music playing state, and other system states that require a low screen refresh rate, the determined target refresh rate may be lower.
  • the electronic device presets the corresponding relationship between each system state and the refresh rate, and obtains the corresponding relationship between the system state and the refresh rate; matches the corresponding relationship between the system state and the refresh rate with the current system state, from the system state to the current system state.
  • the corresponding relationship between the refresh rates determines the refresh rate of the current system state, and uses the determined refresh rate as the target refresh rate.
  • the refresh rate of the game state is determined to be 90HZ from the corresponding relationship between the system state and the refresh rate, that is, the target refresh rate is 90HZ;
  • the current system state is the music playing state, from The corresponding relationship between the system state and the refresh rate determines that the refresh rate of the music playing state is 60HZ, that is, the target refresh rate is 60HZ.
  • the electronic device when the electronic device enters the power saving mode, by adjusting the background color and foreground color of the page of the third-party application, the displayed page of the third-party application is in the dark mode, which can save the screen of the electronic device.
  • Power consumption when the electronic device enters the power saving mode, at the same time, the refresh rate of the electronic device screen can be adjusted to the first refresh rate, which can first reduce the power consumption of the electronic device’s screen and save the power of the electronic device; check the current System status, based on the current system status to determine the target refresh rate, the screen refresh rate can be adjusted from the first refresh rate to the target refresh rate, so that the screen refresh rate matches the current system state, and the accuracy of the adjusted screen refresh rate is improved sex.
  • power consumption can be optimized, that is, the power consumption of the screen of the electronic device is reduced, the target refresh rate is determined based on the current system state, and the refresh rate of the screen is adjusted from the first refresh rate
  • the target refresh rate can also ensure the display effect and user experience of the screen display interface in the current system state, and achieve a balance between power consumption and experience.
  • the method further includes: acquiring the second refresh rate when the electronic device exits the power saving mode; the second refresh rate is higher than or equal to the first refresh rate. A refresh rate; the refresh rate of the screen is adjusted from the target refresh rate to the second refresh rate.
  • the electronic device When the electronic device exits the power saving mode, it returns to the normal mode.
  • the normal mode in order to ensure that the screen display interface is clearer, smoother and more accurate, the obtained second refresh rate is higher than or equal to the first refresh rate, and then the screen is refreshed The rate is adjusted from the target refresh rate to the second refresh rate.
  • the electronic device before the electronic device enters the power saving mode, it further includes: acquiring the current original refresh rate of the screen; when the electronic device exits the power saving mode, acquiring the second refresh rate includes: acquiring the original refresh rate when the electronic device exits the power saving mode Refresh rate; adjusting the refresh rate of the screen from the target refresh rate to the second refresh rate includes: restoring the refresh rate of the screen from the target refresh rate to the original refresh rate.
  • the electronic device Before the electronic device enters the power saving mode, obtain the current original refresh rate of the screen, that is, the refresh rate of the screen in the normal mode of the electronic device, and save the refresh rate in the storage medium (such as flash memory) of the electronic device.
  • the original refresh rate is obtained from the storage medium, and the screen refresh rate is adjusted from the target refresh rate to the second refresh rate, that is, the screen refresh rate is restored to the refresh rate before entering the power saving mode.
  • the current system state includes the first system state or the second system state, and the refresh rate requirement of the first system state is higher than the refresh rate requirement of the second system state;
  • the target refresh rate is determined based on the current system state, and the screen Adjust the refresh rate from the first refresh rate to the target refresh rate, including: when the current system state is the first system state, obtain the first reference refresh rate corresponding to the first system state, and change the refresh rate of the screen from the first refresh rate Adjust to the first reference refresh rate; when the current system state is the second system state, obtain the second reference refresh rate corresponding to the second system state, and adjust the screen refresh rate from the first refresh rate to the second reference refresh rate;
  • the first reference refresh rate is higher than the second reference refresh rate.
  • the first system state is one of a game state, a video playing state, an application switching state, an animation playing state, or a running specified application state; the second system state is a social chat state or a music playing state.
  • the designated application program may be an application program that requires a high refresh rate set by the user, such as Weibo, WeChat, etc., or may be an application program that supports a high refresh rate.
  • the specified application is running, the page of the specified application is displayed on the display interface of the screen, and the screen is refreshed with the first reference refresh rate, and a clearer page of the specified application can be obtained.
  • the first system state requires high visual effects
  • the second system state requires low visual effects, that is, the refresh rate requirement of the first system state is higher than the refresh rate requirement of the second system state.
  • the screen refresh rate corresponding to the first system state is the first reference refresh rate
  • the screen refresh rate corresponding to the second system state is the second Refer to refresh rate. Since the refresh rate requirement of the first system state is higher than the refresh rate requirement of the second system state, the first reference refresh rate is higher than the second reference refresh rate.
  • the current system state includes the first system state or the second system state.
  • the corresponding first reference refresh rate is obtained, and when the current system state is the second system state , Obtain the corresponding second reference refresh rate, the refresh rate requirement of the first system state is higher than the refresh rate requirement of the second system state, then the first reference refresh rate is higher than the second reference refresh rate, and the screen refresh can be adjusted more accurately Rate.
  • the above method further includes: determining a second contrast between the first color and the second color based on the first color and the second color; according to the second contrast, proceeding from the correspondence between the refresh rate and the contrast Match, determine the corresponding second refresh rate; the corresponding relationship between the refresh rate and the contrast is a negative correlation; adjust the refresh rate of the screen to the second refresh rate.
  • the second contrast refers to the measurement of different brightness levels between the first color and the second color.
  • the electronic device can preset the corresponding relationship between the refresh rate and the contrast.
  • the corresponding relationship between the refresh rate and the contrast is a negative correlation, that is, the larger the value of the refresh rate, the smaller the value of the contrast; the smaller the value of the refresh rate brightness, the larger the value of the contrast.
  • the user can easily obtain content from the displayed page of the third-party application, and therefore, a smaller second refresh rate can be determined, thereby saving power consumption of the screen.
  • the value of the second contrast ratio is small, it is not easy for the user to obtain content from the displayed page of the third-party application, so a larger second refresh rate can be determined, so that the displayed page of the third-party application is clearer, and the user can It is easier to obtain the content of third-party applications from the screen display interface.
  • Fig. 10 is a structural block diagram of an apparatus for displaying a page of a third-party application according to an embodiment.
  • a third-party application page display device 1000 is provided, which includes: a color acquisition module 1002, a color adjustment module 1004, a rendering module 1006, and a display module 1008, wherein:
  • the color acquisition module 1002 is used for acquiring the background color and foreground color in the script of the third-party application in response to the opening instruction of the third-party application when the electronic device enters the power-saving mode.
  • the color adjustment module 1004 is used to adjust the background color to the first color and the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, A brightness threshold is less than or equal to the second brightness threshold.
  • the rendering module 1006 is configured to render the background area of the third-party application in the first color, and render the foreground area of the third-party application in the second color to obtain the page of the third-party application.
  • the display module 1008 is used to display the rendered page of the third-party application.
  • the page display device of the above-mentioned third-party application acquires the background color and foreground color in the script of the third-party application in response to the opening instruction of the third-party application when the electronic device enters the power-saving mode; adjusts the background color to For the first color, adjust the foreground color to the second color; the brightness value of the first color is less than the first brightness threshold, the brightness value of the second color is greater than the second brightness threshold, and the first brightness threshold is less than or equal to the second brightness threshold; also That is to say, the background color of the third-party application is darkened, and the foreground color of the third-party application is brighter, and the background area where the background color is located occupies most of the page of the third-party application, so that the third-party application is rendered
  • the page enters dark mode to display the rendered page of a third-party application, which can reduce the power consumption of the screen.
  • the electronic device enters the power-saving mode, and the built-in system applications in the electronic device, such as the system desktop and phone book, also enter the dark mode, and when the electronic device starts the third-party application, the rendered third party is displayed
  • the application page which also enters the dark mode, improves the coordination between the page displayed by the third-party application and the page displayed by the system application.
  • the above-mentioned color adjustment module 1004 is also used to obtain a third brightness threshold, compare the brightness value of the background color and the brightness value of the foreground color with the third brightness threshold; The part of the brightness threshold is adjusted to the first color, and the part of the foreground color that is less than the third brightness threshold is adjusted to the second color; the above-mentioned rendering module 1006 is also used to separate the parts of the first color and the background color that are less than the third brightness threshold The background area corresponding to the third-party application is rendered, and the foreground area of the third-party application is respectively rendered with the second color and the part of the foreground color that is greater than or equal to the third brightness threshold to obtain the page of the third-party application.
  • the page display device of the above-mentioned third-party application program further includes a brightness value acquisition module for acquiring the RGB value of the foreground color and acquiring the RGB value of the background color; combining the RGB value of the foreground color and the RGB value of the background color They are converted into LAB values; the L channel value in the LAB value of the foreground color is used as the brightness value of the foreground color, and the L channel value in the LAB value of the background color is used as the brightness value of the background color.
  • the above-mentioned third-party application page display device further includes a dark mode activation module of the third-party application, which is used to respond to the activation instruction of the third-party application when the electronic device enters the power saving mode, and
  • the third-party application has a dark mode, and the dark mode of the third-party application is turned on;
  • the above-mentioned color acquisition module 1002 is also used to respond to the opening instruction of the third-party application when the electronic device enters the power-saving mode, and the third-party application There is no dark mode, and the background color and foreground color operations in the script to obtain the third-party application are executed.
  • the above-mentioned third-party application page display device further includes a saving module for saving the background color and foreground color in the script of the third-party application; the above-mentioned color acquisition module 1002 is also used when the electronic device exits the province. In electrical mode, obtain the background color and foreground color in the script of the saved third-party application; the above-mentioned rendering module 1006 is also used to render the background area of the third-party application with the background color, and the foreground color to render the foreground area of the third-party application , Update the page of the third-party application; the above-mentioned display module 1008 is also used to display the updated page of the third-party application.
  • the above-mentioned third-party application page display device further includes a focus color obtaining module, which is used to obtain the focus element in the foreground area from the script of the third-party application; the focus element is in the page of the third-party application Elements with priority higher than the priority threshold; adjust the color of the focus element to the focus color; the contrast between the focus color and the first color is higher than the contrast threshold; the rendering module 1006 is also used to render third-party applications in the first color In the background area of the program, the focus element is rendered in the focus color, and other areas in the foreground area of the third-party application program except for the focus element are rendered in the second color to obtain the page of the third-party application program.
  • a focus color obtaining module which is used to obtain the focus element in the foreground area from the script of the third-party application; the focus element is in the page of the third-party application Elements with priority higher than the priority threshold; adjust the color of the focus element to the focus color; the contrast between the focus color and the first color is
  • the first color is black
  • the second color is white
  • the focal color is blue
  • the above-mentioned color adjustment module 1004 is also used to obtain the current ambient light brightness; according to the current ambient light brightness, match the corresponding relationship between the ambient light brightness and the contrast to determine the corresponding first contrast;
  • the corresponding relationship between the brightness and the contrast is a positive correlation; the first color and the second color are determined based on the first contrast, the background color is adjusted to the first color, and the foreground color is adjusted to the second color.
  • the above-mentioned color acquisition module 1002 is further configured to, when the current ambient light brightness change is detected, match the new ambient light brightness from the corresponding relationship between the ambient light brightness and the contrast to determine the new first Contrast; the new first color and the new second color are determined based on the new first contrast; the aforementioned rendering module 1006 is also used to render the background area of the third-party application with the new first color, and to render with the new second color
  • the foreground area of the third-party application program updates the page of the third-party application program;
  • the above-mentioned display module 1008 is also used to display the page of the updated third-party application program.
  • the above-mentioned color acquisition module 1002 is further used for obtaining the foreground and background colors in the script of the system application in response to the opening instruction of the system application in the electronic device;
  • the above-mentioned color adjustment module 1004 is also used for Adjust the foreground color of the system application to the third color, and adjust the background color of the system application to the fourth color;
  • the brightness value of the third color is less than the fourth brightness threshold, and the brightness value of the fourth color is greater than the fifth brightness threshold, The fourth brightness threshold is less than or equal to the fifth brightness threshold;
  • the rendering module 1006 is also configured to render the background area of the system application in the third color, and render the foreground area of the system application in the fourth color to obtain the page of the system application;
  • the above-mentioned display module 1008 is also used to display the rendered page of the system application.
  • the above-mentioned third-party application page display apparatus further includes a refresh rate adjustment module, configured to adjust the refresh rate of the screen of the electronic device to the first refresh rate when the electronic device enters the power saving mode;
  • the refresh rate is within the refresh rate range of the screen and is less than the refresh rate threshold;
  • the current system state is detected;
  • the target refresh rate is determined based on the current system state, and the screen refresh rate is adjusted from the first refresh rate to the target refresh rate.
  • the current system state includes the first system state or the second system state, and the refresh rate requirement of the first system state is higher than the refresh rate requirement of the second system state; the above-mentioned refresh rate adjustment module is also used when the current system state is When the state is the first system state, obtain the first reference refresh rate corresponding to the first system state, and adjust the screen refresh rate from the first refresh rate to the first reference refresh rate; when the current system state is the second system state, The second reference refresh rate corresponding to the second system state is acquired, and the refresh rate of the screen is adjusted from the first refresh rate to the second reference refresh rate; the first reference refresh rate is higher than the second reference refresh rate.
  • the above-mentioned refresh rate adjustment module is further configured to determine a second contrast between the first color and the second color based on the first color and the second color; The corresponding relationship is matched to determine the corresponding second refresh rate; the corresponding relationship between the refresh rate and the contrast is a negative correlation relationship; the refresh rate of the screen is adjusted to the second refresh rate.
  • each module in the page display device of the third-party application is only for illustration. In other embodiments, the page display device of the third-party application can be divided into different modules as needed to complete the third-party application.
  • the page of the program displays all or part of the functions of the device.
  • the various modules in the above-mentioned third-party application page display device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • Fig. 11 is a schematic diagram of the internal structure of an electronic device in an embodiment.
  • the electronic device includes a processor and a memory connected through a system bus.
  • the processor is used to provide calculation and control capabilities to support the operation of the entire electronic device.
  • the memory may include a non-volatile storage medium and internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by the processor to implement a third-party application page display method provided in the following embodiments.
  • the internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium.
  • the electronic device can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and a wearable device.
  • each module in the third-party application page display device provided in the embodiment of the present application may be in the form of a computer program.
  • the computer program can be run on a terminal or a server.
  • the program module composed of the computer program can be stored in the memory of the electronic device.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions, which when the computer-executable instructions are executed by one or more processors, cause the processors to execute a page display of a third-party application Method of operation.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM), which acts as external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Computer Graphics (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种第三方应用程序的页面展示方法,包括:当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色(202);将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值(204);以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面(206);展示渲染得到的第三方应用程序的页面(208)。

Description

第三方应用程序的页面展示方法、装置、电子设备
相关申请的交叉引用
本申请要求于2020年05月29日提交中国专利局、申请号为202010473977.0、发明名称为“第三方应用程序的页面展示方法、装置、电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种第三方应用程序的页面展示方法、装置、电子设备和计算机可读存储介质。
背景技术
随着计算机技术的发展,为了使得电子设备可以更加省电,各个电子设备的厂商开发了省电模式。在电子设备中开启省电模式,通常是对电子设备中自带的系统应用程序或者功能进行处理,如关闭电子设备中自带的系统应用程序、关闭定位功能、关闭震动功能等,从而可以节约电子设备的用电,延长电子设备的电量使用时长。
然而,在电子设备进入省电模式后,传统的第三方应用程序的页面展示方法,存在耗电高的问题。
发明内容
根据本申请的各种实施例提供了一种第三方应用程序的页面展示方法、装置、电子设备、计算机可读存储介质。
一种第三方应用程序的页面展示,包括:
当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取所述第三方应用程序的脚本中的背景色和前景色;
将所述背景色调整为第一颜色,将所述前景色调整为第二颜色;所述第一颜色的亮度值小于第一亮度阈值,所述第二颜色的亮度值大于第二亮度阈值,所述第一亮度阈值小于或等于第二亮度阈值;
以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面;
展示渲染得到的所述第三方应用程序的页面。
一种第三方应用程序的页面展示装置,包括:
颜色获取模块,用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取所述第三方应用程序的脚本中的背景色和前景色;
颜色调整模块,用于将所述背景色调整为第一颜色,将所述前景色调整为第二颜色;所述第一颜色的亮度值小于第一亮度阈值,所述第二颜色的亮度值大于第二亮度阈值,所述第一亮度阈值小于或等于第二亮度阈值;
渲染模块,用于以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面;
展示模块,用于展示渲染得到的所述第三方应用程序的页面。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如上述的第三方应用程序的页面展示方法的操作。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述的方法的操作。
上述第三方应用程序的页面展示方法、装置、电子设备和计算机可读存储介质,当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的 亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;也就是说,将第三方应用程序的背景色调暗,将第三方应用程序的前景色调亮,而背景色所在的背景区域占第三方应用程序的页面的大部分区域,使得渲染得到的第三方应用程序的页面进入暗色模式,展示渲染得到的第三方应用程序的页面,可以降低屏幕的耗电。
进一步地,电子设备进入省电模式,电子设备中自带的系统应用程序,如系统桌面、电话本等也进入了暗色模式,而当电子设备开启第三方应用程序时,展示渲染得到的第三方应用程序的页面,该页面也进入暗色模式,提高了第三方应用程序的展示的页面与系统应用程序展示的页面之间的协调性。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中第三方应用程序的页面展示方法的框架图。
图2为一个实施例中第三方应用程序的页面展示方法的流程图。
图3a为一个实施例中进入省电模式的示意图。
图3b为另一个实施例中进入省电模式的示意图。
图3c为另一个实施例中进入省电模式的示意图。
图4为另一个实施例中第三方应用程序的页面展示方法的流程图。
图5为另一个实施例中第三方应用程序的页面展示方法的流程图。
图6为另一个实施例中第三方应用程序的页面展示方法的流程图。
图7为一个实施例中根据环境光亮度得到第一颜色和第二颜色的流程图。
图8为一个实施例中根据环境光亮度展示第三方应用程序的页面的框架图。
图9为一个实施例中屏幕刷新率的调整方法的流程图。
图10为一个实施例中第三方应用程序的页面展示装置的结构框图。
图11为一个实施例中电子设备的内部结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一颜色称为第二颜色,且类似地,可将第二颜色称为第一颜色。第一颜色和第二颜色两者都是颜色,但其不是同一颜色。
如图1为一个实施例中第三方应用程序的页面展示方法的框架图。当电子设备进入省电模式时,省电控制模块调用第三方暗色控制模块,通过第三方暗色控制模块得到第三方应用程序的页面,并展示得到的第三方应用程序的页面。
进一步地,在电子设备进入省电模式之前,通过文件系统获取第三方应用程序的状态和系统应用程序的状态,并将该第三方应用程序的状态和系统应用程序的状态等数据存储在存储介质中;当电子设备退出省电模式之后,可以从存储介质中获取第三方应用程序的状态和系统应用程序的状态等数据,并将数据进行恢复。
图2为一个实施例中第三方应用程序的页面展示方法的流程图。如图2所示,第三方应用程序的页面展示方法包括操作202至操作208。
操作202,当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色。
可以理解的是,电子设备的省电模式,可以使得电子设备更加节约用电,延长电池电量的使用时间。在省电模式中,可使用的应用程序的数量被限制,一些耗电量大的功能或者特性将被关闭或者禁用,如关闭导航功能,关闭蓝牙功能,关闭震动功能等;非核心的应用程序将被清理并限制自启动和关联启动,并通过调整CPU(central processing unit,中央处理器)参数降低CPU运行时的能耗;电子设备还可以降低屏幕的刷新率等。
在一种实施方式中,在省电模式的显示界面中,接收省电模式的开启指令,进入省电模式中。
如图3a所示,在省电模式的显示界面中,当用户点击省电模式控件302中的开关时,即电子设备接收到省电模式的开启指令,进入省电模式中。在省电模式中,用户可以点击退出控件304,退出省电模式。
当用户点击第三方应用程序306时,生成第三方应用程序306的开启指令,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面;展示渲染得到的第三方应用程序的页面308。
在另一种实施方式中,检测电子设备的电量;当电量小于电量阈值时,生成省电模式弹窗,并将省电模式弹窗展示在屏幕的显示界面中;接收对省电模式弹窗中的开启指令,进入省电模式中。
如图3b所示,当电量小于电量阈值时,生成省电模式弹窗310,并将省电模式弹窗展示在屏幕的显示界面中,提示目前低电量并建议用户开启省电模式;在省电模式弹窗中,包括开启和取消两个按钮,当用户点击开启按钮时,即电子设备接收对省电模式弹窗中的开启指令,进入省电模式中。在省电模式中,用户可以点击退出控件304,退出省电模式。
当用户点击第三方应用程序306时,生成第三方应用程序306的开启指令,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面;展示渲染得到的第三方应用程序的页面308。
在另一种实施方式中,接收语音,对语音进行分析得到分析结果;当分析结果中存在省电模式开启指令时,进入省电模式中。
如图3c所示,接收语音,对语音进行分析得到分析结果312,分析结果312中存在省电模式开启指令“帮我开启省电模式”,进入省电模式中。在省电模式中,用户可以点击304的退出控件,退出省电模式。
306是第三方应用程序,当用户点击第三方应用程序306时,生成第三方应用程序306的开启指令,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面;展示渲染得到的第三方应用程序的页面308。
可以理解的是,在电子设备中自带有系统应用程序,如系统桌面、设置、浏览器、软件商店、计算器、相机、电话本等应用程序,该系统应用程序可以实现电子设备的基础功能,如显示系统桌面、设置功能、浏览网页、从软件商店下载应用程序、计算、拍摄、通话等。而第三方应用程序是第三方应用程序开发商开发,并上传至服务器中的;电子设备可以通过网络从服务器中下载第三方应用程序。第三方应用程序如微信、手机QQ、头条、高德地图、微博、淘宝等。
在第三方应用程序的脚本中,包含有第三方应用程序所展示的页面的代码,而该代码中包括了第三方应用程序所展示的页面的背景色和前景色等信息。背景色指的是第三方应用程序所展示的页面的背景区域的颜色,前景色指的是第三方应用程序所展示的页面的前景区域的颜色。
需要指出的是,第三方应用程序所展示的页面的背景区域可以有一个,也可以有至少两个。例如, 第三方应用程序所展示的页面中包括有导航栏,以及联系人列表,则第三方应用程序所展示的页面中包括有导航栏的背景区域,以及联系人列表的背景区域。相应地,背景色可以有一个,也可以有至少两个。
同样地,第三方应用程序所展示的页面的前景区域可以有一个,也可以有至少两个。前景区域中包括有各种元素,如文本、图标、照片、视频、音频等。相应地,前景色可以有一个,也可以有至少两个。前景色可以指的是前景区域中各个元素的颜色,如文本的颜色、图标的颜色、照片外框的颜色、视频外框的颜色、音频所在控件的颜色等。
在第三方应用程序的脚本中,还可以包括背景色所在的背景区域的大小、样式等,前景色所在的前景区域的大小、样式等。
具体地,当电子设备进入省电模式时,当接收到对第三方应用程序的开启指令时,响应于对第三方应用程序的开启指令,从第三方应用程序的脚本中查找背景标签以及前景标签,获取背景标签对应的背景色,以及前景标签对应的前景色。
在第三方应用程序的脚本中,View中默认分为background和content两部分。背景标签为“background”,背景标签可以根据用户需要进行设置。前景标签可以是除背景标签之外的其他标签。在背景标签或前景标签中,可以设置color(颜色)或drawable,其中drawable中的draw方法可以自定义样式。而content是View中的draw和onDraw方法中绘制的内容。background和content在绘制的时候可以调用了drawText方法。
当前景区域中的元素是图片时,对图片进行采样处理,得到至少两个像素点的颜色值;统计至少两个像素点的各个颜色值,获取属于同一颜色值的像素点的数量;将属于同一颜色值的像素点的最多数量值除以至少两个像素点的数量值,得到数量比例;当数量比例大于或等于比例阈值时,图片为纯色图片;当数量比例小于比例阈值时,图片不是纯色图片。
例如,电子设备对图片进行采样处理,得到100个像素点的颜色值,统计100个像素点的颜色值,其中,白色为98个,黑色为1个,蓝色为1个,即属于同一颜色值的像素点的最多数量值为98,将98除以100得到数量比例为0.98,当比例阈值为0.95时,该图片为纯色图片。
进一步地,当图片为纯色图片时,检测该纯色图片的亮度值是否大于指定亮度阈值;当该纯色图片的亮度值大于指定亮度阈值时,该图片为纯色亮图,对该图片进行反色处理。
具体地,电子设备可以获取该纯色图片的颜色的RGB值;将RGB值转化成LAB值;将LAB值中的L通道值作为该纯色图片的亮度值。
RGB(Red、Green、Blue,红色、绿色、蓝色)值指的是前景色中的三个通道值,分别是红色通道、绿色通道和蓝色通道,通过RGB三个通道值融合可以得到前景色。
LAB是一种色彩模式,包括三个通道值,分别为亮度L,以及两个颜色通道A和B。A代表从绿色到红色的分量,B代表从蓝色到黄色的分量。
操作204,将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值。
亮度值表示颜色明亮程度的数值。亮度值越高,则该颜色越亮;亮度值越低,则该颜色越暗。第一亮度阈值和第二亮度阈值均可以根据用户需要进行设置。电子设备可以预先设置第一颜色和第二颜色。
第一颜色的亮度值小于第一亮度阈值,表示第一颜色的亮度较暗,即将背景色调整为亮度较暗的颜色。第二颜色的亮度值大于第二亮度阈值,表示第二颜色的亮度较亮,即将前景色调整为亮度较亮的颜色。
例如,第一亮度阈值为50,第二亮度阈值也为50,第一颜色为黑色,第二颜色为白色,黑色的亮度值为0,白色的亮度值为100,即将背景色调整为黑色,将前景色调整为白色,则渲染得到的第三方应用程序的页面进入暗色模式。
具体地,电子设备通过HWUI(硬件加速绘制UI)层对绘制命令做判断,再注入反色算法,同时基于原生Force Dark(强制黑暗模式)反色规则对背景色和前景色进行颜色处理,将背景色调整为第一颜色,将前景色调整为第二颜色。从硬件(HWUI层)和软件(原生Force Dark反色规则)上对背景色和前景色进行调整,可以更快速、更准确地得到第一颜色和第二颜色。
其中,HWUI层主要是使用OpenGL ES(OpenGL for Embedded Systems)来进行GPU(Graphics Processing Unit,图形处理器)硬件绘图,提升整个系统的绘制性能。
操作206,以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面。
渲染指的是基于代码生成可视化视图的过程。电子设备以第一颜色渲染第三方应用程序的背景区域,即将第一颜色在背景区域中进行着色。电子设备以第二颜色渲染第三方应用程序的前景区域,即将第二颜色在前景区域中进行着色。
第一颜色的亮度值小于第一亮度阈值,则渲染得到的背景区域的亮度较暗;第二颜色的亮度值大于第二亮度阈值,则渲染得到的前景区域的亮度较亮,得到的第三方应用程序的页面进入暗色模式。
当第三应用程序的页面是浏览器的web页面时,该web页面中的第一颜色和第二颜色的渲染是在浏览器内核中完成的。
操作208,展示渲染得到的第三方应用程序的页面。
电子设备的屏幕可以是OLED(Organic Light-Emitting Diode,有机发光二极管)屏幕。电子设备基于OLED屏幕展示渲染得到的第三方应用程序的页面,当第三方应用程序的页面中的背景区域是亮度值小于第一亮度阈值的第一颜色时,该背景区域对应的OLED屏幕中的区域提供该第一颜色对应的亮度值,第一颜色的亮度较暗,OLED屏幕提供该亮度的用电功耗较低,从而可以节约电子设备屏幕的耗电。
进一步地,当第一颜色是黑色,即第三方应用程序的页面中的背景区域是黑色时,该背景区域对应的OLED屏幕中的区域不需发光,就可以展示背景区域的黑色,从而进一步节约电子设备屏幕的耗电。
上述第三方应用程序的页面展示方法,当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;也就是说,将第三方应用程序的背景色调暗,将第三方应用程序的前景色调亮,而背景色所在的背景区域占第三方应用程序的页面的大部分区域,使得渲染得到的第三方应用程序的页面进入暗色模式,展示渲染得到的第三方应用程序的页面,可以降低屏幕的耗电。
进一步地,电子设备进入省电模式,电子设备中自带的系统应用程序,如系统桌面、电话本等也进入了暗色模式,而当电子设备开启第三方应用程序时,展示渲染得到的第三方应用程序的页面,该页面也进入暗色模式,提高了第三方应用程序的展示的页面与系统应用程序展示的页面之间的协调性。
在一个实施例中,如图4所示,将背景色调整为第一颜色,将前景色调整为第二颜色,包括:
操作402,获取第三亮度阈值,将背景色的亮度值以及前景色的亮度值分别与第三亮度阈值进行比较。
第三亮度阈值可以根据用户需要进行设置,例如第三亮度阈值可以是50。
操作404,将背景色中大于或等于第三亮度阈值的部分调整为第一颜色,将前景色中小于第三亮度阈值的部分调整为第二颜色。
电子设备将大于或等于第三亮度阈值的颜色作为亮色,将小于第三亮度阈值的颜色作为暗色。
背景色可以有一个,也可以有至少两个。同样地,前景色可以有一个,也可以有至少两个。在各个背景色中,将大于或等于第三亮度阈值的部分调整为第一颜色,而小于第三亮度阈值的部分保持不变;第一颜色的亮度值小于第三亮度阈值。也就是说,将背景色中属于亮色类别的部分调整为暗色,而属于暗色类别的部分保持不变。
同样地,在各个前景色中,将小于第三亮度阈值的部分调整为第二颜色,而大于或等于第三亮度阈值的部分保持不变;第二颜色的亮度值大于或等于第三亮度阈值。也就是说,将前景色中属于暗色类别的部分调整为亮色,而属于亮色类别的部分保持不变。
以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面,包括:
操作406,以第一颜色和背景色中小于第三亮度阈值的部分分别渲染第三方应用程序对应的背景区 域,以第二颜色和前景色中大于或等于第三亮度阈值的部分分别渲染第三方应用程序的前景区域,得到第三方应用程序的页面。
在本实施例中,将背景色中大于或等于第三亮度阈值的部分调整为第一颜色,而背景色中小于第三亮度阈值的部分保持不变即无需调整,将前景色中小于第三亮度阈值的部分调整为第二颜色,而前景色中大于或等于第三亮度阈值的部分保持不变即无需调整,可以节约电子设备的处理资源,更快速得到第三方应用程序的页面从而进行展示,提高了效率。
在一个实施例中,获取第三亮度阈值,将背景色的亮度值以及前景色的亮度值分别与第三亮度阈值进行比较之前,还包括:获取前景色的RGB值,获取背景色的RGB值;将前景色的RGB值和背景色的RGB值分别转化成LAB值;将前景色的LAB值中的L通道值作为前景色的亮度值,将背景色的LAB值中的L通道值作为背景色的亮度值。
RGB(Red、Green、Blue,红色、绿色、蓝色)值指的是前景色中的三个通道值,分别是红色通道、绿色通道和蓝色通道,通过RGB三个通道值融合可以得到前景色。
LAB是一种色彩模式,包括三个通道值,分别为亮度L,以及两个颜色通道A和B。A代表从绿色到红色的分量,B代表从蓝色到黄色的分量。
电子设备获取前景色的RGB值和背景色的RGB值,将前景色的RGB值和背景色的RGB值分别转化成LAB值,再将前景色的LAB值中的L通道值作为前景色的亮度值,将背景色的LAB值中的L通道值作为背景色的亮度值,可以准确得到前景色的亮度值和背景色的亮度值。
在一个实施例中,上述方法还包括:当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且第三方应用程序存在暗色模式,开启第三方应用程序的暗色模式;当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且第三方应用程序不存在暗色模式,执行获取第三方应用程序的脚本中的背景色和前景色操作。
当电子设备进入省电模式时,响应于第三方应用程序的开启指令,且第三方应用程序存在暗色模式,开启第三方应用程序的暗色模式,即开启第三方应用程序的暗色模式适配电子设备的省电模式,提高第三方应用程序与电子设备之间的兼容度。
当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且第三方应用程序不存在暗色模式,执行获取第三方应用程序的脚本中的背景色和前景色操作,实现第三方应用程序进入暗色模式,从而节约电子设备的屏幕的耗电,并且提高第三方应用程序的展示的页面与系统应用程序展示的页面之间的协调性。
在一个实施例中,获取第三方应用程序的脚本中的背景色和前景色之后,还包括:保存第三方应用程序的脚本中的背景色和前景色;当电子设备退出省电模式时,获取保存的第三方应用程序的脚本中的背景色和前景色;以背景色渲染第三方应用程序的背景区域,以前景色渲染第三方应用程序的前景区域,更新第三方应用程序的页面;展示更新的第三方应用程序的页面。
电子设备在获取第三方应用程序的脚本中的背景色和前景色之后,可以将该获取的背景色和前景色保存至电子设备的存储介质(如闪存储器)中。当电子设备退出省电模式时,从存储介质(如闪存储器)中获取保存的第三方应用程序的脚本中的背景色和前景色,再以背景色渲染第三方应用程序的背景区域,以前景色渲染第三方应用程序的前景区域,更新第三方应用程序的页面,展示更新的第三方应用程序的页面,将第三方应用程序的页面恢复至进入省电模式之前的状态。
在一个实施例中,如图5所述,电子设备执行操作502,进入省电模式;执行操作504,保存进入省电模式之前的第三方应用程序的状态和系统应用程序的状态。电子设备执行操作506,判断系统应用程序是否已开启暗色模式,当判断为是时,无需操作,即操作508;当判断为否时,执行操作510。操作510,开启系统应用程序的暗色模式。
电子设备中自带有系统应用程序,如系统桌面、设置、浏览器、软件商店、计算器、相机、电话本等应用程序,该系统应用程序可以实现电子设备的基础功能,如显示系统桌面、设置功能、浏览网页、从软件商店下载应用程序、计算、拍摄、通话等。
电子设备执行操作512,判断第三方应用程序是否存在暗色模式;当判断为是时,执行操作514, 开启第三方应用程序自身的暗色模式;当判断为否时,执行操作516。
操作516,渲染第三方应用程序的暗色效果,具体包括:获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面;展示渲染得到的第三方应用程序的页面。
当电子设备执行操作518,退出省电模式时,执行操作520,将第三方应用程序和系统应用程序均恢复至进入省电模式之前的状态。
在一个实施例中,如图6所示,上述方法还包括:
操作602,从第三方应用程序的脚本中获取前景区域内的焦点元素;焦点元素是第三方应用程序的页面中优先级高于优先级阈值的元素。
在前景区域内,包含有各种元素,如文本、图标、照片、视频、音频等,而前景区域内的各个元素的重要程度不同。根据前景区域内的各个元素的重要程度不同,可以对各个元素设置对应的优先级。优先级越高,表示该元素越重要。
例如,在前景区域内包含导航栏、联系人的聊天信息、音量调节控件、拍摄控件等元素,而音量调节控件和拍摄控件是用户经常使用的功能控件,因此可以设置音量调节控件和拍摄控件的优先级均为四级,导航栏的优先级为二级,联系人的聊天信息的优先级为三级,优先级阈值为三级,则音量调节控件和拍摄控件这两个元素为焦点元素。
操作604,将焦点元素的颜色调整为焦点颜色;焦点颜色与第一颜色之间的对比度高于对比度阈值。
焦点颜色与第一颜色之间的对比度指的是焦点颜色和第一颜色之间不同亮度层级的测量,差异范围越大代表对比度越大,差异范围越小代表对比度越小。
第一颜色为背景区域的颜色,而焦点颜色是前景区域中的焦点元素的颜色,焦点颜色与第一颜色之间的对比度高于对比度阈值,则可以从背景区域的颜色中更加突出焦点元素,更加清晰地展示焦点元素。
在一个实施例中,第一颜色为黑色,第二颜色为白色,焦点颜色为蓝色,即背景区域的颜色为黑色,前景区域中除焦点元素之外的元素的区域为白色,焦点元素为蓝色,可以更加突出焦点元素,更加清晰地展示焦点元素。
以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面,包括:
操作606,以第一颜色渲染第三方应用程序的背景区域,以焦点颜色渲染焦点元素,以第二颜色渲染第三方应用程序的前景区域中除焦点元素之外的其他区域,得到第三方应用程序的页面。
在本实施例中,从前景区域中获取焦点元素,并将焦点元素的颜色调整为焦点颜色,而焦点颜色与背景区域的第一颜色的对比度高于对比度阈值,则展示第三方应用程序的页面时可以更突出该焦点元素,更清晰地展示焦点元素;基于无边界设计理念,全天候暗色模式对页面层次进行了区分,有效改善了暗色模式下的对比度,降低了视觉疲劳的可能,第三方应用程序的画面在系统优化下得到了充分的适配,保证不会出现界面元素看不清或者视觉冲突的情况。从醒目的高光比环境,到舒适的低对比条件,全天候暗色模式可满足任意场景,任一时间使用,再加上智能亮度调节功能,让暗色模式在强光或弱光环境均能发挥作用,即使在白天使用,阅读体验不打折扣。
在一个实施例中,如图7所示,将背景色调整为第一颜色,将前景色调整为第二颜色,包括:
操作702,获取当前的环境光亮度。
环境光亮度指的是电子设备所处的环境的亮度。
操作704,根据当前的环境光亮度,从环境光亮度与对比度之间的对应关系进行匹配,确定对应的第一对比度;环境光亮度与对比度的对应关系为正相关关系。
电子设备可以预先设置环境光亮度与对比度之间的对应关系。第一对比度指的是第一颜色和第二颜色之间的对比度。环境光亮度与对比度的对应关系为正相关关系,即环境光亮度的值越大,对比度的值越大;环境光亮度的值越小,对比度的值越小。环境光亮度与对比度的对应关系中的对比度可以根据 用户需要设置,如背景最大亮度、对话框/浮层背景最小亮度、前景最小亮度。
当当前的环境光亮度的值大时,表示环境光亮度高,人眼对电子设备屏幕亮度不敏感,不容易看清屏幕显示界面中的内容,则确定的第一对比度高,才能使得用户看清页面中的内容。当环境光亮度的值小时,表示环境光亮度低,人眼对电子设备屏幕亮度较敏感,则可以确定的较低的第一对比度高。
操作706,基于第一对比度确定第一颜色和第二颜色,将背景色调整为第一颜色,将前景色调整为第二颜色。
在一种实施方式中,电子设备可以先确定第一颜色为黑色,再通过第一对比度确定第二颜色。在另一种实施方式中,电子设备也可以先确定第二颜色为白色,再通过第一对比度确定第一颜色。在其他实施方式中,电子设备还可以基于第一对比度确定第一颜色和第二颜色的多种组合方式,并从多种组合方式中选择一种。
在本实施例中,获取当前的环境光亮度,根据当前的环境光亮度确定第一对比度,进而确定第一颜色和第二颜色,可以使得第三方应用程序的页面与当前的环境光亮度进行结合,从而以更准确地展示第三方应用程序的页面。
在一个实施例中,如图8所示,电子设备中的光感平滑计算亮度拟合模块通过光感监听环境光,获取当前的环境光亮度,再将当前的环境光亮度发送至对比度控制模块。对比度控制模块根据当前的环境光亮度,从环境光亮度与对比度之间的对应关系进行匹配,确定对应的第一对比度;环境光亮度与对比度的对应关系为正相关关系;电子设备基于第一对比度确定第一颜色和第二颜色,将背景色调整为第一颜色,将前景色调整为第二颜色;以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面。
在一个实施例中,展示渲染得到的所述第三方应用程序的页面之后,还包括:当检测到当前的环境光亮度变化时,根据新的环境光亮度从环境光亮度与对比度之间的对应关系进行匹配,确定新的第一对比度;基于新的第一对比度确定新的第一颜色和新的第二颜色;以新的第一颜色渲染第三方应用程序的背景区域,以新的第二颜色渲染第三方应用程序的前景区域,更新第三方应用程序的页面;展示更新的第三方应用程序的页面。
当检测到当前的环境光亮度变化时,电子设备根据新的环境光亮度确定新的第一对比度,从而确定新的第一颜色和第二颜色,再以新的第一颜色渲染第三方应用程序的背景区域,以新的第二颜色渲染第三方应用程序的前景区域,并展示新的第三方应用程序的页面,对第三方应用程序的页面进行更新。
在本实施例中,电子设备检测当前的环境光亮度是否变化,当检测到当前的环境光亮度发生变化时,则确定新的第一颜色和第二颜色,展示更新的第三方应用程序,可以实时地、更准确地展示第三方应用程序的页面。
在一个实施例中,当电子设备进入省电模式时之后,还包括:响应于对电子设备中的系统应用程序的开启指令,获取系统应用程序的脚本中的前景色和背景色;将系统应用程序的前景色调整为第三颜色,将系统应用程序的背景色调整为第四颜色;第三颜色的亮度值小于第四亮度阈值,第四颜色的亮度值大于第五亮度阈值,第四亮度阈值小于或等于第五亮度阈值;以第三颜色渲染系统应用程序的背景区域,以第四颜色渲染系统应用程序的前景区域,得到系统应用程序的页面;展示渲染得到的系统应用程序的页面。
在电子设备中自带有系统应用程序,如系统桌面、设置、浏览器、软件商店、计算器、相机、电话本等应用程序,该系统应用程序可以实现电子设备的基础功能,如显示系统桌面、设置功能、浏览网页、从软件商店下载应用程序、计算、拍摄、通话等。
第四亮度阈值和第五亮度阈值均可以根据用户需要进行设置。电子设备可以预先设置第三颜色和第四颜色。
第三颜色的亮度值小于第四亮度阈值,表示第三颜色的亮度较暗,即将系统应用程序的背景色调整为亮度较暗的颜色。第四颜色的亮度值大于第五亮度阈值,表示第四颜色的亮度较亮,即将系统应用程序的前景色调整为亮度较亮的颜色。
例如,第四亮度阈值为50,第五亮度阈值也为50,第三颜色为黑色,第四颜色为白色,黑色的亮 度值为0,白色的亮度值为100,即将系统应用程序的背景色调整为黑色,将系统应用程序的前景色调整为白色,则渲染得到的系统应用程序的页面进入暗色模式。
在本实施例中,当电子设备进入省电模式时,响应于对系统应用程序的开启指令,将系统应用程序渲染得到暗色模式的系统应用程序的页面,则电子设备进入省电模式之后,在第三方应用程序和系统应用程序之间切换时,可以提高显示的第三方应用程序的页面和系统应用程序的界面之间的协调性,避免第三方应用程序和系统应用程序其中一个处于正常模式,而另外一个处于暗色模式(即一个亮度较亮,另外一个亮度较暗)导致的页面不协调的问题。其中,正常模式指的是背景区域的亮度较亮,而前景区域的各个元素的亮度较暗的模式。
在一个实施例中,如图9所示,上述方法还包括:
操作902,当电子设备进入省电模式时,将电子设备的屏幕的刷新率调整至第一刷新率;第一刷新率处于屏幕的刷新率范围内,并且小于刷新率阈值。
刷新率是指电子束对屏幕上的图像重复扫描的次数。刷新率越高,屏幕所显示的图像(画面)稳定性就越好。例如,屏幕刷新率可以是60HZ,90HZ,120HZ,144HZ;而120HZ的屏幕刷新率显示的图像画面比60HZ的屏幕刷新率显示的图像画面更稳定。
可以理解的是,为了使得人眼观察不出屏幕是处于刷新(扫描)状态,屏幕的刷新率需要大于或等于下限值;而为了使得电子设备的电池电量可以使用更长时间,屏幕的刷新率需要小于或等于上限值,而上限值至下限值之间的范围,即屏幕的刷新率范围。其中,上限值和下限值可以是经验值。
第一刷新率处于屏幕的刷新率范围内,则将电子设备的屏幕的刷新率调整至第一刷新率时,可以保证屏幕处于正常使用状态;而第一刷新率小于刷新率阈值,限定了第一刷新率的最大值,可以节约屏幕用电。第一刷新率也可以是具体的档位,如60HZ,90HZ,120HZ,144HZ等其中的一个。
在一种实施方式中,第一刷新率可以是屏幕的刷新率范围的下限值,即刷新率范围中的最小值,可以最大限度地节约屏幕用电。
刷新率阈值可以根据需要用户需要进行设定。进一步地,电子设备获取进入省电模式之前的刷新率,设置刷新率阈值小于进入省电模式之前的刷新率。电子设备进入省电模式之后,将电子设备的屏幕的刷新率调整至第一刷新率,第一刷新率小于刷新率阈值,而刷新率阈值小于进入省电模式之前的刷新率,则进入省电模式之后第一刷新率小于进入省电模式之前的刷新率,降低了屏幕的刷新率,节约了屏幕用电。
操作904,检测当前系统状态。
当前系统状态指的是电子设备当前系统所处的状态。当前系统状态可以是游戏状态、视频播放状态、应用程序切换状态、动画播放状态、运行指定应用程序状态、社交聊天状态、音乐播放状态等其中的一种。
当前系统状态可以是对屏幕刷新率要求高的系统状态,如游戏状态、视频播放状态、应用程序切换状态、动画播放状态或运行指定应用程序状态等其中的一种;也可以是对屏幕刷新率要求低的系统状态,如社交聊天状态、音乐播放状态等其中的一种。当前系统状态不同,则对应的屏幕刷新率要求可以不同。
在一种实施方式中,电子设备采用轮询读取机制以及注册回调监听等其中的至少一种方式检测当前系统状态。
在另一种实施方式中,电子设备检测当前屏幕显示界面中的应用程序,以及屏幕显示界面中的各个元素,基于当前屏幕显示界面中的应用程序以及屏幕显示界面中的各个元素确定当前系统状态。
当前屏幕显示界面中的应用程序指的是当前处于屏幕显示界面中的应用程序。如用户在使用微信时,则微信是当前屏幕显示界面中的应用程序;当用户在使用微信时,并且同时使用音乐应用程序的歌词浮窗功能,使得歌曲的歌词显示在屏幕显示界面中,则微信以及音乐应用程序均是当前屏幕显示界面中的应用程序。
当前屏幕显示界面中的应用程序的数量可以是一个,也可以是多个。当前使用的应用程序可以是电子设备的系统自带的应用程序,如摄像、音乐、相册等,也可以包括用户下载的应用程序,如微信、支付宝等。
屏幕显示界面中的各个元素,可以包括图片、视频、音频、文本,还可以包括屏幕的亮度、屏幕的尺寸等。
例如,电子设备当前使用的应用程序为微信,屏幕显示界面中包括视频,则可以确定当前系统状态为视频播放状态。又如,电子设备当前使用的应用程序为游戏,屏幕显示界面中包括游戏元素防御塔、敌方小兵等,则可以确定当前系统状态为游戏状态。又如,电子设备当前使用的应用程序包括微信,微信处于前端运行,屏幕显示界面中的各个元素包括文本、图片,则可以确定当前系统状态为社交聊天状态。
操作906,基于当前系统状态确定目标刷新率,将屏幕的刷新率从第一刷新率调整至目标刷新率。
当前系统状态不同,则对应的屏幕刷新率要求可以不同,基于当前系统状态确定的目标刷新率也可以不同。
例如,当当前系统状态是游戏状态、视频播放状态、应用程序切换状态、动画播放状态或运行指定应用程序状态等对屏幕刷新率要求高的系统状态,则确定的目标刷新率可以较高;当当前系统状态是社交聊天状态、音乐播放状态等对屏幕刷新率要求低的系统状态时,则确定的目标刷新率可以较低。
电子设备预先设置各个系统状态与刷新率之间的对应关系,获取系统状态与刷新率之间的对应关系;将系统状态与刷新率之间的对应关系与当前系统状态进行匹配,从系统状态与刷新率之间的对应关系中确定当前系统状态的刷新率,并将该确定的刷新率作为目标刷新率。
例如,当当前系统状态是游戏状态时,从系统状态与刷新率之间的对应关系中确定游戏状态的刷新率为90HZ,即目标刷新率为90HZ;当当前系统状态是音乐播放状态时,从系统状态与刷新率之间的对应关系中确定音乐播放状态的刷新率为60HZ,即目标刷新率为60HZ。
在本实施例中,当电子设备进入省电模式时,通过调整第三方应用程序的页面的背景色和前景色,使得展示的第三方应用程序的页面处于暗色模式,可以节约电子设备的屏幕的耗电;当电子设备进入省电模式时,与此同时还可以将电子设备屏幕的刷新率调整至第一刷新率,可以先降低电子设备的屏幕的功耗,节约电子设备的电量;检测当前系统状态,基于当前系统状态确定目标刷新率,可以将屏幕的刷新率从第一刷新率调整至目标刷新率,使得屏幕的刷新率与当前系统状态相匹配,提高了调整的屏幕刷新率的准确性。
进一步地,当电子设备进入省电模式时,既可以优化功耗,即降低了电子设备的屏幕的功耗,基于当前系统状态确定目标刷新率,再将屏幕的刷新率从第一刷新率调整至目标刷新率,也可以保证在当前系统状态下屏幕显示界面的显示效果与用户体验,达到功耗与体验的平衡。
在一个实施例中,将屏幕的刷新率从第一刷新率调整至目标刷新率之后,还包括:当电子设备退出省电模式时,获取第二刷新率;第二刷新率高于或等于第一刷新率;将屏幕的刷新率从目标刷新率调整至第二刷新率。
当电子设备退出省电模式时,恢复至正常模式,在正常模式中为了保证屏幕显示界面更清晰更流畅更准确,获取的第二刷新率高于或等于第一刷新率,再将屏幕的刷新率从目标刷新率调整至第二刷新率。
进一步地,电子设备进入省电模式之前,还包括:获取屏幕当前的原始刷新率;当电子设备退出省电模式时,获取第二刷新率,包括:当电子设备退出省电模式时,获取原始刷新率;将屏幕的刷新率从目标刷新率调整至第二刷新率,包括:将屏幕的刷新率从目标刷新率恢复至原始刷新率。
电子设备进入省电模式之前,获取屏幕当前的原始刷新率,即电子设备处于正常模式中屏幕的刷新率,并将该刷新率保存至电子设备的存储介质(如闪存储器)中。当电子设备退出省电模式时,从存储介质中获取原始刷新率,将屏幕的刷新率从目标刷新率调整至第二刷新率,即将屏幕的刷新率恢复至进入省电模式之前的刷新率。
在一个实施例中,当前系统状态包括第一系统状态或第二系统状态,第一系统状态的刷新率要求高于第二系统状态的刷新率要求;基于当前系统状态确定目标刷新率,将屏幕的刷新率从第一刷新率调整至目标刷新率,包括:当当前系统状态是第一系统状态时,获取第一系统状态对应的第一参考刷新率,将屏幕的刷新率从第一刷新率调整至第一参考刷新率;当当前系统状态是第二系统状态时,获取第二系统状态对应的第二参考刷新率,将屏幕的刷新率从第一刷新率调整至第二参考刷新率;第一参考刷新率 高于第二参考刷新率。
第一系统状态是游戏状态、视频播放状态、应用程序切换状态、动画播放状态或运行指定应用程序状态其中的一种;第二系统状态是社交聊天状态或音乐播放状态。其中,指定应用程序可以是用户设置的需要高刷新率的应用程序,如微博、微信等,也可以是支持高刷新率的应用程序。当运行指定应用程序时,在屏幕的显示界面上显示指定应用程序的页面,采用第一参考刷新率对屏幕进行刷新,可以获取到指定应用程序更清晰的页面。第一系统状态对视觉效果要求高,第二系统状态对视觉效果要求低,即第一系统状态的刷新率要求高于第二系统状态的刷新率要求。
当当前系统状态时第一系统状态时,第一系统状态对应的屏幕刷新率是第一参考刷新率;当当前系统状态时第二系统状态时,第二系统状态对应的屏幕刷新率是第二参考刷新率。由于第一系统状态的刷新率要求高于第二系统状态的刷新率要求,因此第一参考刷新率高于第二参考刷新率。
在本实施例中,当前系统状态包括第一系统状态或第二系统状态,当当前系统状态是第一系统状态时,获取对应的第一参考刷新率,当当前系统状态是第二系统状态时,获取对应的第二参考刷新率,第一系统状态的刷新率要求高于第二系统状态的刷新率要求,则第一参考刷新率高于第二参考刷新率,可以更准确地调整屏幕刷新率。
在一个实施例中,上述方法还包括:基于第一颜色和第二颜色确定第一颜色和第二颜色之间的第二对比度;根据第二对比度,从刷新率与对比度之间的对应关系进行匹配,确定对应的第二刷新率;刷新率与对比度的对应关系为负相关关系;将屏幕的刷新率调整至第二刷新率。
第二对比度指的是第一颜色和第二颜色之间不同亮度层级的测量,差异范围越大代表第二对比度越大,差异范围越小代表第二对比度越小。
电子设备可以预先设置刷新率与对比度之间的对应关系。刷新率与对比度之间的对应关系为负相关关系,即刷新率的值越大,对比度的值越小;刷新率亮度的值越小,对比度的值越大。
当第二对比度的值大时,用户很容易从显示的第三方应用程序的页面中获取内容,因此可以确定较小的第二刷新率,从而节约屏幕的耗电。
当第二对比度的值小时,用户不容易从显示的第三方应用程序的页面中获取内容,因此可以确定较大的第二刷新率,从而使得显示的第三方应用程序的页面更清晰,用户可以更容易从屏幕显示界面上获取第三方应用程序的内容。
应该理解的是,虽然图2、图4、图6、图7和图9的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,图2、图4、图6、图7和图9中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。
图10为一个实施例的第三方应用程序的页面展示装置的结构框图。如图10所示,提供了一种第三方应用程序的页面展示装置1000,包括:颜色获取模块1002、颜色调整模块1004、渲染模块1006和展示模块1008,其中:
颜色获取模块1002,用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取第三方应用程序的脚本中的背景色和前景色。
颜色调整模块1004,用于将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值。
渲染模块1006,用于以第一颜色渲染第三方应用程序的背景区域,以第二颜色渲染第三方应用程序的前景区域,得到第三方应用程序的页面。
展示模块1008,用于展示渲染得到的第三方应用程序的页面。
上述第三方应用程序的页面展示装置,当电子设备进入省电模式时,响应于对第三方应用程序的开 启指令,获取第三方应用程序的脚本中的背景色和前景色;将背景色调整为第一颜色,将前景色调整为第二颜色;第一颜色的亮度值小于第一亮度阈值,第二颜色的亮度值大于第二亮度阈值,第一亮度阈值小于或等于第二亮度阈值;也就是说,将第三方应用程序的背景色调暗,将第三方应用程序的前景色调亮,而背景色所在的背景区域占第三方应用程序的页面的大部分区域,使得渲染得到的第三方应用程序的页面进入暗色模式,展示渲染得到的第三方应用程序的页面,可以降低屏幕的耗电。
进一步地,电子设备进入省电模式,电子设备中自带的系统应用程序,如系统桌面、电话本等也进入了暗色模式,而当电子设备开启第三方应用程序时,展示渲染得到的第三方应用程序的页面,该页面也进入暗色模式,提高了第三方应用程序的展示的页面与系统应用程序展示的页面之间的协调性。
在一个实施例中,上述颜色调整模块1004还用于获取第三亮度阈值,将背景色的亮度值以及前景色的亮度值分别与第三亮度阈值进行比较;将背景色中大于或等于第三亮度阈值的部分调整为第一颜色,将前景色中小于第三亮度阈值的部分调整为第二颜色;上述渲染模块1006还用于以第一颜色和背景色中小于第三亮度阈值的部分分别渲染第三方应用程序对应的背景区域,以第二颜色和前景色中大于或等于第三亮度阈值的部分分别渲染第三方应用程序的前景区域,得到第三方应用程序的页面。
在一个实施例中,上述第三方应用程序的页面展示装置还包括亮度值获取模块,用于获取前景色的RGB值,获取背景色的RGB值;将前景色的RGB值和背景色的RGB值分别转化成LAB值;将前景色的LAB值中的L通道值作为前景色的亮度值,将背景色的LAB值中的L通道值作为背景色的亮度值。
在一个实施例中,上述第三方应用程序的页面展示装置还包括第三方应用程序的暗色模式开启模块,用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且第三方应用程序存在暗色模式,开启第三方应用程序的暗色模式;上述颜色获取模块1002还用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且第三方应用程序不存在暗色模式,执行获取第三方应用程序的脚本中的背景色和前景色操作。
在一个实施例中,上述第三方应用程序的页面展示装置还包括保存模块,用于保存第三方应用程序的脚本中的背景色和前景色;上述颜色获取模块1002还用于当电子设备退出省电模式时,获取保存的第三方应用程序的脚本中的背景色和前景色;上述渲染模块1006还用于以背景色渲染第三方应用程序的背景区域,以前景色渲染第三方应用程序的前景区域,更新第三方应用程序的页面;上述展示模块1008还用于展示更新的第三方应用程序的页面。
在一个实施例中,上述第三方应用程序的页面展示装置还包括焦点颜色获取模块,用于从第三方应用程序的脚本中获取前景区域内的焦点元素;焦点元素是第三方应用程序的页面中优先级高于优先级阈值的元素;将焦点元素的颜色调整为焦点颜色;焦点颜色与第一颜色之间的对比度高于对比度阈值;上述渲染模块1006还用于以第一颜色渲染第三方应用程序的背景区域,以焦点颜色渲染焦点元素,以第二颜色渲染第三方应用程序的前景区域中除焦点元素之外的其他区域,得到第三方应用程序的页面。
在一个实施例中,第一颜色为黑色,第二颜色为白色,焦点颜色为蓝色。
在一个实施例中,上述颜色调整模块1004还用于获取当前的环境光亮度;根据当前的环境光亮度,从环境光亮度与对比度之间的对应关系进行匹配,确定对应的第一对比度;环境光亮度与对比度的对应关系为正相关关系;基于第一对比度确定第一颜色和第二颜色,将背景色调整为第一颜色,将前景色调整为第二颜色。
在一个实施例中,上述颜色获取模块1002还用于当检测到当前的环境光亮度变化时,根据新的环境光亮度从环境光亮度与对比度之间的对应关系进行匹配,确定新的第一对比度;基于新的第一对比度确定新的第一颜色和新的第二颜色;上述渲染模块1006还用于以新的第一颜色渲染第三方应用程序的背景区域,以新的第二颜色渲染第三方应用程序的前景区域,更新第三方应用程序的页面;上述展示模块1008还用于展示更新的第三方应用程序的页面。
在一个实施例中,上述颜色获取模块1002还用于响应于对电子设备中的系统应用程序的开启指令,获取系统应用程序的脚本中的前景色和背景色;上述颜色调整模块1004还用于将系统应用程序的前景色调整为第三颜色,将系统应用程序的背景色调整为第四颜色;第三颜色的亮度值小于第四亮度阈值,第四颜色的亮度值大于第五亮度阈值,第四亮度阈值小于或等于第五亮度阈值;上述渲染模块1006还 用于以第三颜色渲染系统应用程序的背景区域,以第四颜色渲染系统应用程序的前景区域,得到系统应用程序的页面;上述展示模块1008还用于展示渲染得到的系统应用程序的页面。
在一个实施例中,上述第三方应用程序的页面展示装置还包括刷新率调整模块,用于当电子设备进入省电模式时,将电子设备的屏幕的刷新率调整至第一刷新率;第一刷新率处于屏幕的刷新率范围内,并且小于刷新率阈值;检测当前系统状态;基于当前系统状态确定目标刷新率,将屏幕的刷新率从第一刷新率调整至目标刷新率。
在一个实施例中,当前系统状态包括第一系统状态或第二系统状态,第一系统状态的刷新率要求高于第二系统状态的刷新率要求;上述刷新率调整模块还用于当当前系统状态是第一系统状态时,获取第一系统状态对应的第一参考刷新率,将屏幕的刷新率从第一刷新率调整至第一参考刷新率;当当前系统状态是第二系统状态时,获取第二系统状态对应的第二参考刷新率,将屏幕的刷新率从第一刷新率调整至第二参考刷新率;第一参考刷新率高于第二参考刷新率。
在一个实施例中,上述刷新率调整模块还用于基于第一颜色和第二颜色确定第一颜色和第二颜色之间的第二对比度;根据第二对比度,从刷新率与对比度之间的对应关系进行匹配,确定对应的第二刷新率;刷新率与对比度的对应关系为负相关关系;将屏幕的刷新率调整至第二刷新率。
上述第三方应用程序的页面展示装置中各个模块的划分仅仅用于举例说明,在其他实施例中,可将第三方应用程序的页面展示装置按照需要划分为不同的模块,以完成上述第三方应用程序的页面展示装置的全部或部分功能。
关于第三方应用程序的页面展示装置的具体限定可以参见上文中对于第三方应用程序的页面展示方法的限定,在此不再赘述。上述第三方应用程序的页面展示装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
图11为一个实施例中电子设备的内部结构示意图。如图11所示,该电子设备包括通过系统总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的一种第三方应用程序的页面展示方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。该电子设备可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备。
本申请实施例中提供的第三方应用程序的页面展示装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述方法的操作。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行第三方应用程序的页面展示方法的操作。
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第三方应用程序的页面展示方法。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、 双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (28)

  1. 一种第三方应用程序的页面展示方法,其特征在于,包括:
    当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取所述第三方应用程序的脚本中的背景色和前景色;
    将所述背景色调整为第一颜色,将所述前景色调整为第二颜色;所述第一颜色的亮度值小于第一亮度阈值,所述第二颜色的亮度值大于第二亮度阈值,所述第一亮度阈值小于或等于第二亮度阈值;
    以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面;及
    展示渲染得到的所述第三方应用程序的页面。
  2. 根据权利要求1所述的方法,其特征在于,所述将所述背景色调整为第一颜色,将所述前景色调整为第二颜色,包括:
    获取第三亮度阈值,将所述背景色的亮度值以及所述前景色的亮度值分别与所述第三亮度阈值进行比较;
    将所述背景色中大于或等于所述第三亮度阈值的部分调整为第一颜色,将所述前景色中小于所述第三亮度阈值的部分调整为第二颜色;及
    所述以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面,包括:
    以所述第一颜色和所述背景色中小于所述第三亮度阈值的部分分别渲染所述第三方应用程序对应的背景区域,以所述第二颜色和所述前景色中大于或等于所述第三亮度阈值的部分分别渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面。
  3. 根据权利要求2所述的方法,其特征在于,所述获取第三亮度阈值,将所述背景色的亮度值以及所述前景色的亮度值分别与所述第三亮度阈值进行比较之前,还包括:
    获取所述前景色的RGB值,获取所述背景色的RGB值;
    将所述前景色的RGB值和所述背景色的RGB值分别转化成LAB值;及
    将所述前景色的LAB值中的L通道值作为所述前景色的亮度值,将所述背景色的LAB值中的L通道值作为所述背景色的亮度值。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且所述第三方应用程序存在暗色模式,开启所述第三方应用程序的暗色模式;及
    当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且所述第三方应用程序不存在暗色模式,执行所述获取所述第三方应用程序的脚本中的背景色和前景色操作。
  5. 根据权利要求1所述的方法,其特征在于,所述获取所述第三方应用程序的脚本中的背景色和前景色之后,还包括:
    保存所述第三方应用程序的脚本中的背景色和前景色;
    当所述电子设备退出所述省电模式时,获取保存的所述第三方应用程序的脚本中的背景色和前景色;
    以所述背景色渲染所述第三方应用程序的背景区域,以所述前景色渲染所述第三方应用程序的前景区域,更新所述第三方应用程序的页面;及
    展示更新的所述第三方应用程序的页面。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    从所述第三方应用程序的脚本中获取前景区域内的焦点元素;所述焦点元素是所述第三方应用程序的页面中优先级高于优先级阈值的元素;
    将所述焦点元素的颜色调整为焦点颜色;所述焦点颜色与所述第一颜色之间的对比度高 于对比度阈值;及
    所述以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面,包括:
    以所述第一颜色渲染所述第三方应用程序的背景区域,以所述焦点颜色渲染所述焦点元素,以所述第二颜色渲染所述第三方应用程序的前景区域中除所述焦点元素之外的其他区域,得到所述第三方应用程序的页面。
  7. 根据权利要求6所述的方法,其特征在于,所述第一颜色为黑色,所述第二颜色为白色,所述焦点颜色为蓝色。
  8. 根据权利要求1所述的方法,其特征在于,所述将所述背景色调整为第一颜色,将所述前景色调整为第二颜色,包括:
    获取当前的环境光亮度;
    根据当前的所述环境光亮度,从所述环境光亮度与对比度之间的对应关系进行匹配,确定对应的第一对比度;所述环境光亮度与对比度的对应关系为正相关关系;及
    基于所述第一对比度确定第一颜色和第二颜色,将所述背景色调整为第一颜色,将所述前景色调整为第二颜色。
  9. 根据权利要求8所述的方法,其特征在于,所述展示渲染得到的所述第三方应用程序的页面之后,还包括:
    当检测到当前的所述环境光亮度变化时,根据新的所述环境光亮度从所述环境光亮度与对比度之间的对应关系进行匹配,确定新的第一对比度;
    基于新的所述第一对比度确定新的第一颜色和新的第二颜色;
    以新的所述第一颜色渲染所述第三方应用程序的背景区域,以新的所述第二颜色渲染所述第三方应用程序的前景区域,更新所述第三方应用程序的页面;及
    展示更新的所述第三方应用程序的页面。
  10. 根据权利要求1所述的方法,其特征在于,所述当电子设备进入省电模式时之后,还包括:
    响应于对所述电子设备中的系统应用程序的开启指令,获取所述系统应用程序的脚本中的前景色和背景色;
    将所述系统应用程序的前景色调整为第三颜色,将所述系统应用程序的背景色调整为第四颜色;所述第三颜色的亮度值小于第四亮度阈值,所述第四颜色的亮度值大于第五亮度阈值,所述第四亮度阈值小于或等于第五亮度阈值;
    以所述第三颜色渲染所述系统应用程序的背景区域,以所述第四颜色渲染所述系统应用程序的前景区域,得到所述系统应用程序的页面;及
    展示渲染得到的所述系统应用程序的页面。
  11. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当电子设备进入省电模式时,将所述电子设备的屏幕的刷新率调整至第一刷新率;所述第一刷新率处于所述屏幕的刷新率范围内,并且小于刷新率阈值;
    检测当前系统状态;及
    基于所述当前系统状态确定目标刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述目标刷新率。
  12. 根据权利要求11所述的方法,其特征在于,所述当前系统状态包括第一系统状态或第二系统状态,所述第一系统状态的刷新率要求高于所述第二系统状态的刷新率要求;
    所述基于所述当前系统状态确定目标刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述目标刷新率,包括:
    当所述当前系统状态是所述第一系统状态时,获取所述第一系统状态对应的第一参考刷 新率,将所述屏幕的刷新率从所述第一刷新率调整至所述第一参考刷新率;及
    当所述当前系统状态是所述第二系统状态时,获取所述第二系统状态对应的第二参考刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述第二参考刷新率;所述第一参考刷新率高于所述第二参考刷新率。
  13. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    基于所述第一颜色和所述第二颜色确定所述第一颜色和所述第二颜色之间的第二对比度;
    根据所述第二对比度,从刷新率与对比度之间的对应关系进行匹配,确定对应的第二刷新率;所述刷新率与所述对比度的对应关系为负相关关系;及
    将屏幕的刷新率调整至所述第二刷新率。
  14. 一种第三方应用程序的页面展示装置,其特征在于,包括:
    颜色获取模块,用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,获取所述第三方应用程序的脚本中的背景色和前景色;
    颜色调整模块,用于将所述背景色调整为第一颜色,将所述前景色调整为第二颜色;所述第一颜色的亮度值小于第一亮度阈值,所述第二颜色的亮度值大于第二亮度阈值,所述第一亮度阈值小于或等于第二亮度阈值;
    渲染模块,用于以所述第一颜色渲染所述第三方应用程序的背景区域,以所述第二颜色渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面;及
    展示模块,用于展示渲染得到的所述第三方应用程序的页面。
  15. 根据权利要求14所述的装置,其特征在于,所述颜色调整模块还用于获取第三亮度阈值,将所述背景色的亮度值以及所述前景色的亮度值分别与所述第三亮度阈值进行比较;将所述背景色中大于或等于所述第三亮度阈值的部分调整为第一颜色,将所述前景色中小于所述第三亮度阈值的部分调整为第二颜色;及
    所述渲染模块还用于以所述第一颜色和所述背景色中小于所述第三亮度阈值的部分分别渲染所述第三方应用程序对应的背景区域,以所述第二颜色和所述前景色中大于或等于所述第三亮度阈值的部分分别渲染所述第三方应用程序的前景区域,得到所述第三方应用程序的页面。
  16. 根据权利要求15所述的装置,其特征在于,所述装置还包括亮度值获取模块;所述亮度值获取模块用于获取所述前景色的RGB值,获取所述背景色的RGB值;将所述前景色的RGB值和所述背景色的RGB值分别转化成LAB值;及将所述前景色的LAB值中的L通道值作为所述前景色的亮度值,将所述背景色的LAB值中的L通道值作为所述背景色的亮度值。
  17. 根据权利要求14所述的装置,其特征在于,所述装置还包括第三方应用程序的暗色模式开启模块;所述第三方应用程序的暗色模式开启模块用于当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且所述第三方应用程序存在暗色模式,开启所述第三方应用程序的暗色模式;及当电子设备进入省电模式时,响应于对第三方应用程序的开启指令,且所述第三方应用程序不存在暗色模式,执行所述获取所述第三方应用程序的脚本中的背景色和前景色操作。
  18. 根据权利要求14所述的装置,其特征在于,所述装置还包括保存模块;述保存模块还用于保存所述第三方应用程序的脚本中的背景色和前景色;
    所述颜色获取模块还用于当所述电子设备退出所述省电模式时,获取保存的所述第三方应用程序的脚本中的背景色和前景色;
    所述渲染模块还用于以所述背景色渲染所述第三方应用程序的背景区域,以所述前景色渲染所述第三方应用程序的前景区域,更新所述第三方应用程序的页面;及
    所述展示模块还用于展示更新的所述第三方应用程序的页面。
  19. 根据权利要求14所述的装置,其特征在于,所述装置还包括焦点颜色获取模块;所述焦点颜色获取模块用于从所述第三方应用程序的脚本中获取前景区域内的焦点元素;所述焦点元素是所述第三方应用程序的页面中优先级高于优先级阈值的元素;将所述焦点元素的颜色调整为焦点颜色;所述焦点颜色与所述第一颜色之间的对比度高于对比度阈值;及所述渲染模块还用于以所述第一颜色渲染所述第三方应用程序的背景区域,以所述焦点颜色渲染所述焦点元素,以所述第二颜色渲染所述第三方应用程序的前景区域中除所述焦点元素之外的其他区域,得到所述第三方应用程序的页面。
  20. 根据权利要求19所述的装置,其特征在于,所述第一颜色为黑色,所述第二颜色为白色,所述焦点颜色为蓝色。
  21. 根据权利要求14所述的装置,其特征在于,所述颜色调整模块还用于获取当前的环境光亮度;根据当前的所述环境光亮度,从所述环境光亮度与对比度之间的对应关系进行匹配,确定对应的第一对比度;所述环境光亮度与对比度的对应关系为正相关关系;及基于所述第一对比度确定第一颜色和第二颜色,将所述背景色调整为第一颜色,将所述前景色调整为第二颜色。
  22. 根据权利要求21所述的装置,其特征在于,所述颜色获取模块还用于当检测到当前的所述环境光亮度变化时,根据新的所述环境光亮度从所述环境光亮度与对比度之间的对应关系进行匹配,确定新的第一对比度;基于新的所述第一对比度确定新的第一颜色和新的第二颜色;
    所述渲染模块还用于以新的所述第一颜色渲染所述第三方应用程序的背景区域,以新的所述第二颜色渲染所述第三方应用程序的前景区域,更新所述第三方应用程序的页面;及所述展示模块还用于展示更新的所述第三方应用程序的页面。
  23. 根据权利要求14所述的装置,其特征在于,所述颜色获取模块还用于响应于对所述电子设备中的系统应用程序的开启指令,获取所述系统应用程序的脚本中的前景色和背景色;
    所述颜色调整模块还用于将所述系统应用程序的前景色调整为第三颜色,将所述系统应用程序的背景色调整为第四颜色;所述第三颜色的亮度值小于第四亮度阈值,所述第四颜色的亮度值大于第五亮度阈值,所述第四亮度阈值小于或等于第五亮度阈值;
    所述渲染模块还用于以所述第三颜色渲染所述系统应用程序的背景区域,以所述第四颜色渲染所述系统应用程序的前景区域,得到所述系统应用程序的页面;及
    所述展示模块还用于展示渲染得到的所述系统应用程序的页面。
  24. 根据权利要求14所述的装置,其特征在于,所述装置还包括刷新率调整模块;所述刷新率调整模块用于当电子设备进入省电模式时,将所述电子设备的屏幕的刷新率调整至第一刷新率;所述第一刷新率处于所述屏幕的刷新率范围内,并且小于刷新率阈值;检测当前系统状态;及基于所述当前系统状态确定目标刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述目标刷新率。
  25. 根据权利要求24所述的装置,其特征在于,所述当前系统状态包括第一系统状态或第二系统状态,所述第一系统状态的刷新率要求高于所述第二系统状态的刷新率要求;
    所述刷新率调整模块还用于当所述当前系统状态是所述第一系统状态时,获取所述第一系统状态对应的第一参考刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述第一参考刷新率;及当所述当前系统状态是所述第二系统状态时,获取所述第二系统状态对应的第二参考刷新率,将所述屏幕的刷新率从所述第一刷新率调整至所述第二参考刷新率;所述第一参考刷新率高于所述第二参考刷新率。
  26. 根据权利要求14所述的装置,其特征在于,所述装置还包括刷新率调整模块;所 述刷新率调整模块还用于基于所述第一颜色和所述第二颜色确定所述第一颜色和所述第二颜色之间的第二对比度;根据所述第二对比度,从刷新率与对比度之间的对应关系进行匹配,确定对应的第二刷新率;所述刷新率与所述对比度的对应关系为负相关关系;及将屏幕的刷新率调整至所述第二刷新率。
  27. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至13中任一项所述的第三方应用程序的页面展示方法的操作。
  28. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至13中任一项所述的方法的操作。
PCT/CN2021/086887 2020-05-29 2021-04-13 第三方应用程序的页面展示方法、装置、电子设备 WO2021238469A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21813529.1A EP4145248A4 (en) 2020-05-29 2021-04-13 PAGE DISPLAY METHOD AND APPARATUS FOR THIRD-PARTY APPLICATION, AND ELECTRONIC DEVICE
US17/983,836 US20230071987A1 (en) 2020-05-29 2022-11-09 Page Display Method and Apparatus for Third-Party Application, and Electronic Device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010473977.0 2020-05-29
CN202010473977.0A CN111610847B (zh) 2020-05-29 2020-05-29 第三方应用程序的页面展示方法、装置、电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/983,836 Continuation US20230071987A1 (en) 2020-05-29 2022-11-09 Page Display Method and Apparatus for Third-Party Application, and Electronic Device

Publications (1)

Publication Number Publication Date
WO2021238469A1 true WO2021238469A1 (zh) 2021-12-02

Family

ID=72199392

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/086887 WO2021238469A1 (zh) 2020-05-29 2021-04-13 第三方应用程序的页面展示方法、装置、电子设备

Country Status (4)

Country Link
US (1) US20230071987A1 (zh)
EP (1) EP4145248A4 (zh)
CN (1) CN111610847B (zh)
WO (1) WO2021238469A1 (zh)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9459781B2 (en) 2012-05-09 2016-10-04 Apple Inc. Context-specific user interfaces for displaying animated sequences
US10452253B2 (en) 2014-08-15 2019-10-22 Apple Inc. Weather user interface
EP3337583B1 (en) 2015-08-20 2024-01-17 Apple Inc. Exercise-based watch face
DK179412B1 (en) 2017-05-12 2018-06-06 Apple Inc Context-Specific User Interfaces
DK179555B1 (en) 2017-05-16 2019-02-13 Apple Inc. USER INTERFACE FOR A FLASHLIGHT MODE ON AN ELECTRONIC DEVICE
US11327650B2 (en) 2018-05-07 2022-05-10 Apple Inc. User interfaces having a collection of complications
DK181103B1 (en) 2020-05-11 2022-12-15 Apple Inc User interfaces related to time
CN115552375A (zh) 2020-05-11 2022-12-30 苹果公司 用于管理用户界面共享的用户界面
CN111610847B (zh) * 2020-05-29 2022-05-17 Oppo广东移动通信有限公司 第三方应用程序的页面展示方法、装置、电子设备
CN112578898A (zh) * 2020-12-29 2021-03-30 广东湾区智能终端工业设计研究院有限公司 一种屏幕功耗优化的方法、装置、计算设备及存储介质
US20220342514A1 (en) * 2021-04-27 2022-10-27 Apple Inc. Techniques for managing display usage
US11921992B2 (en) 2021-05-14 2024-03-05 Apple Inc. User interfaces related to time
CN113360820B (zh) * 2021-05-29 2024-03-08 北京网聘信息技术有限公司 一种页面展示方法、系统、设备和存储介质
CN113377479A (zh) * 2021-06-25 2021-09-10 展讯通信(天津)有限公司 应用视觉主题的切换方法、装置、存储介质及终端
CN113676779B (zh) * 2021-07-22 2023-09-26 南京信息职业技术学院 一种智能设备屏幕省电系统及方法
CN113778584A (zh) * 2021-08-04 2021-12-10 瑞芯微电子股份有限公司 一种独立控制应用背景色的方法和存储设备
CN114047447A (zh) * 2021-11-10 2022-02-15 京东方科技集团股份有限公司 一种电量提示的方法、电子标牌、系统及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855453A (zh) * 2011-06-30 2013-01-02 网秦无限(北京)科技有限公司 防止偷窥移动设备屏幕显示的方法和系统
CN107179889A (zh) * 2016-03-09 2017-09-19 阿里巴巴集团控股有限公司 界面色彩调节方法、网页色彩调节方法及装置
CN110109725A (zh) * 2019-04-30 2019-08-09 努比亚技术有限公司 一种界面颜色调整方法及穿戴式设备
CN110609722A (zh) * 2019-08-09 2019-12-24 华为技术有限公司 一种暗模式显示界面处理方法、电子设备与存储介质
US20200066003A1 (en) * 2018-08-22 2020-02-27 Adobe Inc. Contrast-Ratio-Based Color Generation
CN111610847A (zh) * 2020-05-29 2020-09-01 Oppo广东移动通信有限公司 第三方应用程序的页面展示方法、装置、电子设备

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7389432B2 (en) * 2004-11-10 2008-06-17 Microsoft Corporation Advanced power management for computer displays
US8842111B2 (en) * 2010-09-20 2014-09-23 Intel Corporation Techniques for selectively changing display refresh rate
US8976323B2 (en) * 2013-01-04 2015-03-10 Disney Enterprises, Inc. Switching dual layer display with independent layer content and a dynamic mask
KR102266361B1 (ko) * 2013-08-04 2021-06-16 아이즈매치 리미티드 거울을 가상화하는 디바이스들, 시스템들 및 방법들
KR20150040127A (ko) * 2013-10-04 2015-04-14 삼성전자주식회사 전력 절감을 위하여 이미지를 처리하는 방법 및 디바이스
CN104268152B (zh) * 2014-09-01 2018-07-10 可牛网络技术(北京)有限公司 一种网页展现方法和装置
US10032430B2 (en) * 2014-09-17 2018-07-24 Mediatek Inc. Processor for use in dynamic refresh rate switching and related electronic device
TWI666624B (zh) * 2015-02-04 2019-07-21 美商電子墨水股份有限公司 在深色模式及淺色模式中顯示之光電顯示器以及其相關裝置及方法
US20170220307A1 (en) * 2016-02-02 2017-08-03 Samsung Electronics Co., Ltd. Multi-screen mobile device and operation
US11107258B2 (en) * 2018-07-20 2021-08-31 Microsoft Technology Licensing, Llc. Providing a dark viewing mode while preserving formatting
CN110837289A (zh) * 2019-10-18 2020-02-25 北京三快在线科技有限公司 应用于oled屏幕设备的节电方法及装置、电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855453A (zh) * 2011-06-30 2013-01-02 网秦无限(北京)科技有限公司 防止偷窥移动设备屏幕显示的方法和系统
CN107179889A (zh) * 2016-03-09 2017-09-19 阿里巴巴集团控股有限公司 界面色彩调节方法、网页色彩调节方法及装置
US20200066003A1 (en) * 2018-08-22 2020-02-27 Adobe Inc. Contrast-Ratio-Based Color Generation
CN110109725A (zh) * 2019-04-30 2019-08-09 努比亚技术有限公司 一种界面颜色调整方法及穿戴式设备
CN110609722A (zh) * 2019-08-09 2019-12-24 华为技术有限公司 一种暗模式显示界面处理方法、电子设备与存储介质
CN111610847A (zh) * 2020-05-29 2020-09-01 Oppo广东移动通信有限公司 第三方应用程序的页面展示方法、装置、电子设备

Also Published As

Publication number Publication date
CN111610847A (zh) 2020-09-01
CN111610847B (zh) 2022-05-17
US20230071987A1 (en) 2023-03-09
EP4145248A4 (en) 2023-10-25
EP4145248A1 (en) 2023-03-08

Similar Documents

Publication Publication Date Title
WO2021238469A1 (zh) 第三方应用程序的页面展示方法、装置、电子设备
WO2021238473A1 (zh) 屏幕刷新率的调整方法、装置、电子设备和存储介质
US10958850B2 (en) Electronic device and method for capturing image by using display
US9635255B1 (en) Display as adjustable light source
CN109961747B (zh) 电子墨水屏显示方法、装置及电子设备
CN109298912B (zh) 主题色彩的调节方法、装置、存储介质及电子设备
RU2637884C2 (ru) Способ и устройство для отображения метки на пиктограмме
US10019220B2 (en) Control method and apparatus thereof
WO2022001492A1 (zh) 界面处理方法、装置、电子设备和计算机可读存储介质
WO2014187043A1 (zh) 应用程序的显示处理方法及装置
CN109272917B (zh) 屏幕亮度调节方法、装置、存储介质及电子设备
CN106126725B (zh) 页面显示方法及装置
CN113963659A (zh) 显示设备的调整方法及显示设备
US11836342B2 (en) Method for acquiring historical information, storage medium, and system
CN111290723A (zh) 显示背景的调节方法、装置、终端及存储介质
CN110618852B (zh) 视图处理方法、视图处理装置及终端设备
CN112116670A (zh) 信息处理方法及装置、电子设备及存储介质
WO2022134875A1 (zh) 数据的获取方法及电子设备
CN112331158B (zh) 终端显示调节方法、装置、设备及存储介质
JP5556215B2 (ja) 携帯機向けカメラを用いた表示部の画質調整方法、その装置及びそのプログラム
KR20130134546A (ko) 동영상의 섬네일 이미지 생성 방법 및 그 전자 장치
CN113805830B (zh) 一种分布显示方法及相关设备
CN114067733B (zh) 显示屏校正方法、显示屏校正装置以及显示芯片
CN114038370A (zh) 显示参数调整方法、装置、存储介质及显示设备
CN107423060B (zh) 动画效果的呈现方法、装置及终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21813529

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021813529

Country of ref document: EP

Effective date: 20221129

NENP Non-entry into the national phase

Ref country code: DE