Display method, electronic equipment and readable medium

By cache memory attribute information when the electronic device is turned on and only obtaining cached values ​​when the application is running, the problem of sliding lag in electronic devices when running browser or shopping applications is solved, which significantly reduces the time-consuming rendering thread.

CN120215771APending Publication Date: 2025-06-27HONOR DEVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311750058.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When an electronic device runs a browser or shopping application, users are prone to slipping and stuttering when sliding operations. This is mainly because the rendering thread continues to run the WebViewFunctor::drawVk function, which takes a long time, resulting in stuttering.

Method used

By obtaining memory attribute information and cacheing it when the electronic device is powered on and started, the application only obtains cached values ​​when it is run, reducing the number of times the memory attribute information is obtained, especially in the case of non-cold startup, the memory attribute information is not read.

Benefits of technology

It effectively reduces the time-consuming operation of the rendering thread in running the WebViewFunctor::drawVk function, and avoids the sliding lag of users when inputting operations on the application interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215771A_ABST
    Figure CN120215771A_ABST
Patent Text Reader

Abstract

The invention provides a display method, electronic equipment and a readable medium, and the display method comprises the steps: receiving a first operation of starting a first application by a user, obtaining first information and attribute information of a memory, and displaying an interface of the first application based on the first information and the attribute information of the memory; within a first time period after the user quits the first application, receiving a second operation of starting the first application by the user; and obtaining second information, and displaying an interface of the first application based on the second information. The electronic equipment can read the attribute information of the memory only when the first operation input by the user is cold start of the first application and the second operation input by the user is not cold start of the first application and cold start of the first application in a period of time when the user quits the first application, so that the reading frequency of the attribute information of the memory is reduced, the time consumed by a rendering thread for continuously running a WebViewFunctor: drawVk function is reduced, and the user experience is improved. And the phenomenon that the electronic equipment slides and is stuck when the user inputs the operation on the application interface is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of display technologies, and in particular, to a display method, an electronic device, a computer program product, and a computer-readable storage medium. Background Art

[0002] Currently, when a user uses a browser or a shopping application on an electronic device, the electronic device may experience problems with sliding jank.

[0003] The inventors have found through research that during the process of starting and running a browser or a shopping application on an electronic device, in response to a user's sliding operation on the application interface, the rendering thread (RenderThread) of the browser or shopping application on the electronic device runs to update the content of the display interface. The time taken for the rendering thread to continuously run the WebViewFunctor::drawVk function is relatively long, resulting in the problem of sliding jank. The inventors have further found through research that the reason for the relatively long time taken for the rendering thread to continuously run the WebViewFunctor::drawVk function is that the electronic device reads the attribute information of the memory multiple times. Summary of the Invention

[0004] This application provides a display method, an electronic device, a computer program product, and a computer-readable storage medium, aiming to avoid the phenomenon of sliding jank on the electronic device when a user inputs an operation on the application interface.

[0005] To achieve the above objective, this application provides the following technical solutions:

[0006] In a first aspect, this application provides a display method, including: receiving a first operation of a user to start a first application; in response to the first operation, obtaining first information and attribute information of a memory, and displaying an interface of the first application based on the first information and the attribute information of the memory; within a first time period after the user exits the first application, receiving a second operation of the user to start the first application; and in response to the second operation, obtaining second information, and displaying the interface of the first application based on the second information.

[0007] Among them, the user's input of the first operation to start the first application can be understood as a cold start of the first application. In response to the first operation, the electronic device needs to obtain the first information and the attribute information of the memory before displaying the interface of the first application. When the user exits the first application for a period of time and then inputs the second operation to start the first application, it can be understood as a warm start or a hot start of the first application, rather than a cold start. In response to the second operation, the electronic device only obtains the second information before displaying the interface of the first application and does not need to obtain the attribute information of the memory. From this, it can be seen that: only when the electronic device cold-starts the first application, the electronic device will read the attribute information of the memory. When starting the first application in a non-cold start manner, the attribute information of the memory is not read, which can reduce the number of times of reading the attribute information of the memory, reduce the time-consuming of the rendering thread continuously running the WebViewFunctor::drawVk function, and avoid the phenomenon of sliding jitter of the electronic device when the user inputs an operation on the application interface.

