WO2023001163A1 - 一种可提升动效性能的屏幕刷新方法及设备 - Google Patents

一种可提升动效性能的屏幕刷新方法及设备 Download PDF

Info

Publication number
WO2023001163A1
WO2023001163A1 PCT/CN2022/106612 CN2022106612W WO2023001163A1 WO 2023001163 A1 WO2023001163 A1 WO 2023001163A1 CN 2022106612 W CN2022106612 W CN 2022106612W WO 2023001163 A1 WO2023001163 A1 WO 2023001163A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
interface
content
electronic device
updated
Prior art date
Application number
PCT/CN2022/106612
Other languages
English (en)
French (fr)
Inventor
钟建飞
蒋大圆
周泽斌
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023001163A1 publication Critical patent/WO2023001163A1/zh

Links

Images

Classifications

    • 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

Definitions

  • the embodiments of the present application relate to the field of electronic technology, and in particular to a method and device for refreshing a screen that can improve dynamic performance.
  • the electronic device can display the colorful and changeable interface content of each application for the user through the screen.
  • the electronic device realizes the change of interface content in the scenes with dynamic effects by continuously refreshing the display.
  • an electronic device implements interface content updating by updating the content of the entire screen or updating the content of controls on the screen. This method easily leads to useless updates, high power consumption of electronic devices, and poor rendering performance and dynamic performance.
  • Embodiments of the present application provide a screen refresh method and device that can improve dynamic performance, and can accurately update different areas on different interfaces through the same drawing control, which can reduce useless updates, save power consumption, and improve interface update efficiency. Improve rendering performance and animation performance.
  • an embodiment of the present application provides a method for updating an interface, which is applied to an electronic device, and the electronic device includes a first partial drawing control.
  • the method includes: the electronic device displays a first interface, the first interface includes a first area, and the first interface The content of the first area on is the first content.
  • the electronic device displays an updated second interface, the second interface includes a first area, the content of the first area on the second interface is the second content, and the second content is different from the first content, and the first content is passed by the electronic device
  • the first partial drawing control is updated with the second content.
  • the second interface further includes a second area, the second area is different from the first area, and the content of the second area on the second interface is the third content.
  • the electronic device displays an updated third interface, the third interface includes a second area, the content of the second area on the third interface is the fourth content, and the fourth content is different from the third content, and the third content is passed by the electronic device
  • the first partial drawing control is updated to the fourth content.
  • the electronic device can use the first partial drawing control to accurately update the content of the first area on the interface, and use the first partial drawing control to accurately update the content of the second area on the other interface, which can reduce useless updates. Save power consumption of electronic devices, improve interface update efficiency, improve rendering performance and dynamic performance.
  • the first area and the second area are areas to be updated.
  • the area where the first partial drawing control is located includes the first area.
  • the area where the first partial drawing control is located includes the second area.
  • the position and size of the first partial drawing control are adapted to the position and size of the area to be updated (such as the first area or the second area), and the position and size of the first partial drawing control are variable, so that the first The area where the local drawing control is located includes the area to be updated, so that the area to be updated can be accurately updated.
  • the position and size of the first partial drawing control are the same as those of the first target area corresponding to the first area.
  • the first target area includes the first area.
  • the position and size of the first partial drawing control are the same as those of the second target area corresponding to the second area.
  • the second target area includes the second area.
  • the position of the first partial drawing control can be moved within the full screen range, and the position and size of the first partial drawing control can adapt to the target area corresponding to the area to be updated (such as the first area or the second area) Changes can be made permanently, so that different areas on different interfaces can be accurately updated, and useless updates can be reduced.
  • the first target area is the smallest rectangle including the first area
  • the second target area is the smallest rectangle including the second area.
  • the method further includes: the electronic device displays a fourth interface, the fourth interface includes a second area, and the content of the second area on the fourth interface is the first Five contents, and the fifth content is different from the fourth content, the fourth content is updated to the fifth content by the electronic device through the first partial drawing control, and the area where the first partial drawing control is located still includes the second area.
  • the electronic device further includes a second partial drawing control
  • the first interface further includes a third area
  • the third area is different from the first area
  • the second interface further includes a third area
  • the first interface The content of the third area is the sixth content
  • the content of the third area on the second interface is the seventh content
  • the seventh content is different from the sixth content
  • the sixth content is updated to the seventh content by the electronic device through the second partial drawing control Content
  • the area where the second partial drawing control is located includes the third area.
  • the position and size of the second partial drawing control are the same as those of the third target area corresponding to the third area
  • the third target area includes the third area.
  • the size of the first area, the size of the second area, the size of the first partial drawing control, and the size of the second partial drawing control are smaller than or equal to a preset threshold.
  • the electronic device also includes a global drawing control, the size of the global drawing control is the same as the screen size of the electronic device, and the method further includes: the electronic device displays a fifth interface, the fifth interface includes a fourth area, and the fourth area on the fifth interface The content is the eighth content, and the fourth area is greater than the preset threshold.
  • the electronic device displays a sixth interface, the sixth interface includes a fourth area, the content of the fourth area on the sixth interface is the ninth content, and the ninth content is different from the eighth content, and the eighth content is controlled by the electronic device through global drawing Updated to the ninth content.
  • the local drawing control is used for precise update to reduce useless updates; if the size of the area to be updated (such as the fourth area) If it is larger, the global drawing control whose position and size correspond to the full screen is used for updating, and there is no need to adjust the position and size of the local drawing control.
  • the first interface further includes a fifth area, the fifth area is different from the first area, the content of the fifth area on the first interface is not updated, and the content of the fifth area on the second interface The content is the same as that of the fifth area on the first interface.
  • the fifth area on the first interface is not updated, but the first interface is partially updated.
  • the content of the first area is drawn and copied to the interface cache, and then copied from the interface cache to the interface video memory, and then sent to the screen for display.
  • the content of the first area on the second interface has changed compared with the content of the first area on the first interface.
  • the content of the fifth area is not drawn, the content of the fifth area is not copied to the interface cache, nor is it copied from the interface cache to the interface video memory, and the content of the fifth area originally stored in the interface video memory is sent to to the screen for display.
  • the content of the fifth area on the second interface remains unchanged from the content of the fifth area on the first interface.
  • the first area and the second area are different areas in the UI control of the first user interface on the second interface.
  • the electronic device can accurately update different regions of the same UI control on different interfaces by using the first partial drawing control.
  • the area where the first partial drawing control is located includes the first area.
  • the area where the first partial drawing control is located includes the second area and the reserved area to be updated, and the reserved area to be updated includes the first area.
  • the current to-be-updated area is updated together with the to-be-updated area reserved when the first partial drawing control is used to update.
  • the area where the first partial drawing control is located includes the first target area corresponding to the first area; when the third content is updated to the second content
  • the area covered by the first partial drawing control includes the second target area corresponding to the second area, and the target area corresponding to the reserved area to be updated before, and the target area corresponding to the reserved area to be updated before includes the second target area a target area.
  • the first target area is the smallest rectangle including the first area
  • the second target area is the smallest rectangle including the second area.
  • the target area corresponding to the area to be updated this time is updated together with the target area reserved when the first partial drawing control is used to update.
  • the electronic device further includes a global drawing control, and the size of the global drawing control is the same as the screen size of the electronic device.
  • the method also includes: if the first preset condition is satisfied, the electronic device uses the global drawing control to update the full screen; the first preset condition includes any of the following: the area to be updated is greater than or equal to the preset threshold; The number of interface updates performed by a partial drawing is greater than or equal to the first preset value; or, in the process of using the first partial drawing control to update the interface, the size of the reserved area to be updated is greater than or equal to the second preset value; or, The duration of continuously using the first partial drawing to update the interface is greater than or equal to the third preset value; or, the last time the first partial drawing control was used to update the interface, the area to be updated this time is different from the area to be updated last time.
  • the electronic device can update the full screen by using the global drawing control in various flexible ways.
  • the method further includes: the electronic device clears the reserved area to be updated.
  • the reserved area to be updated can be cleared.
  • the method further includes: the electronic device clears the target area corresponding to the reserved area to be updated.
  • the electronic device uses the global drawing control to refresh the full screen, it can clear the target area corresponding to the reserved area to be updated.
  • an embodiment of the present application provides a method for updating an interface, which is applied to an electronic device, and the electronic device includes a first partial drawing control.
  • the method includes: the electronic device displays a first interface, the first interface includes a first area, and the first The content of the first area on an interface is the first content.
  • the electronic device updates the first content in the first area to the second content through the first partial drawing control, and the second content is different from the first content.
  • the electronic device displays a second interface, the second interface includes a first area, and the content of the first area on the second interface is the second content; the second interface also includes a second area, the second area is different from the first area, and the second The content of the second area on the interface is the third content.
  • the electronic device changes the third content in the second area to a fourth content through the first partial drawing control, and the fourth content is different from the third content.
  • the electronic device displays a third interface, the third interface includes a second area, and the content of the second area on the third interface is the fourth content.
  • the electronic device can use the first partial drawing control to accurately update the content of the first area on the interface, and use the first partial drawing control to accurately update the content of the second area on the other interface, which can reduce useless updates. Save power consumption of electronic devices, improve interface update efficiency, improve rendering performance and dynamic performance.
  • the area where the first partial drawing control is located when the electronic device changes the first content to the second content, the area where the first partial drawing control is located includes the first area.
  • the area where the first partial drawing control is located includes the second area.
  • the method further includes: the electronic device updates the fourth content in the second area to the fifth content through the first partial drawing control, and the fifth content is different from In the fourth content, and the area where the first local drawing control is located includes the second area.
  • the electronic device displays a fourth interface, the fourth interface includes a second area, and the content of the second area on the fourth interface is fifth content.
  • the electronic device further includes a second partial drawing control
  • the first interface further includes a third area
  • the content of the third area on the first interface is the sixth content
  • the third area is different from the first area
  • the method further includes: the electronic device updates the sixth content of the third area to the seventh content through the second partial drawing control, the seventh content is different from the sixth content, and the area where the second partial drawing control is located includes the third area .
  • the second interface further includes a third area, and the content of the third area on the second interface is the seventh content.
  • the first interface further includes a fifth area, the fifth area is different from the first area, the content of the fifth area on the first interface has not been updated, and the content of the fifth area on the second interface The content is the same as that of the fifth area on the first interface.
  • the first interface, the second interface and the third interface are interfaces for developing applications across systems on the electronic device, or interfaces for developing applications for a single system on the electronic device.
  • the electronic device can use the above local drawing control to update the interface.
  • an embodiment of the present application provides an interface updating method, which can be applied to an electronic device, where the electronic device includes a first partial drawing control and a second partial drawing control, and the method includes: the electronic device displays the first interface, the first The interface includes a first area, the content of the first area on the first interface is the first content, and the first partial drawing control does not include the first area.
  • the electronic device displays a second interface, the second interface includes a first area, the content of the first area on the second interface is the second content, and the second content is different from the first content, and the first content is captured by the electronic device through the first part
  • the draw control is updated with the second content.
  • the area where the first partial drawing control is located is adjusted to include the first area.
  • the second interface further includes a second area, the second area is different from the first area, the content of the second area on the second interface is the third content, and the area where the second partial drawing control is located does not include the second area.
  • the electronic device displays a third interface, the third interface includes a second area, the content of the second area on the fourth interface is the fourth content, and the fourth content is different from the third content, and the third content is captured by the electronic device through the second part
  • the drawing control is updated to the fourth content.
  • the area where the second partial drawing control is located includes the second area.
  • the electronic device further includes a global drawing control
  • the size of the global drawing control is the same as the screen size of the electronic device
  • the method further includes: if the second preset condition is satisfied, the electronic device uses the global drawing control to perform Full-screen update; the second preset condition includes any of the following: the area to be updated is greater than or equal to a preset threshold; or, the local drawing controls of the electronic device are used up; or, the number of used partial drawing controls is greater than or It is equal to the fourth preset value; or, the size of the used partial drawing control is greater than or equal to the fifth preset value; or, the duration of continuously using partial drawing for interface update is greater than or equal to the sixth preset value.
  • the electronic device when setting the position and size of the first partial drawing control, the electronic device first sets the visual attribute of the first partial drawing control to the first state, and the position and size of the first partial drawing control After the setting is completed, set the visible property of the first partial drawing control to the second state. In this way, the re-layout of various UI controls on the interface can be avoided.
  • the application corresponding to the first interface updates the content of the first area in response to the user's input operation, or the application automatically triggers to update the content of the first area.
  • the electronic device invokes the refresh interface of the first partial drawing control to draw the first target area; the electronic device draws the first target area
  • the drawn content is copied to the interface cache; the electronic device copies the drawn content of the first target area in the interface cache to the interface video memory; the content in the interface video memory of the electronic device is sent to the screen after the next periodic screen refresh signal arrives,
  • the content in the interface display memory includes the drawn content of the first target area; the electronic device refreshes and displays the updated second interface of the first target area on the screen.
  • the electronic device after the electronic device satisfies the first preset condition or the second preset condition and uses the global drawing control to update the full screen, it can clear the target area corresponding to the area to be updated, and the updated target area The content of is solidified on the global drawing control.
  • the electronic device can also release the used partial drawing control, so as to continue to use the partial drawing control for interface update.
  • the electronic device further includes a management drawing control, and the electronic device sets the position and size of the local drawing control through the management drawing control.
  • the electronic device also sets the display state/hidden state of the local drawing control and the global drawing control by managing the drawing control.
  • the electronic device also sets the upper/lower hierarchical relationship of the local drawing control and the global drawing control by managing the drawing control.
  • the first local drawing control is in the display state
  • the global drawing control is also in the display state
  • the first local drawing control is in the upper layer of the global drawing control.
  • the global drawing control when the content of the eighth area is updated to the content of the ninth area through the global drawing control, the global drawing control is in the displayed state, and the first local drawing control is in the hidden state.
  • the first local drawing control being in the hidden state includes: the first local drawing control is located in the lower layer of the global drawing control; or, the size of the first local drawing control is 0; or, the visual attribute of the first partial drawing control is the first state, the first state is used to indicate that the visible attribute of the first partial drawing control is invisible, and the visible attribute further includes a second state used to indicate that the visible attribute of the first partial drawing control is invisible.
  • an embodiment of the present application provides an image display device, which is included in an electronic device, and which has a function of implementing the behavior of the electronic device in any method in the above aspects and possible designs.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • Hardware or software includes at least one module or unit corresponding to the above functions. For example, a display module or unit, an update module or unit, a processing module or unit, and the like.
  • an embodiment of the present application provides an electronic device, which may include a display screen for displaying an interface; one or more processors; memory; and one or more computer programs; wherein, one or more One or more computer programs are stored in the memory, and one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device is made to execute the interface update method in any possible design of the above aspect.
  • an embodiment of the present application provides an electronic device, which may include one or more processors; memory; and one or more computer programs; wherein, one or more computer programs are stored in the memory , one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device is made to execute the interface updating method in any possible design of the above aspect.
  • an embodiment of the present application provides a computer storage medium, including computer instructions.
  • the computer instructions When the computer instructions are run on the electronic device, the electronic device is made to execute the interface update method in any possible design of the above aspects.
  • an embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer, causes the computer to execute the interface updating method in any possible design of the above aspect.
  • FIG. 1A is a schematic diagram of an interface update provided by the prior art
  • FIG. 1B is a schematic diagram of another interface update provided by the prior art
  • FIG. 2A is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
  • FIG. 2B is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an interface update and refresh process provided by an embodiment of the present application.
  • FIG. 4A is a schematic diagram of a target area provided by an embodiment of the present application.
  • FIG. 4B is a schematic diagram of an interface update provided by the embodiment of the present application.
  • FIG. 4C is a schematic diagram of another interface update provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a corresponding relationship between a drawing control and an update provided in an embodiment of the present application
  • FIG. 6 is a schematic diagram of a group of interface updates provided by the embodiment of the present application.
  • FIG. 7 is a flowchart of an interface update provided by the embodiment of the present application.
  • FIG. 8A is a schematic diagram of a setting process of a drawing control provided in an embodiment of the present application.
  • FIG. 8B is a schematic diagram of another drawing control setting process provided by the embodiment of the present application.
  • FIG. 8C is a schematic diagram of another drawing control setting process provided by the embodiment of the present application.
  • FIG. 8D is a schematic diagram of another drawing control setting process provided by the embodiment of the present application.
  • FIG. 9 is a schematic diagram of another set of interface updates provided by the embodiment of the present application.
  • FIG. 10A is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 10B is a schematic diagram of an interface update provided by the embodiment of the present application.
  • FIG. 11A is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 11B is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 12A is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 12B is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 13A is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 13B is another schematic diagram of the corresponding relationship between drawing controls and updates provided by the embodiment of the present application.
  • FIG. 14 is a schematic diagram of the position and size of the drawn controls when the interface is updated according to the embodiment of the present application.
  • FIG. 15 is a schematic diagram of the position and size of the drawing control when another interface is updated according to the embodiment of the present application.
  • FIG. 16 is a flow chart of an interface updating method provided by an embodiment of the present application.
  • FIG. 17 is a schematic structural diagram of another electronic device provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, “plurality” means two or more.
  • the electronic device updates the content of the interface by updating the content of the entire screen of the full screen or the content of the controls on the screen, which easily leads to useless updates, poor rendering performance and dynamic performance.
  • cross-system development frameworks also known as cross-platform development frameworks or multi-system development frameworks
  • Android Flutter development framework Facebook The React Native (referred to as RN) development framework or the adaptive communication environment (adaptive communication environment, ACE) development framework, etc.
  • An application written based on a cross-system development framework may be called a cross-system development application (also called a cross-platform development application or a multi-system development application).
  • Cross-system development applications can be directly or through simple conversion on Android, or Run on multiple different operating systems (or platforms, systems, etc.).
  • the cross-system development framework implements interface update by rewriting the drawing controls of the original operating system running on the electronic device for custom drawing.
  • the drawing control may be a basic scheduling unit of a user interface (user interface, UI) control, such as a basic control or a base class control.
  • UI user interface
  • the drawing control may also be other controls, without limitation.
  • the Android system that is, the Android operating system, also called the Android platform
  • the drawing control is a control View
  • the iOS system the drawing control is a UIView.
  • the UI control may be an input box, a button, a check box, or a switch button. Because the dimensions of controls in the cross-system development framework and operating system controls are different, and the dimensions of controls in different operating systems are also different, it is impossible to correspond one-to-one. System development applications can run on several different operating systems.
  • the full screen corresponds to a drawing control
  • each UI control on the interface corresponds to a drawing control.
  • controls For example, in the Android operating system, the drawing control is a control View, and each UI control corresponds to a control View; in the iOS operating system, the drawing control is a UIView, and each UI control corresponds to a control UIView.
  • the electronic device updates the display effect of the UI control corresponding to the drawn control by drawing the control. In most cases, the area to be updated is a part of the UI control.
  • the embodiment of the present application provides a screen refresh method that can improve dynamic performance, which can be applied to electronic devices, and can accurately update different regions on different interfaces through the same drawing control.
  • electronic devices can accurately update different areas to be updated on different interfaces on the screen through drawing controls that can be adaptively moved and have variable sizes (that is, variable sizes), which can reduce useless updates and save power consumption of electronic devices , improve interface update efficiency, improve rendering performance and animation performance.
  • the method provided by the embodiment of the present application does not need to update the full-screen content every time, but can control the interface to be updated through adaptively movable and variable-sized drawing controls. Accurately update the region, thereby reducing useless updates and improving rendering performance and animation performance.
  • the method provided by the embodiment of the present application does not need to update the entire UI control every time, but can adjust the waiting time of the interface through adaptively movable and variable-sized drawing controls.
  • the update area is accurately updated, which can reduce useless updates and improve rendering performance and animation performance.
  • the electronic device includes a local drawing control that can move adaptively and has a variable size.
  • the electronic device may further include a global drawing control and an update management control, where the update management control is used to manage the relative relationship between the local drawing control and the global drawing control.
  • the local drawing control is used to update the area to be updated; when the interface needs full screen update, the global drawing control is used to update the full screen area.
  • the electronic device may be a mobile phone, a tablet computer, a wearable device, a smart home device, a car device, an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, a notebook computer, a super mobile personal computer ( Ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA) and other devices, the embodiment of the present application does not impose any limitation on the type of electronic device.
  • FIG. 2A shows a schematic structural diagram of the electronic device 100 .
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also provide power for electronic devices through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc.
  • GNSS can include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi-zenith) satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou satellite navigation system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quasi-zenith satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), or an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix) organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), MiniLED, MicroLED, MicroOLED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED) and other materials.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the optical signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the internal memory 121 may include an interface display memory, an interface cache, and the like.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • Touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the display screen 194 can be used to display the interface, and the processor 110 executes the instructions stored in the internal memory 121, and controls the to-be-updated area of the interface on the screen through adaptively movable and variable-sized controls. Accurate updates are performed to reduce useless updates, save power consumption of the electronic device 100, improve interface update efficiency, improve rendering performance and dynamic performance, and the display screen 194 can also be used to display the updated interface.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the software structure of the electronic device includes an operating system, a docking layer, and a cross-system development framework.
  • the software structure of the electronic device 100 is exemplarily described by taking the Android system whose operating system is a layered architecture as an example.
  • FIG. 2B is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the cross-system development framework may include modules such as a rendering pipeline (Pipeline) and a rendering node (RenderNode).
  • the rendering pipeline is used to interface with window objects, and perform input event callbacks and screen refresh callbacks to drive the rendering process.
  • Rendering nodes correspond to UI controls
  • each rendering node corresponds to a UI control
  • each UI control can correspond to one or more rendering nodes.
  • the docking layer includes windows, which can be used to connect to screen refresh signals and input events of the Android system.
  • the docking layer also includes a local drawing control that can move adaptively. The position and size of the local drawing control can match the local area to be updated, so as to accurately update the area to be updated.
  • the docking layer may also include global drawing controls and update management controls. This global drawing control is used to update the content of the entire screen.
  • the update management control is used to manage the local drawing control and the global drawing control, such as managing the relative hierarchical relationship between the local drawing control and the global drawing control (such as the top layer or the bottom layer, etc.), and managing the mutual switching between the local drawing control and the global drawing control , to manage the display/hide status of local drawing controls and global drawing controls, etc.
  • the layered architecture divides the software of the operating system into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, Android Runtime (Android Runtime) and system libraries, and the kernel layer from top to bottom.
  • the application layer can consist of a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • applications are applications developed based on a single Android system, and applications are developed for a single system; some applications are applications developed based on cross-system development frameworks (such as Flutter, RN or ACE, etc.), that is, cross-system Develop applications.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
  • the view system can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 . For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompting text information in the status bar issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
  • Android Runtime includes core library and virtual machine. Android Runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a screen driver (or display driver), a camera driver, an audio driver, and a sensor driver.
  • the rendering pipeline determines the dirty area (ie, the target area corresponding to the area to be updated) according to the area to be updated in the rendering node that needs to be redrawn.
  • the rendering pipeline passes the dirty regions to the update management control.
  • the update management control determines whether to use the local drawing control or the global drawing control for interface update according to the dirty area, so as to accurately update the area to be updated, reduce useless updates, improve interface update efficiency, and improve rendering performance and animation performance.
  • the method for refreshing the screen provided by the embodiment of the present application will be described below by taking the mobile phone having the structure shown in FIG. 2A and FIG. 2B as an example of the electronic device.
  • the mobile phone can implement various functions through application programs (hereinafter referred to as applications).
  • Various interfaces displayed on the mobile phone can be application interfaces.
  • the desktop can be the interface of the desktop management application, and can also have the interface of the e-book application, the interface of the social application, the interface of the video application, the interface of the browser application, or the interface of the e-book application.
  • the refresh process of the mobile application interface involves modules such as screen, page memory, page cache, canvas and screen driver.
  • the interface video memory and the interface cache may be located in the internal memory of the mobile phone, or in the processor of the mobile phone such as CPU or GPU, or in other locations of the mobile phone, which is not limited in this embodiment of the present application.
  • the interface refreshing process of the mobile phone may include: the screen driver periodically sends out a screen refreshing signal (such as a vertical synchronization signal). This period corresponds to the preset interface display frame rate. Each screen refresh signal triggers the content of the interface video memory to be displayed on the screen.
  • the preset interface display frame rate is 60 frames per second (frame per second, fps)
  • the screen refresh signal period is 1/60 second (second, s)
  • the copying of the interface cache content to the interface video memory is triggered on demand.
  • the application interface needs to be updated, the application requests a screen refresh signal from the screen driver.
  • the application receives the screen refresh signal, it draws on the canvas the target area corresponding to the area to be updated (hereinafter also referred to as the dirty area), and copies the drawn dirty area content to the interface cache, and then saves the dirty area in the interface cache
  • the content is copied to the interface memory.
  • the periodic screen refresh signal comes, the content of the interface video memory is sent to the screen for refresh display, so as to realize the update of the interface. That is to say, the screen refreshes the display interface periodically, but the content of the interface is updated on demand.
  • the application interface can be updated in response to the user's operation (such as updating in response to the user's operation of clicking a certain control on the interface, or updating in response to the user's voice command or gesture operation, etc.), or it can be automatically updated by the application. Updated (such as the video recommendation, news recommendation or advertisement recommendation scrolled by the application on the interface, or the application automatically updates the interface content after receiving a message from other contacts, or the application updates the interface content when playing a video, etc.).
  • the embodiment of the present application does not limit the timing and triggering method of updating the application interface.
  • the partial update/full-screen update mentioned in the screen refresh method mainly refers to the full-screen/partial update target area corresponding to the mobile phone when the application interface needs to be updated during the screen refresh process.
  • the mobile phone will not copy the content of the other area to the interface cache, nor will it copy the content of the other area from the interface cache to the interface video memory. Display directly according to the content of the other area originally stored in the video memory. In this way, the content of the other area displayed on the interface is neither updated nor changed.
  • the Android system (or Android platform, Android operating system) will be used in the mobile phone below, the drawing control is View, the local drawing control is local View, the global drawing control is global View, and the update management control is StackView as an example, and the embodiment of the application is provided The screen refresh method is described.
  • the screen refresh method provided by the embodiment of the present application can be applied to refresh the interface of the cross-system development application running on the Android system.
  • the cross-system development application is an application developed based on a cross-system development framework.
  • the mobile phone includes a partial View
  • the position and size of the partial View can be adaptively adjusted according to the area to be updated. That is, the position and size of the partial View can be adaptively changed, and the partial View can be moved within the full screen range of the mobile phone.
  • the position and size of the partial View can be adapted to the position and size of the local area to be updated on the interface, so that the area to be updated can be accurately updated through the partial View, instead of using the existing Perform full-screen updates like in cross-system scenarios, which can reduce useless updates, save power consumption, improve interface update efficiency, and improve rendering performance and animation performance.
  • the matching of the position and size of the partial View with the position and size of the partial area to be updated on the interface means that the area covered by the partial View (or the area where it is located) includes the area to be updated.
  • the matching of the position and size of the partial View with the position and size of the local area to be updated on the interface means that the position of the partial View corresponds to the position of the target area corresponding to the area to be updated, and the partial View The size of is greater than or equal to the size of the target area corresponding to the area to be updated. That is, the area covered by the partial View can completely include the target area corresponding to the area to be updated.
  • the target area corresponding to the area to be updated is an area that can include the area to be updated.
  • the target area corresponding to the area to be updated is the area to be updated itself.
  • the target area corresponding to the area to be updated may be a rectangular area, such as the smallest rectangular area that can completely include the area to be updated.
  • the target area is the smallest rectangular area that can completely include the area to be updated, and the position and size of the local View are the same as those of the target area.
  • the target area is the smallest rectangular area formed by splicing multiple areas to be updated, and the position and size of the local View are spliced with the multiple local areas to be updated
  • the positions and sizes of the smallest rectangular areas formed later are the same; that is, the target area is the smallest rectangular area that can completely include the plurality of areas to be updated.
  • the target area when the area to be updated is a continuous area on the interface, the target area is the smallest rectangular area that can completely include the area to be updated; see (b) in Figure 4A, When the area to be updated is a plurality of areas (continuous or discontinuous) on the interface, the target area is the smallest rectangular area formed by splicing the multiple areas to be updated, and the smallest rectangular area can completely include the multiple areas to be updated.
  • the target area is the area 400 corresponding to the arrow, and the mobile phone will localize the position of the View The sum and size are set to be consistent with the position of the region 400, so that the region 400 is accurately updated through the local View.
  • the target area is the area 400 corresponding to the arrow, and the mobile phone will localize the position of the View
  • the sum and size are set to be consistent with the position of the region 400, so that the region 400 is accurately updated through the local View.
  • the target area is the stitching area 405 of these areas to be updated, and the mobile phone sets the position and size of the partial View to be consistent with the position of the area 404, so that the area 405 is accurately updated through the partial View.
  • the mobile phone can only update the target area corresponding to the area to be updated (such as the area 400 shown in FIG. 4B ) through the partial View, without needing to update the full screen as in the prior art, or the entire control where the area to be updated is located. (For example, the entire control 40 where the target area 400 is located) is updated to accurately update the area to be updated, reduce useless updates, improve interface update efficiency, and improve rendering performance and dynamic performance.
  • the target area corresponding to the area to be updated such as the area 400 shown in FIG. 4B
  • the entire control 40 where the target area 400 is located is updated to accurately update the area to be updated, reduce useless updates, improve interface update efficiency, and improve rendering performance and dynamic performance.
  • the partial View can be used for both partial updating of the interface and full-screen updating of the interface.
  • the target area corresponding to the area to be updated is a local area rather than a full-screen area.
  • the mobile phone uses the local View to perform accurate updates to the area to be updated to reduce useless updates.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the local View.
  • the mobile phone not only includes a local View, but also includes a global View.
  • the target area corresponding to the area to be updated is a local area rather than a full-screen area.
  • the mobile phone uses the local View to perform accurate updates to the area to be updated to reduce useless updates.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the global View.
  • the mobile phone includes not only a local View, a global View, but also a StackView.
  • the StackView is used to manage the local View and the global View, such as managing the hierarchical relationship between the local View and the global View and switching between them.
  • the target area corresponding to the area to be updated is a local area rather than a full-screen area.
  • the mobile phone uses the local View to perform accurate updates to the area to be updated to reduce useless updates.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the global View.
  • the screen refresh method provided by the embodiment of the present application will be described below by taking a mobile phone including a local View, a global View and a StackView, and the size of the local View is equal to the size of the target area corresponding to the area to be updated as an example.
  • the mobile phone continues to display interface 0, and the content of interface 0 is not updated.
  • the interface 0 is the desktop 60 as shown in (a) of FIG. 6 .
  • the content of the interface cache is not copied to the interface memory, and the content of the interface memory remains unchanged.
  • the mobile phone sends the content of the interface memory to the screen according to the periodic screen refresh signal, and the mobile phone continues to display the interface 0.
  • the application 1 is started.
  • the mobile phone performs a full-screen update through the global View, and displays interface 1 corresponding to application 1.
  • the application 1 is a cross-system e-book application.
  • the mobile phone detects that the user clicks the operation of the icon 600 of the e-book application on the desktop 60 (ie interface 0)
  • the e-book application shown in (b) in FIG. 6 is displayed.
  • the interface 601 (namely interface 1) corresponding to the book application.
  • the rendering pipeline matches the input event and determines the hit rendering node.
  • the rendering pipeline processes the input event and determines that a page transition is required to display the interface of application 1, thus hitting all the rendering nodes on the interface.
  • Each render node that is hit marks itself as a redraw node.
  • the window determines that an interface update is required according to the input event, and thus requests a screen refresh signal from the screen driver. After the window receives the screen refresh signal, it passes the screen refresh signal to the rendering pipeline, triggering the rendering pipeline to enter the rendering process.
  • the rendering pipeline After receiving the screen refresh signal, the rendering pipeline determines the dirty area (that is, the target area corresponding to the area to be updated) according to the area to be updated (also called the area to be drawn) of the redraw node. For example, the rendering pipeline traverses all redrawing nodes, and stitches the drawing areas of the redrawing nodes to obtain the dirty area of the current frame. Wherein, the area to be updated of the redrawing node is smaller than or smaller than the area corresponding to the redrawing node.
  • the rendering pipeline passes the dirty area to the StackView. StackView judges that the dirty area is full screen, and calls the refresh interface of the global View (for example, requestFrame()) to trigger a full screen update.
  • the global View passes the canvas to the rendering pipeline (for example, through the interface Processdraw(canvas)), and the rendering pipeline draws the full-screen interface of the dirty area on the canvas (for example, through the interface Paint(canvas)), and draws the dirty area Copy the content of the dirty area to the interface cache, and then copy the content of the dirty area in the interface cache to the interface video memory.
  • the rendering pipeline draws the full-screen interface of the dirty area on the canvas (for example, through the interface Paint(canvas)), and draws the dirty area Copy the content of the dirty area to the interface cache, and then copy the content of the dirty area in the interface cache to the interface video memory.
  • the next screen refresh signal arrives, the contents of the interface video memory are sent to the screen for refresh display, thereby realizing interface update, and the mobile phone displays the interface 601 corresponding to the e-book application.
  • the mobile phone invokes the global View to update the full-screen content
  • the global View is in a displayed state
  • the local View is in a hidden state.
  • the user cannot see the content in the local View through the interface, but can see the content in the global View.
  • the partial View is set with a visible attribute, which is used to represent the visible state of the partial View.
  • the visible attribute is the first state (such as setVisible(false))
  • the visible state of the partial View is invisible
  • the visible property is in the second state (such as setVisible(true)
  • the visible state of the partial View is visible.
  • StackView can be set by setting the visible state of the local View to the first state (that is, invisible), or setting the size of the local View to 0, or setting the local View on the lower layer of the global View (so that the local View will be replaced by the global View occluded and invisible), and other methods can also be used to set the partial View to a hidden state, which is not limited.
  • the mobile phone determines that the interface 1 of application 1 still needs to be updated in full screen, similar to the process shown in Figure 7, the full screen content is updated through the global View (and the local View is still hidden), and the updated interface 2 is displayed.
  • the mobile phone detects the user's click operation on the setting control 61 on the interface 601 (ie interface 1), in response to the operation, an interface 602 (ie interface 2) as shown in (c) in FIG. 6 is displayed.
  • the mobile phone determines that the interface 2 of the application 1 needs to be partially updated, the partial update is performed through the partial View, and the updated interface 3 is displayed.
  • the mobile phone detects the user's sliding operation on the control 603 of the recommended function on the interface 602 (ie, interface 2), in response to the operation, an interface 604 (ie, interface 3) as shown in (d) in FIG. 6 is displayed. .
  • the control 603 on the interface 604 has been updated, and the display effect of the control 603 has changed.
  • other areas on the interface 604 other than the control 603 are not updated, and the display effects of other areas other than the control 603 do not change.
  • the input event is dispatched to the rendering pipeline.
  • the rendering pipeline matches the input event and determines the hit rendering node.
  • the rendering pipeline determines, according to the coordinate position corresponding to the sliding event (that is, the input event), the rendering node that hits the coordinate position.
  • the hit render node handles the input event, determines that sliding effect drawing is required, and marks itself as a redraw node.
  • the window determines that an interface update is required according to the input event, and thus requests a screen refresh signal from the screen driver. After the window receives the screen refresh signal, it passes the screen refresh signal to the rendering pipeline.
  • the rendering pipeline After the rendering pipeline receives the screen refresh signal, it determines the dirty area according to the area to be updated of the redraw node.
  • the dirty area is the dotted line area 605 shown in (c) of FIG. 6 .
  • the rendering pipeline passes the dirty area to the StackView. Referring to Figure 8A, StackView judges that the size of the dirty area is smaller than the full screen, the dirty area is not full screen, and the full screen update is switched to partial update, and the position and size of the local View are set according to the dirty area (for example, through the interface
  • the partial View passes the canvas to the rendering pipeline, and the rendering pipeline draws the dirty area on the canvas, copies the drawn dirty area content to the interface cache, and then copies the dirty area content in the interface cache to the interface video memory.
  • the contents of the interface video memory are sent to the screen for refresh display, thereby realizing interface update, and the mobile phone displays the updated interface 604 .
  • the contents of other areas on the interface 602 other than the dotted line area 605 are not copied to the interface cache, nor are they copied from the interface cache to the interface video memory.
  • the mobile phone displays the interface 604 according to the content in the other area originally stored in the interface video memory. Therefore, the content of this other area is not updated. Compared with the interface 602, the display effect of the other area on the interface 604 has not changed.
  • the mobile phone when switching from full-screen update to partial update, the mobile phone will switch the drawing from the global View to the partial View, and the partial View will enter the display state from the hidden state during the full-screen update.
  • the local View is located on the upper layer of the global View (or the local View is located on the top layer and the global View is located on the bottom layer), the size of the local View is not 0, and the visible state of the local View is the second state (that is, visible), so that the local View is displayed.
  • the global View is still displayed. In this way, the local View on the upper layer blocks some areas of the global View on the lower layer.
  • StackView can first set the visible state of the partial View to the first state (that is, invisible), and wait for the position of the partial View Or after the size adjustment is completed, set the visible state of the partial View to the second state to avoid re-layout of UI controls, recalculate their positions, etc., reduce internal operations of the mobile phone, and improve refresh and rendering efficiency. Then, StackView calls the refresh interface of the partial View to trigger partial update.
  • the mobile phone determines that the interface 3 of the application 1 still needs to be partially updated, the partial update is performed through the partial View, and the updated interface 4 is displayed.
  • the mobile phone detects the user's sliding operation on the control 603 of the recommended function on the interface 604 (ie, the interface 3), it responds to the user's sliding operation and displays the interface 602 as shown in (c) in FIG. 6 (ie, the interface 4).
  • the display effect of the control 603 on the interface 602 has changed.
  • the mobile phone determines that the dirty area is the dotted line area 605 shown in (d) in FIG.
  • the mobile phone After the mobile phone detects the user's sliding operation on the desktop notification control 606 on the interface 604 (ie interface 3), it responds to the user's sliding operation and displays an interface 607 as shown in (e) in Figure 6 (ie Interface 4). Compared with the interface 604, the display effect of the control 606 on the interface 607 has changed.
  • the mobile phone can determine that the dirty area is the dotted line area 608 shown in (d) in Figure 6, judge that the size of the dirty area is smaller than the full screen, and the dirty area is not full screen, and thus call the refresh interface of the partial View to trigger partial update , and the updated interface 607 is displayed. Moreover, during this process, as shown in FIG.
  • StackView determines that the previous partial update was a partial update, and this time it is still a partial update. Compared with the previous partial update, the position and size of the dirty area has changed during this partial update. Therefore, as shown in FIG. 8C , the StackView can adjust the position and size of the partial View so that the position and size of the partial View are the same as the position and size of the current dirty area.
  • the mobile phone calls the refresh interface of the partial View to trigger the partial update. Moreover, before adjusting the position and size of the partial View, the mobile phone can first set the visible state of the partial View to the first state; after adjusting the position and size of the partial View, set the visible state of the partial View to the second state. state. At the same time, the global View is continuously displayed, and the local View is located on the upper layer of the global View.
  • the mobile phone determines that the interface 4 of the application 1 needs to be updated in a full screen, it performs a full-screen update through the global View and displays the updated interface 5 .
  • the mobile phone detects that the user clicks the display and brightness control 609 on the interface 607 (that is, the interface 4), it responds to the user's click operation and displays the setting of the display and brightness as shown in (f) in FIG. 6 Interface 610 (namely interface 4).
  • interface 610 has been updated in full screen.
  • the rendering pipeline registers a screen input event callback with the window, and after the window detects the input event of the user clicking the control 609 on the interface 607, the input event is dispatched to the rendering pipeline.
  • the rendering pipeline matches the input event and determines the hit rendering node.
  • the rendering pipeline processes the input event and determines that a page transition is required to display the display and brightness setting interface, thus hitting all rendering nodes.
  • Each render node that is hit marks itself as a redraw node.
  • the window determines that an interface update is required according to the input event, and thus requests a screen refresh signal from the screen driver. After the window receives the screen refresh signal, it passes the screen refresh signal to the rendering pipeline.
  • the rendering pipeline After the rendering pipeline receives the screen refresh signal, it determines the dirty area according to the area to be updated of the redraw node.
  • the rendering pipeline passes the dirty area to the StackView. Referring to FIG. 8D , StackView judges that the dirty area is full screen, and switches from partial update to full screen update, thereby calling the refresh interface of the global View to trigger full screen update.
  • the global View passes the canvas to the rendering pipeline, and the rendering pipeline draws the full-screen interface of the dirty area on the canvas, copies the drawn dirty area content to the interface cache, and then copies the dirty area content in the interface cache to the interface video memory.
  • the next screen refresh signal arrives, the contents of the interface video memory are sent to the screen for refresh display, thereby realizing interface update, and the mobile phone displays the interface 602 corresponding to the e-book application.
  • StackView when switching from partial update to full-screen update, StackView will switch the drawing from local View to global View, as shown in Figure 8D, StackView controls the local View to switch from the display state during partial update to the hidden state, while the global View remains is displayed.
  • the mobile phone determines that the interface needs to be partially/full-screen updated according to the input event of the user's click operation or slide operation.
  • the mobile phone may also determine that the interface needs partial/full screen update according to other input events triggered by the user, such as the user's drag operation, long press operation, voice command or gesture operation and other input events.
  • the embodiment of the present application does not limit the specific type of the user input event used to trigger the partial/full screen update of the interface.
  • FIG. 9 shows an interface 901 of application 2 .
  • the application 2 is a cross-system development application.
  • the application 2 is a video playing application. Wherein, the video playing application scrolls and displays different recommended videos in the area 902 .
  • the mobile phone is determined to be a partial update, and thus invokes the refresh interface of the partial View to automatically perform a partial update and display an interface 903 as shown in (b) in FIG. 9 .
  • the window of the video playback application dispatches scrolling display events to the rendering pipeline.
  • the rendering pipeline matches the scroll display event to determine the hit rendering node.
  • the hit rendering node handles the scrolling display event, determines that scrolling switching effect drawing is required, and marks itself as a redrawing node.
  • the window determines that an interface update is required according to the scroll display event, and thus requests a screen refresh signal from the screen driver.
  • the window After the window receives the screen refresh signal, it passes the screen refresh signal to the rendering pipeline.
  • the rendering pipeline receives the screen refresh signal, it determines the dirty area according to the area to be updated of the redraw node. Exemplarily, the dirty area is the area 902 shown in (a) in FIG. 9 .
  • the rendering pipeline passes the dirty area to the StackView.
  • StackView determines that the dirty area is not full-screen, and sets the position and size of the local View according to the dirty area so that the position and size of the local View are the same as those of the dirty area, and calls the refresh interface of the local View to trigger a partial update.
  • the partial View passes the canvas to the rendering pipeline, and the rendering pipeline draws the dirty area on the canvas, copies the drawn dirty area content to the interface cache, and then copies the dirty area content in the interface cache to the interface video memory.
  • the next screen refresh signal arrives, the contents of the interface video memory are sent to the screen for refresh display, thereby realizing interface update, and the mobile phone displays the updated interface 903 .
  • the target area corresponding to the area to be updated is a local area rather than the full screen area, and the mobile phone uses the local View to accurately update the area to be updated to reduce useless updates.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the global View.
  • the mobile phone determines that a partial update is required, so that a local update of the interface is performed through the local View; when the area to be updated is large, the mobile phone determines that a full-screen update is required, so that a full-screen update is performed through the global View .
  • a preset threshold value 1 on the mobile phone. When the ratio of the target area corresponding to the area to be updated to the full screen is less than or equal to the threshold value 1, the mobile phone determines that a partial update is required, so that the area to be updated can be accurately updated through the local View to reduce useless updates.
  • threshold 1 is 80%, 90%, or 95%.
  • a threshold value 2 is preset on the mobile phone.
  • the mobile phone determines that a partial update is required, so that the area to be updated can be accurately updated through the local View. Reduce useless updates; when the target area corresponding to the area to be updated is greater than the threshold 2, the mobile phone determines that a full-screen update is required, so that the full-screen update is performed through the global View.
  • the mobile phone includes multiple partial Views (such as partial View1, partial View2, etc.) and one global View. Can be moved across the full screen.
  • the mobile phone may further include a StackView for managing the global View and multiple local Views.
  • the mobile phone updates the full screen through the global View; when the interface of the cross-system development application needs partial update, the mobile phone treats it through one or more local Views The update area is updated precisely to reduce useless updates.
  • each partial View corresponds to an area to be updated
  • the mobile phone can update the area to be updated through multiple partial Views.
  • the location and size of the target region corresponding to the regions are the same.
  • a target area corresponding to an area to be updated may be the smallest rectangular area that can include the area to be updated.
  • the multiple partial Views of the mobile phone include partial View1, partial View2, partial View3 and partial View4.
  • the area to be updated 1001 when the area to be updated 1001, the area to be updated 1002, the area to be updated 1003, and the area to be updated 1004 need to be updated on the interface of the cross-system development application, these areas to be updated are respectively
  • the corresponding set of target area 1005, target area 1006, target area 1007, and target area 1008 is smaller than the full screen.
  • the mobile phone sets the position and size of the partial View1 to be consistent with the position and size of the target area 1005 corresponding to the area to be updated 1001, and sets the position and size of the partial View2 to the position of the target area 1006 corresponding to the area to be updated 1002 Set to be consistent with the size, set the position and size of the partial View3 to be consistent with the position and size of the target area 1007 corresponding to the area to be updated 1003, and set the position and size of the partial View4 to be consistent with the position of the target area 1008 corresponding to the area to be updated 1004 Set to be consistent with the size, and call the refresh interface of partial View1, partial View2, partial View3, and partial View4 to trigger partial update.
  • aggregation is not equivalent to splicing, splicing also includes gap area 1009 but aggregation does not include area 1009 .
  • the solution shown in FIG. 10B can reduce useless updates caused by concatenation of regions to be updated, for example, reduce useless updates to region 1009 .
  • the mobile phone compares the position and size of the local View1 with the area to be updated 1010 (itself is the corresponding target area) ), set the position and size of the local View2 to be consistent with the position and size of the area to be updated 1011 (itself the corresponding target area), and call the refresh interfaces of the local View1 and local View2 to trigger Partial update.
  • each partial View may correspond to one or more regions to be updated.
  • the position and size of the partial View are the same as those of the target area corresponding to the area to be updated.
  • the local View corresponds to the position and size of the stitching area of multiple areas to be updated.
  • the mobile phone when the area to be updated is small, the mobile phone determines that a local update is required, so that the update is performed through the local View; when the area to be updated is large , the mobile phone determines that a full-screen update is required, and thus updates through the global View.
  • a threshold 1 is preset on the mobile phone. When the ratio of the target area corresponding to the area to be updated to the full screen is less than or equal to this threshold, the mobile phone determines that a partial update is required, so that the area to be updated can be accurately updated through one or more partial Views.
  • the mobile phone determines that a full-screen update is required, so that the full-screen update is performed through the global View, and there is no need to adjust the position and size of the local View.
  • the threshold value 2 is preset on the mobile phone. When the size (or area) of the target area corresponding to the area to be updated is smaller than or equal to the threshold value 2, the mobile phone determines that a partial update is required, and thus treats the update area through one or more partial Views. Perform precise updates to reduce useless updates; when the target area corresponding to the area to be updated is greater than the threshold 2, the mobile phone determines that a full-screen update is required, thereby performing a full-screen update through the global View.
  • the mobile phone when the interface of the cross-system development application needs to be partially updated, uses one or more partial Views to accurately update the area to be updated to reduce useless updates ;
  • the mobile phone updates the full screen through the combination of multiple partial Views. For example, when the interface of a cross-system development application needs to be updated in full screen, the mobile phone partially updates the upper half of the screen through partial View1, and updates the lower half of the screen through partial View2, thereby updating the full screen content.
  • the screen refresh method using the combination of the local View and the global View provided in the above embodiments may also be applied to an interface update scenario of a single-system development application.
  • the single-system development application is an Android application, and the Android application can also use the method provided in the above embodiments of the present application to update the interface when updating the interface, which will not be described in detail.
  • the mobile phone includes a global View and a partial View, and the partial View can be moved within the full screen range; when the interface of an Android application needs to be partially updated, the target area corresponding to the area to be updated is a partial area rather than a full screen For the region, the mobile phone accurately updates the area to be updated through the local View to reduce useless updates; when the interface of the Android application needs to be updated in full screen, the target area corresponding to the area to be updated is the full-screen area, and the mobile phone updates the area to be updated through the global View.
  • a mobile phone includes a global View and multiple partial Views, and the partial Views can be moved within the full screen range.
  • cross-system development applications use the solution of combining local View and global View provided by the above embodiments to carry out interface Update, while the interface update of the Android application adopts the method that each existing UI control corresponds to a View for interface update.
  • both the cross-system development application and the Android application adopt the above solution of combining the local View and the global View to update the interface.
  • the embodiment of the present application can accurately update the dynamic area of the interface (that is, the area to be updated) through the partial View whose position and size can be adaptively adjusted, reduce useless updates, save power consumption of the mobile phone, and improve the interface update efficiency. Rendering performance and dynamic performance make the interface refresh more smoothly. Moreover, the smaller the motion effect area, the greater the benefit that can be obtained by the embodiment of the present application.
  • the present application provides a method for refreshing a screen, which can be applied to updating an interface of an application developed by a single system.
  • a single-system development application is an application developed based on a single operating system.
  • the single-system development application is an Android application developed based on the Android operating system.
  • the mobile phone includes a global View, each specific UI control corresponds to a local View, and each non-specific UI control corresponds to a regular View.
  • the partial View is movable within the bounds of that particular UI control.
  • the specific UI control may be a large-area control (such as a large-scale control customized by an application developer based on the Android system).
  • this regular View is the same as that of the corresponding UI control.
  • the target area corresponding to the area to be updated is the full screen area
  • the mobile phone updates the area to be updated through the global View.
  • the local View is used to perform fine-grained local update, so as to reduce useless updates of areas other than the area to be updated in the specific UI control and save power consumption.
  • partial updates are performed through the regular View corresponding to the non-specific UI control.
  • the partial View and the regular View can be used in combination.
  • a specific UI control can correspond to multiple partial Views, and each area to be updated in the specific UI control can be updated using a partial View.
  • the present application provides a screen refreshing method, which can be applied to update the interface of a single-system development application such as an Android application.
  • a single-system development application such as an Android application.
  • the mobile phone includes a global View
  • each UI control (including specific UI controls and non-specific UI controls) corresponds to a regular View
  • the specific UI control also includes a partial View
  • the partial View Can move within the bounds of that particular UI control.
  • the specific UI control may be a control with a relatively large area.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the global View.
  • a local View is used for partial update, so as to reduce useless updates of areas other than the area to be updated in a specific UI control and save power consumption.
  • partial updates are performed through the regular View corresponding to the non-specific UI control.
  • the partial View and the regular View can be used in combination.
  • the UI control can correspond to multiple partial Views, and each area to be updated in the UI control can be updated using a partial View.
  • the present application provides a screen refreshing method, which can be applied to update the interface of a single-system development application such as an Android application.
  • a single-system development application such as an Android application.
  • the mobile phone includes a global View and a partial View, each UI control corresponds to a regular View, and the partial View can be moved within the full screen range.
  • the target area corresponding to the area to be updated is the full screen area, and the mobile phone updates the area to be updated through the global View.
  • a local View is used for partial update to reduce useless updates to areas outside the area to be updated in the UI control.
  • the conventional View corresponding to the UI control is used for partial update.
  • the area to be updated includes a partial area of a UI control and other UI controls
  • the partial View can be used in combination with the regular View.
  • the mobile phone may include multiple partial Views, and the area to be updated inside each UI control may be updated using one partial View.
  • the mobile phone when the mobile phone includes a partial View and a full-screen View, and the partial View can move within the full-screen range, when the interface needs to be partially updated, the mobile phone uses the partial View to update.
  • the mobile phone uses the partial View for partial interface update continuously, the mobile phone will update the dirty area corresponding to this partial interface update together with the dirty area retained during the previous continuous partial update.
  • the dirty area during the first and second partial interface update is retained and together with the third time
  • the corresponding dirty areas are updated together.
  • the area covered by the local View includes the previously reserved dirty area and this dirty area. Area).
  • the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update, so that the solidified content can be presented to the user through the global View later.
  • the dirty area corresponding to the first interface update is area 1401
  • the position and size of the partial View used in the update are the same as area 1401
  • the dirty area corresponding to the second interface update is area 1402
  • the area covered by the local View used in the update includes the current dirty area and the last dirty area reserved, for example, it can be completely
  • the dirty area corresponding to the third interface update is area 1403, and the area covered by the local View used in the update includes this dirty area (that is, area 1403) and the previous dirty area ( That is, area 1401 and area 1402), for example, can be the smallest rectangle 142 that can completely include area 1401, area 1402, and area 1403 (for example, it can be the smallest rectangle formed by splicing area 1401, area 1402, and area 1403, or it can be this time Refresh the smallest rectangle formed by splicing the area 1403 which is the dirty area and the area covered by the previous local View).
  • the dirty area is cleared.
  • the global View can be used to perform a full-screen update.
  • preset condition a the mobile phone determines that a full-screen update is required, for example, the area to be updated is greater than the above threshold 2, etc. At this time, the mobile phone can use the global View to perform a full-screen update to clear the dirty area reserved before the full-screen update. Moreover, before the full-screen update, the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the preset condition b the number of times the mobile phone uses the partial View to perform partial interface updates continuously is greater than or equal to a preset value of 1.
  • the number of dirty areas reserved by the mobile phone may be large, and the area may also be large, so the global View can be used to perform a full-screen update to clear the dirty areas reserved before the full-screen update.
  • the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the preset value 1 may be 3 or 5 and so on.
  • the preset value is 1, that is, after each partial update of the mobile phone using the partial View, the full-screen View will be used to perform a full-screen refresh no matter whether the subsequent partial update or full-screen update is required, so that the partial View will be updated this time.
  • the content of the local area is solidified to the global View, and the dirty area is cleared.
  • the preset condition c the mobile phone continuously uses the partial View to perform partial interface update, and the size of the dirty area reserved by the mobile phone is greater than or equal to the preset value 2.
  • the area of the dirty area reserved by the mobile phone is relatively large, and the global View can be used to perform a full-screen update to clear the dirty area reserved before the full-screen update.
  • the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the preset condition d the duration of the mobile phone continuously using the local View for interface update is greater than or equal to the preset value 3, or the duration of the mobile phone not using the global View for updating is greater than or equal to the preset value 3.
  • the mobile phone has not performed full-screen update for a long time, and the dirty area reserved by the mobile phone may be relatively large.
  • the mobile phone can use the global View to perform a full-screen update to clear the dirty area reserved before the full-screen update.
  • the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the mobile phone regularly uses the global View to perform a full-screen update according to a preset cycle, so as to clear the dirty area that may be retained within a cycle. Moreover, before the full-screen update, the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the preset condition e after the mobile phone uses the local View to update the dirty area, other parts outside the dirty area need to be updated. At this time, compared with the previous update, the dirty area of this update has changed, and the mobile phone can use the global View to perform a full-screen update to clear the dirty area reserved before the full-screen update. Moreover, before the full-screen update, the updated content of the dirty area reserved by the mobile phone can be solidified on the global View through the full-screen update.
  • the mobile phone when it determines that any one of the above preset conditions b-d is met, it uses the global View to perform a full-screen update; Any one, and when it is determined that the interface needs to be updated (partial update or full-screen update), the global View is used to perform a full-screen update.
  • any one of the preset conditions b-e may be combined with the preset condition a.
  • the mobile phone uses the global View for full-screen update when it determines that a full-screen update is required, and also uses the local View when the number of times the mobile phone uses the local View for partial interface update is greater than or equal to the preset value 1.
  • the global View is updated.
  • the mobile phone when the mobile phone includes multiple partial Views and one full-screen View, and the partial Views can move within the full-screen range, when the mobile phone determines that the interface needs to be partially updated, the mobile phone uses one partial View to perform the update. renew. Then, when the interface needs to be partially updated again, if the dirty area is the same, the same partial View is still used for updating; if the dirty area is different, another partial View is used for updating. The position and size of the dirty area of the frame are the same; and so on, until the preset conditions are met, the global View is used to perform a full-screen update regardless of whether a full-screen update or a partial update is required at that time.
  • the mobile phone can release the partial Views that have been used, and clear the dirty areas corresponding to multiple partial Views that have been used.
  • the updated content of the dirty areas corresponding to the multiple local Views that have been used can be solidified on the global View through a full-screen refresh, so that the cured content can be presented to the user through the global View later.
  • the dirty area corresponding to the first interface update is area 1501
  • the mobile phone uses partial View1 for updating, and the position and size of partial View1 are the same as area 1501 .
  • the dirty area corresponding to the second interface update is area 1502.
  • Area 1502 is different from area 1501.
  • the mobile phone uses partial View2 for updating, and the position and size of partial View2 are the same as area 1502.
  • the dirty area corresponding to the third interface update is area 1503.
  • Area 1503 is different from area 1502 and area 1501.
  • the mobile phone uses partial View3 for updating, and the position and size of partial View3 are the same as area 1503.
  • the mobile phone If the dirty area corresponding to the third interface update is area 1502, the mobile phone still uses the local View2 to update, and the position and size of the local View2 are the same as area 1502; if the dirty area corresponding to the third interface update is area 1501, the mobile phone The partial View1 is still used for updating, and the position and size of the partial View1 are the same as those of the area 1501 .
  • the dirty area is cleared, and each local View is also released, which can be used to update other areas.
  • the global View can be used to perform a full-screen update.
  • preset condition A the mobile phone needs to update the full screen, for example, the area to be updated is greater than the above threshold 2, etc.
  • the mobile phone can use the global View to perform a full-screen update to release the partial View that has been used, so that the partial View can continue later Used for partial refresh.
  • the number of partial Views included in the mobile phone is limited, and preset condition B: the partial Views included in the mobile phone are exhausted.
  • the mobile phone can use the global View to perform a full-screen update to release the used partial View, so that the partial View can continue to be used for partial refresh later.
  • the preset condition C the number of partial Views that have been used is greater than or equal to the preset value 4. At this time, the number of dirty areas corresponding to the used partial Views is large, and the mobile phone can use the global View to perform a full-screen update to release the used partial Views.
  • the preset condition D the mobile phone continuously uses the partial View to update the partial interface, and the area of the dirty area corresponding to the used partial View is greater than or equal to the preset value of 5. At this time, the area of the dirty area corresponding to the used partial View is large, and the mobile phone can use the global View to perform a full-screen update to release the used partial View and clear the corresponding dirty area.
  • preset condition E the duration of the mobile phone's continuous interface update using the partial View is greater than or equal to the preset value 6, or the duration of the mobile phone not using the global View for updating is greater than or equal to the preset value of 6.
  • the mobile phone has not been updated full-screen for a long time, the number of used partial Views may be large, and the dirty area corresponding to the used partial Views may be large.
  • the mobile phone can use the global View to perform a full-screen update to release The partial View that has been used.
  • the mobile phone regularly uses the global View to perform a full-screen update according to a preset cycle, so as to release the used partial View.
  • the mobile phone when it determines that any one of the above preset conditions B-E is satisfied, it uses the global View to perform a full-screen update; Any one, and when it is determined that the interface needs to be updated (partial update or full-screen update), the global View is used to perform a full-screen update.
  • any one of the preset conditions B-E can be combined with the preset condition A.
  • the mobile phone uses the global View for full-screen update when it determines that a full-screen update is required, and uses the global View for full-screen update when the partial View included in the mobile phone is used up.
  • another embodiment of the present application provides a method for updating an interface, which can be implemented on an electronic device having the structure shown in FIG. 2A, and the electronic device includes a first partial drawing control .
  • the first partial drawing control may be the partial View in the above embodiment.
  • the method includes:
  • the electronic device displays a first interface, where the first interface includes a first area, and the content of the first area on the first interface is first content.
  • the first interface may be the interface 602 shown in (c) in FIG. 6
  • the first area may be the area 605 .
  • the electronic device displays a second interface, the second interface includes a first area, the content of the first area on the second interface is the second content, and the second content is different from the first content, and the first content is captured by the electronic device through the second A partial drawing control is updated with the second content; the second interface further includes a second area, the second area is different from the first area, and the content of the second area on the second interface is the third content.
  • the second interface can be the interface 604 shown in (d) in Figure 6, and the first partial drawing control can be a partial View; the second area can be the area on the interface 604 shown in (d) in Figure 6 608.
  • the electronic device displays a third interface, the third interface includes a second area, the content of the second area on the third interface is the fourth content, and the fourth content is different from the third content, and the third content is obtained by the electronic device through the first
  • the local drawing control is updated with the fourth content.
  • the third interface may be the interface 607 shown in (e) of FIG. 6 .
  • the first area and the second area are areas to be updated on the interface.
  • the electronic device can use the first partial drawing control to accurately update the content of the first area on the interface, and use the first partial drawing control to accurately update the content of the second area on the other interface, thereby reducing useless updates and saving the cost of the electronic device. Power consumption, improve interface update efficiency, improve rendering performance and animation performance.
  • the area where the first partial drawing control is located includes the first area.
  • the area where the first partial drawing control is located includes the second area. That is to say, the position and size of the first partial drawing control can be changed, and the first partial drawing control can be moved within the full screen range to accurately update different partial regions.
  • the first target area is the smallest rectangular area including the first area
  • the second target area is the smallest rectangular area including the second area, so as to minimize useless updates.
  • the method further includes: the electronic device displays a fourth interface, the fourth interface includes a second area, the content of the second area on the fourth interface is fifth content, and the fifth content is different from the fourth content , the fourth content is updated to the fifth content by the electronic device through the first partial drawing control, and the area where the first partial drawing control is located includes the second area. That is to say, when the area to be updated remains unchanged, the position and size of the first local control also remain unchanged.
  • the electronic device further includes a second partial drawing control
  • the first interface further includes a third area
  • the third area is different from the first area
  • the second interface further includes a third area
  • the content of the third area is the sixth content
  • the content of the third area on the second interface is the seventh content
  • the seventh content is different from the sixth content
  • the sixth content is updated to the seventh content by the electronic device through the second partial drawing control Content
  • the area where the second partial drawing control is located includes the third area.
  • the size of the first area, the size of the second area, the size of the first partial drawing control, and the size of the second partial drawing control are smaller than or equal to a preset threshold.
  • the electronic device also includes a global drawing control, the size of the global drawing control is the same as the screen size of the electronic device, and the method further includes: the electronic device displays a fifth interface, the fifth interface includes a fourth area, and the fourth area on the fifth interface The content is the eighth content, and the size of the fourth area is larger than the preset threshold; the electronic device displays the sixth interface, the sixth interface includes the fourth area, the content of the fourth area on the sixth interface is the ninth content, and the ninth content Different from the eighth content, the eighth content is updated to the ninth content by the electronic device through the global drawing control. That is to say, if the size of the area to be updated is small, the local drawing control is used for precise update; if the area to be updated is large, the global drawing control is used for updating.
  • the first interface further includes a fifth area, the fifth area is different from the first area, the content of the fifth area has not been updated, and the content of the fifth area on the second interface is the same as that of the first interface.
  • the content of the fifth area is the same. That is to say, when the partial first area on the first interface is updated, the fifth area on the first interface is not updated, but the first interface is partially updated.
  • the electronic device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the functional modules of the electronic device may be divided according to the above method example.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules may be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • a possible composition of the electronic device involved in the above embodiment includes: a display unit, an updating unit, a processing unit, and the like. It should be noted that all relevant content of the steps involved in the above method embodiments can be referred to the function description of the corresponding function module, and will not be repeated here.
  • the embodiment of the present application also provides an electronic device, as shown in FIG. Devices may be connected by one or more communication buses 1705 .
  • the one or more computer programs 1704 are stored in the above-mentioned memory 1703 and are configured to be executed by the one or more processors 1702, the one or more computer programs 1704 include instructions, and the above-mentioned instructions can be used to perform the above-mentioned implementation steps in the example.
  • all relevant content of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.
  • the above-mentioned processor 1702 may specifically be the processor 110 shown in FIG. 2A
  • the above-mentioned memory 1703 may specifically be the internal memory 121 shown in FIG. 2A
  • the above-mentioned display screen 1701 may specifically be the display screen 194 shown in FIG. 2A .
  • the embodiment of the present application also provides an electronic device, including one or more processors and one or more memories.
  • the one or more memories are coupled with one or more processors, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs The above related method steps implement the screen refreshing method in the above embodiment.
  • Embodiments of the present application also provide a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run on the electronic device, the electronic device executes the above-mentioned relevant method steps to realize the above-mentioned embodiment The screen refresh method in .
  • Embodiments of the present application also provide a computer program product, which, when running on a computer, causes the computer to execute the above-mentioned related steps, so as to implement the screen refreshing method performed by the electronic device in the above-mentioned embodiments.
  • an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executed instructions stored in the memory, so that the device executes the screen refreshing method performed by the electronic device in the above method embodiments.
  • the electronic equipment, computer-readable storage medium, computer program product or device provided in this embodiment are all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above-mentioned The beneficial effects of the corresponding method will not be repeated here.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种可提升动效性能的屏幕刷新方法及设备,涉及电子技术领域,能够通过同一绘制控件对不同界面上的不同区域进行精准更新,可减少无用的更新,节省功耗,提高界面更新效率,提升渲染性能和动效性能。该方法包括:电子设备采用局部绘制控件更新界面上某个局部区域的内容,而后采用同一局部绘制控件更新另一界面上另一个局部区域的内容。该方法用于屏幕刷新。

