Method for displaying interface and electronic device

By detecting and preloading the application's configuration file after a cold start using the pre-read module, the sluggish scrolling issue was resolved, achieving smoothness and memory optimization of the scrolling interface after a cold start.

CN120255761BActive Publication Date: 2026-04-24HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2023-12-27
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

After a cold start, the application experiences lag when scrolling through the interface within a preset time, affecting the user experience.

Method used

The pre-read module detects applications that meet specific conditions and preloads their matching configuration files, including files that need to be loaded within a preset time period after the application's cold start. These files are preloaded into the cache using native service modules or the kernel layer to avoid UI lag caused by increased IO wait time.

Benefits of technology

During the preset period after the application's cold start, the user's swiping of the interface avoids lag, improves the smoothness of interface swiping, and reduces memory consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120255761B_ABST
    Figure CN120255761B_ABST
Patent Text Reader

Abstract

The application provides a method for interface display and an electronic device, and relates to the terminal field. The application provides a method for interface display, which comprises the following steps: when a first application is cold started, detecting whether the first application belongs to an application in a pre-reading list; and if it is detected that the first application belongs to the application in the pre-reading list, preloading related files. By using the method in the application, when the interface of the application is in a sliding state, the problem of sliding lagging does not occur within a preset period of cold starting of the application in the electronic device, and the smoothness of interface sliding is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a method for displaying an interface and an electronic device. Background Technology

[0002] With the widespread use of mobile devices in daily life, users can use different types of applications to enrich their lives, such as video applications and shopping applications.

[0003] However, within a preset time (e.g., 2 minutes) after a certain application has been cold-started, the interface may experience lag when the user swipes or drags it, affecting the user experience. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method for displaying an interface and an electronic device, which avoids the problem of lag when the application interface is in a sliding state during a preset period after the application has been cold-started in the electronic device, thereby improving the smoothness of the interface sliding.

[0005] In a first aspect, this application provides a method for displaying an interface, applied to an electronic device. The electronic device includes a pre-reading module. The method includes: when the pre-reading module detects a cold start of a first application, detecting whether the first application belongs to a pre-reading list of applications. The pre-reading list is used to store application identification information of applications that meet a first condition. The first condition is that the application performs an operation to load files required by a first component during a first preset time period after the application's cold start and while the application's interface is in a sliding state; when the pre-reading module detects that the first application belongs to an application in the pre-reading list, instructing a Native service module to preload a configuration file matching the first component. The configuration file includes files that the first application needs to load during the first preset time period after the first application's cold start; and the Native service module, in response to the instruction of the pre-reading module, loads the configuration file corresponding to the pre-reading list.

[0006] In this way, within the first preset time period (e.g., 1 minute, 50 seconds) after a cold start on an electronic device (such as a mobile phone, tablet, smartwatch, or fitness tracker), if the user drags or quickly swipes the application's interface, causing the interface to be in a swiping state, and the application performs a file loading operation (e.g., when the interface is swiping), such as when the application initializes the WebView component, it needs to load a file page, leading to increased I / O wait time, blocking the application's UI thread, and causing the interface to lag. In this example, the electronic device can accurately identify applications that may experience interface lag issues within the first preset time period after a cold start based on a first condition: the application performs a file loading operation within the first preset time period after a cold start and when the application's interface is in a swiping state. For applications that meet the first condition, the pre-fetch module in the electronic device instructs the Native service module to obtain the configuration file, which is then pre-loaded by the Native service module. This configuration file includes files that the application needs to load, such as files that need to be loaded when the application initializes the WebView component. Because the Native service module preloads the files required by the application, applications meeting the first condition will not experience long I / O wait times or UI thread blocking issues due to the electronic device loading application files during the first preset period after a cold start (e.g., within 1 minute), even if the interface is scrolling. This avoids the problem of interface lag. Furthermore, the electronic device promptly identifies applications meeting the first condition, preventing interface lag and improving the smoothness of scrolling. For applications not meeting the first condition, preloading files is unnecessary, reducing information in configuration files and lowering memory consumption.

[0007] According to the first aspect, before the pre-reading module detects that the first application belongs to the pre-reading list, the method further includes: when the pre-reading module detects a cold start of the first application, detecting whether the first application belongs to the pre-reading list; when the pre-reading module detects that the first application does not belong to the pre-reading list, during a first preset time period of the first application's cold start, detecting whether the first application has performed the operation of loading the files required for the first component while the interface of the first application is in a sliding state; when the pre-reading module detects that the first application has performed the operation of loading the files required for the first component while the interface of the first application is in a sliding state, adding the application identification information of the first application to the pre-reading list.

[0008] In this way, if an electronic device detects that the first application is not in the pre-read list, it can determine whether the application's identification information (such as the application's package name) needs to be added to the pre-read list by checking whether the application meets the first condition. If the electronic device detects that the application meets the first condition, it adds the application's identification information to the pre-read list. This method can promptly identify applications that meet the first condition without manual operation, thus avoiding the problem of interface lag when the first application is launched again.

[0009] According to the first aspect, during the first preset time period of the first application's cold start, detecting whether the first application has performed the operation of loading the files required by the first component while the interface of the first application is in a sliding state includes: when the pre-reading module detects that the interface of the first application is in a sliding state, updating the sliding state of the first application to a first state, the first state being used to indicate that the interface of the application is in a sliding state; when the pre-reading module detects that the first application has performed the operation of loading the files required by the first component, obtaining the sliding state of the first application; when the pre-reading module detects that the sliding state of the first application is the first state, determining that the first application has performed the operation of loading files while the interface of the first application is in a sliding state.

[0010] In this way, when the pre-read module detects that the application's interface is in a swiping state, it records the application's swiping state; this allows the pre-read module to promptly obtain the swiping state of the first application when it detects that the first application has performed a file loading operation, reducing the judgment time.

[0011] According to the first aspect, the first component is a Webview component prefetching module that detects whether the first application has performed the operation of loading the files required by the first component. This includes: when the Activity Management Service (AMS) detects that the first service has been started, it sends a first detection result to the prefetching module. The first detection result is used to indicate that the first application has initialized the Webview component. When the prefetching module receives the first detection result, it determines that it has detected that the first application has performed the operation of loading the files required by the first component. In this way, when the application initializes the Webview component, the AMS starts the Webview service (i.e., WebviewService). When the AMS detects that the WebviewService has been started, it can determine that the application has initialized the Webview component. The AMS sends the detection result to the prefetching module, so that the prefetching module can know in a timely manner whether the first application has performed the operation of loading files.

[0012] According to the first aspect, the pre-reading module detects whether the interface of the first application is in a sliding state, including: a sliding detection module in the electronic device detects whether the interface of the first application has slid; when the sliding detection module detects that the interface of the first application has slid, it sends a second detection result to the pre-reading module, the second detection result indicating that the interface of the first application has slid; and when the pre-reading module receives the second detection result, it determines that the interface of the first application is in a sliding state. In this way, the sliding detection module in the electronic device monitors whether the interface has slid in real time and sends the detection result to the pre-reading module, enabling the pre-reading module to obtain the sliding state of the interface in a timely manner.

