Page display method and terminal device
Patent Information
- Application Number
- CN202510571815.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
例如,当前台应用的不同页面多次切换的过程中,终端设备会为每个页面中的图片分配大量资源(比如内存),造成了资源的浪费
Smart Images

Figure CN123011382A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a page display method and terminal device. Background Technology
[0002] As the capabilities of terminal devices continue to improve, the pages presented to users by various applications on these devices are becoming increasingly rich. Generally speaking, application pages mostly contain various types of images.
[0003] Currently, on the one hand, terminal devices have limited control over foreground applications. For example, when switching between different pages of a foreground application multiple times, the terminal device allocates a large amount of resources (such as memory) to the images on each page, resulting in a waste of resources.
[0004] On the other hand, terminal devices typically manage background applications by controlling the application process itself, without specifically controlling the resources used by images.
[0005] When an application runs in the foreground, the terminal device allocates a large amount of resources to the images contained in the various pages of the application; when the application runs in the background, it also increases the risk that the application process will be killed, which may cause the services that the application's background process should have provided to be stopped unexpectedly. Summary of the Invention
[0006] This application provides a page display method and terminal device that effectively reclaims resources occupied by images at appropriate times, improves the resource utilization of the terminal device, and avoids problems caused by excessive image resource consumption.
[0007] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0008] Firstly, a page display method is provided, comprising: a terminal device displaying a first routing page of a first application, the first routing page including at least a first tab and a second tab. The first tab is associated with a first tab page; for example, when the first tab is selected, the terminal device displays the first tab page, the first tab page including a first number of images. After receiving a user's operation on a second tab while the terminal device is displaying the first tab page, the terminal device displays the second tab page from the first routing page and releases the display resources of the second number of images in the first tab page.
[0009] In this method, during tab switching (displaying the second tab and hiding the first tab), the display resources of the images in the hidden tab are released. This allows for the reclamation of resources (memory resources) occupied by the images when the tab is hidden, effectively managing memory and significantly reducing peak application image memory usage, thus minimizing memory waste.
[0010] In conjunction with the first aspect, in one possible implementation, the method further includes: after receiving an operation from a user on the first tab, the terminal device displays a third tab and loads a second number of images on the third tab.
[0011] In this method, when another tab switch occurs (the first tab is shown and the second tab is hidden), the images in the tab that will soon be visible to the user (the first tab) are reloaded. The display resources for these images were released when the first tab was hidden. After reloading the images in the first tab, the first tab can be displayed.
[0012] In one possible implementation, after receiving the user's operation on the first tab, the terminal device also releases the display resources of a third number of images in the second tab.
[0013] In conjunction with the first aspect, in one possible implementation, the second quantity is less than or equal to a preset quantity threshold.
[0014] When image display resources in a tab are released, these images need to be reloaded when the tab is displayed again. Reloading images incurs system performance overhead. Releasing fewer images than a preset threshold avoids excessive performance overhead during image reloading, preventing performance degradation and ensuring optimal page display.
[0015] In conjunction with the first aspect, in one possible implementation, the second number of images includes images from the first number of images that meet preset conditions; the preset conditions include at least one of the following: the image is an image cached locally or a local image; the image size is less than a preset size threshold.
[0016] In this method, images originating from the network and requiring real-time download are not released to avoid prolonged reloading times that could negatively impact user experience. Images already cached locally or local images can be released. Since large images take a long time to reload, not releasing the display resources of large images helps prevent this from affecting the user experience.
[0017] In conjunction with the first aspect, in one possible implementation, after receiving a user's operation on the second tab, the terminal device displays the second tab in the first routing page; after a first time period following receiving the user's operation on the second tab, the terminal device releases the display resources of the second number of images in the first tab.
[0018] After a pre-set timeout, the release task is executed. This avoids frequent tab switching, which would cause repeated release and loading of image display resources, leading to a decrease in system performance.
[0019] Secondly, a page display method is provided, which includes: a terminal device displaying a first page in a first application window, the first page including a first number of images; in response to a user's first operation on the first page, the terminal device displaying a second page in the first application window; that is, performing a routing page switch.
[0020] If the first application window is hidden while the second page is displayed, the terminal device releases the display resources for the second number of images on the first page.
[0021] This method releases image display resources on the page when the application window is hidden, improving resource utilization, reducing background application memory usage, lowering the risk of application being detected and killed, and enhancing the stability of background services. Furthermore, by releasing sufficient resources, the foreground application can run more smoothly, improving the user experience.
[0022] In conjunction with the second aspect, in one possible implementation, in response to a user's second operation, the terminal device displays a first application window, within which a second page is displayed; in response to a user's third operation on the second page, the terminal device displays a third page and loads a second number of images on the third page.
[0023] In this method, images from the page to be presented to the user are reloaded only when the application window becomes visible to the user and the routing page is switched, instead of loading all images from multiple pages at once; this avoids the time-consuming process of loading a large number of images at once, which would affect system performance.
[0024] In conjunction with the second aspect, in one possible implementation, the second number is less than or equal to a preset threshold. After image display resources are released, these images need to be reloaded when the page is displayed again. Reloading images incurs system performance overhead. Releasing fewer images than the preset threshold avoids excessive performance overhead during image reloading, thus preventing performance degradation and ensuring optimal page display.
[0025] In conjunction with the second aspect, in one possible implementation, the second number of images includes images from the first number of images that meet preset conditions; the preset conditions include at least one of the following: the image is an image that has been cached locally or a local image; the image size is less than a preset size threshold.
[0026] In this method, images originating from the network and requiring real-time download are not released to avoid prolonged reloading times that could negatively impact user experience. Images already cached locally or local images can be released. Since large images take a long time to reload, not releasing the display resources of large images helps prevent this from affecting the user experience.
[0027] In conjunction with the second aspect, in one possible implementation, the first application window is hidden by at least one of the following: the first application runs in the background; the terminal device screen is turned off; the second application is launched; the second application switches from running in the background to running in the foreground.
[0028] In conjunction with the second aspect, in one possible implementation, the second page includes a third number of images. If the first application window is hidden, the terminal device releases display resources for a fourth number of images on the second page, where the proportion of the fourth number to the third number is less than or equal to a preset ratio. This minimizes the impact on page loading speed when the application window is visible while improving memory resource utilization.
[0029] In another possible implementation, if the window of the first application is hidden, the terminal device does not release the display resources of the images on the second page. Since the resources occupied by the images on the second page are not released, the page can be displayed promptly when the application window becomes visible to the user again, avoiding slow page loading and impacting the user experience.
[0030] In another possible implementation, if the window of the first application is hidden, the terminal device releases the display resources for all images on the second page. This greatly improves memory resource utilization.
[0031] Thirdly, a terminal device is provided, comprising: a processor, a memory, and a display screen; the display screen is used to display a user interface, the memory is used to store computer execution instructions, and when the terminal device is running, the processor executes the computer execution instructions stored in the memory to cause the terminal device to perform the method as described in any of the possible embodiments of the first or second aspect above.
[0032] Fourthly, a computer-readable storage medium is provided that stores instructions which, when executed on a computer, enable the computer to perform the method described in any of the possible embodiments of the first or second aspect.
[0033] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, enables the computer to perform the method described in any of the possible embodiments of the first or second aspect described above.
[0034] The technical effects of any of the possible implementations in the third to fifth aspects can be found in the technical effects of different implementations in the first or second aspects, and will not be repeated here. Attached Figure Description
[0035] Figure 1Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 1 ;
[0036] Figure 2 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 2 ;
[0037] Figure 3 A schematic diagram of a white block in the page display method provided in the embodiments of this application;
[0038] Figure 4 A profile of the memory resources used by images during the operation of a mobile app;
[0039] Figure 5 This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application;
[0040] Figure 6 This application provides a schematic diagram of the software architecture of a terminal device.
[0041] Figure 7 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 3 ;
[0042] Figure 8 A schematic diagram illustrating a process for releasing the display resources of an image in a tab in a page display method provided in an embodiment of this application;
[0043] Figure 9 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 4 ;
[0044] Figure 10 A schematic flowchart illustrating the method for loading images from a tab in a page display method provided in this application embodiment;
[0045] Figure 11 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 5 ;
[0046] Figure 12 A flowchart illustrating the page display method provided in this application embodiment during a single tab switching process;
[0047] Figure 13 A schematic diagram of the processing flow during a single tab switching process in the page display method provided in the embodiments of this application;
[0048] Figure 14 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 6 ;
[0049] Figure 15 A schematic diagram illustrating a scenario where the application window is hidden in the page display method provided in this application embodiment;
[0050] Figure 16 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 7 ;
[0051] Figure 17 Illustration of the scenarios to which the page display method provided in the embodiments of this application is applicable. Figure 8 ;
[0052] Figure 18 A flowchart illustrating the page display method provided in this application embodiment during the application window state change process;
[0053] Figure 19 A schematic diagram of the processing flow during the change of application window state in the page display method provided in the embodiments of this application;
[0054] Figure 20 This is a schematic diagram of the structural composition of a terminal device provided in an embodiment of this application. Detailed Implementation
[0055] The relevant concepts in the embodiments of this application will be introduced below.
[0056] In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0057] References to "one embodiment", "some embodiments" and the like described in this specification mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Accordingly, the appearances of the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some additional embodiments" and the like in various places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another manner. The terms "comprise", "include", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another manner. The term "connection" includes direct connection and indirect connection, unless otherwise specified. The terms "first" and "second" are used for descriptive purposes only, and shall not be construed as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0058] In the embodiments of the present application, words such as "exemplary" or "for example" are used to denote an example, instance or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "exemplary" or "for example" is intended to present the related concepts in a specific manner.
[0059] route page, tab page
[0060] A route page (Router), also referred to as a page or an interface, is a user interface provided by an application (App) for a user. Exemplarily, Android TM the route page in the system is implemented by A-router, and the route page in HarmonyOS TM (Harmony operating system) can be implemented by a router component, a navigation component and the like.
[0061] One route page may include a plurality of tabs, and each tab is associated with a respective tab page; when a tab is selected, the tab page corresponding to the selected tab is displayed in the route page. Exemplarily, the tab page may be implemented by a Tab (tab) component.
[0062] A router component (or A-router, navigation component) can include multiple tab components. A router component (or A-router, navigation component) can also include only one tab component. Alternatively, a router component (or A-router, navigation component) may not include any tab components. When a router component (or A-router, navigation component) does not include any tab components or includes only one tab component, the routing page and the tab page are the same page.
[0063] For example, such as Figure 1 As shown in (a), the mobile phone displays page 101, which includes a "Themes" tab 102, a "Wallpaper" tab 103, a "Ringtones" tab 104, a "Watch Faces" tab 105, etc. When the "Themes" tab 102 is selected, for example, see reference... Figure 1 In (a), when the "Topic" tab 102 is selected, "Topic" is bolded and highlighted; the "Topic" tab 106 is displayed within page 101, meaning page 101 includes the "Topic" tab 106; page 101 is called the routing page, and the "Topic" tab 106 is called the tab page. For example, as... Figure 1 As shown in (b), when the "Wallpaper" tab 103 is selected on page 101, for example, see reference... Figure 1 (b) When the "Wallpaper" tab 103 is selected, "Wallpaper" is bolded and highlighted; the "Wallpaper" tab 107 is displayed within page 101, meaning page 101 includes the "Wallpaper" tab 107; the "Wallpaper" tab 107 is referred to as a tab. The "Themes" tab 102 is associated with the "Themes" tab 106, and the "Wallpaper" tab 103 is associated with the "Wallpaper" tab 107.
[0064] Tab switching
[0065] Within a single route page, when a user clicks on different tabs on that route page, the corresponding tab page will be displayed. Switching from one tab page to another is called tab switching.
[0066] For example, such as Figure 1 As shown in (a), when the phone displays the "Themes" tab 106, it receives the user's selection of the "Wallpaper" tab 103, as follows: Figure 1 As shown in (b), the phone displays the "Wallpaper" tab 107 associated with the "Wallpaper" tab 103.
[0067] like Figure 1 As shown in (b), when the phone displays the "Wallpaper" tab 107, it receives the user's selection of the "Themes" tab 102, as follows: Figure 1 As shown in (a), the phone displays the "Themes" tab 106.
[0068] Route page redirection
[0069] A route page (or tab) can include some jump controls that will display another route page when the user clicks on the jump control of the route page (or tab).
[0070] For example, consider a tab page that includes a navigation control. Figure 2 As shown in (a), the mobile phone displays page 101, which includes a "Themes" tab 106. The "Themes" tab 106 includes a "More" control 1061. This "More" control 1061 is a navigation control. Upon receiving a user's action on the "More" control 1061 (e.g., a click), as... Figure 2 As shown in (b), the phone displays the "Hottest Recommendations" page 108. This "Hottest Recommendations" page 108 is another route page. Optionally, the "Hottest Recommendations" page 108 may also include multiple tabs.
[0071] like Figure 2 As shown in (b), the "Hottest Recommendations" page 108 includes a "Back" control 1081. When the "Hottest Recommendations" page 108 is displayed on the mobile phone, after receiving an operation (e.g., a click) from the user on the "Back" control 1081, as shown in (b), the user can... Figure 2 As shown in (a), the mobile phone displays page 101, which includes a “Topics” tab 106.
[0072] Image display resources
[0073] Display resources can also be called bitmap files, graphics files, etc. For example, Android... TM In the system, resources are displayed as bitmap files, while in HarmonyOS, resources are displayed as pixelmap files.
[0074] In one implementation, the image's display resources are stored in the memory allocated to that image. Releasing the memory occupied by the image releases its display resources.
[0075] Loading images
[0076] Loading an image means loading the image's display resources. In one implementation, the process of loading an image includes allocating memory for the image and storing the image's display resources into the memory corresponding to the image.
[0077] White tiles
[0078] This refers to the phenomenon where an image appears as a blank block during the loading process, from before it is actually displayed to before it is fully loaded. In one example, before the image's display resources are fully loaded, it is displayed as a white block containing only the image's border, with no image displayed within the border. For example, such as... Figure 3 As shown, during the image loading process, a white block appears in front of the image before the image is displayed.
[0079] Currently, terminal devices do not manage the resources used by images in applications separately. During application operation, images can consume a lot of resources, such as memory resources.
[0080] For example, Figure 4 This is a profile of the memory resources used by images during the operation of a mobile app.
[0081] like Figure 4 As shown, after a cold start, the app displays a tab. When this tab contains images, the device allocates memory for these images. After a tab switch, the tab is hidden, but the memory allocated for the images in that tab remains occupied. The page then updates based on the user's swipes on the tab; a video on the tab also plays. During the page update process, the phone allocates memory for the updated images and video. Currently, mobile phones generally do not manage the memory of foreground applications, and the memory occupied by the images in this tab continuously increases, resulting in a serious waste of memory space.
[0082] When the app is moved to the background, the memory usage of the images remains unchanged while the app is running in the background, resulting in a high memory consumption and increasing the risk that the app's background process will be detected and killed.
[0083] This application provides a page display method that manages the resources occupied by images on the page, releases the resources occupied by images at appropriate times, improves resource utilization, and reduces the risk of processes being killed due to excessive resource consumption, thereby improving user experience and overall system performance.
[0084] The page display method provided in this application can be applied to terminal devices including displays. These terminal devices may include mobile phones, tablets, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, smart home devices (e.g., smart TVs, smart screens, large screens, smart speakers, smart air conditioners, etc.), personal digital assistants (PDAs), wearable devices (e.g., smartwatches, smart bracelets, etc.), in-vehicle devices, virtual reality devices, etc., and this application does not impose any limitations on these.
[0085] For example, Figure 5 This is a schematic diagram of the hardware structure of a terminal device 100 provided in an embodiment of this application. Figure 5 As shown, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a camera 190, and a display screen 191, etc. The sensor module 180 may include a temperature sensor, an ambient light sensor, a touch sensor, a depth sensor, etc.
[0086] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0087] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0088] The controller can serve as the central nervous system and command center of the terminal device 100. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0089] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are being used repeatedly.
[0090] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0091] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, music, and video files can be saved on the external storage card.
[0092] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of terminal device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. The data storage area may store data created during the use of terminal device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0093] The charging management module 140 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also power the terminal device via the power management module 141. The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and powers the processor 110, internal memory 121, external memory, display screen 191, camera 190, and wireless communication module 160, etc.
[0094] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0095] Terminal device 100 can implement audio functions, such as music playback and recording, through audio module 170 and application processor.
[0096] Terminal device 100 can perform shooting functions through ISP, camera 190, video codec, GPU, display 191 and application processor.
[0097] A camera 190, also known as a camera module, is used to capture still images or videos. An object passes through a lens, generating an optical image that is projected onto a photosensitive element. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP (Image Signal Processor) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for further processing. The DSP converts the digital image signal into standard image signals in formats such as RGB and YUV.
[0098] Terminal device 100 implements display functions through a GPU, display screen 191, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 191 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0099] Display screen 191 is used to display images, videos, etc. Display screen 191 is also referred to as screen 191. Display screen 191 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, terminal device 100 may include one or N display screens 191, where N is a positive integer greater than 1. For example, in this embodiment, display screen 191 can be used to display application windows, routing pages, tabs, etc.
[0100] The terminal device provided in this application embodiment can run an operating system (OS). This operating system can be various operating systems used in the industry, such as an operating system based on OpenHarmony, like HarmonyOS; or other operating systems such as Android. TMAn operating system can refer to the iOS mobile operating system; it can also refer to various open-source operating systems or their derivatives, such as Linux OS and other embedded operating systems; or it can refer to future new operating systems, such as AI operating systems based on artificial intelligence. An operating system is a set of interconnected system software programs that manage and control the operation of terminal devices, utilize and run hardware and software resources, and provide public services to organize user interactions. In a terminal device, the operating system connects downwards to the physical hardware layer and upwards to provide a runtime environment for application software.
[0101] The types and forms of terminal devices we use in our daily lives vary greatly, and the application scenarios for these devices are also very wide. Therefore, based on different forms and functions of terminal devices, different application scenarios, and different user needs, the operating systems used on these terminal devices may also differ. The basic functions implemented by the terminal device provided in this application can be implemented using a general-purpose operating system or a dedicated operating system. To more clearly illustrate the implementation of the embodiments of this application under a specific operating system, the architecture of HarmonyOS is shown below. Those skilled in the art can deduce the implementation of the embodiments of this application under other specific operating systems, such as Android. TM Implementation under operating systems, etc.
[0102] like Figure 6 As shown, the software architecture of an electronic device can be divided into several layers. In some embodiments, from bottom to top, these layers are: kernel layer, system service layer, framework layer, and application layer. Layers communicate with each other through software interfaces. System functions can be tailored, added, or combined at the subsystem granularity in different device deployment scenarios, and each subsystem can also be tailored, added, or combined at the functional granularity.
[0103] The kernel abstraction layer (KAL) provides basic kernel capabilities to higher layers by shielding them from the differences between multiple kernels. These capabilities include, but are not limited to, process / thread management, memory management, file system management, network management, and peripheral device management. The kernel layer can include the KAL kernel abstraction layer, kernel subsystems, driver subsystems, etc.
[0104] The system service layer comprises the core capabilities of the system, providing services to applications through the framework layer. This layer includes, but is not limited to, a set of subsystems, including, but not limited to, the following: basic system capability subsystems, basic software service subsystems, enhanced software service subsystems, and hardware service subsystems. The basic system capability subsystems provide the foundational capabilities for the operation, scheduling, and migration of distributed applications across multiple devices; these subsystems may include a distributed soft bus, distributed data management, distributed task scheduling, and the Ark multi-language runtime; they may also include a multi-modal input subsystem, a graphics subsystem, a security subsystem, and an AI business subsystem.
[0105] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The framework layer includes the ArkUI framework, user application framework, and capability framework. Different devices may have different operating systems, and therefore support different APIs. The ArkUI framework provides a complete infrastructure for UI development of system applications, including UI functions (such as components, layouts, animations, and interactive events), as well as real-time interface preview tools. The ArkUI framework provides at least two development paradigms: a declarative development paradigm based on ArkTS (referred to as the "declarative development paradigm") and a JS-compatible web-like development paradigm (referred to as the "web-like development paradigm").
[0106] In one example, the ArkUI framework includes an image resource management module. This module manages the resources used by images on the application's pages, such as releasing and rebuilding image resources. The image resource management module can include an application state management module, an image information management module, an image resource recycling module, and an image resource rebuilding module. The application state management module manages the app's state, which can include app startup, app shutdown, foreground running, and background running. The image information management module manages basic image information, such as image size and source. The image resource recycling module manages the image resource release process, and the image resource rebuilding module manages the rebuilding of image resources.
[0107] The HarmonyOS API is designed to support HarmonyOS. TM The HarmonyOS API is a series of open capabilities provided for application development. The HarmonyOS API can be set at the framework layer or independently of the framework layer. The HarmonyOS API includes Audio API (audio service), Push API (push service), Account API (account service), etc.
[0108] Applications at the application layer can include system applications and extended / third-party applications. System applications can include the desktop, control bar, settings, contacts, phone, camera, etc., while extended / third-party applications can include social applications, travel applications, etc.
[0109] The execution subject of the page display method provided in this application embodiment can be a terminal device, or a chip, chip system, or processor that supports the terminal device in implementing the method, or a logic module or software that can implement all or part of the functions of the terminal device, such as an image resource management module.
[0110] The following describes the solution provided in this application in detail, taking the execution of the page display method on a terminal device as an example. It should be noted that this embodiment uses a mobile phone as an example of the terminal device.
[0111] In some embodiments, a single routing page of the application includes multiple tabs, and each tab acts as a container for multiple images. When switching tabs, the new tab is displayed and the old tab is hidden. Resources occupied by images in the old tab are released, and resources used by the images (such as memory resources) are reclaimed to reduce resource waste.
[0112] In a scenario, such as Figure 7 As shown in (a), the mobile phone displays page 101 (first routing page), which includes a "Themes" tab 106 (first tab). Page 101 also includes a "Themes" tab 102 (first tab), a "Wallpaper" tab 103 (second tab), etc. The user can interact with the "Wallpaper" tab 103 (e.g., click it) to switch tabs on the mobile phone. For example, upon receiving a user's click on the "Wallpaper" tab 103, as shown... Figure 7 As shown in (b), the mobile phone displays an updated page 101, which includes a "Wallpaper" tab 107 (the second tab), which is associated with the "Wallpaper" tab 103. The updated page 101 also includes a "Themes" tab 102, a "Wallpaper" tab 103, and so on.
[0113] During this process, after receiving a user's click on the "Wallpaper" tab 103, the phone displays a new tab: "Wallpaper" tab 107, and hides the old tab: "Themes" tab 106.
[0114] Upon receiving a user's click on the "Wallpaper" tab 103, the phone releases the resources occupied by images in hidden tabs (e.g., the "Themes" tab 106). For example, the phone releases the display resources of the image. In one implementation, the image's display resources are stored in memory allocated to that image; releasing the memory occupied by the image releases its display resources.
[0115] Optionally, the phone can release the display resources of all images in the hidden tab; alternatively, the phone can release the display resources of some images in the hidden tab. For example, such as... Figure 7 As shown in (c), after receiving a user's click on the "Wallpaper" tab 103, the phone releases the display resources of images A, B, C, D, E, and F on the "Themes" tab 106.
[0116] In this scenario, when a tab switch occurs, the display resources of images in the hidden tab are released. This effectively manages image resource usage for applications running in the foreground, preventing memory waste. Furthermore, compared to methods that manage memory usage by foreground applications when memory resources are insufficient, the resource reclamation mechanism provided in this embodiment is more stable and effective.
[0117] For example, Figure 8 This illustration shows a flowchart of releasing the display resources of an image in a tab in the page display method provided in an embodiment of this application.
[0118] like Figure 8 As shown, the method includes:
[0119] S801, Trigger the release of display resources for images in the tab.
[0120] In one example, when a tab switch occurs, the display resources of the images in the hidden tab are released.
[0121] S802. Determine whether the display resources of the images in this tab have been released. If yes, exit; if no, proceed to the next step.
[0122] Optionally, determine whether the display resources of the images in the tab have been released. For example, if tab switching is very frequent, and the tab is hidden, the display resources of the images in that tab have been released. Then, if the tab is displayed again and quickly hidden again, the images in that tab have not yet been loaded, confirming that the display resources of the images in that tab have been released.
[0123] In one implementation, if it is determined that the display resource corresponding to the image in the tab is empty, then it is determined that the display resource of the image in the tab has been released.
[0124] S803. Determine if the tab is visible to the user. If yes, exit; otherwise, proceed to the next step.
[0125] Optionally, determine whether the tab is visible to the user. In one possible scenario, if tab switching is frequent, the tab may have already been updated to be visible to the user by the time the display resources of the images in the tab are released.
[0126] In one implementation, the terminal device records the visibility state of the tab, which includes whether the tab is visible to the user or not. For example, when the tab is hidden, its visibility state is invisible to the user; when the terminal device displays the tab in the user-visible area of the display screen, its visibility state is visible to the user. Based on this, it can be determined whether the tab is visible to the user according to the visibility state recorded by the terminal device.
[0127] S804. Determine if there are any unexecuted or incomplete tasks for releasing image display resources in this tab. If so, exit; otherwise, proceed to the next step.
[0128] In one implementation, after the terminal device creates a task to release the display resources of an image in a tab, it adds the release task to the release task list. After the release task is executed, it is removed from the release task list. If a release task for a certain tab exists in the release task list, it means that the release task for that tab has not been executed or has not been completed.
[0129] Optionally, if there are tasks that are not executed or are not completed in the process of releasing the image display resources in the tab, the current process will be exited and the task of releasing the image display resources in the tab will not be executed again.
[0130] It should be noted that the order of S802-S804 is not limited in the embodiments of this application.
[0131] S805, Execute the task of releasing the image display resources in this tab.
[0132] In one implementation, after S801 triggers the release of image display resources in the tab, a task for releasing image display resources in the tab is created; for example, the task is added to the release task list. After a preset duration (the first duration), the task is executed. This avoids frequent tab switching and repeated release and loading of image display resources, which would otherwise degrade system performance.
[0133] In one possible implementation, during the task of releasing the display resources of images in a tab, images in the tab that meet preset conditions are released.
[0134] In one example, the preset conditions include: the image is either a cached image or a local image. Images originating from the network and requiring real-time download are not released to avoid lengthy reloading times that could negatively impact user experience; images already cached locally or local images can be released.
[0135] In one example, the preset conditions include: the image size is smaller than a preset size threshold. If the image size is too large, reloading will take a long time. Not releasing the display resources of overly large images can avoid the long reload time affecting the user experience.
[0136] Of course, multiple preset conditions mentioned above can also be combined for judgment.
[0137] In one possible implementation, the number of images released from the image display resources of a tab is less than or equal to a preset threshold. After the image display resources in a tab are released, these images need to be reloaded when the tab is displayed again. Reloading images incurs system performance overhead. Releasing the number of images from the image display resources to less than the preset threshold avoids excessive performance overhead during image reloading, which could lead to performance degradation and affect the page display.
[0138] The task is complete when the number of images whose display resources in the tab are released equals the total number of images in the tab, or when all display resources for all images in the tab have been released. In one implementation, this task can be removed from the release task list.
[0139] In another scenario, such as Figure 9 As shown in (a), the phone displays page 101, which includes a "Wallpaper" tab 107. For example, Figure 9 Page 101 shown in (a) is Figure 7 Page 101, shown in (b). Figure 7 During the tab switching process shown, the tab displayed on page 101 is updated from the "Themes" tab 106 to the "Wallpaper" tab 107.
[0140] like Figure 9 As shown in (a), the user can interact with the "Topics" tab 102 (e.g., click it) to switch tabs on the phone. For example, upon receiving a click on the "Topics" tab 102, as... Figure 9 As shown in (b), the mobile phone updates page 101, and the updated page 101 includes a "Topics" tab 109 (third tab).
[0141] exist Figure 7During the tab switching process shown, the "Themes" tab 106 is hidden, and the display resources for images A, B, C, D, E, and F in the "Themes" tab 106 are released. Correspondingly, upon receiving a user's click on the "Themes" tab 102, as... Figure 9 As shown in (b), the phone loads images A, B, C, D, E, and F on the "Themes" tab 109.
[0142] After images A, B, C, D, E, and F are loaded, page 101 is updated, and the updated page 101 includes the "Topics" tab 106.
[0143] In this scenario, when a tab switch occurs, the images in the tab that will soon be visible to the user are reloaded. The display resources for these images were released when the tab was previously hidden. After reloading the images, the tab can be displayed.
[0144] For example, Figure 10 This illustration shows a flowchart of loading an image from a tab in a page display method provided in an embodiment of this application.
[0145] like Figure 10 As shown, the method includes:
[0146] S1001, Trigger loading of images in the tab.
[0147] In one example, when a tab switch occurs, the loading of the image in the tab that will soon be visible to the user is triggered.
[0148] S1002. Determine if there is a task to release the display resources of the image in this tab. If yes, cancel the task to release the display resources of the image in this tab and then proceed to the next step; otherwise, proceed to the next step.
[0149] In one implementation, if a release task corresponding to the tab exists in the release task list, it means that the task of releasing the display resources of the image in the tab has been triggered and executed, or the task of releasing the display resources of the image in the tab has not yet started execution, and the task of releasing the display resources of the image in the tab is cancelled.
[0150] S1003. Determine if there is an image in this tab that has had its display resources released. If yes, proceed to the next step; otherwise, exit.
[0151] In one implementation, if the display resource corresponding to the image is empty, it is determined that the image's display resource has been released.
[0152] S1004. Execute the task of loading the images in this tab.
[0153] In one implementation, memory is allocated for the image, and the image's display resources are stored in the image's memory, thus completing the image loading process.
[0154] For images that exist in the local cache, load them from the local cache; for local images, load them from local storage; for network images, download the image from the network and load it.
[0155] The page display method provided in this application releases the display resources of the images in the tab if the tab is hidden; if the tab is about to be displayed, it loads the images in the tab. Since loading images takes time, especially when the tab contains high-resolution images, the process of loading images in the tab is lengthy. Before the images have finished loading, the images in the tab may appear as white blocks.
[0156] For example, such as Figure 11 As shown in (a), the mobile phone displays page 101, which includes a "Themes" tab 102, a "Wallpaper" tab 103, etc. When the "Themes" tab 102 is selected, page 101 displays the "Themes" tab page 106. After receiving the user's selection operation on the "Wallpaper" tab 103 (e.g., clicking the "Wallpaper" tab 103), as... Figure 11 As shown in (b), the phone displays the "Wallpaper" tab 107 associated with the "Wallpaper" tab 103. That is, the "Themes" tab 106 in page 101 is hidden, and the "Wallpaper" tab 107 is displayed. During this tab switching process, the display resources of the images in the "Themes" tab 106 are released.
[0157] like Figure 11 As shown in (b), when the phone displays the "Wallpaper" tab 107, it receives a selection operation from the user on the "Themes" tab 102 in page 101 (e.g., clicking the "Themes" tab 102). Figure 11 As shown in (c), the "Wallpaper" tab 107 is hidden, and the "Themes" tab 106' associated with the "Themes" tab 102 is displayed. Because some images in the "Themes" tab 106' have not finished loading, these images are displayed as white blocks. Once these images have all finished loading, the display will show as follows: Figure 11 The “Topic” tab 106 is shown in (a).
[0158] In some scenarios, high-speed cameras can capture white blocks during tab switching. In some extreme scenarios (such as when there are many high-resolution images in a tab), the process of a white block gradually transforming into a complete image during tab loading can be observed with the naked eye.
[0159] In the above embodiments, the process of releasing the display resources of the images in the "Themes" tab 106 when it is hidden, and reloading the images in the "Themes" tab 106 before it is about to be displayed, are used as examples to illustrate the implementation of releasing and loading the image display resources in the tab in the page display method provided in this application embodiment.
[0160] Understandably, the hiding of the "Themes" tab 106 and its impending display represent two separate tab switching processes. During a single tab switching process, there may be both loading images from the tab and releasing image display resources. For example, in... Figure 7 During the tab switching process shown, after the phone receives the user's click on the "Wallpaper" tab 103, the "Themes" tab 106 is hidden, and the display resources of images A, B, C, D, E, and F on the "Themes" tab 106 are released; furthermore, if the "Wallpaper" tab 107 contains images, for example, such as... Figure 7 As shown in (b), the "Wallpaper" tab 107 contains images 1, 2, 3, 4, 5, and 6, and the display resources of images 1, 2, 3, 4, 5, and 6 have been released. After the mobile phone receives the user's click operation on the "Wallpaper" tab 103, it will also load images 1, 2, 3, 4, 5, and 6.
[0161] For example, Figure 12 The diagram illustrates a flow chart of the page display method provided in this application during a single tab switching process.
[0162] like Figure 12 As shown, when the app launches, its application window is displayed. This window contains a routing page, which includes at least two tabs: Tab 1 and Tab 2. For example, if Tab 1 is currently selected, the routing page includes Tab 1. Upon receiving a user action on Tab 2, Tab 2 (associated with Tab 2) is displayed, and Tab 1 is hidden. This constitutes a tab switching operation.
[0163] During the tab switching process, the image in tab 2 is loaded first, and then the display resources of the image in tab 1 are released. Loading the image in tab 2 first allows tab 2 to be displayed as quickly as possible, avoiding disruption to the tab display.
[0164] For example, Figure 13 This illustration shows a schematic diagram of the processing flow during a single tab switching process in the page display method provided in an embodiment of this application.
[0165] Let's take the example of showing tab 2 and hiding tab 1 during a single tab switching process. Figure 13 As shown, the method includes:
[0166] S1301, Received user's operation to switch tabs.
[0167] For example, this action is a user clicking on label 2.
[0168] S1302, Trigger loading of images in tab 2.
[0169] S1303. Determine if there is a task to release the display resources of the image in tab 2. If yes, cancel the task to release the display resources of the image in tab 2, and then execute S1304; otherwise, execute S1304.
[0170] S1304. Determine if there is an image in tab 2 whose display resources have been released. If yes, proceed to S1305; otherwise, proceed to S1310.
[0171] S1305, Execute the task of loading the image in tab 2.
[0172] For a detailed description of S1305, please refer to S1004; it will not be repeated here. After S1305 is executed, S1310 can be executed.
[0173] S1310, Trigger the release of the display resources of the image in tab 1.
[0174] S1311. Determine whether the display resources of the image in tab 1 have been released. If yes, exit and the task is complete; otherwise, execute S1312.
[0175] S1312. Determine if tab 1 is visible to the user. If yes, exit and the task is complete; otherwise, execute S1313.
[0176] S1313. Determine if there are any unexecuted or incomplete tasks related to releasing image display resources in tab 1. If yes, exit and complete this task; otherwise, proceed to S1314.
[0177] It should be noted that the order of S1311-S1313 is not limited in the embodiments of this application. The specific process of S1311-S1313 can be referred to S802-S804, and will not be repeated here.
[0178] S1314. Execute the task of releasing the image display resources in tab 1.
[0179] The specific process of S1314 can be found in S805, and will not be repeated here.
[0180] The page display method provided in this application releases the display resources of images in hidden tabs during tab switching; and reloads the images in the tab just before it is displayed. This allows for the reclamation of resources (memory resources) occupied by images when the tab is hidden, effectively managing memory and significantly reducing peak application image memory usage, thus minimizing memory waste. Furthermore, by controlling the number of images released when releasing display resources, the method avoids excessive loading time that could affect tab display, ensuring a superior user experience.
[0181] In other embodiments, page 1 is displayed within the application window; based on user actions, the application window is updated to display page 2; wherein page 1 and page 2 are different route pages. After the application window is hidden, the pages within the application window are not visible to the user, releasing the resources occupied by images on the pages within the application window, and reclaiming the resources occupied by the images (such as memory resources) to reduce resource waste.
[0182] In one example, such as Figure 14 As shown in (a), after the phone launches application one (the first application), it displays page 1401 (the first page) of application one, which includes multiple images. The system receives user actions to switch pages (the first action), such as swiping right on page 1401. Figure 14 As shown in (b), the phone displays page 1402 (the second page) of application one, which includes multiple images. Page 1402 and page 1401 are different routing pages within the same application window. In some possible implementations, if at least one routing page switch has occurred within the application window (showing the new page and hiding the old page), the phone will allocate corresponding resources, such as memory resources and display resources, to the new page each time a routing page switch occurs.
[0183] The application window is hidden when the phone displays page 1402. (Reference) Figure 15 In one scenario, the application window is hidden when it's moved to the background. For example, if the user minimizes the application window, the application will move to the background. In another scenario, the application window is hidden when the phone screen is off. In yet another scenario, another application is launched, and the application window is hidden. In yet another scenario, another application switches from running in the background to running in the foreground, and the application window is hidden.
[0184] For example, such as Figure 14 As shown in (c), the application is moved to the background and the phone displays the desktop interface 1403.
[0185] In this embodiment, when the application window is hidden, the resources occupied by images on the pages within the application window are released. In this application, the last page displayed before the application window is hidden is called the current page.
[0186] In one implementation, when the application window is hidden, the resources occupied by images on pages other than the current page within the application window are released. For example... Figure 14 In the example shown, after the phone launches application one, pages 1401 and 1402 are displayed, with page 1402 being the current page. When the window of application one is hidden, the resources occupied by the images on page 1401 are released.
[0187] For details on the process of releasing images on the page, please refer to [link / reference]. Figure 8 The process of releasing the display resources of images in the tab is shown below and will not be described in detail here.
[0188] When the application window is hidden, resources used by images on pages other than the current page are released, effectively reclaiming image resources. If resources used by images on the current page are not released, the page can be displayed promptly when the application window becomes visible again, preventing slow page loading and impacting user experience.
[0189] In another implementation, when the application window is hidden, resources occupied by images on pages other than the current page within the application window are released, as are resources occupied by images on the current page that meet certain conditions. For example, resources occupied by a certain number of images on the current page are released. For instance, the percentage of images whose resources are released on the current page is less than or equal to a preset percentage. Optionally, a certain number of images can be released in the order they are displayed on the current page, from front to back; alternatively, a certain number of images can be released in descending order of size; or a certain number of images can be released in the order they are stored, etc. For example, such as... Figure 14 As shown in (b), page 1402 includes 9 images, of which images G, H, and K are released. This implementation minimizes the impact on page loading speed when the application window is visible while improving memory resource utilization.
[0190] In another implementation, when the application window is hidden, the resources occupied by images in all pages within that application window are released. This greatly improves memory resource utilization.
[0191] In this example, page 1401 does not contain multiple tabs. When switching between routing pages (showing page 1402 and hiding page 1401), the resources occupied by the images in page 1401 are not released; instead, the resources occupied by the images in page 1401 are released when the application window is hidden.
[0192] In another example, such as Figure 16 As shown in (a), after the phone launches application two, page 101 of application two is displayed. Page 101 includes multiple tabs; when the "Theme" tab is selected, page 101 includes a "Theme" tab page 106, which includes multiple images and a "More" control 1061. Upon receiving a user's action on the "More" control 1061 (e.g., a click), as follows... Figure 16 As shown in (b), the phone displays the "Hottest Recommendations" page 108. Page 108 and page 101 are different route pages within the same application window.
[0193] During this process, the "Themes" tab 106 on page 101 is hidden. In one implementation, after receiving a user's operation on the "More" control 1061, the phone releases the resources occupied by the images in the hidden tab ("Themes" tab 106).
[0194] When the phone displays the "Hottest Recommendations" page (page 108), the application window for application two is hidden. For example, as shown... Figure 16 As shown in (c), application two runs in the background, and the phone displays the desktop interface 1403. Since the image resources in the tab ("Themes" tab 106) have already been recycled when switching the routing page, there is no need to perform the operation of releasing the resources occupied by the images in the "Themes" tab 106 when the application window of application two is hidden.
[0195] In this example, page 101 includes multiple tabs. When switching the routing page (displaying the "Hottest Recommendations" page 108 and hiding page 101), the image resources occupied by the "Themes" tab 106 in page 101 are released. When the application window is hidden, since the image resources occupied by the "Themes" tab 106 have already been released when it is hidden, the release is not performed again.
[0196] In this embodiment, when a tab is hidden, the resources occupied by the images in the tab are released; when a route page that does not contain multiple tabs is hidden, the resources occupied by the images in that route page are not released, but are released together when the application window is hidden. This avoids repeatedly triggering the release process of image resources in tabs when switching between route pages containing multiple tabs, thus improving system performance.
[0197] Furthermore, in response to the user's second action, the previously hidden application window (the application window of application one) becomes visible to the user. For example, the second action could be closing application two, or launching application one (e.g., clicking the application icon of application one). For instance, as shown... Figure 17As shown in (a), the mobile phone displays a desktop interface 1403, which includes an application icon for application one. After receiving a user's operation on the application icon of application one (e.g., a click operation), the mobile phone displays the application window of application one.
[0198] In one implementation, if the resources occupied by the image on page 1402 are released when the application window of application one is hidden, then when the application window of application one is brought to the foreground, the image whose resources have been released on page 1402 is reloaded. Then, as... Figure 17 As shown in (b), page 1402 is displayed in the application window of application one.
[0199] Furthermore, a routing page switch occurs.
[0200] In one example, when the phone displays page 1402, after receiving a user's page switching operation (the third operation), such as a swipe left on page 1402, the images that have been released from resources on page 1401 are reloaded; after all images on page 1401 have been successfully loaded, such as... Figure 17 As shown in (d), the phone displays page 1401.
[0201] Loading images takes time, and while the images are still loading, they may appear as white blocks on the page. This can be observed visually, such as under high-speed camera footage or in certain scenarios, during page transitions. For example,... Figure 17 As shown in (c), after the phone receives the user's swipe-left gesture on page 1402, it displays page 1404 (the third page), which includes white blocks. Page 1401 is displayed after all images in page 1401 have been loaded.
[0202] In another example, refer to Figure 16 When the phone displays page 108, after receiving a user's operation to switch pages, such as swiping left on page 108, the images that have been released in the "Themes" tab 106 of page 101 are reloaded; after all the images in the "Themes" tab 106 are successfully loaded, the phone displays page 101, which includes the "Themes" tab 106.
[0203] For details on the process of loading images on the page, please refer to [link / reference]. Figure 10 The process of loading images from a tab, as shown, will not be elaborated here.
[0204] For example, Figure 18 This illustration shows a flowchart of the page display method provided in the embodiments of this application during the application window state change process.
[0205] like Figure 18 As shown, when the app launches, its application window is displayed. This window displays route page 1. Upon receiving a user action on route page 1, route page 2 is displayed and route page 1 is hidden, thus performing a route page switch. Afterwards, the application window is hidden, triggering the release of display resources for images in route page 1 within the application window; optionally, the release of display resources for images in route page 2 within the application window can also be triggered. Then, the application window becomes visible again. Optionally, if the aforementioned steps released display resources for images in route page 2, then loading the images in route page 2 is triggered; after the images are loaded, route page 2 is displayed. Afterwards, upon receiving a user action on route page 2, route page 1 is displayed and route page 2 is hidden; thus performing a route page switch. During the route page switch, loading the images in route page 1 is triggered.
[0206] For example, Figure 19 This illustration shows a schematic diagram of the processing flow during the application window state change process in the page display method provided in the embodiments of this application.
[0207] S1901, The application window is hidden.
[0208] S1902, Trigger the release of image display resources in the route page.
[0209] In some cases, when the application window is hidden, the release of display resources for images in the routed pages may be triggered multiple times. For example, it may trigger the release of display resources for images on the current page, as well as images on other pages. Furthermore, if multiple routed page transitions have occurred, there may be multiple pages existing besides the current one.
[0210] The resource release of the image display in each route page is triggered once. That is, S1902-S1906 can be executed multiple times.
[0211] S1903. Determine whether the image display resource in the routing page has been released. If yes, return to S1902 and process the next routing page; otherwise, execute S1904.
[0212] S1904. Determine if the route page is visible to the user. If yes, return to S1902 and process the next route page; otherwise, execute S1905.
[0213] S1905. Determine if there are any unexecuted or incomplete tasks for releasing image display resources in this route page. If yes, return to S1902 and process the next route page; otherwise, execute S1906.
[0214] It should be noted that the embodiments of this application do not limit the order of S1903-S1905. The specific processes of S1903-S1905 can be referred to S802-S804, and will not be repeated here.
[0215] S1906, Execute the task of releasing the image display resources in this route page.
[0216] The specific process of S1906 can be referred to in S805, and will not be repeated here.
[0217] S1910, The application window is switched to be visible to the user.
[0218] For example, after an application is switched to run in the foreground, the application window becomes visible to the user.
[0219] Optionally, if the display resources of the images on the current page have been released when the application window is hidden, execute S1912-S1915 to load the images in the route page when the application window becomes visible to the user.
[0220] S1911, Received user-triggered route page switching operation.
[0221] Upon receiving a user's command to switch routing pages, execute steps S1912-S1915 to load the image of the routing page that will be displayed to the user during this routing page switch.
[0222] S1912, Trigger loading of the image on the route page.
[0223] S1913. Determine if there is a task to release the display resources of images in the route page. If yes, cancel the task to release the display resources of images in the route page, and then execute S1914; otherwise, execute S1914.
[0224] S1914. Determine if there is an image whose display resources have been released in the route page. If yes, proceed to S1915; otherwise, exit.
[0225] S1915, Execute the task of loading the image for this route page.
[0226] For a detailed description of S1915, please refer to S1004; it will not be repeated here.
[0227] The page display method provided in this application releases the display resources of images on the page when the application window is hidden; this improves resource utilization, reduces the memory usage of background applications, reduces the risk of the application being detected and killed, and improves the stability of background services. Furthermore, because sufficient resources are released, the foreground application can run more smoothly, improving the user experience.
[0228] Furthermore, once the application window is visible to the user, the images in the page to be presented to the user are reloaded only when switching between routing pages, instead of loading all the images from multiple pages at once (such as when the application window becomes visible to the user); this avoids the impact on system performance caused by excessively long image loading times.
[0229] This application also provides a page display method. During route page switching, for example, route page 2 is displayed while route page 1 is hidden. If route page 1 does not include tabs, the display resources of images in route page 1 are also released. Correspondingly, the loading of images in route page 2 is also triggered. The specific implementation of releasing the display resources of images in a route page can refer to the implementation of releasing the display resources of images in a tab; the specific implementation of loading images in a route page can refer to the implementation of loading images in a tab. This method can efficiently manage the resource usage of images.
[0230] It is understood that the terminal device provided in this application embodiment includes hardware structures and / or software modules corresponding to the execution of each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0231] This application embodiment can divide the terminal device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0232] In one example, please refer to Figure 20 The diagram illustrates a possible structural schematic of the terminal device involved in the above embodiments. The terminal device 2000 includes: a processing unit 2010, a storage unit 2020, and a display unit 2030.
[0233] The processing unit 2010 controls and manages the actions of the terminal device 2000. The storage unit 2020 stores the program code and data of the terminal device 2000. The processing unit 2010 calls the program code stored in the storage unit 2020 to execute the steps in the above method embodiments. The display unit 2030 displays the user interface of the terminal device 2000, such as a routing page or tabs.
[0234] Of course, the unit modules in the aforementioned terminal device 2000 include, but are not limited to, the processing unit 2010, the storage unit 2020, and the display unit 2030. For example, the terminal device 2000 may also include a communication unit, a power supply unit, etc. The communication unit is used for communication between the terminal device 2000 and other terminal devices. The power supply unit is used to supply power to the terminal device 2000.
[0235] The processing unit 2010 can be a processor or controller, such as a central processing unit (CPU), graphics processing unit (GPU), digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The storage unit 2020 can be a memory. The display unit 2030 can be a display screen, etc.
[0236] For example, the processing unit 2010 is a processor (such as...) Figure 5 The processor 110 shown can be a memory (such as a storage unit 2020). Figure 5 The internal memory 121 shown can be a display unit 2030, and the display unit 2030 can be a display screen (such as...). Figure 5 The display screen 191 shown is shown. The terminal device 2000 provided in this embodiment of the application can be... Figure 5 The terminal device 100 shown above. The processor, memory, display screen, etc., can be connected together, for example, via a bus. The processor calls the program code stored in the memory to execute the various steps in the above method embodiments.
[0237] This application also provides a chip system (e.g., a system-on-a-chip, SoC) including at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (e.g., the memory of a terminal device). As another example, the interface circuit can be used to send signals to other devices (e.g., the processor or the touchscreen of the terminal device). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the terminal device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application does not specifically limit this.
[0238] This application also provides a computer-readable storage medium including computer instructions that, when executed on the terminal device, cause the terminal device to perform various functions or steps in the above method embodiments.
[0239] This application also provides a computer program product that, when run on a computer, causes the computer to perform the functions or steps described in the above method embodiments.
[0240] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0241] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0242] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0243] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0244] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0245] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A page display method, characterized in that, include: The terminal device displays a first route page of a first application. The first route page includes a first tab page. The first route page includes at least a first tab and a second tab. The first tab is associated with the first tab page. The first tab page includes a first number of images. Upon receiving the user's operation on the second tab, the terminal device displays the second tab in the first routing page and releases the display resources of the second number of images in the first tab.
2. The method according to claim 1, characterized in that, The method further includes: Upon receiving the user's operation on the first tab, the terminal device displays a third tab and loads the second number of images on the third tab.
3. The method according to claim 1 or 2, characterized in that, The second quantity is less than or equal to a preset quantity threshold.
4. The method according to any one of claims 1-3, characterized in that, The second number of images includes the images from the first number of images that meet the preset conditions; The preset conditions include at least one of the following: The image is either a cached image or a local image; The image size is smaller than the preset size threshold.
5. The method according to any one of claims 1-4, characterized in that, After receiving the user's operation on the second tab, the terminal device displays the second tab in the first routing page and releases the display resources of the second number of images in the first tab, including: Upon receiving the user's operation on the second tab, the terminal device displays the second tab page in the first routing page; After a first duration following the user's operation on the second tab, the terminal device releases the display resources of the second number of images in the first tab.
6. The method according to claim 2, characterized in that, After receiving the user's operation on the first tag, the method further includes: The terminal device releases the display resources of a third number of images in the second tab.
7. A page display method, characterized in that, include: The terminal device displays a first page within a first application window; the first page includes a first number of images; In response to the user's first operation on the first page, the terminal device displays a second page within the first application window; If the first application window is hidden while the second page is displayed, the terminal device releases the display resources of the second number of images on the first page.
8. The method according to claim 7, characterized in that, The method further includes: In response to a second user action, the terminal device displays the first application window; the second page is displayed within the first application window. In response to a third operation by the user on the second page, the terminal device displays a third page and loads the second number of images on the third page.
9. The method according to claim 7 or 8, characterized in that, The second number is less than or equal to a preset quantity threshold.
10. The method according to any one of claims 7-9, characterized in that, The second number of images includes the images in the first number of images that meet the preset conditions; The preset conditions include at least one of the following: The image is either a cached image or a local image; The image size is smaller than the preset size threshold.
11. The method according to any one of claims 7-10, characterized in that, The first application window is hidden by at least one of the following: The first application is moved to the background. The terminal device screen is off; The second application is launched; The second application switches from running in the background to running in the foreground.
12. The method according to any one of claims 7-11, characterized in that, The second page includes a third number of images, and the method further includes: If the first application window is hidden, the terminal device releases the display resources for the fourth number of images on the second page; the proportion of the fourth number to the third number is less than or equal to a preset proportion; or... If the window of the first application is hidden, the terminal device does not release the display resources of the images on the second page.
13. A terminal device, characterized in that, The device includes a memory, a processor, and a display screen; the display screen is used to display pages, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor invokes the computer instructions to cause the terminal device to perform the method as described in any one of claims 1-12.
14. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1-12.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1-12.