Description

一种可提升动效性能的屏幕刷新方法及设备
本申请要求于2021年7月20日提交国家知识产权局、申请号为202110820324.X、申请名称为“一种可提升动效性能的屏幕刷新方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及电子技术领域,尤其涉及一种可提升动效性能的屏幕刷新方法及设备。
背景技术
目前,用户使用的电子设备和应用越来越多。电子设备可通过屏幕为用户显示各应用绚丽多变的界面内容。为了提升用户体验,动效的场景越来越多,电子设备通过不断刷新显示来实现动效场景下界面内容的变化。现有技术中,电子设备通过更新整个屏幕的内容或者更新屏幕上控件的内容来实现界面内容的更新。该方式容易导致无用的更新,电子设备的功耗较大,渲染性能和动效性能较差。
发明内容
本申请实施例提供一种可提升动效性能的屏幕刷新方法及设备,能够通过同一绘制控件对不同界面上的不同区域进行精准更新,可减少无用的更新,节省功耗,提高界面更新效率,提升渲染性能和动效性能。
为达到上述目的,本申请实施例采用如下技术方案:
一方面,本申请实施例提供一种界面更新方法,应用于电子设备,电子设备包括第一局部绘制控件,该方法包括:电子设备显示第一界面,第一界面包括第一区域,第一界面上的第一区域的内容为第一内容。电子设备显示更新后的第二界面,第二界面包括第一区域,第二界面上的第一区域的内容为第二内容,且第二内容不同于第一内容,第一内容被电子设备通过第一局部绘制控件更新为第二内容。第二界面还包括第二区域,第二区域不同于第一区域,第二界面上的第二区域的内容为第三内容。电子设备显示更新后的第三界面,第三界面包括第二区域,第三界面上的第二区域的内容为第四内容,且第四内容不同于第三内容,第三内容被电子设备通过第一局部绘制控件更新为第四内容。
在该方案中,电子设备可以采用第一局部绘制控件精准更新界面上第一区域的内容,并采用该第一局部绘制控件精准更新另一界面上第二区域的内容,能够减少无用的更新,节省电子设备的功耗,提高界面更新效率,提升渲染性能和动效性能。其中,第一区域和第二区域为待更新区域。
在一种可能的设计中,第一内容被更新为第二内容的过程中,第一局部绘制控件所在的区域包括第一区域。在第三内容被更新为第四内容的过程中,第一局部绘制控件所在的区域包括第二区域。
也就是说,第一局部绘制控件的位置和尺寸与待更新区域(比如第一区域或第二 区域)的位置和尺寸相适配,第一局部绘制控件的位置和尺寸可变,以便第一局部绘制控件所在的区域包括待更新区域,从而可以精准更新待更新区域。
在另一种可能的设计中,在第一内容被更新为第二内容的过程中,第一局部绘制控件的位置和尺寸与第一区域对应的第一目标区域的位置和尺寸相同。其中,第一目标区域包括第一区域。在第三内容通过第一局部绘制控件更新为第四内容的过程中,第一局部绘制控件的位置和尺寸与第二区域对应的第二目标区域的位置和尺寸相同。其中,第二目标区域包括第二区域。
在该方案中,第一局部绘制控件的位置可在全屏范围内移动,第一局部绘制控件的位置和尺寸,可随着待更新区域(比如第一区域或第二区域)对应的目标区域适应性地变化,从而对不同界面上的不同区域进行精准更新,减少无用更新。
例如,第一目标区域为包括第一区域的最小矩形,第二目标区域为包括第二区域的最小矩形。这样,在界面更新过程中,局部绘制控件的位置和尺寸与该最小矩形的位置和尺寸相同,能够尽量减少无用刷新。
在另一种可能的设计中,在电子设备显示第三界面后,该方法还包括:电子设备显示第四界面,第四界面包括第二区域,第四界面上的第二区域的内容为第五内容,且第五内容不同于第四内容,第四内容被电子设备通过第一局部绘制控件更新为第五内容,第一局部绘制控件所在的区域仍包括第二区域。
也就是说,如果待更新区域不变,用于进行精准更新的第一局部绘制控件的位置和尺寸也不变。
在另一种可能的设计中,电子设备还包括第二局部绘制控件,第一界面还包括第三区域,第三区域不同于第一区域,第二界面还包括第三区域,第一界面上第三区域的内容为第六内容,第二界面上第三区域的内容为第七内容,且第七内容不同于第六内容,第六内容被电子设备通过第二局部绘制控件更新为第七内容,第二局部绘制控件所在的区域包括第三区域。例如,第二局部绘制控件的位置和尺寸与第三区域对应的第三目标区域的位置和尺寸相同,且第三目标区域包括第三区域。
在该方案中,同一界面上的不同区域,可以通过不同的局部绘制控件分别进行精准更新。
在另一种可能的设计中,第一区域的尺寸,第二区域的尺寸,第一局部绘制控件的尺寸,以及第二局部绘制控件的尺寸小于或者等于预设阈值。电子设备还包括全局绘制控件,全局绘制控件的尺寸与电子设备的屏幕尺寸相同,该方法还包括:电子设备显示第五界面,第五界面包括第四区域,第五界面上的第四区域的内容为第八内容,第四区域大于预设阈值。电子设备显示第六界面,第六界面包括第四区域,第六界面上的第四区域的内容为第九内容,且第九内容不同于第八内容,第八内容被电子设备通过全局绘制控件更新为第九内容。
在该方案中,如果待更新区域(如第一区域或第二区域)的尺寸较小,则采用局部绘制控件进行精准更新,以减少无用更新;如果待更新区域(如第四区域)的尺寸较大,则采用位置和尺寸与全屏相对应的全局绘制控件进行更新,可以不用调整局部绘制控件的位置和尺寸。
在另一种可能的设计中,第一界面还包括第五区域,第五区域不同于第一区域, 第一界面上的第五区域的内容未被更新,第二界面上的第五区域的内容与第一界面上的第五区域的内容相同。
也就是说,在第一界面上局部的第一区域进行更新时,第一界面上的第五区域未进行更新,第一界面进行了局部更新。其中,在第一界面进行更新时,第一区域的内容被绘制后拷贝至界面缓存中,并从界面缓存拷贝至界面显存,从而送至屏幕进行显示。第二界面上第一区域的内容与第一界面上第一区域的内容相比,发生了变化。在第一界面进行更新时,第五区域的内容未被绘制,第五区域的内容未拷贝至界面缓存,也未从界面缓存拷贝至界面显存,界面显存中原本存储的第五区域的内容送至屏幕进行显示。第二界面上第五区域的内容与第一界面上第五区域的内容相比未发生变化。
在另一种可能的设计中,第一区域和第二区域为第二界面上第一用户界面UI控件中的不同区域。
这样,电子设备可以采用第一局部绘制控件,对不同界面上,同一UI控件中的不同区域进行精准更新。
在另一种可能的设计中,在第一内容被更新为第二内容的过程中,第一局部绘制控件所在的区域包括第一区域。在第三内容被更新为第四内容的过程中,第一局部绘制控件所在的区域包括第二区域以及保留的待更新区域,保留的待更新区域包括第一区域。
在该方案中,电子设备每次采用第一局部绘制控件进行更新时,将本次待更新区域,连同之前采用第一局部绘制控件进行更新时保留的待更新区域,一起进行更新。
在另一种可能的设计中,在第一内容被更新为第二内容的过程中,第一局部绘制控件所在的区域包括第一区域对应的第一目标区域;在第三内容被更新为第四内容的过程中,第一局部绘制控件所覆盖的区域包括第二区域对应的第二目标区域,以及保留的之前待更新区域对应的目标区域,保留的之前待更新区域对应的目标区域包括第一目标区域。例如,第一目标区域为包括第一区域的最小矩形,第二目标区域为包括第二区域的最小矩形。
在该方案中,电子设备每次采用第一局部绘制控件进行更新时,将本次待更新区域对应的目标区域,连同之前采用第一局部绘制控件进行更新时保留的目标区域一起进行更新。
在另一种可能的设计中,电子设备还包括全局绘制控件,全局绘制控件的尺寸与电子设备的屏幕尺寸相同。该方法还包括:若满足第一预设条件,则电子设备采用全局绘制控件进行全屏更新;第一预设条件包括以下任意一项:待更新区域大于或者等于预设阈值;或者,连续采用第一局部绘制进行界面更新的次数大于或者等于第一预设值;或者,采用第一局部绘制控件进行界面更新的过程中,保留的待更新区域的尺寸大于或者等于第二预设值;或者,连续采用第一局部绘制进行界面更新的时长大于或者等于第三预设值;或者,上一次采用第一局部绘制控件进行界面更新,本次待更新区域不同于上一次的待更新区域。
也就是说,电子设备可以通过多种灵活方式,采用全局绘制控件进行全屏更新。
在另一种可能的设计中,在电子设备采用全局绘制控件进行全屏更新之后,该方法还包括:电子设备清除保留的待更新区域。
也就是说,电子设备采用全局绘制控件进行全屏刷新后,可以清除保留的待更新区域。
在另一种可能的设计中,在电子设备采用全局绘制控件进行全屏更新之后,该方法还包括:电子设备清除保留的待更新区域对应的目标区域。
也就是说,电子设备采用全局绘制控件进行全屏刷新后,可以清除保留的待更新区域对应的目标区域。
另一方面,本申请实施例提供了一种界面更新方法,应用于电子设备,电子设备包括第一局部绘制控件,该方法包括:电子设备显示第一界面,第一界面包括第一区域,第一界面上的第一区域的内容为第一内容。电子设备通过第一局部绘制控件,将第一区域的第一内容更新为第二内容,第二内容不同于第一内容。电子设备显示第二界面,第二界面包括第一区域,第二界面上的第一区域的内容为第二内容;第二界面还包括第二区域,第二区域不同于第一区域,第二界面上的第二区域的内容为第三内容。电子设备通过第一局部绘制控件,将第二区域的第三内容更为第四内容,第四内容不同于第三内容。电子设备显示第三界面,第三界面包括第二区域,第三界面上的第二区域的内容为第四内容。
在该方案中,电子设备可以采用第一局部绘制控件精准更新界面上第一区域的内容,并采用该第一局部绘制控件精准更新另一界面上第二区域的内容,能够减少无用的更新,节省电子设备的功耗,提高界面更新效率,提升渲染性能和动效性能。
在一种可能的设计中,在电子设备将第一内容更为第二内容的过程中,第一局部绘制控件所在的区域包括第一区域。在电子设备将第三内容更为第四内容的过程中,第一局部绘制控件所在的区域包括第二区域。
在另一种可能的设计中,在电子设备显示第三界面后,该方法还包括:电子设备通过第一局部绘制控件,将第二区域的第四内容更新为第五内容,第五内容不同于第四内容,且第一局部绘制控件所在的区域包括第二区域。电子设备显示第四界面,第四界面包括第二区域,第四界面上的第二区域的内容为第五内容。
在另一种可能的设计中,电子设备还包括第二局部绘制控件,第一界面还包括第三区域,第一界面上第三区域的内容为第六内容,第三区域不同于第一区域。该方法还包括:电子设备通过第二局部绘制控件,将第三区域的第六内容更新为第七内容,第七内容不同于第六内容,且第二局部绘制控件所在的区域包括第三区域。第二界面还包括第三区域,第二界面上的第三区域的内容为第七内容。
在另一种可能的设计中,第一界面还包括第五区域,第五区域不同于第一区域,第一界面上的第五区域的内容未被更新,第二界面上的第五区域的内容与第一界面上的第五区域的内容相同。
在另一种可能的设计中,第一界面、第二界面和第三界面为电子设备上跨系统开发应用的界面,或者为电子设备上单系统开发应用的界面。
也就是说,不论跨系统开发应用的界面,还是单系统开发应用的界面,电子设备均可以采用以上局部绘制控件进行界面更新。
另一方面,本申请实施例提供一种界面更新方法,可应用于电子设备,该电子设备包括第一局部绘制控件和第二局部绘制控件,该方法包括:电子设备显示第一界面, 第一界面包括第一区域,第一界面上的第一区域的内容为第一内容,第一局部绘制控件未包括第一区域。电子设备显示第二界面,第二界面包括第一区域,第二界面上的第一区域的内容为第二内容,且第二内容不同于第一内容,第一内容被电子设备通过第一局部绘制控件更新为第二内容。在第一内容被更新为第二内容的过程中,第一局部绘制控件所在的区域被调整为包括第一区域。第二界面还包括第二区域,第二区域不同于第一区域,第二界面上的第二区域的内容为第三内容,第二局部绘制控件所在的区域不包括第二区域。电子设备显示第三界面,第三界面包括第二区域,第四界面上的第二区域的内容为第四内容,且第四内容不同于第三内容,第三内容被电子设备通过第二局部绘制控件更新为第四内容。在第三内容被更新为第四内容的过程中,第二局部绘制控件所在的区域包括第二区域。
在该方案中,不同界面上的不同待更新区域可以采用不同的局部绘制控件进行更新,每增加一个待更新区域可以增加一个局部绘制控件来进行更新。并且,局部绘制控件的位置可在全屏范围内迁移。
在一种可能的设计中,电子设备还包括全局绘制控件,全局绘制控件的尺寸与电子设备的屏幕尺寸相同,该方法还包括:若满足第二预设条件,则电子设备采用全局绘制控件进行全屏更新;第二预设条件包括以下任意一项:待更新区域大于或者等于预设阈值;或者,电子设备具有的局部绘制控件被使用完;或者,已被使用的局部绘制控件的数量大于或者等于第四预设值;或者,已被使用的局部绘制控件的尺寸大于或者等于第五预设值;或者,连续采用局部绘制进行界面更新的时长大于或者等于第六预设值。
在一种可能的设计中,电子设备在设置第一局部绘制控件的位置和尺寸时,先将第一局部绘制控件的可视属性设置为第一状态,在第一局部绘制控件的位置和尺寸设置完成后,再将第一局部绘制控件的可视属性设置为第二状态。这样,可避免界面上的各UI控件进行重新布局。
在另一种可能的设计中,第一界面对应的应用响应于用户的输入操作更新第一区域的内容,或者该应用自动触发更新第一区域的内容。
在另一种可能的设计中,在第一内容被更新为第二内容的过程中,电子设备调用第一局部绘制控件的刷新接口,对第一目标区域进行绘制;电子设备将第一目标区域绘制后的内容拷贝至界面缓存;电子设备将界面缓存中第一目标区域绘制后的内容拷贝至界面显存;电子设备界面显存中的内容在下一个周期性的屏幕刷新信号到来后送显至屏幕,界面显存中的内容包括第一目标区域绘制后的内容;电子设备在屏幕上刷新显示第一目标区域更新后的第二界面。
在另一种可能的设计中,电子设备在满足第一预设条件或第二预设条件,采用全局绘制控件进行全屏更新后,可以清除待更新区域对应的目标区域,将更新后的目标区域的内容固化到全局绘制控件上。电子设备还可以释放已使用的局部绘制控件,以便继续使用局部绘制控件进行界面更新。
在另一种可能的设计中,电子设备还包括管理绘制控件,电子设备通过管理绘制控件设置局部绘制控件的位置和尺寸。电子设备还通过管理绘制控件设置局部绘制控件和全局绘制控件的显示状态/隐藏状态。电子设备还通过管理绘制控件设置局部绘制 控件和全局绘制控件的上/下层的层级关系。
在另一种可能的设计中,在第一区域的内容通过第一局部绘制控件更新为第二区域的内容时的过程中,以及第三区域的内容通过第一局部绘制控件更新为第四区域的内容时的过程中,第一局部绘制控件处于显示状态,全局绘制控件也处于显示状态,且第一局部绘制控件处于全局绘制控件的上层。
在另一种可能的设计中,在第八区域的内容通过全局绘制控件更新为第九区域的内容时的过程中,全局绘制控件处于显示状态,第一局部绘制控件处于隐藏状态。其中,第一局部绘制控件处于隐藏状态包括:第一局部绘制控件位于全局绘制控件的下层;或者,第一局部绘制控件的尺寸为0;或者,第一局部绘制控件的可视属性为第一状态,第一状态用于表示第一局部绘制控件的可视属性为不可见,可视属性还包括第二状态用于表示第一局部绘制控件的可视属性为不可见。
又一方面,本申请实施例提供了一种图像显示装置,该装置包含在电子设备中,该装置具有实现上述方面及可能的设计中任一方法中电子设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,显示模块或单元、更新模块或单元、处理模块或单元等。
另一方面,本申请实施例提供了一种电子设备,该电子设备可以包括显示屏,用于显示界面;一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令;当指令被处理器执行时,使得电子设备执行上述方面任一项可能的设计中的界面更新方法。
又一方面,本申请实施例提供了一种电子设备,该电子设备可以包括一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令;当指令被处理器执行时,使得电子设备执行上述方面任一项可能的设计中的界面更新方法。
另一方面,本申请实施例提供了一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述方面任一项可能的设计中的界面更新方法。
又一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述方面任一项可能的设计中的界面更新方法。
本申请其他方面的有益效果可以参见上述方法方面有益效果的相关描述,不予赘述。
附图说明
图1A为现有技术提供的一种界面更新示意图;
图1B为现有技术提供的另一种界面更新示意图;
图2A为本申请实施例提供的一种电子设备的硬件结构示意图;
图2B为本申请实施例提供的一种电子设备的软件结构示意图;
图3为本申请实施例提供的一种界面更新和刷新过程示意图;
图4A为本申请实施例提供的一种目标区域示意图;
图4B为本申请实施例提供的一种界面更新示意图;
图4C为本申请实施例提供的另一种界面更新示意图;
图5为本申请实施例提供的一种绘制控件与更新的对应关系示意图;
图6为本申请实施例提供的一组界面更新示意图;
图7为本申请实施例提供的一种界面更新流程图;
图8A为本申请实施例提供的一种绘制控件的设置过程示意图;
图8B为本申请实施例提供的另一种绘制控件的设置过程示意图;
图8C为本申请实施例提供的另一种绘制控件的设置过程示意图;
图8D为本申请实施例提供的另一种绘制控件的设置过程示意图;
图9为本申请实施例提供的另一组界面更新示意图;
图10A为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图10B为本申请实施例提供的一种界面更新示意图;
图11A为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图11B为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图12A为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图12B为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图13A为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图13B为本申请实施例提供的另一种绘制控件与更新的对应关系示意图;
图14为本申请实施例提供的一种界面更新时绘制控件的位置和尺寸示意图;
图15为本申请实施例提供的另一种界面更新时绘制控件的位置和尺寸示意图;
图16为本申请实施例提供的一种界面更新方法流程图;
图17为本申请实施例提供的另一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
现有技术中,电子设备通过更新全屏整个屏幕的内容或者更新屏幕上控件的内容来实现更新界面内容的更新,容易导致无用的更新,渲染性能和动效性能较差。
例如,业界目前有很多跨系统开发框架(也称跨平台开发框架或多系统开发框架),比如安卓
Figure PCTCN2022106612-appb-000001
的Flutter开发框架、脸书
Figure PCTCN2022106612-appb-000002
的React Native(简称 RN)开发框架或自适配通信环境(adaptive communication environment,ACE)开发框架等。基于跨系统开发框架编写的应用可以称为跨系统开发应用(也称跨平台开发应用或多系统开发应用)。跨系统开发应用可以直接或者通过简单的转换在Android、
Figure PCTCN2022106612-appb-000003
Figure PCTCN2022106612-appb-000004
等多个不同的操作系统(或称平台、系统等)上运行。在跨系统场景下,跨系统开发框架通过重写电子设备运行的原操作系统的绘制控件进行自定义绘制,来实现界面更新。例如,该绘制控件可以为用户界面(user interface,UI)控件的基本调度单元,比如可以为基础控件或基类控件等。当然,该绘制控件也可以为其他控件,不予限制。举例来说,在安卓系统(即安卓操作系统,也称安卓平台)中,该绘制控件为控件View;在iOS系统中,该绘制控件为UIView。比如,该UI控件可以是输入框、按钮、复选框或开关按钮等。由于跨系统开发框架的控件和操作系统控件的维度不同,且不同操作系统控件的维度也不同,无法一一对应,所以跨系统开发框架将绘制集中到一个自定义绘制控件中来实现,以便跨系统开发应用可以在多个不同的操作系统上运行。因此,参见图1A中的(a)-(b),对于跨系统开发应用来说,即使界面上仅一个小范围的区域101需要进行更新,电子设备也会更新整个屏幕的内容,从而导致了较多的无用更新,功耗较大,更新效率较低,渲染性能和动效性能较差。
再例如,对于基于安卓、iOS、Windows或其他单个操作系统开发的单系统开发应用(也称单平台开发应用)来说,全屏对应一个绘制控件,且界面上的每个UI控件分别对应一个绘制控件。例如,在安卓操作系统中,绘制控件为控件View,每个UI控件对应一个控件View;在iOS操作系统中,绘制控件为UIView,每个UI控件对应一个控件UIView。电子设备通过绘制控件来更新该绘制控件对应的UI控件的显示效果。多数情况下,待更新区域为UI控件内的部分区域,更新整个UI控件会导致无用的更新,功耗较大,更新效率较低,渲染性能和动效性能较差。例如,参见图1B中的(a)-(b),仅UI控件102中的区域103需要更新,但电子设备会更新整个UI控件102。
本申请实施例提供了一种可提升动效性能的屏幕刷新方法,可应用于电子设备,能够通过同一绘制控件对不同界面上的不同区域进行精准更新。比如,电子设备能够通过可自适应移动且大小可变(即尺寸可变)的绘制控件,对屏幕上不同界面的不同待更新区域进行精准更新,可减少无用的更新,节省电子设备的功耗,提高界面更新效率,提升渲染性能和动效性能。
与现有跨系统开发应用的界面更新机制相比,本申请实施例提供的方法不需要每次都更新全屏内容,而可以通过可自适应移动且大小可变的绘制控件,对界面的待更新区域进行精准更新,从而可减少无用的更新,提升渲染性能和动效性能。
与现有单系统开发应用的界面更新机制相比,本申请实施例提供的方法不需要每次都更新整个UI控件,而可以通过可自适应移动且大小可变的绘制控件,对界面的待更新区域进行精准更新,从而可减少无用的更新,提升渲染性能和动效性能。
在本申请的一些实施例中,电子设备包括可自适应移动且大小可变的局部绘制控件。在另一些实施例中,电子设备还可以包括全局绘制控件以及更新管理控件,该更新管理控件用于管理该局部绘制控件和全局绘制控件的相对关系。当界面需要局部更新时,该局部绘制控件用于对待更新区域进行更新;当界面需要全屏更新时,该全局绘制控件用于对全屏区域进行更新。
例如,该电子设备可以是手机、平板电脑、可穿戴设备、智能家居设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或个人数字助理(personal digital assistant,PDA)等设备,本申请实施例对电子设备的设备类型不作任何限制。
示例性的,图2A示出了电子设备100的一种结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器, 也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),或者采用有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),MiniLED,MicroLED,MicroOLED,量子点发光二极管(quantum dot light emitting diodes,QLED)等材料。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优 化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。例如,内部存储器121可以包括界面显存和界面缓存等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
在本申请的实施例中,显示屏194可以用于显示界面,处理器110通过运行存储在内部存储器121的指令,通过可自适应移动且大小可变的控件,对屏幕上界面的待更新区域进行精准更新,从而减少无用的更新,节省电子设备100的功耗,提高界面更新效率,提升渲染性能和动效性能,显示屏194还可以用于显示更新后的界面。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务 架构,或云架构。本申请实施例中,电子设备的软件结构包括操作系统、对接层和跨系统开发框架等部分。本申请实施例以操作系统为分层架构的安卓系统为例,示例性说明电子设备100的软件结构。
图2B是本申请实施例的电子设备100的软件结构框图。其中,跨系统开发框架可以包括渲染管线(Pipeline)和渲染节点(RenderNode)等模块。渲染管线用于对接窗口对象,进行输入事件回调和屏幕刷新回调,从而驱动渲染流程。渲染节点与UI控件相对应,每个渲染节点对应一个UI控件,每个UI控件可以对应一个或多个渲染节点。
对接层包括窗口,可用于对接安卓系统的屏幕刷新信号和输入事件等。对接层还包括可自适应移动的局部绘制控件,该局部绘制控件的位置和大小可以与局部的待更新区域相匹配,从而精准地更新待更新区域。在一些实施例中,该对接层还可以包括全局绘制控件和更新管理控件。该全局绘制控件用于更新整个屏幕的内容。该更新管理控件用于管理局部绘制控件和全局绘制控件,比如管理局部绘制控件和全局绘制控件的相对层级关系(比如顶层或底层等),管理局部绘制控件和全局绘制控件的相互切换,管理局部绘制控件和全局绘制控件的显示/隐藏状态等。
分层架构将操作系统的软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将安卓系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android Runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。
如图2B所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。其中,一些应用程序为基于单个的安卓系统开发的应用程序,为单系统开发应用;还有一些应用程序为基于跨系统开发框架(例如Flutter、RN或ACE等)开发的应用程序,即跨系统开发应用。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android Runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含屏幕驱动(或称显示驱动),摄像头驱动,音频驱动,以及传感器驱动等。
在本申请的实施例中,渲染管线根据需要重绘的渲染节点中的待更新区域确定脏区(即待更新区域对应的目标区域)。渲染管线将脏区传递给更新管理控件。更新管理控件根据脏区确定采用局部绘制控件还是全局绘制控件进行界面更新,从而对待更新区域进行精准更新,减少无用更新,提高界面更新效率,提升渲染性能和动效性能。
以下将以电子设备为具有图2A和图2B所示结构的手机为例,对本申请实施例提供的屏幕刷新方法进行说明。
手机可以通过应用程序(以下简称应用)来实现各种功能。手机显示的各种界面均可以为应用的界面,比如桌面可以为桌面管理应用的界面,还可以有电子书应用的界面,社交应用的界面,视频应用的界面,浏览器应用的界面,或电子阅读器应用的界面等。
手机应用界面的刷新过程涉及屏幕、页面显存、页面缓存、画布和屏幕驱动等模块。其中,界面显存与界面缓存可以位于手机的内部存储器,或者位于手机的处理器如CPU或GPU中,或者位于手机的其他位置,本申请实施例对此不予限定。参见图3,手机的界面刷新过程可以包括:屏幕驱动周期性地发出屏幕刷新信号(例如垂直同步信号)。该周期与预设的界面显示帧率相对应。每次屏幕刷新信号均触发界面显存内容送显至屏幕。例如,预设的界面显示帧率为60帧每秒(frame per second,fps), 屏幕刷新信号周期为1/60秒(second,s),屏幕每秒刷新显示60帧画面。而界面缓存内容拷贝至界面显存则按需触发。比如,当应用界面需要更新时,应用向屏幕驱动请求屏幕刷新信号。应用接收到屏幕刷新信号后,在画布上针对待更新区域对应的目标区域(以下也称脏区)进行绘制,并将绘制后的脏区内容拷贝至界面缓存,然后将界面缓存中的脏区内容拷贝至界面显存。当周期性的屏幕刷新信号来临后,界面显存内容送显至屏幕进行刷新显示,从而实现界面的更新。也就是说,屏幕周期性地刷新显示界面,但界面内容按需更新。
其中,应用界面可以是响应于用户的操作进行更新的(比如响应于用户点击界面上某个控件的操作进行更新,或者响应于用户的语音指令或手势操作进行更新等),也可以是应用自动更新的(比如应用在界面上滚动显示的视频推荐、新闻推荐或广告推荐,或者应用接收到其他联系人发送的消息后自动更新界面内容,或者应用在播放视频时更新界面内容等)。本申请实施例对应用界面更新的时机和触发方式不予限定。
需要说明的是,本申请以下实施例提供的屏幕刷新方法中所说的局部更新/全屏更新,主要是指屏幕刷新过程中,当应用界面需要更新时手机将全屏/局部待更新区域对应的目标区域的内容拷贝至界面缓存,并从界面缓存拷贝至界面显存的过程。在界面更新过程中,对于待更新区域对应的目标区域以外的其他区域,手机不会将该其他区域的内容拷贝至界面缓存,也不会从界面缓存拷贝该其他区域的内容至界面显存,手机直接根据显存中原来存储的该其他区域的内容进行显示。这样,界面上显示的该其他区域的内容未进行更新,也未发生变化。
以下将以手机采用安卓系统(或称安卓平台、安卓操作系统),绘制控件为View,局部绘制控件为局部View,全局绘制控件为全局View,更新管理控件为StackView为例,对本申请实施例提供的屏幕刷新方法进行阐述。
本申请实施例提供的屏幕刷新方法,可应用于对安卓系统上运行的跨系统开发应用的界面进行刷新。该跨系统开发应用为基于跨系统开发框架所开发的应用程序。
在一些技术方案中,手机包括1个局部View,局部View的位置和大小可根据待更新区域自适应调整。即,局部View的位置和大小可自适应变化,且局部View可在手机的全屏范围内移动。当跨系统开发应用的界面需要局部更新时,局部View的位置和大小可与界面局部的待更新区域的位置和大小相适配,从而通过局部View对待更新区域进行精准更新,而不用像现有跨系统场景下那样进行全屏更新,从而可以减少无用更新,节省功耗,提高界面更新效率,提升渲染性能和动效性能。
在一些技术方案中,局部View的位置和大小与界面局部的待更新区域的位置和大小相适配是指,局部View所覆盖的区域(或称所在的区域)包括待更新区域。在另一些技术方案中,局部View的位置和大小与界面局部的待更新区域的位置和大小相适配是指,局部View的位置与待更新区域对应的目标区域的位置相对应,且局部View的大小大于或者等于待更新区域对应的目标区域的大小。即,局部View所覆盖的区域能够完全包括待更新区域对应的目标区域。其中,当局部View的大小等于待更新区域对应的目标区域的大小时,能够减少更多的无用更新,节省功耗。待更新区域对应的目标区域为能够包括待更新区域的区域。
在一些实施例中,待更新区域对应的目标区域为待更新区域本身。在另一些实施 例中,由于手机是按块存储的,因而待更新区域对应的目标区域可以为矩形区域,比如为能够完全包括待更新区域的最小矩形区域。其中,当待更新区域为界面上一个连续的区域时,目标区域为能够完全包括该待更新区域的最小矩形区域,局部View的位置和大小与目标区域的位置和大小相同。当待更新区域为界面上多个区域(可连续或不连续)时,目标区域为多个待更新区域拼接后形成的最小矩形区域,局部View的位置和大小与局部的多个待更新区域拼接后形成的最小矩形区域的位置和大小相同;也即目标区域为能够完全包括该多个待更新区域的最小矩形区域。
示例性的,参见图4A中的(a),当待更新区域为界面上一个连续的区域时,目标区域为能够完全包括该待更新区域的最小矩形区域;参见图4A中的(b),当待更新区域为界面上多个区域(可连续或不连续)时,目标区域为多个待更新区域拼接后形成的最小矩形区域,该最小矩形区域能够完全包括该多个待更新区域。
示例性的,参见图4B中的(a)-(b),当跨系统开发应用的界面上,控件40中的箭头需要更新时,目标区域为箭头对应的区域400,手机将局部View的位置和大小与区域400的位置设置为一致,从而通过局部View对区域400进行精准更新。再示例性的,参见图4C中的(a)-(b),当跨系统开发应用的界面上,待更新区域401、待更新区域402、待更新区域403和待更新区域404需要更新时,目标区域为这些待更新区域的拼接区域405,手机将局部View的位置和大小与区域404的位置设置为一致,从而通过局部View对区域405进行精准更新。
这样,手机可以通过局部View仅对待更新区域对应的目标区域(比如图4B所示的区域400)进行更新,而不需要像现有技术那样需要对全屏进行更新,或者对待更新区域所在的整个控件(比如目标区域400所在的整个控件40)进行更新,可以对待更新区域进行精准更新,减少无用更新,提高界面更新效率,提升渲染性能和动效性能。
在另一种实现方案中,局部View既可以用于界面局部更新,也可以用于界面全屏更新。当跨系统开发应用的界面需要局部更新时,待更新区域对应的目标区域为局部区域而非全屏区域,手机通过局部View对待更新区域进行精准更新,减少无用更新。当跨系统开发应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过局部View对待更新区域进行更新。
在另一些技术方案中,手机不仅包括1个局部View,还包括1个全局View。当跨系统开发应用的界面需要局部更新时,待更新区域对应的目标区域为局部区域而非全屏区域,手机通过局部View对待更新区域进行精准更新,减少无用更新。当跨系统开发应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。
在另一些技术方案中,参见图5,手机不仅包括1个局部View,1个全局View,还包括1个StackView。该StackView用于管理局部View和全局View,例如管理局部View和全局View的层级关系及相互切换等。当跨系统开发应用的界面需要局部更新时,待更新区域对应的目标区域为局部区域而非全屏区域,手机通过局部View对待更新区域进行精准更新,减少无用更新。当跨系统开发应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。
以下以手机包括1个局部View,1个全局View以及1个StackView,局部View的大小等于待更新区域对应的目标区域的大小为例,对本申请实施例提供的屏幕刷新方法进行说明。
例如,手机持续显示界面0,界面0的内容未进行更新。示例性的,界面0为如图6中的(a)所示的桌面60。在该过程中,不存在待更新区域,界面缓存内容不向界面显存拷贝,界面显存内容不变,手机根据周期性地屏幕刷新信号将界面显存内容送显至屏幕,手机持续显示该界面0。
而后,若手机检测到用户指示打开应用1的操作,则启动应用1。手机通过全局View进行全屏更新,并显示应用1对应的界面1。示例性的,该应用1为跨系统电子书应用,手机检测到用户点击桌面60(即界面0)上电子书应用的图标600的操作后,显示如图6中的(b)所示的电子书应用对应的界面601(即界面1)。
在该过程中,参见图7所示的手机内部模块间的交互流程图,渲染管线向窗口注册了屏幕输入事件回调,窗口检测到用户点击界面60上图标600的输入事件后,将该输入事件派发至渲染管线中。渲染管线对输入事件进行匹配,确定命中的渲染节点。在该场景中,渲染管线对输入事件进行处理确定需要进行页面转场,以显示应用1的界面,因而命中界面上所有的渲染节点。命中的各渲染节点将自己标记为重绘节点。窗口根据该输入事件确定需要进行界面更新,因而向屏幕驱动请求屏幕刷新信号。窗口接收到屏幕刷新信号后,将屏幕刷新信号传递给渲染管线,触发渲染管线进入渲染流程。渲染管线接收到屏幕刷新信号后,根据重绘节点的待更新区域(也称待绘制区域)确定脏区(即待更新区域对应的目标区域)。例如,渲染管线遍历所有的重绘节点,将重绘节点的绘制区域进行拼接得到当前帧的脏区。其中,重绘节点的待更新区域小于或者小于重绘节点对应的区域。渲染管线将脏区传递给StackView。StackView判断脏区为全屏,从而调用全局View的刷新接口(例如为接口requestFrame()),触发全屏更新。全局View将画布传给渲染管线(例如通过接口Processdraw(canvas)来实现),渲染管线在画布上进行脏区全屏界面的绘制(例如通过接口Paint(canvas)来实现),并将绘制后的脏区内容拷贝至界面缓存,然后将界面缓存中的脏区内容拷贝至界面显存。在下一个屏幕刷新信号到来后,界面显存内容送显至屏幕进行刷新显示,从而实现界面更新,手机显示电子书应用对应的界面601。
其中,在全屏更新的情况下,手机调用全局View来更新全屏内容,全局View为显示状态,局部View处于隐藏状态。该种情况下,用户通过界面看不到局部View中的内容,能够看到全局View中的内容。例如,局部View设置有可视属性,该可视属性用于表示局部View的可视状态,当可视属性为第一状态(比如setVisible(false))时,局部View的可视状态为不可见;当可视属性为第二状态(比如setVisible(true))时,局部View的可视状态为可见。StackView具体可以通过将局部View的可视状态设置为第一状态(即不可见),或者将局部View的尺寸设置为0,或者将局部View设置在全局View的下层(这样局部View会被全局View遮挡而不可见),还可以通过其他方式来将局部View设置为隐藏状态,不予限定。
若手机确定应用1的界面1仍需要全屏更新,则与图7所示的流程类似,通过全局View来更新全屏内容(且局部View仍处于隐藏状态),并显示更新后的界面2。 示例性的,手机检测到用户针对界面601(即界面1)上设置控件61的点击操作后,响应于该操作显示如图6中的(c)所示的界面602(即界面2)。
之后,若手机确定应用1的界面2需要局部更新,则通过局部View进行局部更新,并显示更新后的界面3。示例性的,手机检测到用户针对界面602(即界面2)上推荐功能的控件603的滑动操作后,响应于该操作显示如图6中的(d)所示的界面604(即界面3)。与界面602相比,界面604上控件603进行了更新,控件603的显示效果发生了变化。与界面602相比,界面604上控件603以外的其他区域未进行更新,控件603以外的其他区域的显示效果未发生变化。
在该过程中,窗口检测到用户在界面602上针对控件603进行滑动的输入事件后,将该输入事件派发至渲染管线中。渲染管线对输入事件进行匹配,确定命中的渲染节点。在该场景中,渲染管线根据滑动事件(即输入事件)对应的坐标位置,确定命中该坐标位置所对应的渲染节点。命中的渲染节点处理输入事件,确定需要进行滑动效果绘制,从而将自己标记为重绘节点。窗口根据该输入事件确定需要进行界面更新,因而向屏幕驱动请求屏幕刷新信号。窗口接收到屏幕刷新信号后,将屏幕刷新信号传递给渲染管线。渲染管线接收到屏幕刷新信号后,根据重绘节点的待更新区域确定脏区。示例性的,脏区为图6中的(c)所示的虚线区域605。渲染管线将脏区传递给StackView。参见图8A,StackView判断脏区的尺寸小于全屏,脏区为非全屏,由全屏更新切换为局部更新,根据脏区设置局部View的位置和大小(例如通过接口
setLayoutRect(dirtyRect2)来实现),使得局部View的位置和大小与脏区的位置和大小相同,并调用局部View的刷新接口,触发局部更新。局部View将画布传给渲染管线,渲染管线在画布上对脏区进行绘制,并将绘制后的脏区内容拷贝至界面缓存,然后将界面缓存中的脏区内容拷贝至界面显存。在下一个屏幕刷新信号到来后,界面显存内容送显至屏幕进行刷新显示,从而实现界面更新,手机显示更新后的界面604。
需要说明的是,在该过程中,界面602上虚线区域605以外的其他区域的内容未拷贝至界面缓存,也未从界面缓存拷贝至界面显存。手机根据界面显存原本存储的该其他区域的内容来显示界面604。因而,该其他区域的内容未进行更新。与界面602相比,界面604上该其他区域的显示效果未发生变化。
其中,当由全屏更新切换为局部更新时,手机将绘制从全局View切换到局部View上,局部View由全屏更新时的隐藏状态进入显示状态。例如,局部View位于全局View的上层(或者说局部View位于顶层全局View位于底层),局部View的尺寸不为0,且局部View的可视状态为第二状态(即可见),以使得局部View处于显示状态。同时,全局View仍处于显示状态。这样,上层的局部View遮挡了下层全局View的部分区域,用户可以通过局部View看到界面上局部更新的内容,通过全局View看到界面上未进行更新的其他区域的内容。需要说明的是,在本申请的实施例中,不论全屏更新还是局部更新,全局View均处于显示状态,以便用户可以始终通过屏幕看到整个全屏界面。
在一些技术方案中,当需要调整局部View的位置或尺寸时(比如初次设置局部View的位置或尺寸,或者更新局部View的位置或尺寸),若局部View的可视状态为第二状态(即可见),则各UI控件会进行重新布局,重新计算各自的位置等,因而 参见图8A,StackView可以先将局部View的可视状态设置为第一状态(即不可见),待局部View的位置或大小调整完成后,再将局部View的可视状态设置为第二状态,以避免各UI控件进行重新布局,重新计算各自的位置等,减少手机内部的操作,提高刷新和渲染效率。而后,StackView再调用局部View的刷新接口,触发局部更新。
然后,若手机确定应用1的界面3仍然需要局部更新,则通过局部View进行局部更新,并显示更新后的界面4。示例性的,手机检测到用户针对界面604(即界面3)上推荐功能的控件603的滑动操作后,响应于用户的滑动操作显示如图6中的(c)所示的界面602(即界面4)。与界面604相比,界面602上控件603的显示效果发生了变化。手机确定脏区为图6中的(d)所示的虚线区域605,判断脏区的尺寸小于全屏,脏区为非全屏,从而调用局部View的刷新接口,触发局部更新。而后,手机显示更新后的界面602。该过程中,参见图8B,StackView确定上一次为局部更新,本次仍为局部更新,且与上一次局部更新相比,本次局部更新的脏区位置和大小未发生变化,仍为虚线区域605,此时不需要再设置局部View的位置和大小,而可以直接调用局部View的刷新接口,触发局部更新。也就是说,当持续进行局部刷新时,如果脏区位置和大小保持不变,则仅第一次需要进行局部View的位置和大小的调整,后续直接进行绘制和更新。
再示例性的,手机检测到用户针对界面604(即界面3)上桌面通知的控件606的滑动操作后,响应于用户的滑动操作显示如图6中的(e)所示的界面607(即界面4)。与界面604相比,界面607上控件606的显示效果发生了变化。在该过程中,手机可以确定脏区为图6中的(d)所示的虚线区域608,判断脏区的尺寸小于全屏,脏区为非全屏,从而调用局部View的刷新接口,触发局部更新,显示更新后的界面607。并且,该过程中,参见图8C,StackView确定上一次为局部更新,本次仍为局部更新,且与上一次局部更新相比,本次局部更新时脏区的位置和大小发生了变化。因而,如图8C所示,StackView可以调整局部View的位置和大小,使得局部View的位置和大小与本次脏区的位置和大小相同。
而后,手机再调用局部View的刷新接口,触发局部更新。并且,手机在调整局部View的位置和大小之前,可以先将局部View的可视状态设置为第一状态;在调整局部View的位置和大小之后,再将局部View的可视状态设置为第二状态。同时,全局View持续处于显示状态,且局部View位于全局View的上层。
而后,若手机确定应用1的界面4需要全屏更新,则通过全局View进行全屏更新,并显示更新后的界面5。示例性的,手机检测到用户点击界面607(即界面4)上显示与亮度的控件609的操作后,响应于用户的点击操作显示如图6中的(f)所示的显示与亮度的设置界面610(即界面4)。与界面607相比,界面610进行了全屏更新。在该过程中,渲染管线向窗口注册了屏幕输入事件回调,窗口检测到用户点击界面607上控件609的输入事件后,将该输入事件派发至渲染管线中。渲染管线对输入事件进行匹配,确定命中的渲染节点。在该场景中,渲染管线对输入事件进行处理确定需要进行页面转场,以显示显示与亮度的设置界面,因而命中所有的渲染节点。命中的各渲染节点将自己标记为重绘节点。窗口根据该输入事件确定需要进行界面更新,因而向屏幕驱动请求屏幕刷新信号。窗口接收到屏幕刷新信号后,将屏幕刷新信号传递给 渲染管线。渲染管线接收到屏幕刷新信号后,根据重绘节点的待更新区域确定脏区。渲染管线将脏区传递给StackView。参见图8D,StackView判断脏区为全屏,由局部更新切换为全屏更新,从而调用全局View的刷新接口,触发全屏更新。全局View将画布传给渲染管线,渲染管线在画布上进行脏区全屏界面的绘制,并将绘制后的脏区内容拷贝至界面缓存,然后将界面缓存中的脏区内容拷贝至界面显存。在下一个屏幕刷新信号到来后,界面显存内容送显至屏幕进行刷新显示,从而实现界面更新,手机显示电子书应用对应的界面602。
其中,当由局部更新切换为全屏更新时,StackView将绘制从局部View切换到全局View上,如图8D所示,StackView控制局部View由局部更新时的显示状态切换为隐藏状态,同时全局View仍处于显示状态。
需要说明的是,以上是以手机根据用户的点击操作或滑动操作的输入事件后,确定界面需要局部/全屏更新的。在本申请其他一些实施例中,手机也可以根据用户触发的其他输入事件,确定界面需要局部/全屏更新,比如用户的拖拽操作、长按操作、语音指令或手势操作等输入事件。本申请实施例对用于触发界面局部/全屏更新的用户输入事件的具体类型不予限定。
以上是以手机根据用户的输入事件确定界面需要局部/全屏更新的,手机也可以根据应用自身的逻辑自动确定界面需要局部/全屏更新。示例性的,图9中的(a)示出了应用2的界面901。该应用2为跨系统开发应用。该应用2为视频播放应用。其中,该视频播放应用在区域902内滚动显示推荐的不同视频。该种情况下,手机确定为局部更新,从而调用局部View的刷新接口,自动进行局部更新,显示如图9中的(b)所示的界面903。在该过程中,视频播放应用的窗口将滚动显示事件派发至渲染管线中。渲染管线对滚动显示事件进行匹配,确定命中的渲染节点。命中的渲染节点处理滚动显示事件,确定需要进行滚动切换效果绘制,从而将自己标记为重绘节点。窗口根据滚动显示事件确定需要界面更新,因而向屏幕驱动请求屏幕刷新信号。窗口接收到屏幕刷新信号后,将屏幕刷新信号传递给渲染管线。渲染管线接收到屏幕刷新信号后,根据重绘节点的待更新区域确定脏区。示例性的,脏区为图9中的(a)所示的区域902。渲染管线将脏区传递给StackView。StackView判断脏区为非全屏,根据脏区设置局部View的位置和大小,使得局部View的位置和大小与脏区的位置和大小相同,并调用局部View的刷新接口,触发局部更新。局部View将画布传给渲染管线,渲染管线在画布上对脏区进行绘制,并将绘制后的脏区内容拷贝至界面缓存,然后将界面缓存中的脏区内容拷贝至界面显存。在下一个屏幕刷新信号到来后,界面显存内容送显至屏幕进行刷新显示,从而实现界面更新,手机显示更新后的界面903。
在以上实施例中,当跨系统开发应用的界面需要局部更新时,待更新区域对应的目标区域为局部区域而非全屏区域,手机通过局部View对待更新区域进行精准更新,减少无用更新。当跨系统开发应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。在另一些实施例中,当待更新区域较小时,手机确定需要局部更新,从而通过局部View进行界面局部更新;当待更新区域较大时,手机确定需要全屏更新,从而通过全局View进行全屏更新。例如,手机上预设有阈值1,当待更新区域对应的目标区域与全屏的比例小于或者等 于该阈值1时,手机确定需要局部更新,从而通过局部View对待更新区域进行精准更新,减少无用更新;当待更新区域对应的目标区域与全屏的比例大于该阈值1时,手机确定需要全屏更新,从而通过全局View进行全屏更新。比如,阈值1为80%、90%或95%等。再例如,手机上预设有阈值2,当待更新区域对应的目标区域的尺寸(或面积)小于或者等于该阈值2时,手机确定需要局部更新,从而通过局部View对待更新区域进行精准更新,减少无用更新;当待更新区域对应的目标区域大于该阈值2时,手机确定需要全屏更新,从而通过全局View进行全屏更新。
在其他一些实施例中,参见图10A,手机包括多个局部View(如局部View1、局部View2等)和1个全局View,局部View的位置和大小可根据待更新区域自适应调整,且局部View可在全屏范围内移动。如图10A所示,手机还可以包括1个StackView,用于管理该全局View和多个局部View。在一种可能的方案中,当跨系统开发应用的界面需要全屏更新时,手机通过全局View对全屏进行更新;当跨系统开发应用的界面需要局部更新时,手机通过一个或多个局部View对待更新区域进行精准更新,减少无用更新。
在一些技术方案中,当界面包括多个待更新区域时,每个局部View对应一个待更新区域,手机可以通过多个局部View对待更新区域进行更新,局部View的位置和大小分别与一个待更新区域对应的目标区域的位置和大小相同。例如,一个待更新区域对应的目标区域可以为能够包括该待更新区域的最小矩形区域。与手机包括1个局部View的方案相比,手机包括多个View时可以减少待更新区域的拼接导致的无用更新,节省功耗。
示例性的,手机的多个局部View包括局部View1、局部View2、局部View3和局部View4。参见图10B中的(a)-(b),当跨系统开发应用的界面上,待更新区域1001、待更新区域1002、待更新区域1003和待更新区域1004需要更新时,这些待更新区域分别对应的目标区域1005、目标区域1006、目标区域1007和目标区域1008的集合小于全屏。该种情况下,手机将局部View1的位置和大小与待更新区域1001对应的目标区域1005的位置和大小设置为一致,将局部View2的位置和大小与待更新区域1002对应的目标区域1006的位置和大小设置为一致,将局部View3的位置和大小与待更新区域1003对应的目标区域1007的位置和大小设置为一致,将局部View4的位置和大小与待更新区域1004对应的目标区域1008的位置和大小设置为一致,并调用局部View1、局部View2、局部View3和局部View4的刷新接口,触发局部更新。需要说明的是,集合不等同于拼接,拼接还包括间隙区域1009但集合不包括区域1009。与图4C所示的方案相比,图10B所示的方案能够减少待更新区域的拼接导致的无用更新,比如减少对区域1009的无用更新。
而后,参见图10B中的(b)-(c),若待更新区域1010和待更新区域1011需要更新,则手机将局部View1的位置和大小与待更新区域1010(本身即为对应的目标区域)的位置和大小设置为一致,将局部View2的位置和大小与待更新区域1011(本身即为对应的目标区域)的位置和大小设置为一致,并调用局部View1和局部View2的刷新接口,触发局部更新。
在一些技术方案中,若待更新区域的数量大于局部View的数量,则每个局部View 可以与一个或多个待更新区域相对应。当局部View与一个待更新区域相对应时,该局部View的位置和尺寸与该待更新区域对应的目标区域的位置和尺寸相同。当局部View与多个待更新区域的拼接区域的位置和尺寸相对应。
在手机包括多个局部View和1个全局View的情况下,在其他一些技术方案中,当待更新区域较小时,手机确定需要局部更新,从而通过局部View进行更新;当待更新区域较大时,手机确定需要全屏更新,从而通过全局View进行更新。例如,手机上预设有阈值1,当待更新区域对应的目标区域与全屏的比例小于或者等于该阈值时,手机确定需要局部更新,从而通过一个或多个局部View对待更新区域进行精准更新,减少无用更新;当待更新区域对应的目标区域与全屏的比例大于该阈值1时,手机确定需要全屏更新,从而通过全局View进行全屏更新,不用再调整局部View的位置和尺寸。再例如,手机上预设有阈值2,当待更新区域对应的目标区域的尺寸(或面积)小于或者等于该阈值2时,手机确定需要局部更新,从而通过一个或多个局部View对待更新区域进行精准更新,减少无用更新;当待更新区域对应的目标区域大于该阈值2时,手机确定需要全屏更新,从而通过全局View进行全屏更新。
在另一种可能的方案中,在手机的多个局部View的情况下,当跨系统开发应用的界面需要局部更新时,手机通过一个或多个局部View对待更新区域进行精准更新,减少无用更新;当跨系统开发应用的界面需要全屏更新时,手机通过多个局部View的组合对全屏进行更新。比如,跨系统开发应用的界面需要全屏更新时,手机通过局部View1对上半屏进行局部更新,并通过局部View2对下半屏进行更新,从而实现对全屏内容进行更新。
以上实施例提供的采用局部View与全局View相结合的屏幕刷新方法,也可以应用于单系统开发应用的界面更新场景。比如,单系统开发应用为安卓应用,安卓应用在界面更新时也可以采用本申请以上实施例提供的方法进行界面更新,不再详细说明。仅举个简单示例:手机包括1个全局View和1个局部View,局部View可在全屏范围内移动;当安卓应用的界面需要局部更新时,待更新区域对应的目标区域为局部区域而非全屏区域,手机通过局部View对待更新区域进行精准更新,减少无用更新;当安卓应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。再比如,手机包括1个全局View和多个局部View,局部View可在全屏范围内移动。
针对手机上既包括跨系统开发应用,又包括单系统开发应用如安卓应用的场景,在一些实施例中,跨系统开发应用采用以上实施例提供的局部View与全局View相结合的方案来进行界面更新,而安卓应用的界面更新则采用现有每个UI控件对应一个View的方式进行界面更新。在另一些实施例中,跨系统开发应用和安卓应用均采用以上局部View与全局View相结合的方案来进行界面更新。
目前,为了提升用户体验,动效的场景越来越多,而大部分动效为界面的局部更新。本申请实施例通过位置和大小可自适应调整的局部View,可以对界面的动效区域(即待更新区域)进行精准更新,减少无用更新,节省手机的功耗,并提高界面更新效率,提升渲染性能和动效性能,使得界面刷新更为流畅。并且,动效区域越小,本申请实施例能够获得的收益越大。
在其他一些实施例中,本申请提供一种屏幕刷新方法,可应用于单系统开发应用的界面更新。如前所述,单系统开发应用是基于单个操作系统开发的应用。比如,单系统开发应用为基于安卓操作系统开发的安卓应用。在该方法中,参见图11A,手机包括1个全局View,每个特定UI控件对应1个局部View,每个非特定UI控件对应1个常规View。该局部View可在该特定UI控件范围内移动。例如,该特定UI控件可以是面积较大的控件(比如应用开发者基于安卓系统自定义的大范围的控件)。该常规View的位置和大小与对应的UI控件的位置和大小相同。当安卓应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。对于特定UI控件内的待更新区域,采用局部View进行细粒度的局部更新,以减少特定UI控件内待更新区域以外的区域的无用更新,节省功耗。对于非特定UI控件,则通过该非特定UI控件对应的常规View进行局部更新。当待更新区域包括特定UI控件内的区域以及非特定UI控件时,局部View与常规View可以结合使用。在一些技术方案中,参见图11B,特定UI控件可以对应多个局部View,该特定UI控件内的每个待更新区域分别可以采用一个局部View来进行更新。
在其他一些实施例中,本申请提供一种屏幕刷新方法,可应用于单系统开发应用如安卓应用的界面更新。在该方法中,参见图12A,手机包括1个全局View,每个UI控件(包括特定UI控件和非特定UI控件)对应1个常规View,特定UI控件还包括1个局部View,该局部View可在该特定UI控件范围内移动。例如,该特定UI控件可以是面积较大的控件。当安卓应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。对于特定UI控件内的待更新区域,采用局部View进行局部更新,以减少特定UI控件内待更新区域以外的区域的无用更新,节省功耗。对于非特定UI控件,则通过该非特定UI控件对应的常规View进行局部更新。当待更新区域包括特定UI控件内的区域以及非特定UI控件时,局部View与常规View可以结合使用。在一些技术方案中,参见图12B,UI控件可以对应多个局部View,UI控件内的每个待更新区域分别可以采用一个局部View来进行更新。
在其他一些实施例中,本申请提供一种屏幕刷新方法,可应用于单系统开发应用如安卓应用的界面更新。在该方法中,参见图13A,手机包括1个全局View和1个局部View,每个UI控件对应1个常规View,该局部View可在全屏范围内移动。当安卓应用的界面需要全屏更新时,待更新区域对应的目标区域为全屏区域,手机通过全局View对待更新区域进行更新。当待更新区域在某个UI控件内部时,采用局部View进行局部更新,以减少对UI控件内待更新区域以外的区域的无用更新。当待更新区域包括整个UI控件时,采用该UI控件对应的常规View进行局部更新。当待更新区域包括某个UI控件的部分区域以及其他UI控件时,局部View与常规View可以结合使用。在一些技术方案中,参见图13B,手机可以包括多个局部View,每个UI控件内部的待更新区域分别可以采用一个局部View来进行更新。
在本申请另一些实施例中,在手机包括1个局部View和1个全屏View,且局部View可在全屏范围内移动的情况下,在界面需要局部更新时,手机采用局部View进行更新。在手机连续采用局部View进行界面局部更新的情况下,手机将本次界面局 部更新对应的脏区,连同之前连续局部更新时保留下来的脏区一起进行更新。比如,在连续3次采用局部View进行界面局部更新的情况下,在手机第3次进行界面局部更新时,第1次和第2次界面局部更新时的脏区保留了下来并连同第3次界面局部更新时对应的脏区一起进行更新。手机每次采用局部View进行更新时,局部View所覆盖的区域包括之前保留的脏区和本次脏区,直至采用全局View进行全屏更新后手机保留的脏区才会清除(而后重新开始保留脏区)。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上,以便后续通过全局View将该固化的内容呈现给用户。
示例性的,参见图14中的(a),第一次界面更新对应的脏区为区域1401,更新时采用的局部View的位置和尺寸与区域1401相同。参见图14中的(b),第二次界面更新对应的脏区为区域1402,更新时采用的局部View所覆盖的区域包括本次脏区和保留的上一次脏区,例如可以是能够完全包括区域1401和区域1402的最小矩形区域141。参见图14中的(c),第三次界面更新对应的脏区为区域1403,更新时采用的局部View所覆盖的区域包括本次脏区(即区域1403)以及保留的之前的脏区(即区域1401和区域1402),例如可以是能够完全包括区域1401、区域1402和区域1403的最小矩形142(比如可以是区域1401、区域1402和区域1403拼接后形成的最小矩形,也可以是本次刷新作为脏区的区域1403与上一次局部View所覆盖的区域拼接后形成的最小矩形)。后续,参见图14中的(d),手机采用全局View进行全屏刷新后,脏区清除。
在手机采用局部View进行界面局部更新的情况下,若满足以下至少一个预设条件,则可以采用全局View进行一次全屏更新。
例如,预设条件a:手机确定需要全屏更新,比如待更新区域大于上述阈值2等,此时手机可以采用全局View进行一次全屏更新,以清除全屏更新前保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。
再例如,预设条件b:手机连续采用局部View进行界面局部更新的次数大于或者等于预设值1。此时,手机保留的脏区的数量可能较多,面积可能也较大,因而可以采用全局View进行一次全屏更新,以清除全屏更新前保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。比如,该预设值1可以为3或5等。在一些可能的方案中,该预设值为1,即手机每使用局部View进行一次局部更新后,不论后续需要局部更新还是全屏更新均使用全屏View进行一次全屏刷新,从而将局部View本次更新的局部区域的内容固化到全局View上,并清除本次脏区。
再例如,预设条件c:手机连续采用局部View进行界面局部更新,且手机保留的脏区的尺寸大于或者等于预设值2。此时,手机保留的脏区的面积较大,可以采用全局View进行一次全屏更新,以清除全屏更新前保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。
又例如,预设条件d:手机连续采用局部View进行界面更新的时长大于或者等于预设值3,或者手机未采用全局View进行更新的时长大于或者等于预设值3。此时, 手机未进行全屏更新的时间较长,手机保留的脏区的面积可能较大,手机可以采用全局View进行一次全屏更新,以清除全屏更新前保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。在一些可能的方案中,手机按照预设周期定时采用全局View进行一次全屏更新,以清除一个周期内可能保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。
又例如,预设条件e:手机采用局部View对脏区进行更新后,该脏区以外的其他部分需要更新。此时,与上一次更新相比,本次更新的脏区发生了变化,手机可以采用全局View进行一次全屏更新,以清除全屏更新前保留的脏区。并且,在全屏更新前,手机保留的脏区更新后的内容,可以通过全屏更新固化到全局View上。
在一些可能的实现中,手机在确定满足上述预设条件b-d中的任意一个时,即采用全局View进行一次全屏更新;在另一些可能的实现中,手机在确定满足上述预设条件b-d中的任意一个,且确定界面需要更新(局部更新或全屏更新)时,才采用全局View进行一次全屏更新。
再例如,预设条件b-e中的任意一个,与预设条件a可以组合。例如,当预设条件b与预设条件a相组合时,手机确定需要全屏更新时采用全局View进行全屏更新,手机连续采用局部View进行界面局部更新的次数大于或者等于预设值1时也采用全局View进行更新。
在本申请另一些实施例中,在手机包括多个局部View和1个全屏View,且局部View可在全屏范围内移动的情况下,在手机确定界面需要局部更新时,手机采用一个局部View进行更新。而后,当界面再次需要局部更新时,若脏区相同,则仍采用相同的局部View进行更新;若脏区不同,则采用另一个局部View进行更新,手机采用的局部View的位置和尺寸与每帧的脏区的位置和大小相同;依次类推,直至满足预设条件后采用全局View进行一次全屏更新而不论当时需要进行全屏更新还是局部更新。在全屏刷新后,手机可以释放已被使用的局部View,清除已被使用的多个局部View对应的脏区。并且,在全屏更新前,已被使用的多个局部View对应的脏区更新后的内容,可以通过全屏刷新固化到全局View上,以便后续通过全局View将该固化的内容呈现给用户。
示例性的,参见图15中的(a),第一次界面更新对应的脏区为区域1501,手机采用局部View1进行更新,局部View1的位置和尺寸与区域1501相同。参见图15中的(b),第二次界面更新对应的脏区为区域1502,区域1502不同于区域1501,手机采用局部View2进行更新,局部View2的位置和尺寸与区域1502相同。参见图15中的(c),第三次界面更新对应的脏区为区域1503,区域1503不同于区域1502和区域1501,手机采用局部View3进行更新,局部View3的位置和尺寸与区域1503相同。若第三次界面更新对应的脏区为区域1502,则手机仍采用局部View2进行更新,局部View2的位置和尺寸与区域1502相同;若第三次界面更新对应的脏区为区域1501,则手机仍采用局部View1进行更新,局部View1的位置和尺寸与区域1501相同。后续,参见图15中的(d),手机采用全局View全屏刷新后,脏区清除,各局部View也被释放,可以用于更新其他区域。
在手机采用多个局部View进行界面更新的情况下,若满足以下至少一个预设条件,则可以采用全局View进行一次全屏更新。
例如,预设条件A:手机确定需要全屏更新,比如待更新区域大于上述阈值2等,此时手机可以采用全局View进行一次全屏更新,以释放已被使用的局部View,以便局部View后续可以继续用于进行局部刷新。
再例如,手机包括的局部View的数量有限,预设条件B:手机包括的局部View被用完。此时,手机可以采用全局View进行一次全屏更新,以释放已被使用的局部View,以便局部View后续可以继续用于进行局部刷新。
又例如,预设条件C:局部View已被使用的数量大于或者等于预设值4。此时,已使用的局部View对应的脏区数量较多,手机可以采用全局View进行一次全屏更新,以释放已被使用的局部View。
再例如,预设条件D:手机连续采用局部View进行界面局部更新,且已使用的局部View对应的脏区的面积大于或者等于预设值5。此时,已使用的局部View对应的脏区的面积较大,手机可以采用全局View进行一次全屏更新,以释放已被使用的局部View,清除对应的脏区。
又例如,预设条件E:手机连续采用局部View进行界面更新的时长大于或者等于预设值6,或者手机未采用全局View进行更新的时长大于或者等于预设值6。此时,手机未进行全屏更新的时间较长,已使用的局部View的数量可能较多,已使用的局部View对应的脏区面积可能较大,手机可以采用全局View进行一次全屏更新,以释放已被使用的局部View。在一些可能的方案中,手机按照预设周期定时采用全局View进行一次全屏更新,以释放已被使用的局部View。
在一些可能的实现中,手机在确定满足上述预设条件B-E中的任意一个时,即采用全局View进行一次全屏更新;在另一些可能的实现中,手机在确定满足上述预设条件B-E中的任意一个,且确定界面需要更新(局部更新或全屏更新)时,才采用全局View进行一次全屏更新。
再例如,预设条件B-E中的任意一个,可以与预设条件A进行组合。例如,当预设条件B与预设条件A相组合时,手机确定需要全屏更新时采用全局View进行全屏更新,手机包括的局部View被用完时也采用全局View进行全屏更新。
另外,结合上述实施例及相应的附图,本申请另一实施例提供一种界面更新方法,该方法可以在具有图2A所示结构的电子设备上实现,该电子设备包括第一局部绘制控件。例如,该第一局部绘制控件可以为上述实施例中的局部View。参见图16,该方法包括:
1601、电子设备显示第一界面,第一界面包括第一区域,第一界面上的第一区域的内容为第一内容。
例如,第一界面可以为图6中的(c)所示的界面602,第一区域可以为区域605。
1602、电子设备显示第二界面,第二界面包括第一区域,第二界面上的第一区域的内容为第二内容,且第二内容不同于第一内容,第一内容被电子设备通过第一局部绘制控件更新为第二内容;第二界面还包括第二区域,第二区域不同于第一区域,第二界面上的第二区域的内容为第三内容。
例如,第二界面可以为图6中的(d)所示的界面604,第一局部绘制控件可以为局部View;第二区域可以为图6中的(d)所示的界面604上的区域608。
1603、电子设备显示第三界面,第三界面包括第二区域,第三界面上第二区域的内容为第四内容,且第四内容不同于第三内容,第三内容被电子设备通过第一局部绘制控件更新为第四内容。
例如,第三界面可以为图6中的(e)所示的界面607。
在本申请实施例中,第一区域和第二区域为界面上的待更新区域。电子设备可以采用第一局部绘制控件精准更新界面上第一区域的内容,并采用该第一局部绘制控件精准更新另一界面上第二区域的内容,从而能够减少无用的更新,节省电子设备的功耗,提高界面更新效率,提升渲染性能和动效性能。
其中,在第一内容被更新为第二内容的过程中,第一局部绘制控件所在的区域包括第一区域。在第三内容被更新为第四内容的过程中,第一局部绘制控件所在的区域包括第二区域。也就是说,第一局部绘制控件的位置和大小可变,第一局部绘制控件可在全屏范围内移动,以对不同的局部区域进行精准更新。例如,第一目标区域为包括第一区域的最小矩形区域,第二目标区域为包括第二区域的最小矩形区域,以尽量减少无用更新。
在一些实施例中,该方法还包括:电子设备显示第四界面,第四界面包括第二区域,第四界面上的第二区域的内容为第五内容,且第五内容不同于第四内容,第四内容被电子设备通过第一局部绘制控件更新为第五内容,第一局部绘制控件所在的区域包括第二区域。也就是说,当待更新区域不变时,第一局部控制控件的位置和尺寸也保持不变。
在另一些实施例中,电子设备还包括第二局部绘制控件,第一界面还包括第三区域,第三区域不同于第一区域,第二界面还包括第三区域,第一界面上的第三区域的内容为第六内容,第二界面上的第三区域的内容为第七内容,且第七内容不同于第六内容,第六内容被电子设备通过第二局部绘制控件更新为第七内容,第二局部绘制控件所在的区域包括第三区域。这样,不同的局部绘制控件可以用于更新同一界面上的不同局部区域。
在另一些实施例中,第一区域尺寸、第二区域的尺寸、第一局部绘制控件的尺寸以及第二局部绘制控件的尺寸小于或者等于预设阈值。电子设备还包括全局绘制控件,全局绘制控件的尺寸与电子设备的屏幕尺寸相同,该方法还包括:电子设备显示第五界面,第五界面包括第四区域,第五界面上的第四区域的内容为第八内容,第四区域的尺寸大于预设阈值;电子设备显示第六界面,第六界面包括第四区域,第六界面上的第四区域的内容为第九内容,且第九内容不同于第八内容,第八内容被电子设备通过全局绘制控件更新为第九内容。也就是说,如果待更新区域的尺寸较小,则采用局部绘制控件进行精准更新;如果待更新区域较大,则采用全局绘制控件进行更新。
在另一些实施例中,第一界面还包括第五区域,第五区域不同于第一区域,第五区域的内容未被更新,第二界面上的第五区域的内容与第一界面上的第五区域的内容相同。也就是说,在第一界面上局部的第一区域进行更新时,第一界面上的第五区域未进行更新,第一界面进行了局部更新。
可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,上述实施例中涉及的电子设备的一种可能的组成包括:显示单元、更新单元和处理单元等。需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本申请实施例还提供一种电子设备,如图17所示,包括:显示屏(或称屏幕)1701,一个或多个处理器1702,存储器1703,以及一个或多个计算机程序1704,上述各器件可以通过一个或多个通信总线1705连接。其中该一个或多个计算机程序1704被存储在上述存储器1703中并被配置为被该一个或多个处理器1702执行,该一个或多个计算机程序1704包括指令,上述指令可以用于执行上述实施例中的各个步骤。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应实体器件的功能描述,在此不再赘述。
示例性的,上述处理器1702具体可以为图2A所示的处理器110,上述存储器1703具体可以为图2A所示的内部存储器121,上述显示屏1701具体可以为图2A所示的显示屏194。
本申请实施例还提供一种电子设备,包括一个或多个处理器以及一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述相关方法步骤实现上述实施例中的屏幕刷新方法。
本申请的实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的屏幕刷新方法。
本申请的实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中电子设备执行的屏幕刷新方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使装置执行上述各方法实施例中电子设备执行的屏幕刷新方法。
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或装置 均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (19)

  1. 一种界面更新方法,应用于电子设备,其特征在于,所述电子设备包括第一局部绘制控件,所述方法包括:
    所述电子设备显示第一界面,所述第一界面包括第一区域,所述第一界面上的所述第一区域的内容为第一内容;
    所述电子设备显示第二界面,所述第二界面包括所述第一区域,所述第二界面上的所述第一区域的内容为第二内容,且所述第二内容不同于所述第一内容,所述第一内容被所述电子设备通过所述第一局部绘制控件更新为所述第二内容;所述第二界面还包括第二区域,所述第二区域不同于所述第一区域,所述第二界面上的所述第二区域的内容为第三内容;
    所述电子设备显示第三界面,所述第三界面包括所述第二区域,所述第三界面上的所述第二区域的内容为第四内容,且所述第四内容不同于所述第三内容,所述第三内容被所述电子设备通过所述第一局部绘制控件更新为所述第四内容。
  2. 根据权利要求1所述的方法,其特征在于,在所述第一内容被更新为所述第二内容的过程中,所述第一局部绘制控件所在的区域包括所述第一区域;
    在所述第三内容被更新为所述第四内容的过程中,所述第一局部绘制控件所在的区域包括所述第二区域。
  3. 根据权利要求2所述的方法,其特征在于,在所述电子设备显示第三界面后,所述方法还包括:
    所述电子设备显示第四界面,所述第四界面包括所述第二区域,所述第四界面上的所述第二区域的内容为第五内容,且所述第五内容不同于所述第四内容,所述第四内容被所述电子设备通过所述第一局部绘制控件更新为所述第五内容,所述第一局部绘制控件所在的区域包括所述第二区域。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述电子设备还包括第二局部绘制控件,所述第一界面还包括第三区域,所述第三区域不同于所述第一区域,所述第二界面还包括所述第三区域,所述第一界面上的所述第三区域的内容为第六内容,所述第二界面上的所述第三区域的内容为第七内容,且所述第七内容不同于所述第六内容,所述第六内容被所述电子设备通过所述第二局部绘制控件更新为所述第七内容,所述第二局部绘制控件所在的区域包括所述第三区域。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述第一区域的尺寸,所述第二区域的尺寸,所述第一局部绘制控件的尺寸,以及所述第二局部绘制控件的尺寸小于或者等于预设阈值;所述电子设备还包括全局绘制控件,所述全局绘制控件的尺寸与所述电子设备的屏幕尺寸相同,所述方法还包括:
    所述电子设备显示第五界面,所述第五界面包括第四区域,所述第五界面上的所述第四区域的内容为第八内容,所述第四区域的尺寸大于所述预设阈值;
    所述电子设备显示第六界面,所述第六界面包括所述第四区域,所述第六界面上的所述第四区域的内容为第九内容,且所述第九内容不同于所述第八内容,所述第八内容被所述电子设备通过所述全局绘制控件更新为所述第九内容。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一界面还包括第五区 域,所述第五区域不同于所述第一区域,所述第一界面上的所述第五区域的内容未被更新,所述第二界面上的所述第五区域的内容与所述第一界面上的所述第五区域的内容相同。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述第一区域和所述第二区域为所述第二界面上第一用户界面UI控件中的不同区域。
  8. 根据权利要求1所述的方法,其特征在于,在所述第一内容被更新为所述第二内容的过程中,所述第一局部绘制控件所在的区域包括所述第一区域;
    在所述第三内容被更新为所述第四内容的过程中,所述第一局部绘制控件所在的区域包括所述第二区域以及保留的待更新区域,所述保留的待更新区域包括所述第一区域。
  9. 根据权利要求8所述的方法,其特征在于,所述电子设备还包括全局绘制控件,所述全局绘制控件的尺寸与所述电子设备的屏幕尺寸相同,所述方法还包括:
    若满足第一预设条件,则所述电子设备采用所述全局绘制控件进行全屏更新;所述第一预设条件包括以下任意一项:
    待更新区域大于或者等于预设阈值;
    或者,连续采用所述第一局部绘制进行界面更新的次数大于或者等于第一预设值;
    或者,采用所述第一局部绘制控件进行界面更新的过程中,保留的待更新区域的尺寸大于或者等于第二预设值;
    或者,连续采用所述第一局部绘制进行界面更新的时长大于或者等于第三预设值;
    或者,上一次采用所述第一局部绘制控件进行界面更新,本次待更新区域不同于上一次的待更新区域。
  10. 根据权利要求9所述的方法,其特征在于,在所述电子设备采用所述全局绘制控件进行全屏更新之后,所述方法还包括:
    所述电子设备清除保留的待更新区域。
  11. 一种界面更新方法,应用于电子设备,其特征在于,所述电子设备包括第一局部绘制控件,所述方法包括:
    所述电子设备显示第一界面,所述第一界面包括第一区域,所述第一界面上的所述第一区域的内容为第一内容;
    所述电子设备通过所述第一局部绘制控件,将所述第一区域的所述第一内容更新为第二内容,所述第二内容不同于所述第一内容;
    所述电子设备显示第二界面,所述第二界面包括所述第一区域,所述第二界面上的所述第一区域的内容为所述第二内容;所述第二界面还包括第二区域,所述第二区域不同于所述第一区域,所述第二界面上的所述第二区域的内容为第三内容;
    所述电子设备通过所述第一局部绘制控件,将所述第二区域的所述第三内容更为第四内容,所述第四内容不同于所述第三内容;
    所述电子设备显示第三界面,所述第三界面包括所述第二区域,所述第三界面上的所述第二区域的内容为所述第四内容。
  12. 根据权利要求11所述的方法,其特征在于,在所述电子设备将所述第一内容更为所述第二内容的过程中,所述第一局部绘制控件所在的区域包括所述第一区域;
    在所述电子设备将所述第三内容更为所述第四内容的过程中,所述第一局部绘制控件所在的区域包括所述第二区域。
  13. 根据权利要求12所述的方法,其特征在于,在所述电子设备显示第三界面之后,所述方法还包括:
    所述电子设备通过所述第一局部绘制控件,将所述第二区域的所述第四内容更新为第五内容,所述第五内容不同于所述第四内容,且所述第一局部绘制控件所在的区域包括所述第二区域;
    所述电子设备显示第四界面,所述第四界面包括所述第二区域,所述第四界面上的所述第二区域的内容为所述第五内容。
  14. 根据权利要求11-13任一项所述的方法,其特征在于,所述电子设备还包括第二局部绘制控件,所述第一界面还包括第三区域,所述第一界面上的所述第三区域的内容为第六内容,所述第三区域不同于所述第一区域,所述方法还包括:
    所述电子设备通过所述第二局部绘制控件,将所述第三区域的所述第六内容更新为第七内容,所述第七内容不同于所述第六内容,且所述第二局部绘制控件所在的区域包括所述第三区域;
    所述第二界面还包括所述第三区域,所述第二界面上的所述第三区域的内容为所述第七内容。
  15. 根据权利要求11-14任一项所述的方法,其特征在于,所述第一界面还包括第五区域,所述第五区域不同于所述第一区域,所述第一界面上的所述第五区域的内容未被更新,所述第二界面上的所述第五区域的内容与所述第一界面上的所述第五区域的内容相同。
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述第一界面、所述第二界面和所述第三界面为所述电子设备上跨系统开发应用的界面,或者为所述电子设备上单系统开发应用的界面。
  17. 一种电子设备,其特征在于,包括:
    屏幕,用于显示界面;
    一个或多个处理器;
    存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-16中任一项所述的界面更新方法。
  18. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-16中任一项所述的界面更新方法。
  19. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-16中任一项所述的界面更新方法。