[0013] According to the first aspect, the method further includes: when the pre-reading module detects the electronic device booting up, it loads a configuration file matching the first component; the pre-reading module establishes a first correspondence between the pre-reading list and the first component; the pre-reading module sends the configuration file and the identification information of the first component to the Native service module; the Native service module saves the configuration file and binds the configuration file to the identification information of the first component. In this way, the pre-reading module obtains the configuration file required by the first component when the electronic device boots up and establishes a correspondence between the pre-reading list and the first component, enabling the pre-reading module to determine the component to be loaded by the application in the pre-reading list; the Native service module stores the configuration file and binds it to the identification information of the first component, thus making the configuration file correspond to the pre-reading list. That is, the pre-reading module can instruct the Native service module to load the configuration file corresponding to the pre-reading list. Furthermore, by pre-storing the configuration file, the application does not need to additionally obtain the required file; when the application meets the first condition, it is added to the pre-reading list, thus achieving the operation of pre-loading the configuration file quickly.

[0014] According to the first aspect, when the pre-read module detects that the first application belongs to the pre-read list, it instructs the Native service module to preload the configuration file corresponding to the pre-read list. This includes: the pre-read module determining the components to be loaded for the first application based on a first correspondence; the pre-read module sending the identification information of the components to be loaded and the pre-loading instruction to the Native service module; and the Native service module, in response to the pre-read module's instruction, loading the configuration file corresponding to the pre-read list, including: the Native service module obtaining the configuration file based on the identification information of the components to be loaded; and the Native service module loading the configuration file. Thus, after determining that the first application is an application in the pre-read list, the pre-read module can send the pre-loading instruction and the identification information of the components to be loaded for that application to the Native service module via a Socket, enabling the Native service module to load the files required by the first application in a timely manner.

[0015] According to the first aspect, the method further includes: when the sliding detection module detects that the interface of the first application has stopped sliding, it sends a third detection result to the pre-reading module, the third detection result indicating that the interface of the first application has stopped sliding; when the pre-reading module receives the third detection result, it updates the sliding state of the first application to a second state, the second state indicating that the application's interface is not in a sliding state. In this way, the pre-reading module updates the sliding state of the first application to the second state in a timely manner, avoiding duplicate addition of the first application's identification information to the pre-reading list.

[0016] Secondly, this application provides a method for displaying an interface, applied to an electronic device. The electronic device includes a pre-reading module. The method includes: when the pre-reading module detects a cold start of a first application, detecting whether the first application belongs to a pre-reading list of applications. The pre-reading list is used to store application identification information of applications that meet a first condition. The first condition is that the application performs a file loading operation during a first preset time period after the application's cold start and while the application's interface is in a sliding state; when the pre-reading module detects that the first application belongs to an application in the pre-reading list, instructing the kernel layer to preload a target file corresponding to the first application. The target file includes files that the first application needs to load during the first preset time period after the first application's cold start; and the kernel layer, in response to the instruction of the pre-reading module, loads the target file corresponding to the first application into the page cache.

[0017] In this way, within the first preset time period (e.g., 1 minute, 50 seconds) after a cold start on an electronic device (such as a mobile phone, tablet, smartwatch, or fitness tracker), if the user drags or quickly swipes the application's interface, the application's interface will be in a swiping state. While the application is in this swiping state (i.e., during the swiping process), if the application performs a file loading operation, such as when initializing a WebView component, it needs to load a file page, leading to increased I / O wait time, blocking the application's UI thread, and causing the interface to lag. In this example, the electronic device can accurately identify applications that will experience interface lag issues based on a first condition: the application performs a file loading operation within the first preset time period after a cold start and while the application's interface is in a swiping state. For applications that meet the first condition, the prefetch module in the electronic device instructs the kernel layer to retrieve the target file corresponding to that application. The kernel layer then loads this target file into the page cache, thereby reducing I / O operations and I / O wait times, and preventing the application's UI thread from being blocked. This ensures that even if the application meets the first condition and its interface is scrolled within a preset cold start period (e.g., within 1 minute), there will be no lag or stuttering. In this example, the kernel layer preloads the target file corresponding to the first application instead of retrieving a fixed configuration file, improving the flexibility of preloading and reducing redundant memory consumption. Furthermore, the electronic device can promptly identify applications that meet the first condition, thus preventing lag or stuttering during interface scrolling. For applications that do not meet the first condition, there is no need to preload files, reducing the information in the configuration file and lowering memory consumption.

[0018] According to the second aspect, before the pre-reading module detects that the first application belongs to the pre-reading list, the method further includes: when the pre-reading module detects a cold start of the first application, it checks whether the first application belongs to the pre-reading list; when the pre-reading module detects that the first application does not belong to the pre-reading list, within a first preset time period after the first application's cold start, it checks whether the first application has performed a file loading operation while the first application's interface is in a swiping state; when the pre-reading module detects that the first application has performed a file loading operation while the first application's interface is in a swiping state, it adds the application identification information of the first application to the pre-reading list. In this way, if the electronic device detects that the first application does not belong to the pre-reading list, it can check whether the application meets the first condition. If it does, it adds the identification information of the first application to the pre-reading list. This method can promptly add applications that meet the first condition to the pre-reading list, so that after the identification information of the first application is added to the pre-reading list, the first application can pre-load files during the next cold start, avoiding interface lag issues.

[0019] According to the second aspect, during the first preset time period of the first application's cold start, detecting whether the first application has performed a file loading operation while its interface is in a swiping state includes: when the pre-reading module detects that the first application's interface is in a swiping state, it updates the swiping state of the first application to a first state, which indicates that the application's interface is in a swiping state; when the pre-reading module detects that the first application has performed a file loading operation, it acquires the swiping state of the first application; when the pre-reading module detects that the first application's swiping state is the first state, it determines that the first application has performed a file loading operation while its interface is in a swiping state. In this way, when the pre-reading module detects that the application's interface is in a swiping state, it records the application's swiping state; when the pre-reading module detects that a file loading operation has been performed during the preset time period of the application's cold start, it can directly acquire the application's swiping state to determine whether the application meets the first condition; without requiring the pre-reading module to detect the application's swiping state in real time.