[0008] In a possible implementation, the first information and the second information are association information for displaying the interface of the first application.

[0009] In a possible implementation, before obtaining the first information and the attribute information of the memory, it further includes: determining that a process needs to be started during the startup process of the first application. If a process needs to be started during the startup process of the first application, it indicates that the first application is a cold start.

[0010] In a possible implementation, before obtaining the second information, it further includes: determining that no process needs to be started during the startup process of the first application. If no process needs to be started during the startup process of the first application, it indicates that the first application is not a cold start.

[0011] In a possible implementation, it further includes: receiving a third operation input by the user on the interface of the first application, where the third operation is used to switch the interface of the first application; in response to the third operation, obtaining the third information and displaying the switched interface of the first application based on the third information, where the third information is association information for displaying the switched interface of the first application.

[0012] In the above possible implementation, when the user inputs the third operation on the interface of the first application to switch the display interface, the electronic device only obtains the third information and does not obtain the attribute information of the memory, which also reduces the number of times of reading the attribute information of the memory, further reduces the time-consuming of the rendering thread continuously running the WebViewFunctor::drawVk function, and avoids the phenomenon of sliding jitter of the electronic device when the user inputs an operation on the application interface.

[0013] In a possible implementation, obtaining the first information and the attribute information of the memory includes: obtaining the cached values of the first information and the attribute information of the memory. The cached value of the attribute information of the memory is different from the attribute information of the memory. The electronic device obtains the cached value of the attribute information of the memory without calling multiple functions to read parameters such as available memory heaps and memory types. Thus, the time taken for the electronic device to obtain the cached value of the attribute information of the memory once is much less than the time taken to obtain the attribute information of the memory once, and it also reduces the time taken for the rendering thread to continuously run the WebViewFunctor::drawVk function, avoiding the phenomenon of the electronic device experiencing sliding jitter when the user inputs operations on the application interface.

[0014] In a possible implementation, the time taken to obtain the cached value of the attribute information of the memory is at the microsecond level.

[0015] In a possible implementation, during the process of obtaining the cached value of the attribute information of the memory, the electronic device does not call a function to read the parameters saved in the register.

[0016] In a possible implementation, when the electronic device is powered on, the cached value of the attribute information of the memory is saved in the form of a variable.

[0017] In a possible implementation, obtaining the first information and the attribute information of the memory includes: when the graphics processor driver of the electronic device receives an interface display task through the Vulkan three-dimensional graphics processing library, obtaining the first information and the attribute information of the memory.

[0018] In a second aspect, the present application provides an electronic device, including: one or more processors, a memory, and a display screen; the memory and the display screen are coupled to the one or more processors, and the memory is used to store a computer program, and the computer program includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the display method provided in any one of the first aspect and its possible implementations.

[0019] In a third aspect, the present application provides a computer-readable storage medium for storing a computer program, and when the computer program is executed, it is specifically used to implement the display method provided in any one of the first aspect and its possible implementations.

[0020] In a fourth aspect, the present application provides a computer program product, and when the computer program product runs on a computer, it causes the computer to execute the display method provided in any one of the first aspect and its possible implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a software structure diagram of the electronic device provided by the embodiment of the present application;

[0022] Figure 2 An interaction diagram of a method for obtaining attribute information of the memory of an electronic device during the startup process of a first application provided by an embodiment of the present application;

[0023] Figure 3 A flowchart of a method for displaying an interface of a first application provided by an embodiment of the present application;

[0024] Figure 4 A hardware structure diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "the foregoing", "this" are also intended to include, for example, the expression form of "one or more", unless otherwise clearly indicated in the context.

[0026] The reference to "some embodiments" described in this specification means that in one or more embodiments of the present application, specific features, structures, or characteristics described in conjunction with the embodiment are included. Thus, the statements "in some embodiments", "in other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0027] Multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0028] Currently, when a user uses a browser or a shopping application on an electronic device, the electronic device will experience problems with sliding jitter.

[0029] The inventors have found through research that during the process of starting up and running a browser or a shopping application on an electronic device, in response to a sliding operation of the user on the application interface, the rendering thread (RenderThread) of the browser or the shopping application of the electronic device runs to update the content of the display interface. The time-consuming for the rendering thread to continuously run the WebViewFunctor::drawVk function is relatively long, resulting in problems with sliding jitter.

[0030] The inventor further analyzed and found that:

[0031] The main application thread of the browser or shopping application creates a view and calls the WebViewFunctor::drawVk function of the WebView through the rendering thread. The reason why the WebViewFunctor::drawVk function takes a long time is that during the process of the electronic device updating the display interface content in response to the user's sliding operation on the application interface, the GetPhysicalDeviceMemoryProperties2 function will be called repeatedly many times. For example, statistics show that within 10 seconds, the GetPhysicalDeviceMemoryProperties2 function was called 51 times, with the maximum time consumption for one call being 49 ms and the minimum being 14 ms. When the GetPhysicalDeviceMemoryProperties2 function is called and runs, Chrome_InProGp needs to run, and when Chrome_InProGp runs, it will wake up WebViewFunctor::drawVk, and the WebViewFunctor::drawVk takes 186 ms, reaching the level of severe lag.

[0032] Moreover, the purpose of calling the GetPhysicalDeviceMemoryProperties2 function is to read the property information of the memory to support the application to apply for memory according to the property information of the memory. However, the memory properties of the electronic device are determined at the time of factory and will not be modified, so there is no need to read them repeatedly during the running process of the browser or shopping application.

[0033] Based on this, in order to solve the problem of sliding lag that occurs when the electronic device runs the browser or shopping application, the embodiments of the present application provide the following two solutions:

[0034] 1. When the electronic device is powered on and starts up, obtain the property information of the electronic device memory and cache it. During the running process of the browser or shopping application, the electronic device obtains the cached value.

[0035] 2. Reduce the number of times of obtaining the property information of the electronic device memory. When the browser or shopping application is cold-started, the electronic device reads the property information of the memory once. When the browser or shopping application is hot-started or warm-started, it does not read the property information of the memory.

[0036] To introduce the above two methods provided by the embodiments of the present application in detail, the following will be described in conjunction with the functional modules in the software structure of the electronic device.

[0037] First, introduce the software structure of the electronic device. The software structure of the electronic device can be understood as a layered architecture of the operating system of the electronic device. The operating system of the electronic device runs on the hardware components of the electronic device and can be: iOS operating system, Android open source operating system, Windows operating system, etc.

[0038] In the embodiments of this application, take the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device.

[0039] Figure 1 It is a software structure block diagram of the electronic device in the embodiments of this application.

[0040] The layered architecture divides the software into several layers, and the layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom are the application layer, application framework layer, Android runtime and system libraries, hardware abstraction layer, and kernel layer.

[0041] The application layer can include multiple applications. Exemplarily, Figure 1 shows two applications: a browser and a shopping application.

[0042] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. Exemplarily, Figure 1 the shown application framework layer includes a view system. In some embodiments, the view system can be used to build applications, including visual controls, such as controls for displaying text, controls for displaying pictures, etc. During the process of the electronic device executing the above two solutions, the functions of the view system can be seen in the following content.

[0043] The system libraries can include multiple functional modules. For example Figure 1 the shown Hwui, 3D graphics processing library (such as Vulkan) and Webview. In some embodiments, Hwui is for hardware-accelerated UI drawing and is used for 2D drawing; Hwui mainly uses Vulkan for GPU hardware drawing; Vulkan is used to implement 3D graphics drawing, image rendering, composition, and layer processing, etc.; Webview is used to display web pages. During the process of the electronic device executing the above two solutions, the functions of Hwui, Vulkan, and Webview can be seen in the following content.

[0044] The hardware abstraction layer at least includes the Device Development Kit (DDK) of the graphics processing unit (GPU), which can be abbreviated as GPU DDK for short.

[0045] The kernel layer at least includes the GPU Driver.

[0046] Taking the browser application as an example, the following introduces the cache value of the attribute information of the electronic device memory obtained by the cooperation of the view system, Hwui, Vulkan, Webview, GPU DDK, and GPU Driver during the running process of the browser application.

[0047] As Figure 2 shown, the method for obtaining the attribute information of the electronic device memory includes:

[0048] S101. The browser application receives the user's startup operation.

[0049] In some embodiments, the user can start the browser application by clicking the icon of the browser application, or clicking the interface of the browser application in the multitasking management interface, or waking up the browser application by voice, etc. The browser application can receive the user's startup operation.