PCT/CN2022/106612 2021-07-20 2022-07-20 一种可提升动效性能的屏幕刷新方法及设备 WO2023001163A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110820324.X 2021-07-20
CN202110820324.XA CN115640083A (zh) 2021-07-20 2021-07-20 一种可提升动效性能的屏幕刷新方法及设备

Publications (1)

Publication Number Publication Date
WO2023001163A1 true WO2023001163A1 (zh) 2023-01-26

Family

ID=84939790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106612 WO2023001163A1 (zh) 2021-07-20 2022-07-20 一种可提升动效性能的屏幕刷新方法及设备

Country Status (2)

Country Link
CN (1) CN115640083A (zh)
WO (1) WO2023001163A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076035A (zh) * 2023-10-13 2023-11-17 麒麟软件有限公司 一种x窗口系统下花屏的优化方法
CN117453111A (zh) * 2023-12-25 2024-01-26 合肥联宝信息技术有限公司 一种触控响应方法及装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101937311A (zh) * 2010-09-09 2011-01-05 宇龙计算机通信科技(深圳)有限公司 一种移动终端及图标控制方法
CN102253560A (zh) * 2010-05-18 2011-11-23 上海政申信息科技有限公司 显示装置、显示界面的刷新方法及装置
CN102270428A (zh) * 2010-06-01 2011-12-07 上海政申信息科技有限公司 显示装置、显示界面的刷新方法及装置
CN110580125A (zh) * 2018-06-07 2019-12-17 广州视源电子科技股份有限公司 显示界面的局部刷新方法、装置、设备及介质
WO2020140719A1 (en) * 2019-01-04 2020-07-09 Boe Technology Group Co., Ltd. Method and computer-readable medium for displaying image, and display device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253560A (zh) * 2010-05-18 2011-11-23 上海政申信息科技有限公司 显示装置、显示界面的刷新方法及装置
CN102270428A (zh) * 2010-06-01 2011-12-07 上海政申信息科技有限公司 显示装置、显示界面的刷新方法及装置
CN101937311A (zh) * 2010-09-09 2011-01-05 宇龙计算机通信科技(深圳)有限公司 一种移动终端及图标控制方法
CN110580125A (zh) * 2018-06-07 2019-12-17 广州视源电子科技股份有限公司 显示界面的局部刷新方法、装置、设备及介质
WO2020140719A1 (en) * 2019-01-04 2020-07-09 Boe Technology Group Co., Ltd. Method and computer-readable medium for displaying image, and display device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076035A (zh) * 2023-10-13 2023-11-17 麒麟软件有限公司 一种x窗口系统下花屏的优化方法
CN117076035B (zh) * 2023-10-13 2023-12-26 麒麟软件有限公司 一种x窗口系统下花屏的优化方法
CN117453111A (zh) * 2023-12-25 2024-01-26 合肥联宝信息技术有限公司 一种触控响应方法及装置、电子设备和存储介质
CN117453111B (zh) * 2023-12-25 2024-03-15 合肥联宝信息技术有限公司 一种触控响应方法及装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN115640083A (zh) 2023-01-24