[0020] According to the first aspect, after adding the application identification information of the first application to the pre-read list, the method further includes: the pre-read module updating the learning state of the first application to a third state, whereby the third state indicates that the electronic device currently does not store file information of the target file; the pre-read module acquiring the learning state of the first application when it detects that the interface of the first application has stopped scrolling; when the pre-read module detects that the learning state of the first application is the third state, it instructs the kernel layer to acquire information of the file accessed by the first application during the interface scrolling process; and the kernel layer, in response to the instruction of the pre-read module, acquires the information of the file accessed by the first application during the interface scrolling process as the target file information and saves the target file information. In this way, the pre-read module updates the learning state of the first application to the third state, enabling the pre-read module to acquire information of the file accessed by the first application during the scrolling process based on the learning state of the first application when the page stops scrolling, thus avoiding repeated acquisition of information of the file accessed by the first application during the scrolling process.

[0021] According to the first aspect, the pre-read module instructs the kernel layer to obtain information about files accessed by the first application during the interface swiping process, including: the pre-read module sending learning information of the first application to the Native service module, the learning information including learning instructions and application information of the first application, the application information of the first application including process identification information and package name of the first application; the Native service module sending the learning information of the first application to the kernel layer; the kernel layer responding to the instruction of the pre-read module, obtaining information about files accessed by the first application during the interface swiping process and saving target file information, including: the kernel layer obtaining information about files accessed by the first application as target file information based on the process identification information of the first application; the kernel layer saving the target file information; the kernel layer determining the identification identifier of the target file information based on the package name and scenario information of the first application, the scenario information being the identification information of the business scenario in which the first application loads files within a first preset time period after cold start.

[0022] In this way, the kernel layer can accurately obtain the file information accessed by the first application during the swiping process through the process identification information of the first application. Using the target file information identified by the application's package name, the kernel layer can then accurately retrieve the corresponding target file based on the application's package name and scenario information. For example, if the first application loads a file when initializing the WebView component, this scenario information indicates the scenario in which the application initializes the WebView component during the swiping process. This scenario information can be set to either "Webview_fling" or simply "Webview". The kernel layer uses the application's package name and scenario information as identifiers for the target file information. This means that for the same application executing different file loading scenarios during the swiping process (such as loading the AssistCardEngine component), the kernel layer can store different file information.

[0023] According to the second aspect, after the pre-read module instructs the kernel layer to obtain the file information loaded by the first application during the interface swiping process, the method further includes: updating the learning state of the first application to a fourth state, which indicates that the electronic device has already stored the file information of the target file. In this way, the electronic device can avoid repeatedly storing the target file of the first application.

[0024] According to the second aspect, the method further includes: when the pre-reading module detects that the interface of the first application has stopped scrolling, it updates the scrolling state of the first application to a second state, wherein the second state indicates that the interface of the first application is not in a scrolling state. In this way, the pre-reading module updates the scrolling state of the first application to the second state in a timely manner, avoiding duplicate addition of the first application's identification information to the pre-reading list.

[0025] According to the second aspect, the pre-read module detects whether the first application has performed a file loading operation, including: when the Activity Management Service (AMS) detects that the first service has been started, it sends a first detection result to the pre-read module. The first detection result is used to indicate that the first application has initialized the WebView component; when the pre-read module receives the first detection result, it determines that the first application has performed a file loading operation. Thus, when the application initializes the WebView component, the AMS starts the first service (such as WebViewService). When the AMS detects that the first service has been launched, it can determine that the application has initialized the WebView component. The AMS then sends the detection result to the pre-read module, allowing the pre-read module to promptly know whether the first application has performed a file loading operation.

[0026] According to the second aspect, the pre-reading module detects whether the interface of the first application is in a sliding state, including: a sliding detection module in the electronic device detects whether the interface of the first application has slid; when the sliding detection module detects that the interface of the first application has slid, it sends a second detection result to the pre-reading module, the second detection result indicating that the interface of the first application has slid; and when the pre-reading module receives the second detection result, it determines that the interface of the first application is in a sliding state. In this way, the sliding detection module in the electronic device monitors whether the interface has slid in real time and sends the detection result to the pre-reading module, enabling the pre-reading module to obtain the sliding state of the interface in a timely manner.

[0027] Thirdly, this application provides an electronic device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the method of displaying an interface corresponding to the first aspect and any implementation thereof; or performs the method of displaying an interface corresponding to the second aspect and any implementation thereof.

[0028] The third aspect and any implementation thereof correspond to the first aspect and any implementation thereof, or the third aspect and any implementation thereof correspond to the second aspect and any implementation thereof. The technical effects corresponding to the third aspect and any implementation thereof can be found in the technical effects corresponding to the first aspect and any implementation thereof, or in the technical effects corresponding to the second aspect and any implementation thereof, and will not be repeated here.

[0029] Fourthly, this application provides a computer-readable medium for storing a computer program that, when the computer program is run on an electronic device, causes the electronic device to execute the interface display method corresponding to the first aspect and any implementation thereof, or to execute the interface display method corresponding to the second aspect and any implementation thereof. Attached Figure Description

[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is an illustrative diagram illustrating a scenario where the interface lags.

[0032] Figure 2 This is an illustrative diagram of a video application when a page swipe operation is received;

[0033] Figure 3 This is an exemplary hardware structure diagram of an electronic device;

[0034] Figure 4 This is an exemplary software structure block diagram of an electronic device;

[0035] Figure 5 This is an exemplary schematic diagram illustrating the interactions between modules in an electronic device during the process of adding an application to a pre-read list;

[0036] Figure 6 This is an exemplary schematic diagram illustrating the interactions between modules during the preloading of a configuration file in an electronic device.

[0037] Figure 7 This is a schematic diagram illustrating an example of a sliding interface on an electronic device;

[0038] Figure 8 This is an illustrative diagram of a swipe gesture;

[0039] Figure 9 This is an exemplary diagram illustrating the interaction between modules during the loading process of a file in an electronic device learning application.

[0040] Figure 10 This is an exemplary schematic diagram illustrating the interactions between modules during the preloading of a configuration file in an electronic device. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0043] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0044] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0045] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.

[0046] Before providing a detailed explanation of the embodiments of this application, the application scenarios in this application will be described first. For example... Figure 1 As shown in 1a, the phone's main interface 101 displays icons for various applications. In response to the user clicking the video application's icon, the phone launches the video application. The video application's display interface 102 is as follows... Figure 1 As shown in 1b, the interface 102 displays thumbnails of each short video. When a user clicks on a thumbnail in the interface 102, the video application responds to the user's click operation and plays the video corresponding to the clicked thumbnail.

[0047] In this example, if the video application has been running for less than 2 minutes, when the user inputs a swipe operation on interface 102, such as pressing their finger at point A on the screen and moving it towards point B, the phone should normally respond to the user's swipe operation by moving interface 102 from point A to point B. Here, the coordinates of point A on the display screen are (x1, y1), and the coordinates of point B on the display screen are (x2, y2). That is, the distance interface 102 moves is d1 = y2 - y1.

[0048] However, the interface 102 exhibited a scrolling lag, meaning that the interface did not move the distance d1, as shown in the image. Figure 1 As shown in 1c, the user's finger has moved from point A on the screen to point B on the phone screen, but the interface 102 has not moved from point A to point B, that is, the current interface swiping is laggy.

[0049] This application can be obtained Figure 1 A diagram illustrating the operations performed by each thread during the interface scrolling process in a mid-length video application.

[0050] like Figure 2 As shown in the diagram, there are two threads: the video application thread (com.xxx.ship11377) and the rendering thread (Render Thread 11667). Within one minute of the video application's cold start, the video application thread initializes the WebView component during the time interval from time c to time d. The rendering thread is used to draw the interface to be displayed in real time. For example, the rendering thread draws the frame images to be displayed in real time during the time interval from time a to time c. Figure 2 The vertical bars during the time interval from time a to time c represent the images rendered by that rendering thread. When the video application's thread initializes the WebView component (e.g., ...), ... Figure 2 The application shown initializes the WebView component at time c. This requires loading the necessary file pages for the WebView component. Since the WebView component requires a large number of file pages, this results in a long IO wait (iowait) time, blocking the application's UI thread (i.e., the rendering thread) from updating the user interface. Figure 2 As shown, the rendering thread waits for the video application's thread to initialize the Webview component between time c and time d. The UI thread cannot update the interface in time, resulting in a stuttering issue when scrolling on the terminal.

[0051] In other words, when an application cold starts, since there are no processes running in the foreground, the application needs to load necessary components, such as video applications, social applications, and chat applications, to initialize the WebView component. Within one minute of the application's cold start, if the user scrolls through the application's interface, the initialization of the WebView component within that minute, which requires loading numerous files, increases the I / O wait time, blocking the UI thread and causing the application's interface to lag.

[0052] In some embodiments, within one minute of an application's cold start, the application may also perform other file loading operations, such as loading the AssistCardEngine component, which is an auxiliary component within the application. During this one-minute period after a cold start, the application interface is in a scrolling state, and the application is performing the AssistCardEngine component loading operation. Due to the large number of files being loaded, the I / O wait time increases, blocking the UI thread and causing lag in the application interface's scrolling.

[0053] This application provides a method for displaying an interface, which is executed by an electronic device, such as a mobile phone, tablet, smartwatch, wristband, or in-vehicle computer. Within a first preset time period (e.g., 50 seconds, 60 seconds, 90 seconds) after launching a first application, if the electronic device detects that the first application belongs to a pre-read application list, it can pre-load a stored configuration file. In this example, during the scrolling process of the first application's interface, when the first application initializes the WebView component, the pre-loaded stored configuration file reduces the I / O wait time, avoids UI thread blocking, and thus prevents stuttering during interface scrolling.

[0054] Figure 3 This is a schematic diagram illustrating the structure of an electronic device 100 according to an embodiment of this application. It should be understood that... Figure 3 The electronic device 100 shown is merely an example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 3 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits. In this example, electronic device 100 is exemplified by a mobile phone.

[0055] Electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.

[0056] Figure 4 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0057] The application layer can include a series of application packages. For example... Figure 4 As shown, the application package can include applications such as short videos, camera, gallery, calendar, and SMS.

[0058] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0059] like Figure 4 As shown, the application framework layer can include an Activity Management Service (AMS). AMS is used to uniformly schedule application processes and manage the lifecycle of activities.

[0060] In addition, the application framework layer may also include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0061] The window manager manages windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots. The content provider stores and retrieves data, making it accessible to applications. This data can include video, images, audio, made and received calls, browsing history and bookmarks, phone books, etc. The view system is used to build applications. The phone manager provides communication functionality for electronic devices, such as managing call status (connection, termination, etc.). The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, video files, etc. The notification manager allows applications to display notifications in the status bar, conveying informational messages that can disappear automatically after a short pause without user interaction.

[0062] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0063] The system library may include a native layer for caching the mapping between application domain names and IP addresses, and setting the storage time and TTL of IP addresses.

[0064] The system library may also include multiple functional modules such as: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). Figure 4 (Not shown in the image).

[0065] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, sensor drivers, etc. For ease of understanding, the following embodiments in this application will use [specific examples / examples]. Figure 3 and Figure 4 Taking the electronic device with the structure shown as an example, and in conjunction with the accompanying drawings and application scenarios, the application startup method provided in this application embodiment will be specifically described.

[0066] The following is combined Figure 5 and Figure 6 This application provides a detailed description of the interface display method. The pre-read list in this application stores application identification information (such as the application's package name) for applications that require pre-loading of configuration files. When the pre-read module detects that the first application belongs to the pre-read list, it instructs the Native module to pre-load the configuration file. Figure 5 This is an illustrative diagram showing an electronic device adding application identification information of a first application to a pre-read list.

[0067] This example uses a mobile phone as an example of an electronic device, and takes the initialization of the WebView component within one minute after the first application's cold start as an example. Figure 5 The AMS, sliding monitoring module, and pre-read module are located in the application framework layer.

[0068] Step 5011: The pre-read module in the electronic device loads the preset configuration file.

[0069] In some embodiments, in response to a system update instruction, the mobile phone receives a configuration file matching the first component from the server, and the mobile phone stores the received configuration file. Optionally, this configuration file may be file information required by the same component (i.e., the first component) in different applications. For example, if the first component is a WebView component, the configuration file may be the file required by different applications when initializing the WebView component. That is, the file required by application A to initialize the WebView component is the same as the file required by application B to initialize the WebView component, where application A and application B are not the same application.

[0070] Optionally, the server can distribute configuration files corresponding to multiple components. For example, the prefetch module can receive the configuration file that the AssistCardEngine component needs to load and the configuration file that the Webview component needs to load for initialization.

[0071] In some embodiments, the mobile phone may also pre-store a configuration file. This configuration file can be a resource library that the application needs to access; for example, the format of the configuration file when the application initializes the WebView component might be as follows:

[0072] <webviewpreread>

[0073] <libxxx.so>

[0074] <Webviewxxx.apk>

[0075] < / webviewpreread>

[0076] In this example, "WebviewPreread" represents the name of the configuration file, "libxxx.so" is the filename of the static library, and "Webviewxxx.apk" represents the package name of the Webview component in the current application. This example is for illustrative purposes only; in actual applications, the configuration file may contain other information, such as permission information for the current application.

[0077] When the pre-read module detects the electronic device powering on, it can obtain the stored configuration file and execute step 5012.

[0078] In some embodiments, the prefetch module establishes a first correspondence between the first component and the configuration file. For example, if the prefetch module obtains the configuration file 1 of the Webview component, it can establish a correspondence between the Webview component and the prefetch list.

[0079] Optionally, the pre-fetch module can store multiple pre-fetch lists, each corresponding to a different component. For example, the first pre-fetch list might correspond to the WebView component, and the second pre-fetch list might correspond to the AssistCardEngine component. In other words, the applications stored in the first pre-fetch list meet the condition that, during a first preset time period of application cold start and while the application's interface is in a scrolling state, the application performs the operation of loading the files required by the WebView component. Similarly, the applications stored in the second pre-fetch list meet the condition that, during a first preset time period of application cold start and while the application's interface is in a scrolling state, the application performs the operation of loading the files required by the AssistCardEngine component.

[0080] In this example, the prefetch module is illustrated by saving a prefetch list.

[0081] Step 5012: The pre-read module sends the configuration file to the Native service module.

[0082] After determining the first correspondence between the first component and the configuration file, the pre-read module can send the identification information of the first component and the configuration file to the Native service module.

[0083] Step 5013: The Native service module maintains its configuration file.

[0084] Specifically, the Native service module receives the configuration file sent by the pre-read module and saves it. The Native service module can then bind this configuration file to the identification information of the first component, thus establishing a correspondence between the configuration file and the identification information of the first component.

[0085] After the electronic device completes steps 5011 to 5013, the Native service module saves the configuration file corresponding to the first component.

[0086] When the first application on the phone is launched, steps 5014 to 5022 can be executed; or steps such as Figure 6 The steps are shown in the figure.

[0087] Step 5014: The pre-read module obtains the application startup information.

[0088] Specifically, the phone responds to the user's input to launch a first application, and launches that first application, for example... Figure 7As shown in Figure 7a, when a user clicks the application icon, the phone responds to the click and launches the video application. It should be noted that the electronic device launches the application in this example using a cold start method. A cold start works as follows: when the phone launches an application, if there is no background process for that application, the system creates a new process and assigns it to the application. Then, based on the launch parameters, it launches the corresponding process components.

[0089] Once the phone's first application (application A) has completed its cold start, it can send application startup information to the pre-read module. This application startup information may include the application's package name. It may also include process identification information (process ID) of the application running in the foreground. After obtaining the application A startup information, the pre-read module can execute step 5015.

[0090] Step 5015: The pre-read module determines whether the first application is in the pre-read list. When it is detected that the first application is not in the pre-read list, it checks whether the first application has performed a swiping behavior.

[0091] Specifically, after obtaining the package name of the currently running application (Application A), the prefetch module compares this package name with the package names stored in the prefetch list. If the prefetch module detects that no package name matching Application A exists in the prefetch list, it checks whether to add the application's package name to the list. If it does, it adds the application's package name to the list. If it does not need to add the application's package name, the process ends. It should be noted that the prefetch list is empty when the phone is first booted or after a factory reset.

[0092] The process by which the prefetch module detects whether an application needs to be added to the prefetch list may include: the prefetch module detecting whether the application meets a first condition, which is that the application performed a file loading operation within a first preset time period after a cold start and while the application's interface is in a scrolling state. The first preset time period can be within 60 seconds or within 90 seconds.

[0093] The pre-read module detects whether the application meets the first condition by: acquiring the application's swiping state within a first preset time period; detecting whether the application has performed a file loading operation; and if a file loading operation is detected, determining whether the first condition is met based on the application's swiping state. Specific steps can be found in steps 5016 to 5022.

[0094] Step 5016: Application A responds to the swipe operation, and the page begins to swipe.

[0095] Specifically, application A (i.e., the first application) responds to the user's input swipe gesture by controlling the page swiping, that is, adjusting the position of the image to be displayed on the page. Optionally, the swipe gesture can include various types, such as drag gestures and quick swipe gestures. Drag gestures, such as... Figure 8 The gesture shown in (1) involves the user pressing their finger on the screen to move from one position to another. Quick swipe gestures include... Figure 8 As shown in (2), the user's finger quickly swipes across a short distance on the screen.

[0096] Step 5017: The sliding detection module detects that application A has slid, and notifies the pre-reading module that the interface of application A has slid.

[0097] Specifically, in response to the information acquisition request from the swipe detection module, application A transmits the position information of the currently displayed interface to the swipe detection module. After receiving the interface position information sent by application A, the swipe detection module can determine whether the interface of the currently running application has swiped based on this information. For example, the swipe detection module can detect whether the position of the displayed interface has changed (e.g., whether the coordinates of the midpoint of the interface have changed, or whether the coordinates of the position where the user presses on the interface have changed). If a change in the position of the displayed interface is detected, it is determined that the interface of the currently running application has swiped.

[0098] When the swipe detection module detects that the interface of the currently running application A has been swiped, it can send a notification to the pre-read module. This notification includes information that the interface of application A has been swiped.

[0099] Step 5018: The pre-read module records the swiping state of the application.

[0100] The pre-read module receives the notification sent by the swipe monitoring module and can record the swipe state of the application. For example, the pre-read module sets the swipe state of application A to true (i.e., the first state), where "true" indicates that the interface of application A is in a swipe state.

[0101] Step 5019: Application A initializes the Webview component.

[0102] Specifically, when application A's interface is in a scrolling state, due to the cold start method used by application A, application A will initialize the WebView component during the first preset time period of the cold start. The process of application initialization of WebView component will not be described in detail here.

[0103] Step 5020: AMS detects that the application is initializing the Webview component.

[0104] Specifically, when application A begins initializing the WebView component, AMS starts the "WebViewService" service. Based on this, in this example, AMS can detect whether the application is initializing the WebView component based on whether the "WebViewService" service is running. For example, if AMS detects that the "WebViewService" service is running, it determines that the application is initializing the WebView component; if AMS does not detect that the "WebViewService" service is running, it determines that the application is not initializing the WebView component.

[0105] In one example, AMS can detect whether the application is initializing the WebView component within a preset cold start time (such as 1 minute). When it detects that the application is initializing the WebView component, it sends a notification to the prefetch module to inform the prefetch module that the application is initializing the WebView component.

[0106] Step 5021: The AMS notification prefetch module detects the initial Webview component.

[0107] Specifically, after AMS detects that the application is initializing the Webview component, it notifies the prefetch module that the application is initializing the Webview component. This notification may include information indicating that the application is initializing the Webview component.

[0108] Step 5022: The prefetch module detects that the application is in a swiping state and adds the application to the prefetch list.

[0109] Specifically, after receiving a notification from AMS, the prefetch module can obtain the application's swipe state. When the prefetch module detects that the application's swipe state is "true", it adds the application's package name to the prefetch list. When the prefetch module detects that the application's swipe state is "false" (i.e., the second state), the process ends.

[0110] It should be noted that when the swipe detection module detects that application A has ended swiping, it can send a notification to the pre-read module indicating that application A has ended swiping. Upon receiving this notification, the pre-read module resets the swipe status of that application to false.

[0111] In this example, after the electronic device cold-starts the first application, the prefetch module in the electronic device can detect whether the first application is in the prefetch list. If the first application is not in the prefetch list, it checks whether the interface of the first application is in a scrolling state and is initializing the WebView component. When the prefetch module detects that the interface of the first application is in a scrolling state and is initializing the WebView component, it adds the package name of the first application to the prefetch list. This ensures that the next time the first application cold-starts, the prefetch module will detect that the first application is in the prefetch list and instruct the Native service module to preload the stored configuration file, thus avoiding interface lag during a preset period after the first application cold-starts.

[0112] The following is combined Figure 6 Specifically, explain the interaction process between modules when the first application is among the applications in the pre-read list.

[0113] Step 6011: The pre-read module obtains the application startup information.

[0114] Specifically, after application A completes its cold start, it can send application startup information to the pre-read module. This application startup information may include the application's package name. It may also include the process ID of the application running in the foreground. After obtaining the application A startup information, the pre-read module can execute step 6012.

[0115] Step 6012: The pre-read module determines whether the first application is an application in the pre-read list. When the first application is detected to be an application in the pre-read list, step 6013 is executed.

[0116] After obtaining the package name of the currently running application A, the prefetch module compares the package name of application A with the package names in the prefetch list. When the prefetch module detects a package name in the prefetch list that is the same as that of application A, it determines that application A is an application in the prefetch list. When the prefetch module determines that application A is an application in the prefetch list, it can proceed to step 6013.

[0117] Step 6013: The pre-read module sends the identification information of the components to be loaded in application A to the Native service module.

[0118] Specifically, the pre-read module can determine the identification information of the component to be loaded in application A based on the stored first correspondence, and send the identification information of the component to be loaded in application A to the Native service module. The Native service module obtains the configuration file bound to the component to be loaded based on the identification information of the component to be loaded in application A, that is, executes step 6014.

[0119] For example, the pre-read module determines that the component to be loaded in application A is a Webview component, obtains the identification identifier of the Webview component, and sends the identification identifier of the Webview component and the loading instruction to the Native service module. The Native service module responds to the loading instruction, finds the corresponding configuration file based on the identification identifier of the Webview component, and loads the obtained configuration file.

[0120] Step 6014: Preload configuration files for Native service modules.

[0121] Specifically, native service modules can preload configuration files using the mmap command. This preloading reduces I / O wait time, allowing the UI thread to render the interface normally, thus preventing stuttering during scrolling.

[0122] Figure 7 This is a schematic diagram illustrating an example of an electronic device employing the interface display method of this application.

[0123] The phone has executed steps 5011 to 5022, meaning that the pre-read module has added the package name of the video application to the pre-read list, the phone's Native service module has stored the configuration file corresponding to the pre-read list, and the pre-read list stored in the Native service module has been updated (i.e., the pre-read list in the Native service module includes the package name of the video application).

[0124] like Figure 7 As shown in Figure 7a, when a user clicks the video application icon on the phone's home screen 701, the phone responds to the click and launches the video application. The phone's pre-read module detects that the video application is on the pre-read list and instructs the Native service module to load the configuration file. Within one minute of the video application's cold start, as... Figure 7 As shown in 7b, when a user presses point A on interface 702 and slides their finger from point A to point B, the interface slides normally without any lag or stuttering. Figure 7 As shown in 7c, interface 703 displays normally without any lag.

[0125] The configuration files stored in the native service module are fixed files, and the same configuration files are preloaded by different applications. This results in a large amount of content in the configuration files stored by the native service module, which is redundant relative to the configuration files of any particular application, leading to high memory consumption. In some embodiments, to reduce the consumption of redundant memory on the phone, the native service module can store configuration files corresponding to different applications.

[0126] The following is combined Figure 9 and Figure 10 The method of displaying the interface in this application shall be described in detail.

[0127] Figure 9 This is an illustrative diagram showing how to add the application identification information of the first application to the pre-read list and store the corresponding target file.

[0128] Step 9011: The pre-read module obtains the application startup information.

[0129] Specifically, the phone launches the application in response to the user's input to launch the application. The application launch method mentioned in this example is a cold start. After the phone's application A completes its cold start, it can send application launch information to the pre-read module. This application launch information may include the application's package name and process ID. After obtaining the application A launch information, the pre-read module can execute step 9012.

[0130] Step 9012: The pre-read module determines whether the first application is in the pre-read list. When it is detected that the first application is not in the pre-read list, it checks whether the first application has performed a swiping behavior.

[0131] Step 9013: Application A responds to the swipe operation, and the page begins to swipe.

[0132] Step 9014: The sliding detection module detects that application A has slid, and notifies the pre-reading module that the interface of application A has slid.

[0133] Step 9015: The pre-read module records the swiping state of the application.

[0134] Step 9016: Application A initializes the Webview component.

[0135] Step 9017: AMS detects that the application is initializing the Webview component.

[0136] Step 9018: The AMS notification prefetch module detects the initial Webview component.

[0137] Step 9019: The prefetch module detects that the application is in a swiping state and adds the application to the prefetch list.

[0138] Steps 9012 to 9019 are largely the same as steps 5015 to 5022, and can be referred to the relevant descriptions in steps 5015 to 5022, which will not be repeated here.

[0139] Step 9020: The pre-read module sets the learning status of the application to true.

[0140] Specifically, after the prefetching module adds the application to the prefetching list, it can set the application's learning state to true (i.e., the third state). This true learning state indicates that the application meets the first condition and the phone has not stored information about the files accessed by the application during swiping. For example, in this example, true indicates that the first application meets the first condition, and the kernel layer has not yet stored information about the files accessed by the first application during swiping. When the learning state is false (i.e., the fourth state), it indicates that the prefetching module does not need to control the kernel layer to obtain information about the files required by the application to initialize the WebView component.

[0141] Step 9021: The sliding detection module detected the sliding of the end screen of application A.

[0142] Specifically, the swipe detection module monitors in real time whether the interface of application A has swiped. When it detects that the interface of application A has not swiped within a second preset time period, it determines that the swiping of the interface of application A has ended, and step 9022 can be executed. The second preset time period can be shorter than the first preset time period, such as 2 seconds, 5 seconds, 10 seconds, 20 seconds, etc.

[0143] Step 9022: The sliding monitoring module notifies the pre-reading module A that the application has finished sliding the interface.

[0144] Specifically, the swipe detection module can send a notification to application A, which includes information about whether a swipe has occurred on the current screen of application A. In this example, the notification sent by the swipe detection module to application A indicates that the current screen of application A has ended the swipe.

[0145] Step 9023: After receiving the notification from the sliding monitoring module, the pre-reading module determines whether the current application is in a learning state. If the application is detected to be in a learning state, then step 9024 is executed.

[0146] Specifically, after receiving a notification from the swipe monitoring module, the pre-read module resets the application's swipe state to false. The pre-read module can also obtain the application's learning state; if it detects that the application's learning state is true, it can proceed to step 9024. If the pre-read module detects that the learning state is false, it terminates the current process.

[0147] Step 9024: The pre-read module sends the information learned by the application to the Native service module.

[0148] Specifically, the pre-read module can send the information learned by the application to the Native service module via Socket. This information may include the application's process ID and package name.

[0149] Step 9025: The Native service module sends the learning information and learning commands of the application to the kernel layer.

[0150] Specifically, after receiving the learning information, the Native service can send the application's learning information and the command instructing the kernel layer to learn to the kernel layer via ioctl.

[0151] Step 9026: The kernel layer maintains the file page information of the application in the sliding scenario.

[0152] Specifically, the kernel layer can traverse the file information accessed by the application process based on the process ID (this can be understood as file mapping). The kernel layer obtains the file information accessed by the application process and retrieves information about the file pages associated with the WebView. For example, the kernel layer can search for information containing preset keywords from the accessed file information and use the found information as the file page information associated with the WebView; the keyword can include WebView. The target file information stored by the kernel layer can record the file's inode and the address offset information for accessing the file.

[0153] When the kernel layer saves the target file information, it can determine the key-value pair of the file information based on the application's package name. Optionally, the kernel layer can use the application's package name as the key for the application's file information. For example, if application A's package name is "com.example.appname", the key for the application's file information can be "com.example.appname", and the file information can be used as the value in the key-value pair.

[0154] Optionally, the kernel layer can also use the package name plus a keyword of the usage scenario as the keyword for the application's file information. For example, the preloaded scenario is to initialize the WebView component when the interface of application A is in a scrolling state; the package name of application A is obtained as "com.example.appname", and "Webview_fling" is used as the scenario name for initializing the WebView component. The kernel layer uses the package name of application A and the scenario name for initializing the WebView component to obtain the keyword "com.example.appname_Webview_fling" for the file information of application A; special symbols such as "_" and "+" can be used for combination. Another example is to preload the AssistCardEngine component within one minute of application A's startup while the application's interface is in a scrolling state. The scenario name can be "AssistCardEngine_fling", the package name of application A is "com.example.appname", and the kernel layer uses "com.example.appname_AssistCardEngine_fling" as the identification information for the stored target file information.

[0155] The kernel layer sets a corresponding keyword for each file information so that when the application performs a cold start next time, it can use the keyword to find the preloaded file information, obtain the target file to be loaded based on the file information, and load the target file into the page cache.

[0156] In this example, the electronic device detects that the application that is cold-started is not in the pre-read list. It checks whether the application meets the pre-loading conditions. If it does, the application is added to the pre-read list and the file information required for the application to be pre-loaded is saved. This allows the application to pre-load the stored file information the next time it is cold-started, thus avoiding the problem of lag when the interface is scrolling after the next cold start.

[0157] Figure 10 This example illustrates the interaction process between modules after the package name of the first application is added to the prefetch list.

[0158] Step 1011: The pre-read module obtains the application startup information.

[0159] Step 1012: The pre-read module determines whether the first application is an application in the pre-read list. When the first application is detected to be an application in the pre-read list, step 1013 is executed.

[0160] Steps 1011 to 1012 are largely the same as steps 6011 to 6012. Please refer to the relevant descriptions in steps 6011 to 6012. They will not be repeated here.

[0161] Step 1013: The pre-read module sends the application's information to the Native service module.

[0162] Specifically, when the prefetch module detects that the first application belongs to the prefetch list, it can send the process ID and package name of the first application to the Native service module via Socket.

[0163] Step 1014: The Native service module sends the preloaded commands and application information of the application to the kernel layer.

[0164] Specifically, after receiving the process ID and package name of the first application, the Native service module can send preload commands and application information to the kernel layer. The application information includes the process ID and package name of the first application. Optionally, the Native service module can send preload commands and application information to the kernel layer via ioctl.

[0165] Step 1015: The kernel layer loads the file plane into the page cache.

[0166] Specifically, in response to a read-ahead command, the kernel layer can obtain the package name from the application information. Based on the package name of the first application and the current scene name, the kernel layer determines the keywords for the read-ahead information. For example, if the package name of the first application is "com.example.appname" and the current scene name is "Webview_fling", the kernel layer combines the package name and scene name to obtain the keyword "com.example.appname_Webview_fling". The kernel layer then uses this keyword to retrieve the target file information corresponding to that keyword. Optionally, the kernel layer can execute a readahead command to obtain the target file based on the target file information and load the target file into the page cache, reducing the I / O wait time and allowing the UI thread to draw the interface normally, thus displaying the drawn interface on the screen in a timely manner.

[0167] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, 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 in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0168] This application also provides a chip system 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 an electronic device). As another example, the interface circuit can be used to send signals to other devices (e.g., the processor). 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 electronic 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.

[0169] This embodiment also provides a computer storage medium storing computer instructions. When these computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the interface display method described in the above embodiment. The storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0170] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the interface display method described in the above embodiment.

[0171] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding interface display method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.

[0172] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.

[0173] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for displaying an interface, characterized in that, Applied to an electronic device, the electronic device including a pre-read module, the method includes: When the pre-reading module detects a cold start of the first application, it checks whether the first application belongs to the pre-reading list. The pre-reading list is used to store application identification information of applications that meet a first condition. The first condition is that the application performs the operation of loading the files required by the first component during a first preset time period of application cold start and when the interface of the application is in a sliding state. When the pre-read module detects that the first application belongs to the application in the pre-read list, it instructs the Native service module to preload the configuration file that matches the first component. The configuration file includes the files that the first application needs to load during the first preset time period after the first application's cold start. The Native service module responds to the instruction of the prefetch module by loading the configuration file corresponding to the prefetch list.

2. The method according to claim 1, characterized in that, Before the prefetch module detects that the first application belongs to the prefetch list, the method further includes: When the pre-read module detects a cold start of the first application, it checks whether the first application belongs to the pre-read list. When the pre-reading module detects that the first application is not among the applications in the pre-reading list, it detects whether the first application has performed the operation of loading the files required by the first component while the interface of the first application is in a sliding state during the first preset time period of the first application's cold start. When the pre-read module detects that the first application has performed the operation of loading the file required by the first component while the interface of the first application is in a sliding state, it adds the application identification information of the first application to the pre-read list.

3. The method according to claim 2, characterized in that, During the first preset time period of the first application's cold start, it is detected whether the first application has performed the operation of loading the files required by the first component while the interface of the first application is in a scrolling state, including: When the pre-reading module detects that the interface of the first application is in a sliding state, it updates the sliding state of the first application to a first state, which is used to indicate that the interface of the application is in a sliding state. When the pre-read module detects that the first application has performed the operation of loading the files required by the first component, it obtains the sliding state of the first application. When the pre-read module detects that the first application is in a first state of sliding, it determines that the first application has performed the operation of loading the files required by the first component while the interface of the first application is in a sliding state.

4. The method according to claim 3, characterized in that, The first component is a Webview component; The pre-read module detects whether the first application has performed the operation of loading the files required by the first component, including: When the Activity Management Service (AMS) detects that the WebView service has been started, it sends a first detection result to the pre-read module. The first detection result is used to indicate that the first application has initialized the WebView component. When the pre-read module receives the first detection result, it determines that the first application has performed the operation of loading the files required by the first component.

5. The method according to claim 3, characterized in that, The pre-read module detects whether the interface of the first application is in a scrolling state, including: The sliding detection module in the electronic device detects whether the interface of the first application has been slid. When the sliding detection module detects that the interface of the first application has been slid, it sends a second detection result to the pre-reading module. The second detection result is used to indicate that the interface of the first application has been slid. When the pre-reading module receives the second detection result, it determines that the interface of the first application is in a sliding state.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: When the pre-read module detects that the electronic device is powered on and started, it loads a configuration file that matches the first component. The pre-read module establishes a first correspondence between the pre-read list and the first component; The pre-read module sends the configuration file and the identification information of the first component to the Native service module; The Native service module saves the configuration file and binds the configuration file to the identification information of the first component.

7. The method according to claim 6, characterized in that, When the pre-read module detects that the first application belongs to the pre-read list, it instructs the Native service module to preload the configuration file corresponding to the pre-read list, including: The pre-read module determines the components to be loaded in the first application based on the first correspondence relationship; The pre-read module sends the identification information of the component to be loaded and the pre-loading instruction to the Native service module; In response to the instruction from the prefetch module, the Native service module loads the configuration file corresponding to the prefetch list, including: In response to the preloading instruction, the Native service module obtains the configuration file based on the identification information of the component to be loaded. The Native service module loads the configuration file.

8. The method according to claim 5, characterized in that, The method further includes: When the sliding detection module detects that the interface of the first application has stopped sliding, it sends a third detection result to the pre-reading module. The third detection result is used to indicate that the interface of the first application has stopped sliding. When the pre-reading module receives the third detection result, it updates the sliding state of the first application to the second state, which indicates that the application's interface is not in a sliding state.

9. A method for displaying an interface, characterized in that, Applied to an electronic device, the electronic device including a pre-read module, the method includes: When the pre-reading module detects a cold start of the first application, it checks whether the first application belongs to the pre-reading list. The pre-reading list is used to store application identification information of applications that meet a first condition. The first condition is that the application performs a file loading operation during a first preset time period of application cold start and when the application's interface is in a sliding state. When the pre-read module detects that the first application belongs to the application in the pre-read list, it instructs the kernel layer to preload the target file corresponding to the first application. The target file includes the file that the first application needs to load during a first preset time period after the first application's cold start. In response to the instruction of the prefetch module, the kernel layer loads the target file corresponding to the first application into the page cache.

10. The method according to claim 9, characterized in that, Before the prefetch module detects that the first application belongs to the prefetch list, the method further includes: When the pre-read module detects a cold start of the first application, it checks whether the first application belongs to the pre-read list. When the pre-reading module detects that the first application is not among the applications in the pre-reading list, it detects whether the first application has performed a file loading operation while the interface of the first application is in a sliding state within a first preset time period after the first application has been cold started. When the pre-read module detects that the first application has performed a file loading operation while the interface of the first application is in a swiping state, it adds the application identification information of the first application to the pre-read list.

11. The method according to claim 9, characterized in that, Within a first preset time period after the first application's cold start, it is detected whether the first application performed a file loading operation while its interface was in a scrolling state, including: When the pre-reading module detects that the interface of the first application is in a sliding state, it updates the sliding state of the first application to a first state, which is used to indicate that the interface of the application is in a sliding state. When the pre-read module detects that the first application has performed a file loading operation, it obtains the sliding state of the first application. When the pre-read module detects that the first application is in a first state of sliding, it determines that the first application has performed a file loading operation while the interface of the first application is in a sliding state.

12. The method according to claim 10, characterized in that, After adding the application identification information of the first application to the pre-read list, the method further includes: The pre-read module updates the learning status of the first application to a third status, which indicates that the electronic device does not currently store file information of the target file. When the pre-reading module detects that the interface of the first application has stopped scrolling, it obtains the learning status of the first application. When the pre-read module detects that the learning state of the first application is the third state, it instructs the kernel layer to obtain information about the files accessed by the first application during the interface swiping process. In response to the instruction of the pre-read module, the kernel layer obtains information about the files accessed by the first application during the interface swiping process as target file information and saves the target file information.

13. The method according to claim 12, characterized in that, The pre-read module instructs the kernel layer to obtain information about the files accessed by the first application during the interface swiping process, including: The pre-read module sends the learning information of the first application to the Native service module. The learning information includes learning instructions and application information of the first application. The application information of the first application includes process identification information of the first application and package name of the first application. The Native service module sends the learning information of the first application to the kernel layer; In response to the instruction of the pre-read module, the kernel layer obtains information about the files accessed by the first application during the interface swiping process and saves the target file information, including: The kernel layer obtains information about the files accessed by the first application as target file information based on the process identification information of the first application. The kernel layer stores the target file information; The kernel layer determines the identification identifier of the target file information based on the package name and scenario information of the first application. The scenario information is the identification information of the business scenario in which the first application loads files within a first preset time period after a cold start.

14. The method according to claim 12, characterized in that, After the pre-read module instructs the kernel layer to obtain file information loaded by the first application during interface scrolling, the method further includes: The learning state of the first application is updated to a fourth state, which indicates that the electronic device has stored the file information of the target file.

15. The method according to claim 11, characterized in that, The method further includes: When the pre-reading module detects that the interface of the first application has stopped scrolling, it updates the scrolling state of the first application to a second state, which indicates that the interface of the first application is not in a scrolling state.

16. The method according to claim 10, characterized in that, The pre-read module detects whether the first application has performed a file loading operation, including: When the Activity Management Service (AMS) detects that the first service has been started, it sends a first detection result to the pre-read module. The first detection result is used to indicate that the first application has initialized the Webview component. When the pre-read module receives the first detection result, it determines that the first application has performed a file loading operation.

17. The method according to claim 10, characterized in that, The pre-read module detects whether the interface of the first application is in a scrolling state, including: The sliding detection module in the electronic device detects whether the interface of the first application has been slid. When the sliding detection module detects that the interface of the first application has been slid, it sends a second detection result to the pre-reading module. The second detection result is used to indicate that the interface of the first application has been slid. When the pre-reading module receives the second detection result, it determines that the interface of the first application is in a sliding state.

18. An electronic device, characterized in that, include: A memory and a processor, wherein the memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the electronic device to perform the interface display method according to any one of claims 1 to 17.

19. A computer-readable storage medium comprising a computer program, characterized in that, When the computer program is run on an electronic device, it causes the electronic device to perform the interface display method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Method for preloading file page, electronic equipment and chip system

    CN115858047A