[0050] S102. In response to the user's startup operation, the browser application calls the interface of Webview through the view system, Hwui, and Vulkan to transmit the interface display task.

[0051] When the user starts the browser application, the display screen of the electronic device displays the interface of the browser application. Based on this, the browser application can send the interface display task to the lower-level module. In some embodiments, the browser application can send the interface display task by sending instructions to the lower-level module.

[0052] The browser application sends the interface display task to the view system. After receiving the interface display task, the view system can send the interface display task to Hwui. In some embodiments, the view system can send the interface display task to Hwui by calling the libhwui.so database. In other embodiments, after receiving the interface display task, the view system can also create the interface of the browser application.

[0053] From the content of the software structure of the foregoing electronic device, Hwui mainly uses Vulkan for GPU hardware drawing. Based on this, when Hwui receives an interface display task, it can send the interface display task to Vulkan. In some embodiments, the libhwui.so database calls the libwebviewchromium.so database through Vulkan to transfer the interface display task, thereby implementing the sending of the interface display task from Hwui to Vulkan and the sending of the interface display task from Vulkan to Webview.

[0054] In some embodiments, after receiving the interface display task, Vulkan performs operations such as three-dimensional graphics drawing, image rendering, composition, and layer processing based on the browser interface indicated by the interface display task.

[0055] S103. Webview transfers the interface display task to the GPU Driver through the GPU DDK.

[0056] After receiving the interface display task, Webview transfers the interface display task to the GPU Driver through the GPU DDK.

[0057] The libwebviewchromium.so database of Webview transfers the interface display task to the GPU Driver through a call via the GPU DDK.

[0058] Webview is used to display web pages. Therefore, Hwui sends the interface display task to Webview through Vulkan. In some embodiments, after receiving the interface display task, Webview can perform the operation of displaying web pages based on the browser interface indicated by the interface display task.

[0059] It should be noted that in the scenario where the user launches a shopping application, the electronic device does not need to display a web page when displaying the interface of the shopping application. In this case, after the shopping application issues the interface display task to Vulkan through the view system and Hwui, Vulkan can directly transfer the interface display task to the GPU Driver through the GPU DDK.

[0060] S104. In the case of a cold start of the browser, the GPU Driver obtains the cache value of the attribute information of the memory.

[0061] It should be noted that the startup of an application is divided into cold start, hot start, and warm start.

[0062] Cold start: It refers to the first run of an application after the electronic device is started, or the restart of the application process after the application process has been cleared (for example, due to system memory pressure or user-initiated clearing). That is, before the application is started, there are no processes of the application in the system. Cold start requires creating a process and initializing the application.

[0063] Warm start: It refers to restarting the application after exiting the application. When starting, the application process exists, and the Activity object still exists in memory, which can avoid object initialization and layout parsing and drawing.

[0064] Hot start: It refers to restarting the application after exiting the application. When starting, the application process exists, but the Activity object may be recycled due to insufficient memory.

[0065] It should also be noted that as described above: when the electronic device is powered on, the GPU Driver obtains the attribute information of the electronic device's memory and caches it. After the GPU Driver receives the interface display task, the GPU Driver obtains the cached value of the attribute information of the electronic device's memory instead of obtaining the attribute information of the electronic device's memory.

[0066] In some embodiments, the GPU Driver calls the GetPhysicalDeviceMemoryProperties2 function to obtain the cached value of the attribute information of the memory.

[0067] In some embodiments, the attribute information of the memory of a physical device describes the available memory heaps and memory types. Based on this, during the process of the GPU Driver obtaining the attribute information of the electronic device's memory, after the GPU Driver calls the GetPhysicalDeviceMemoryProperties2 function, the GPU Driver also needs to call multiple functions to read parameters such as the available memory heaps and memory types from the registers. It takes a certain amount of time for the GPU Driver to call multiple functions to read parameters from the registers.

[0068] The GPU Driver obtains the attribute information of the memory of the electronic device and caches it, which can enable the GPU Driver to cache parameters such as available memory heaps and memory types in the form of variables. To obtain the cached value of the attribute information of the memory of the electronic device, the GPU Driver can directly look up and obtain the variable, without having to call multiple functions to read parameters such as available memory heaps and memory types. In this way, the time taken to obtain the cached value of the attribute information of the memory of the electronic device by the GPU Driver is much less than the time taken to obtain the attribute information of the memory of the electronic device.

[0069] In some embodiments, pMemoryProperties can point to a variable containing parameters such as available memory heaps and memory types.

[0070] It can be seen from this that: by calling the GetPhysicalDeviceMemoryProperties2 function, the GPU Driver can obtain the cached value of the attribute information of the memory of the electronic device, which can reduce the call time of the WebViewFunctor::drawVk function and alleviate the problem of sliding jank caused by the long time taken for the rendering thread to continuously run the WebViewFunctor::drawVk function.

[0071] After receiving the interface display task, the GPU Driver can determine whether the browser application is a cold start. If the GPU Driver determines that the browser application is a cold start, it obtains the cached value of the attribute information of the memory.

[0072] In some embodiments, when the electronic device starts the browser application, it can first determine the start mode of the browser application. As described in the content of the three start modes of the foregoing application, the electronic device can determine the start mode of the browser application by detecting whether the process of the browser application and the Activity object of the browser application exist. If the electronic device detects that the process of the browser application and the Activity object of the browser application exist, it determines that the browser application is a cold start; otherwise, the electronic device determines that the browser application is not a cold start.

[0073] If the GPU driver determines that the browser application is not a cold start, i.e., the browser application is a warm start or a hot start, it does not obtain the cached value of the memory property information. Since the GPU driver can only obtain the cached value of the memory property information in the scenario of cold starting the browser application, based on this, the number of times the GetPhysicalDeviceMemoryProperties2 function is called and run is greatly reduced, reducing the time-consuming of the GetPhysicalDeviceMemoryProperties2 function being called and run, and further reducing the call time-consuming of the WebViewFunctor::drawVk function, solving the problem of long time-consuming of the rendering thread continuously running the WebViewFunctor::drawVk function, resulting in sliding jankiness.

[0074] It should be noted that during the running of the browser application, following the operations input by the user on the interface of the browser application, the electronic device can perform interface switching, that is, switch from one interface of the browser application to another interface. During the process of the electronic device switching the browser application interface, the browser application can also send an interface display task to the GPU driver through the view system, Hwui, Vulkan, Webview, and GPU DDK. When the GPU driver receives the interface display task, it does not obtain the cached value of the memory property information.

[0075] In some other embodiments, when the GPU driver receives the interface display task, it can determine that the browser application is a cold start, and the GPU driver can also obtain the property information of the electronic device memory. Since the GPU driver does not obtain the property information of the electronic device memory in the scenarios of warm start and hot start of the browser application, the number of times the GetPhysicalDeviceMemoryProperties2 function is called and run is greatly reduced, reducing the time-consuming of the GetPhysicalDeviceMemoryProperties2 function being called and run, and further reducing the call time-consuming of the WebViewFunctor::drawVk function, which can alleviate the problem of long time-consuming of the rendering thread continuously running the WebViewFunctor::drawVk function, resulting in sliding jankiness.

[0076] As can be seen from the above, the GPU Driver obtaining the cached value of the attribute information of the electronic device's memory can alleviate the problem of long time consumption caused by the rendering thread continuously running the WebViewFunctor::drawVk function, resulting in sliding jankiness; the GPU Driver obtaining the attribute information of the electronic device's memory in the scenario of cold starting an application can also alleviate the problem of long time consumption caused by the rendering thread continuously running the WebViewFunctor::drawVk function, resulting in sliding jankiness. The GPU Driver can obtain the cached value of the attribute information of the memory only in the scenario of cold starting a browser application, which can solve the problem of long time consumption caused by the rendering thread continuously running the WebViewFunctor::drawVk function, resulting in sliding jankiness.

[0077] After the inventor tested the solution provided in the embodiment of the present application on an electronic device, it was found that:

[0078] When the GPU Driver cold starts a browser application, it calls the GetPhysicalDeviceMemoryProperties2 function to obtain the cached value of the attribute information of the electronic device's memory. Compared with the GPU Driver calling the GetPhysicalDeviceMemoryProperties2 function to obtain the attribute information of the electronic device's memory, the call duration is reduced from the original 30 ms to 3 us. This solves 5% of the sliding jankiness problems in big data.

[0079] That is to say, the time consumption of the GPU Driver calling the GetPhysicalDeviceMemoryProperties2 function to obtain the attribute information of the electronic device's memory is at the millisecond level, while the time consumption of the GPU Driver calling the GetPhysicalDeviceMemoryProperties2 function to obtain the cached value of the attribute information of the electronic device's memory is at the microsecond level.

[0080] It should also be noted that after the GPU Driver obtains the cached value of the attribute information of the memory, it can also send the cached value of the attribute information of the memory to the GPU. In some embodiments, the cached value of the attribute information of the electronic device's memory can be sent to the GPU in the form of a structure including memoryTypeCount, memoryTypes, memoryHeapCount, and memoryHeaps.

[0081] After receiving the cached value of the attribute information of the electronic device's memory, the GPU can perform the operation of displaying the interface of the browser application based on the cached value of the attribute information of the electronic device's memory and the first information. Of course, the first information is necessary information for the GPU to display the interface of the browser application. For example, the priority of the GPU, which is used to indicate whether the GPU gives priority to processing the interface display task. The first information can also include data for image rendering, such as the size and texture of the image. The first information can be referred to in the relevant technical content.

[0082] Of course, since the cached value of the attribute information of the electronic device's memory is not necessary information during the process of the GPU displaying the interface of the browser application, in the scenario of a warm start or a cold start of the browser application, the GPU will not receive the cached value of the attribute information of the electronic device's memory, but can perform the operation of displaying the interface of the browser application based on the first information.

[0083] It can be seen from the above that: during the process of the electronic device starting the browser application or the shopping application, the electronic device can adopt Figure 3 the method shown to display the interface of the browser application or the shopping application, so as to avoid the problem of sliding jitter in the input operation on the interface of the browser application or the shopping application.

[0084] Figure 3 The display method shown includes the steps:

[0085] S201. Receive the start operation of the first application.

[0086] The first application refers to the browser application or a shopping application. The user inputs the operation of starting the first application, and the electronic device receives this operation.

[0087] S202. Determine whether a process needs to be started during the process of starting the first application.

[0088] After receiving the start operation of the first application, the electronic device can display the interface of the first application. Before displaying the interface of the first application, first determine whether a process needs to be started during the start process of the first application, so as to determine whether the first application belongs to a cold start. If the electronic device determines that a process needs to be started during the process of starting the first application, it is determined that the first application is a cold start, and steps S203 and S204 are executed. Otherwise, it is determined that the first application is not a cold start, and steps S205 and S206 are executed.

[0089] S203. Obtain the first information and the cached value of the attribute information of the memory.

[0090] The first information is as described above, which is the associated information for displaying the interface of the first application and is necessary information for displaying the interface of the first application.

[0091] S204. Display the interface of the first application based on the first information and the cached value of the memory attribute information.

[0092] After the electronic device obtains the first information and the cached value of the memory attribute information, it can display the interface of the first application based on the first information and the cached value of the memory attribute information.

[0093] S205. Obtain the first information.

[0094] If the first application is not a cold start, the electronic device does not need to obtain the cached value of the memory attribute information, can only obtain the first information, and through step S206, display the interface of the first application based on the first information.

[0095] S206. Display the interface of the first application based on the first information.

[0096] In some embodiments, after the first application is started and is in a running state, the user can input an operation to switch the interface of the first application. For example, if the first application is a shopping application, the user inputs an interface switching operation to control the electronic device to switch the display from the home page interface to the shopping cart interface. For the switched interface of the first application, before the electronic device displays the interface, it also does not need to obtain the cached value of the memory attribute information.

[0097] In some embodiments, when the user inputs a sliding operation on the interface of the first application, the electronic device also does not obtain the cached value of the memory attribute information.

[0098] It should also be noted that the method for obtaining the attribute information of the electronic device memory provided in the embodiments of the present application can also be applied to other software modules or other hardware components of the electronic device, and there are also behaviors of frequently obtaining the attribute information of the device memory in other software modules or other hardware components of the electronic device.

[0099] The electronic device mentioned in the above embodiments of the present application can be a mobile phone, a tablet computer, a personal digital assistant (PDA), a desktop, laptop, notebook computer, ultra-mobile personal computer (UMPC), a handheld computer, a netbook, and a wearable device, etc.

[0100] Taking a mobile phone as an example, Figure 4 This is a composition example of an electronic device provided in the embodiments of the present application. As Figure 4 shown, the electronic device 100 may include a processor 110, an internal memory 120, a display screen 130, and a sensor module 140, etc.

[0101] It should be understood that, for the convenience of understanding the embodiments of the present application, Figure 4 the electronic device 100 shown only includes some components related to the method for obtaining the attribute information of the memory of the electronic device provided in the embodiments of the present application. The electronic device provided in the embodiments of the present application may include more or fewer components than Figure 4 the electronic device 100 shown. That is to say, Figure 4 the electronic device 100 shown does not constitute a specific limitation on the electronic device provided in the embodiments of the present application.

[0102] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), and a video codec. A memory may also be provided in the processor 110 for storing instructions and data.

[0103] The internal memory 120 may be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 120. In some embodiments, the instructions stored in the internal memory 120 are for executing the method for obtaining the attribute information of the memory of the electronic device. The processor 110 may obtain the cache value of the attribute information of the memory when the browser application or the shopping application is running and when the browser or the shopping application is in cold start by executing the instructions stored in the internal memory 120.

[0104] In the sensor module 140, the pressure sensor 140A is used to sense pressure signals and can convert the pressure signals into electrical signals. The touch sensor 140B, also referred to as a "touch control device". The touch sensor 140B may be disposed on the display screen 130, and the touch sensor 140B and the display screen 130 form a touch screen, also referred to as a "touch control screen". The touch sensor 140B is used to detect touch operations acting thereon or nearby. The touch sensor may transmit the detected touch operation to the application processor to determine the type of touch event.

[0105] Another embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are run on a computer or a processor, the computer or the processor is caused to execute one or more steps in any of the above methods.

[0106] A computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0107] Another embodiment of the present application further provides a computer program product containing instructions. When the computer program product runs on a computer or a processor, the computer or the processor is caused to execute one or more steps in any of the above methods.

Claims

1. A display method, characterized in that, Including: Receiving a first operation by the user to start a first application; In response to the first operation, obtaining first information and attribute information of the memory, and displaying an interface of the first application based on the first information and the attribute information of the memory; Receiving a second operation by the user to start the first application within a first time period after the user exits the first application; In response to the second operation, obtaining second information, and displaying an interface of the first application based on the second information.

2. The display method according to claim 1, wherein The first information and the second information are associated information for displaying an interface of the first application.

3. The display method according to claim 1 or 2, characterized in that Before obtaining the first information and the attribute information of the memory, it further includes: determining that a process needs to be started during the startup process of the first application.

4. The display method according to any one of claims 1 to 3, characterized in that, Before obtaining the second information, it further includes: determining that no process needs to be started during the startup process of the first application.

5. The display method according to any one of claims 1 to 4, characterized in that It further includes: Receiving a third operation input by the user on the interface of the first application, where the third operation is used to switch the interface of the first application; In response to the third operation, obtaining third information, and displaying a switched interface of the first application based on the third information, where the third information is associated information for displaying the switched interface of the first application.

6. The display method according to claim 5, wherein Obtaining the first information and the attribute information of the memory includes: obtaining cache values of the first information and the attribute information of the memory.

7. The display method according to claim 6, wherein The time taken to obtain the cache value of the attribute information of the memory is at the microsecond level.

8. The display method according to claim 5 or 6, characterized in that During the process of obtaining the cache value of the attribute information of the memory, the electronic device does not call a function to read parameters saved in a register.

9. The display method according to any one of claims 5 to 8, characterized in that The cache value of the attribute information of the memory is saved in the form of a variable when the electronic device is powered on.

10. The display method according to any one of claims 1 to 9, characterized in that, Obtaining the first information and the attribute information of the memory includes: When the graphics processor driver of the electronic device receives an interface display task through the Vulkan three-dimensional graphics processing library, obtaining the first information and the attribute information of the memory.

11. An electronic device, characterized in that, Including: One or more processors, a memory, and a display screen; The memory and the display screen are coupled to the one or more processors, the memory is used to store a computer program, the computer program includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the display method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that, For storing a computer program, when the computer program is executed, it is specifically used to implement the display method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Display method, electronic device, and readable medium

    EP4752696A1

  • Display method, electronic device, and readable medium

    WO2025130054A1