Similar Documents

Publication Publication Date Title
WO2023001163A1 (zh) 一种可提升动效性能的屏幕刷新方法及设备
WO2021129253A1 (zh) 显示多窗口的方法、电子设备和系统
CN116501210B (zh) 一种显示方法、电子设备及存储介质
WO2021013019A1 (zh) 一种图片处理方法及装置
WO2024041047A1 (zh) 一种屏幕刷新率切换方法及电子设备
WO2023226455A1 (zh) 应用图标的显示方法、电子设备及可读存储介质
WO2022242487A1 (zh) 显示方法及相关装置
WO2023040666A1 (zh) 键盘显示方法、折叠屏设备和计算机可读存储介质
WO2023093776A1 (zh) 界面生成方法及电子设备
CN116774809A (zh) 调整频率的方法、装置、电子设备及可读存储介质
WO2023093169A1 (zh) 拍摄的方法和电子设备
WO2023005751A1 (zh) 渲染方法及电子设备
WO2023103800A1 (zh) 绘制方法及电子设备
WO2023066165A1 (zh) 动画效果显示方法及电子设备
WO2023093779A1 (zh) 界面生成方法及电子设备
EP4155916A1 (en) Font switching method and electronic device
WO2023066177A1 (zh) 动画效果显示方法及电子设备
WO2024093431A1 (zh) 一种图像绘制方法及电子设备
WO2024016798A9 (zh) 图像显示方法和相关装置
CN116719587B (zh) 屏幕显示方法、电子设备及计算机可读存储介质
WO2023160209A1 (zh) 帧数据显示方法、电子设备及存储介质
WO2013185664A1 (zh) 一种操作方法及装置
WO2024131481A1 (zh) 一种界面渲染方法及电子设备
WO2024027504A1 (zh) 一种应用显示方法及电子设备
WO2023030276A1 (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: 22845328

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE