Application startup method and device
By initializing application modules on demand, the problem of high startup load and large memory consumption under the direct function access method is solved, and more efficient application startup performance and memory management are achieved.
Patent Information
- Application Number
- PCT/CN2026/093712
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-16
- Filing Date
- 2026-04-28
- Publication Date
- 2026-11-19
AI Technical Summary
Existing technologies cannot effectively initialize application modules on demand when launching applications via direct function access, resulting in high startup load and large memory consumption.
Instead of full initialization, the application modules required by the target page are determined and initialized in response to different startup entry points. This is achieved by combining pre-configured matching rules and dependencies to achieve on-demand initialization.
It reduces the load when the application starts, improves startup performance, reduces memory usage, and enhances the flexibility and accuracy of memory management.
Smart Images

Figure CN2026093712_19112026_PF_FP_ABST
Abstract
Description
An application launch method and device
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202510637669.X, filed on May 16, 2025, entitled "An Application Launching Method and Device", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of computer technology, and in particular to an application startup method and device. Background Technology
[0004] User applications generally refer to programs that run on a device's operating system and provide specific services to users; they are often simply called "applications." Application packages typically support modular development. When an application starts, it usually needs to execute some initialization tasks to initialize the application modules and support its operation.
[0005] As electronic devices become increasingly feature-rich, various ways to directly access functions can be provided. These methods include: interacting with cards on the device's home screen, using voice assistants to invoke commands, sharing, managing notifications, or using shortcuts. Similarly, application launches can offer multiple entry points. Besides the traditional method of clicking the application icon, applications can also be launched via direct function access.
[0006] However, triggering application launch via direct function access typically displays the corresponding page directly, requiring only the initialization of a subset of modules without the need for full module initialization. Therefore, how to implement on-demand initialization of application modules is of significant research importance. Summary of the Invention
[0007] This application provides an application startup method and device to initialize application modules on demand according to the way the application is triggered to start, thereby reducing the load during application startup, improving application startup performance, and reducing memory usage.
[0008] Firstly, this application provides an application launch method applicable to a device. The method includes: in response to a first operation of launching a first application via a first entry point, determining a first target page; wherein the first entry point is used to directly jump to the first target page; initializing M application modules related to the first target page, the application including N application modules, the M application modules being configured as modules for displaying the first target page, where M is less than N; and displaying the first target page.
[0009] This method allows for the on-demand initialization of application modules based on the application startup method, thereby reducing the application startup load, improving application startup performance, and reducing memory usage.
[0010] In one possible scenario, the method further includes any of the following scenarios:
[0011] Scenario A: After initializing the M application modules or after displaying the first target page, initialize O application modules. The N application modules include the M application modules and the O application modules, and the O application modules include the application module that displays the homepage.
[0012] Scenario B: In response to the second operation of switching the first target page, the O application modules are not initialized; wherein, the second operation includes: returning to the desktop, switching to the second application, or exiting the first application.
[0013] In this scenario, the M application modules required by the first target page and the remaining modules included in the application are initialized at different times, or the remaining modules not needed by the first target page are not initialized. This allows application modules to be initialized according to the needs of the target page in scenarios where a non-homepage interface is displayed via direct access. Compared to full initialization of application modules, this reduces the load at application startup, improves application startup performance, and reduces memory usage.
[0014] In one possible scenario, initializing the M application modules related to the first target page includes: obtaining a matching rule from the application startup parameters of the first application, wherein the matching rule is pre-stored and used to indicate the M application modules; or, sending a request message to the first application and determining the M application modules based on the response message of the first application; wherein the request message is used to obtain the matching rule.
[0015] In this scenario, by pre-configuring the mapping between matching rules and application modules, the modules required by the first target page can be determined after obtaining the matching rules from the startup parameters of the first target page. This allows for on-demand initialization of application modules without requiring a full initialization, thereby reducing the load during application startup, improving startup performance, and lowering memory usage.
[0016] In one possible scenario, the matching rule corresponds to M1 application modules, which are application modules directly associated with the first target page; the M1 application modules also include M2 indirectly associated application modules, which are used to indicate the application modules that are depended upon by any of the M1 application modules.
[0017] In this scenario, the automatic loading of dependent application modules ensures the accuracy of the first target page's display. Furthermore, configuring application modules directly associated with the first target page in the matching rules reduces the configuration load.
[0018] In one possible scenario, the method further includes: pre-initializing L application modules corresponding to a second target page according to a pre-initialization instruction from the first application, wherein the second target page is a next-level page predicted to switch from the first target page, or a page that can be directly accessed based on the predicted operation of the first control on the first target page, and the L application modules are a portion of the N application modules included in the first application; or, pre-initializing L application modules corresponding to the second target page according to learning from historical initialization behaviors.
[0019] In this scenario, an implementation method for pre-initializing application modules is also provided, which facilitates flexible memory management and ensures the normal operation of critical tasks such as those running in the foreground.
[0020] In one possible scenario, the method further includes: determining that the L application modules have been initialized in response to an operation of switching from the first target page to the second target page.
[0021] In this scenario, the pre-initialization process can speed up the switching efficiency when actually switching to the second target page.
[0022] In one possible scenario, the method further includes: in response to an operation of switching to a third target page, initializing M' application modules associated with the third target page, wherein the third target page is different from the second target page, and the M' application modules are a portion of the N application modules included in the first application.
[0023] In this scenario, even if the pre-initialized application module is different from or not exactly the same as the application module required by the actual third target page, the application module required by the third target page can be initialized when actually switching to the third target page, which can also ensure the accuracy of the switching.
[0024] In some possible examples, the pre-initialization in this application can also be determined based on memory availability. For example, when there is ample remaining memory, the pre-initialization of the application module is performed; while when there is limited remaining memory, the pre-initialization of the application module is not performed, thereby avoiding increased memory pressure.
[0025] In one possible scenario, the method further includes: reclaiming a portion of application modules based on a memory waterline; wherein the memory waterline is used to indicate the maximum usage of the memory pool, and the portion of application modules includes at least one of the following: pre-initialized but unused application modules, application modules marked as reclaimable, and application modules that are no longer in use.
[0026] In this scenario, a method for intelligent recycling of application modules is also provided, which facilitates flexible memory management. This not only ensures the normal operation of critical tasks such as those running in the foreground, but also reduces the probability of background applications being completely cleared.
[0027] In one possible scenario, the recycling of some application modules is carried out according to the following priority: application modules marked as recyclable; pre-initialized but unused application modules; and application modules that are no longer in use.
[0028] In this scenario, the priority of application modules can be used to indicate the probability that an application module may continue to be used. Prioritizing the recycling of modules with a higher probability of not being used can improve the accuracy of memory management.
[0029] In one possible scenario, the step of recycling some application modules based on the memory threshold includes: when the memory threshold is less than a first memory threshold, recycling of application modules that meet the conditions begins; when the memory threshold is detected to be greater than a second memory threshold, recycling of application modules that meet the conditions stops; wherein the second memory threshold is greater than or equal to the first memory threshold.
[0030] In this scenario, flexible recycling of application modules based on memory waterlines enables dynamic memory management. This not only ensures the normal operation of critical tasks such as those running in the foreground, but also reduces the probability of background applications being completely deleted.
[0031] In one possible scenario, the first target page is a second-level or third-level page. This can also be understood as the first target page not being the homepage of the first application. In this scenario, where the application's second-level or third-level page is directly displayed through some direct access method, the methods provided in any of the above scenarios can be used to initialize the application's modules on demand, thereby reducing the application's startup load, improving startup performance, and reducing memory usage.
[0032] Secondly, this application provides an application launch method that can be applied to a device. The method includes: displaying an application card of a first application on the desktop; initializing M application modules related to a first target page in response to a first operation on the application card; wherein the application card is used to directly jump to the first target page; the first application includes N application modules, and the M application modules are configured to display the first target page, where M is less than N; and displaying the first target page.
[0033] In one possible scenario, the method further includes: after initializing the M application modules or displaying the first target page, initializing O application modules, wherein the N application modules include the M application modules and the O application modules, and the O application modules include the application module that displays the homepage; or, in response to a second operation of switching the first target page, not initializing the O application modules; wherein the second operation includes: returning to the desktop, switching to a second application, or exiting the first application.
[0034] In one possible scenario, the method further includes: in response to an operation of switching from the first target page to the second target page, initializing L application modules related to the second target page, wherein the L application modules are a portion of the N application modules included in the first application.
[0035] In one possible scenario, the first target page is not the homepage of the first application. For example, the first target page is a second-level or third-level page.
[0036] Thirdly, this application also provides an apparatus comprising: at least one memory and at least one processor; wherein the at least one memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the at least one processor, the apparatus causes to perform the method in the first aspect and any possible scenario of the first aspect, or to perform the method in the second aspect and any possible scenario of the second aspect.
[0037] Fourthly, this application also provides an application launching device, which includes a module / unit for executing the methods described in the first aspect and any possible scenario of the first aspect, or a module / unit for executing the methods described in the second aspect and any possible scenario of the second aspect. These modules / units can be implemented in hardware or by hardware executing corresponding software.
[0038] Fifthly, a computer-readable storage medium is provided, which stores a computer program (also referred to as code or instructions) that, when executed on a computer, causes the computer to perform the methods described in the first aspect and any possible scenario of the first aspect, or to perform the methods described in the second aspect and any possible scenario of the second aspect.
[0039] Sixthly, a computer program product is provided, comprising: a computer program (also referred to as code or instructions), which, when executed, causes the method in the first aspect and any possible scenario of the first aspect to be executed, or the method in the second aspect and any possible scenario of the second aspect to be executed.
[0040] A seventh aspect also provides a graphical user interface on a device, the device having a display screen, one or more memories, and one or more processors, the one or more processors being configured to execute one or more computer programs stored in one or more memories, the graphical user interface including a graphical user interface displayed when the device executes the first aspect of the present application and any possible scenario in the first aspect, or a graphical user interface displayed when the device executes the second aspect of the present application and any possible scenario in the second aspect.
[0041] It should be noted that the beneficial effects of the devices provided in the second to seventh aspects of this application in various scenarios should be referred to the beneficial effects of any possible scenario in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0042] Figure 1A is one of the interface display diagrams for direct access to functions;
[0043] Figure 1B is a second example of an interface display for direct access to functions;
[0044] Figure 1C is the third interface display diagram of a function that allows direct access;
[0045] Figure 1D is the fourth diagram of an interface display for direct access to functions;
[0046] Figure 1E is the fifth diagram of an interface display for direct access to functions;
[0047] Figure 2 is a schematic diagram of the hardware architecture of a device provided in an embodiment of this application;
[0048] Figure 3 is a software system architecture block diagram of a device provided in an embodiment of this application;
[0049] Figure 4 is a schematic diagram of a scenario provided by an embodiment of this application;
[0050] Figure 5 is a schematic diagram of the sports and health module provided in an embodiment of this application;
[0051] Figure 6A is a scenario example diagram of an application launch method provided in an embodiment of this application;
[0052] Figure 6B is an example diagram of another scenario of an application launch method provided in an embodiment of this application;
[0053] Figure 7 is a flowchart illustrating an application startup method provided in an embodiment of this application;
[0054] Figure 8 is an example diagram of pre-initialization provided in an embodiment of this application;
[0055] Figure 9 is an example diagram of recycling provided in an embodiment of this application;
[0056] Figure 10 is another flowchart illustrating an application startup method provided in an embodiment of this application;
[0057] Figure 11 is another flowchart illustrating an application startup method provided in an embodiment of this application. Detailed Implementation
[0058] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0059] (1) The at least one involved in the embodiments of this application includes one or more; wherein, multiple means two or more. Furthermore, it should be understood that in the description of this specification, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order. For example, the first startup task and the second startup task do not represent their relative importance or order, but are merely for descriptive distinction. In the embodiments of this application, "and / or" merely describes the relationship, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0060] (2) The directional terms mentioned in the embodiments of this application, such as “up,” “down,” “left,” “right,” “inner,” and “outer,” are only for reference to the directions in the accompanying drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of this application, rather than indicating or implying that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0061] (3) References to “one embodiment,” “in some examples,” or “some embodiments” as described in this specification mean that one or more embodiments of this specification include the specific features, structures, or characteristics described in connection with that embodiment. Therefore, the phrases “in some examples,” “in one embodiment,” “in some embodiments,” “in other embodiments,” “in still other embodiments,” etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean “one or more, but not all, embodiments,” unless otherwise specifically emphasized. The terms “comprising,” “including,” “having,” and variations thereof mean “including, but not limited to,” unless otherwise specifically emphasized.
[0062] (4) Application module refers to the components of an application, and may also be simply referred to as a module in this embodiment. Typically, an application may include modules that can implement various functions or carry different code and resources. Modular development can improve the efficiency of application development.
[0063] For example, application modules can be function packages, shared packages, shared library files, etc. For example, the shared library can be an .so file.
[0064] (5) Startup tasks refer to a series of initialization tasks that are typically executed when an application starts, which can initialize application modules. For example, a startup task can be used to initialize an application module. In addition, the execution order and dependencies of startup tasks can be configured, for example, through the dependencies between application modules.
[0065] In this context, application module initialization can be understood as the application module being ready to run, such as being able to display a page and refresh the page. In this embodiment, the operation of the application module is not limited and can be determined according to actual business needs.
[0066] In one alternative approach, the operating system can provide a startup framework. This framework offers a simple and efficient way to launch applications, supporting asynchronous task startup and accelerating application startup. Furthermore, by uniformly configuring the execution order and dependencies of multiple startup tasks in a single configuration file, the code executing these tasks becomes more concise, clear, and easier to maintain.
[0067] (6) Direct access to functions refers to triggering a specific function on an electronic device directly through a quick operation, without having to manually open the application and click through the steps. This method greatly improves efficiency and is especially suitable for frequently used functions, such as payment, QR code scanning, and navigation. Currently, electronic devices can provide direct access to functions in various ways.
[0068] For example, multiple applications on electronic devices can provide the function of creating cards on the desktop. These cards can display some information about the application or provide some functions of the application. By operating the card, users can directly jump to the page corresponding to the card, without having to manually operate the homepage of the application corresponding to the card to jump to the target page. For example, Figure 1A shows an interface display diagram of direct function access. As shown in (A) of Figure 1A, a sports and health application can provide a sports card 100A, which can be displayed on the desktop. In response to the click operation on the sports card 100A in (A) of Figure 1A, the mobile phone can directly jump to the interface shown in (B) of Figure 1A, which is used to display the sports page of the sports and health application.
[0069] For example, by waking up the voice assistant in an electronic device, users can invoke commands through dialogue with the voice assistant, thus directly jumping to the page corresponding to the command, without displaying the homepage of the application and requiring the user to manually navigate to the target page. For instance, Figure 1B shows another interface display for direct function access. As shown in (A) of Figure 1B, the phone responds to the voice command 100B collected by the voice assistant and directly jumps to the interface shown in (B) of Figure 1B. The voice command 100B could be, for example, "View the payment bill of the payment application," as shown in (B) of Figure 1B, which displays the details page of the payment bill.
[0070] Alternatively, through sharing operations between applications, it's possible to directly jump to the target application's share-receiving interface without displaying the homepage of the application corresponding to the sharing operation, requiring the user to manually navigate to the target page. For example, Figure 1C shows another interface display diagram for direct function access. As shown in Figure 1C(A), this can be a sharing interface triggered by a sharing operation. In response to the sharing operation on page 100C, the phone directly jumps to the interface shown in Figure 1C(B). Here, Figure 1C(B) shows the chat box page, which includes message 100D. Message 100D instructs the user to send page 100C from Figure 1C(A) to the chat partner.
[0071] Alternatively, for example, an electronic device can directly jump to the interface corresponding to a notification message in the notification bar in response to an operation, without displaying the homepage of the application corresponding to the notification and requiring the user to manually jump to the target page. For example, Figure 1D shows another interface display diagram of direct function access. As shown in (A) of Figure 1D, the notification bar may include chat message 100E; in response to the click operation on chat message 100E in (A) of Figure 1D, the mobile phone can directly jump to the interface shown in (B) of Figure 1D, which is used to display the chat page, for example, the chat interface may include new message 100F.
[0072] For example, the lock screen or notification bar of an electronic device can provide shortcuts. In response to a user's action on a shortcut, the screen can directly jump to the interface corresponding to that shortcut, without displaying the homepage of the application to which the shortcut belongs, requiring the user to manually navigate to the target page. For instance, Figure 1E shows another interface display for direct access to a function. As shown in Figure 1E(A), the notification bar can include a scan shortcut 100G for a payment app; in response to a click on the scan shortcut 100G in Figure 1E(A), the phone can directly jump to the interface shown in Figure 1E(B), which displays the QR code scanning page.
[0073] (7) The entry point for launching the application can include traditional launch methods, such as clicking on the icon displayed on the desktop of the electronic device; or launch methods corresponding to the content of the function access introduction, such as clicking on the sports card as shown in Figure 1A, calling the intent of the voice assistant as shown in Figure 1B, triggering the sharing operation as shown in Figure 1C, operating on the notification message as shown in Figure 1D, and operating on the shortcut as shown in Figure 1E, etc.
[0074] Given that different application startup points require different application modules, how to achieve on-demand initialization of application modules is a topic worthy of study.
[0075] In view of this, embodiments of this application provide an application startup method and device. In this method, in response to an operation to launch an application through a first entry point, a target page is displayed; based on the target page, M application modules out of N application modules are determined to be initialized. Here, the first entry point is triggered via a direct function access method; N is the number of modules included in the application, and M is the number of modules required by the target page, where M is less than N. Thus, in scenarios where the target page of the application is directly displayed via a direct function access method, initialization can be performed only according to the application modules required by the target page, without needing to initialize all application modules. This reduces the load during application startup, improves application startup performance, and reduces memory usage.
[0076] The technical solutions in this application embodiment can be applied to devices, and the device can be any device capable of installing application packages. For example, the device can be a mobile phone, tablet computer, wearable device (e.g., watch, bracelet, etc.), in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), smart home device (e.g., smart TV, smart speaker, etc.), etc., that can run application packages. It is understood that this application embodiment does not impose any limitations on the specific type of device.
[0077] The devices to which this application embodiment can be applied, and exemplary embodiments may include, but are not limited to, those equipped with... Or devices with other operating systems. The aforementioned devices can also be other devices, such as laptops with touch-sensitive surfaces (e.g., touch panels).
[0078] Figure 2 illustrates a possible hardware structure of the device. As shown in Figure 2, the device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, antenna 1, antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an accelerometer sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.
[0079] Processor 210 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. Processor 210 may serve as the central nervous system and command center of device 200. Processor 210 can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In this embodiment, processor 210 can, in response to launching an application through a first entry point, determine M application modules associated with the first entry point, thereby initializing the M application modules; wherein the M application modules are a portion of the N application modules included in the application.
[0080] The wireless communication function of device 200 can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 250 can provide wireless communication solutions including 2G / 3G / 4G / 5G for device 200. Wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies for device 200. In this embodiment, based on the wireless communication function of device 200, application packages can be obtained from a server, thereby enabling the download of application packages.
[0081] The display screen 294 is used to display the application's interface, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the device 200 may include one or N display screens 294, where N is a positive integer greater than 1. In this application embodiment, the display screen 294 can be used to display the relevant interface of the application after startup, such as the target interface corresponding to the function direct access; this application does not limit the displayed interface.
[0082] Internal memory 221 can be used to store computer executable program code, including instructions. Processor 210 executes various functional applications and data processing of device 200 by running the instructions stored in internal memory 221. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application. The data storage area may store data generated during the use of device 200 (e.g., images, videos, etc.). Furthermore, internal memory 221 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. In this embodiment, internal memory 221 can be used to store application packages.
[0083] Touch sensor 280K, also known as a "touch panel," can be located on display screen 294. The touch sensor 280K and display screen 294 together form a touchscreen, also known as a "touchscreen." Touch sensor 280K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 294. In other embodiments, touch sensor 280K may also be located on the surface of device 200, in a different position than display screen 294. For example, in this embodiment, touch sensor 280K can receive a user's operation to launch an application via function direct access through display screen 294, which can then be transmitted to processor 210 to execute application launch processing.
[0084] It is understood that the components shown in Figure 2 do not constitute a specific limitation on the mobile phone. The mobile phone may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements. In the following embodiments, the device 200 shown in Figure 2 is used as an example for description.
[0085] The operating system (OS) involved in this application embodiment is the most basic system software running on device 200. The software system of device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment takes an operating system adopting a layered architecture as an example to illustrate the software system architecture of device 200.
[0086] Figure 3 is a block diagram of the software system architecture of a device according to an embodiment of this application. As shown in Figure 3, the software system architecture of the device can be a layered architecture, for example, the software can be divided into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into five layers, from top to bottom: application layer, application framework layer (framework, FWK), runtime and system library, kernel layer, and hardware layer.
[0087] The application layer can include a series of application packages and various user interaction entry points. As shown in Figure 3, the application layer can include camera, settings, third-party applications, etc. Third-party applications can include fitness and health apps, payment apps, music apps, call apps, video apps, memo apps, etc. In this embodiment, the application layer can also include, but is not limited to, the following user interaction entry points: cards, shortcuts, notification bars, voice assistants, etc. These user interaction entry points can also be used to call the application programming interface (API) provided by the application framework layer.
[0088] Taking a sports and health app as an example, a sports and health app can provide a variety of possible interaction methods, including but not limited to: shortcuts, which can be used to jump to the health app for processing; intents, which can be used to jump to the health app for processing via a voice assistant; cards, which can be used to jump to the health app for processing via cards; and notifications, which can be used to jump to the health app for processing via notifications displayed in the notification bar.
[0089] The application package for a sports and health app can include N application modules, such as module 1, ..., module N. When an application module is initialized, it can be initialized via a startup task. The initialization process of the startup task can be executed by the application framework layer.
[0090] In addition, the application package for sports and health can also include a startup task configuration file, which is used to indicate the dependencies between modules. For example, if module A depends on the initialization of module B before it can be initialized, then according to the startup task configuration file, it can be determined that module B will be initialized first and then module A will be initialized.
[0091] In one possible implementation, the application can be developed using a programming language and completed by calling APIs provided by the application framework layer. Developers can then interact with the underlying operating system layers (such as the hardware layer and kernel layer) through the application framework layer to develop their own applications. This application framework layer primarily consists of a series of services and management systems within the operating system.
[0092] The application framework layer provides application programming interfaces and a programming framework for applications within the application layer. The application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer may include an activity manager, window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0093] The Activity Manager manages the lifecycle of each application and provides commonly used navigation and back functions, offering an interactive interface for all program windows.
[0094] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0095] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.
[0096] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0097] The phone manager is used to provide communication functions for the device, such as managing call status (including connection, hang-up, etc.).
[0098] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0099] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0100] The runtime consists of the core libraries and the virtual machine. The runtime is responsible for the scheduling and management of the operating system. The core libraries consist of two parts: one part contains the functionalities that the programming language needs to call, and the other part is the core libraries of the operating system. The application layer and application framework layer run in the virtual machine. The virtual machine executes the programming files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0101] The system library can include multiple functional modules. For example: surface manager, media framework, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.
[0102] The Surface Manager is used to manage the display subsystem and provides the blending of two-dimensional and three-dimensional layers for multiple applications.
[0103] The media framework supports playback and recording of various commonly used audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, and AMR; and multiple image file formats, such as JPG and PNG.
[0104] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0105] A 2D graphics engine is a drawing engine for 2D drawing.
[0106] In some embodiments, a 3D graphics processing library can be used to draw 3D motion images, and a 2D graphics engine can be used to draw 2D motion images.
[0107] The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver. In this embodiment, the display driver can be used to display a target page that is directly accessed via a function call.
[0108] The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, and touch sensors.
[0109] Typically, a device 200 can run multiple applications simultaneously. In a simpler scenario, one application corresponds to one process; in a more complex scenario, one application can correspond to multiple processes. Each process has a unique process ID.
[0110] It should be understood that the hardware structure of the device can be as shown in Figure 2, and the software system architecture can be as shown in Figure 3. The software programs and / or modules corresponding to the software system architecture in the device can be stored in the internal memory 221. The processor 210 can run the software programs and applications stored in the internal memory 221 to execute the process of an application startup method provided in the embodiments of this application.
[0111] To facilitate understanding of the application startup method provided in this application, the implementation process of the method provided in this application will be described below with reference to the content shown in Figures 4 to 9.
[0112] First, the terms that may be used in the following embodiments will be introduced for easy distinction:
[0113] (1) N application modules refer to the modules included in the application. Where N represents the maximum number of modules included in the application.
[0114] (2) M application modules refer to the application modules required by the target page. It can be understood that M represents the number of modules initialized on demand as determined by the scheme provided in the embodiments of this application. M is usually less than N. It can be understood that the specific number of application modules required for different target pages may differ, and the specific number of M is not limited in the embodiments of this application.
[0115] Optionally, the M application modules may include the following directly related modules and indirectly related modules.
[0116] (3) Directly related modules refer to modules that are directly related to the target page, such as M1 application modules. For example, if the target page displays a map, the directly related modules may include the map module.
[0117] (4) Indirectly related modules refer to modules that the initialization of directly related modules depends on. For example, this can be represented as M² application modules. For instance, the target page is directly related to module A but not directly related to module B. Since the initialization of module A depends on module B, the M application modules corresponding to the target page include both module A and module B. For example, module A is the map module and module B is the database module. Although the target page is not directly related to the database module, the database module still needs to be initialized because the map module depends on the database module.
[0118] It is understandable that M equals the sum of M1 and M2.
[0119] (5) O application modules, used to indicate whether to delay initialization or not initialization of application modules after initialization of M application modules or display of the target page, including application modules that display the homepage.
[0120] In some possible examples, the delayed initialization of O application modules could include scenarios triggered in response to page switching, scenarios triggered based on pre-initialization rules, and scenarios not triggered in response to page switching. For example, when the application displays another interface from a directly accessed target page, the O application modules required for that interface can be initialized in response to the operation of displaying the other interface; in this case, the O application modules can be all or some of the remaining application modules. Alternatively, the O application modules can be initialized after a specified period of initialization of M application modules; these O application modules can be all or some of the remaining application modules. It can be understood that in this example, N is greater than or equal to the sum of M and O.
[0121] In other possible examples, if no page switch is detected, the O application modules may not need to be initialized. For example, in response to an action on the target page indicating that the application should switch to the background or exit, the remaining modules may not need to be initialized; where the action may include: returning to the desktop, switching to a second application, or exiting the application. In this example, N can be equal to the sum of M and O.
[0122] (6) L application modules, used to indicate pre-initialized modules. In this embodiment, the size relationship between L and M is not limited and can be determined according to the actual business scenario. Wherein, L is less than N.
[0123] For example, if the scenario involves O application modules triggered by pre-initialization rules, then O equals L. In other scenarios, the relationship between L and O is not fixed and can be determined based on the actual business scenario.
[0124] (7) P application modules, used to indicate the modules to be recycled. P is less than N, and P can be determined according to the actual business scenario.
[0125] The method provided in this application embodiment can be applied to scenarios where an application is launched via direct function access. In this scenario, the target page of the application can be directly displayed based on the direct function access method, and this target page is related to M application modules. The method provided in this application embodiment can initialize the M application modules based on the displayed target page. It can be understood that the remaining application modules out of the N application modules (excluding the M modules) can be initialized with a delay or not initialized at all.
[0126] It should be noted that the embodiments of this application do not limit the target page to include only some application modules. This can be determined based on business requirements; some target pages may require all application modules. The following embodiments use the example of a target page needing to initialize N application modules out of M application modules.
[0127] For ease of understanding, Figure 4 is a schematic diagram of a scenario provided by an embodiment of this application. As shown in Figure 4, three possible application launch entry points are used as examples:
[0128] (1) Desktop icon launch entry, usually used to display the application's home page. It can be understood that displaying the application's home page usually requires initializing all N application modules included in the application. For example, in Figure 4, the application includes modules 1 to 8. In the scenario of launching the application through the desktop image launch entry, all application modules need to be initialized.
[0129] (2) The card-based jump-start entry is a type of direct function access method, typically used to display the target page corresponding to the card. For example, the target page corresponding to the card is usually not the application homepage, but a page within the application. This page may only be related to a portion of the application modules included in the application, so only M application modules need to be initialized. For instance, the target page jumped to through the card-based jump-start entry in Figure 4 may be related to modules 5 and 6, so only modules 5 and 6 need to be initialized.
[0130] Another example is that indirectly related modules can be obtained by using the dependencies between modules recorded in the startup task configuration file. As shown in Figure 4, modules 5 and 6 do not have any dependent modules, so no additional modules need to be initialized.
[0131] (3) Intent-based launch entry is also a type of direct function access method, typically used to display the target page corresponding to the intent. For example, the target page corresponding to the intent is usually not the application homepage, but a page within the application. This page may only be related to a portion of the application modules included in the application, so only M application modules need to be initialized. For instance, if the target page jumped to through the intent-based launch entry in Figure 4 can be directly associated with module 4, then module 4 needs to be initialized.
[0132] Another example is that indirectly related modules can be obtained by using the dependencies between modules recorded in the task configuration file. As shown in Figure 4, the initialization of module 4 depends on the initialization of module 8. Therefore, in addition to initializing module 4, module 8 also needs to be initialized. Thus, the modules that need to be initialized in this scenario include module 4 and module 8.
[0133] Taking a sports and health application as an example, Figure 5 is a schematic diagram of the sports and health module provided in an embodiment of this application. As shown in Figure 5, the sports and health application may include the following modules:
[0134] (1) The application entry point refers to common modules that must be included in the application entry point regardless of the page. For example, it may include: a logging module, a container module, a database module, and a configuration module.
[0135] The logging module can be used to record application logs, which facilitates application debugging, error location, and runtime status monitoring.
[0136] Container modules can be used for page layout, component lifecycle management, or initialization of modular views.
[0137] The database module can be used to read data.
[0138] The configuration module is used to implement global configuration management for the application, such as reading configuration files and dynamically switching themes.
[0139] (2) The homepage section (the displayed page; not all target pages are required) may include: account module, end-to-cloud synchronization module, map module, location module, NFC module, badge module, and web module. Among these,
[0140] The account module is used to indicate the user account logged in on the sports and health application, such as handling login, registration, and personal information management.
[0141] The end-to-cloud synchronization module is used to achieve bidirectional data synchronization between local devices and cloud servers, ensuring consistency across multiple devices.
[0142] The map module is used to provide maps.
[0143] The positioning module is used to determine the device's current location. For example, it can be combined with a map module to display the current location on a map.
[0144] The Near Field Communication (NFC) module provides near field communication functionality, supporting the reading and writing of NFC tags or interaction with other devices, such as access control and file transfer.
[0145] The badge module provides a user achievement system, such as displaying badges, levels, or rewards, which can motivate users to participate in interactive activities, such as participating in exercise check-ins.
[0146] The World Wide Web (WWW) module is used to initialize H5 pages or interact with Web services.
[0147] Based on the modules included in the sports and health application as shown in Figure 5, the following are some examples of directly displaying the target page of sports and health through function access methods.
[0148] Example 1: Sports cards
[0149] For example, Figure 6A is a scenario example diagram of an application launch method provided in an embodiment of this application. As shown in Figure 6A(A), this is the desktop of a mobile phone, including a sports card 100A from a sports and health application. In Figure 6A(A), in response to an operation on the sports card 100A, M application modules are initialized, and Figure 6A(B) is displayed; wherein, the M application modules are configured to display the modules shown in Figure 6A(B). As shown in Figure 6A(B), the page may include information such as a map 600A and user account information 600B. Based on this, as shown in Figure 6A(C), the relevant M application modules in this example, in addition to including the modules included in the application entry module in Figure 5, also need to include the following modules from the homepage section in Figure 5: account module, end-to-cloud synchronization module, map module, and location module. In addition to the required modules, the NFC module, badge module, and Web module can be initialized with a delay, for example, after the initialization of the M application modules or after displaying (B) in Figure 6A; or, if the user does not perform any further operations on the interface, the NFC module, badge module, and Web module may not be initialized.
[0150] Example 2: Intent to invoke activity record
[0151] For example, Figure 6B is another scenario example diagram of an application launch method provided by an embodiment of this application. As shown in Figure 6B(A), the desktop of the mobile phone includes a semi-modal window for displaying the voice assistant page. In Figure 6B(A), in response to the received voice command 600C, M application modules are initialized, and Figure 6B(B) is displayed; wherein, the M application modules are configured to display the modules shown in Figure 6B(B). As shown in Figure 6B(A), the voice command 600C can be, for example, "Open the activity record page of Sports Health". As shown in Figure 6B(B), the page may include information such as user account information 600D. Based on this, as shown in Figure 6B(C), the relevant M application modules in this example, in addition to including the modules included in the application entry module in Figure 5, also need to include the account module and the end-to-cloud synchronization module in the homepage section of Figure 5. In addition to the required modules, the map module, positioning module, NFC module, badge module, and web module can be initialized with a delay, for example, after the initialization of the M application modules or after displaying (B) in Figure 6B; or, if the user does not perform any further operations on the interface, the map module, positioning module, NFC module, badge module, and web module may not be initialized.
[0152] It should be noted that Figures 6A and 6B are only possible examples. The modules required for different pages are not limited in the embodiments of this application, and can be determined according to business needs or pre-configuration.
[0153] Based on the descriptions in Figures 4 to 6B above, the following describes the processing flow of the device-based application startup method provided in this application, in order to illustrate how the method provided in this application can achieve the aforementioned processing effect, thereby reducing the load when starting the application, improving application startup performance, and reducing memory usage.
[0154] For example, Figure 7 is a flowchart illustrating an application startup method provided in an embodiment of this application. This method can be applied to a device, specifically in scenarios involving device startup tasks. The process of this method may include:
[0155] Step 701: In response to the operation of launching the application through the first entry point, determine the target page; wherein, the first entry point is triggered by the function direct access method.
[0156] In some examples, the target page is not the application's homepage. For instance, the target page could be a second-level or third-level page within the application. For example, the interface shown in Figure 1A is not the homepage for the health and fitness app, but rather a fitness page, which could be a second-level or third-level page; similarly, the interface shown in Figure 1B is not the homepage for the payment application, but rather a detailed payment bill page, which could be a second-level or third-level page; or, as shown in Figures 1C to 1E, none of the interfaces are the application's homepage, but rather second-level or third-level pages.
[0157] The direct access methods can include, but are not limited to: jumping via clicking on a card, as shown in Figure 1A; jumping via intent recognized by voice commands, as shown in Figure 1B; jumping triggered by sharing, as shown in Figure 1C; jumping triggered by interacting with a notification message, as shown in Figure 1D; and jumping triggered by interacting with a shortcut, as shown in Figure 1E. Combining Figures 1A to 1E, directly jumping to the target page via an entry point avoids multiple user steps from the homepage, reducing operational complexity. Based on this scenario, and considering that the target page typically requires fewer application modules than the homepage, the implementation process described later can be used to initialize the M application modules required by the target page, thereby improving application startup performance in this scenario.
[0158] Step 702: Initialize M application modules related to the target page, wherein the M application modules are a portion of the N application modules included in the application.
[0159] For example, M application modules can be identified in a variety of ways.
[0160] Method (A): Determine M application modules from the application startup parameters.
[0161] In some possible implementations, matching rules indicating the correspondence between pages and application modules can be pre-stored; it is understood that the application modules that a page needs to initialize can be determined based on the matching rules. The modules corresponding to the matching rules are fixed, while the pages corresponding to the matching rules are not fixed. Optionally, a page can correspond to multiple matching rules, and different matching rules can be associated with different modules. Alternatively, multiple pages can correspond to the same matching rules, and the modules associated with the same matching rules are the same; this can also be understood as multiple pages being associated with the same modules. For ease of understanding, see Table 1 below:
[0162] Table 1
[0163] As shown in Table 1 above, page 1 can correspond to both matching rule 1 and matching rule 2, meaning one page can correspond to multiple matching rules. Furthermore, not only page 1 can correspond to matching rule 1, but page 2 can also correspond to matching rule 1, meaning multiple pages can correspond to the same matching rule.
[0164] In this embodiment, when a page corresponds to multiple matching rules, the matching rules can be obtained from the application startup parameters. For example, if matching rule 1 and matching rule 2 are directly obtained from the application startup parameters, the associated application modules can be determined to be module A, module B, and module C. Alternatively, the jump to page 1 can be obtained from the application startup parameters, and the corresponding matching rule 1 and matching rule 2 can be indirectly obtained based on page 1 and the correspondence shown in Table 1 above. Based on matching rule 1 and matching rule 2, the associated application modules can be jointly determined to be module A, module B, and module C. In this way, based on the obtained matching rules, M application modules can be determined. Optionally, the modules associated in Table 1 can be directly associated modules. The electronic device can also obtain dependent modules based on the application modules associated with the matching rules shown in Table 1, that is, obtain indirectly associated modules. For example, when module A depends on module E, in addition to initializing application A, application E also needs to be initialized.
[0165] For example, application launch parameters may include, but are not limited to, at least one of the following forms: deep links, such as app linking, app links, etc.; intents; actions, etc. In this embodiment, obtaining matching rules from application launch parameters can be precise matching or fuzzy matching, thereby determining the application modules required by the page. For example, deep links can explicitly indicate matching rules, or matching rules can be obtained by analyzing deep links. It is understood that the matching rules corresponding to different deep link addresses may be different, or they may be the same, and can be determined based on the specific address of the deep link.
[0166] Method (B): Based on the instructions of the third-party application, identify M application modules.
[0167] When the M application modules cannot be determined from the application startup parameters, the application startup parameters can be sent back to a third-party application. The third-party application provides the matching rules or the application modules that need to be initialized. After the electronic device obtains the matching rules or the application modules that need to be initialized indicated by the third-party application, it determines the M application modules.
[0168] To improve efficiency, in addition to the initialization of M application modules shown in Figure 7, this embodiment of the application can also implement the pre-initialization of L application modules.
[0169] In one possible scenario, electronic devices can provide pre-initialization interfaces to third-party applications, facilitating proactive management of application modules by these applications. For example, the pre-initialization interface could include a notify initialization interface. Understandably, the electronic device can determine whether to execute the pre-initialization instructions from the third-party application based on memory usage. For instance, when the memory level is low, the module pre-initialization of the third-party application can be temporarily suspended, as the page has not yet been truly switched and therefore no processing is required. Here, the memory level refers to a threshold set in the memory region for memory management, indicating the maximum usage of the memory pool; one or more thresholds can be set.
[0170] For example, before performing the steps shown in Figure 7 above, when the electronic device receives a pre-initialization instruction from a third-party application, it can pre-initialize L application modules according to the pre-initialization instruction.
[0171] Optionally, the L application modules can be exactly the same as the M application modules in step 702. It can be understood that in this scenario, the interface to be switched is the same as the interface to be switched. In this case, based on the pre-initialization of the L application modules, the execution efficiency of step 702 can be improved.
[0172] Alternatively, the L application modules may not be exactly the same as the M application modules in step 702. In this case, based on the M application modules and the L application modules, the modules that have not been initialized among the M application modules can be determined, thereby ensuring that all M application modules are started.
[0173] It's understandable that in this scenario, the expected interface to switch and the actual interface to switch may differ, but some application modules may be the same. Therefore, by pre-initializing L application modules, some modules out of M application modules can be pre-initialized. Then, initializing the remaining uninitialized modules out of the M application modules can improve the initialization efficiency of the M application modules. The L application modules and M application modules not being completely identical can include, but are not limited to, the following situations: L application modules contain M application modules, M application modules contain L application modules, and L and M application modules include common modules. It's understood that the L application modules are pre-initialized modules, determined by pre-initialization rules, while the M application modules are the modules that actually need to be initialized, determined by the actual page to switch; therefore, they do not affect each other.
[0174] Alternatively, the L application modules can be completely different from the M application modules in step 702. In this case, the initialization of the M application modules needs to be performed. It is understandable that in this scenario, the expected interface to switch to differs from the actual interface, and the required modules are also completely different.
[0175] In another example, after performing the steps shown in Figure 7 above, when the electronic device receives a pre-initialization instruction from a third-party application, it can also pre-initialize L application modules according to the pre-initialization instruction. Here, the L application modules are modules required by another target page.
[0176] The pre-initialization of third-party applications can be managed automatically or manually; this application does not limit this.
[0177] In another possible scenario, electronic devices can also perform intelligent pre-initialization based on the historical initialization behavior of application modules. For example, the historical initialization behavior of application modules can be determined by calls to the initialization interface from a third-party application, and the initialization interface can include the `init` interface. It's understandable that, unlike the `notify init` interface, when the electronic device receives a call to the `init` interface, it needs to execute the module initialization of the third-party application. At this point, the page actually switches, thus requiring processing.
[0178] For example, based on the historical initialization behavior of the process shown in Figure 7, the electronic device can learn the modules that the user actually initializes under different operations. This allows the electronic device to learn and perform intelligent pre-initialization. For instance, if a user opens the activity record page through a fitness card every night at 7 PM, the electronic device can learn that this behavior requires the initialization of the log module, container module, database module, configuration module, account module, and end-to-cloud synchronization module each time. Based on this learning, the electronic device can pre-initialize the log module, container module, database module, configuration module, account module, and end-to-cloud synchronization module before 7 PM every day to improve application startup efficiency.
[0179] For ease of understanding, Figure 8 is an example diagram of pre-initialization provided in an embodiment of this application. As shown in Figure 8, in response to the operation of launching the application triggered through the first entry point, the electronic device initializes the application module based on matching rule 1; it can be understood that the process of initializing the application module based on matching rule 1 can be referred to the flow shown in Figure 7. By learning from historical initialization behaviors, the electronic device can pre-initialize the application module based on matching rule 2; it can be understood that based on historical initialization behaviors, the page corresponding to matching rule 1 is usually switched to the page corresponding to matching rule 2.
[0180] When an electronic device detects a call event that actually indicates a switch from the page corresponding to matching rule 1 to the page corresponding to matching rule 2, the application startup efficiency can be improved because the application modules based on matching rule 2 have already been pre-initialized. The call event can be a call from the application itself. It can be understood that when the pre-initialized modules do not include all the application modules involved in the call event, incremental initialization can be performed. Since the number of incrementally initialized modules is usually less than the number of modules that need to be initialized, this also improves application startup efficiency.
[0181] Then, by learning from historical initialization behaviors, the electronic device can pre-initialize the application module based on matching rule 4 and matching rule 5. It can be understood that, based on historical initialization behaviors, the page corresponding to matching rule 2 is usually switched to the page corresponding to matching rule 4 or the page corresponding to matching rule 5.
[0182] However, when the electronic device detects a call event that actually indicates a switch from initializing the application module based on matching rule 2 to initializing the application module based on matching rule 3, the electronic device initializes the application module based on matching rule 3. The call event can be a call from the application.
[0183] Based on the above information, it can be confirmed that the electronic device has initialized the application modules based on matching rule 1, matching rule 2, matching rule 4, matching rule 5, and matching rule 3.
[0184] In other possible embodiments, the present application embodiments can also reclaim P application modules. For example, when the electronic device detects that an application has switched to background operation, it can trigger intelligent reclamation, thereby releasing memory in a timely manner and reducing the probability of the application being cleared from the background.
[0185] In one possible scenario, the electronic device can also provide a recycling interface to third-party applications, facilitating proactive management of application modules by these applications. It's understood that the pre-initialization interface and the recycling interface provided by the electronic device to the third-party application can be the same interface or different interfaces. For example, the recycling interface could include a `release` interface to implement the recycling of modules that are determined to be no longer in use. When the electronic device receives a call to the `release` interface, it needs to execute the module recycling for the third-party application. Alternatively, the recycling interface could also include a `notify release` interface to indicate the recycling of modules that may still be used but are marked as recyclable. When the electronic device receives a call to the `notify release` interface, it can determine whether to recycle the module based on the memory situation. For example, when the memory level is high, recycling can be temporarily suspended; when the memory level is low, module recycling can be performed.
[0186] For example, after performing the steps shown in Figure 7 above, when the electronic device receives a recycling instruction from a third-party application, it can recycle P application modules according to the recycling instruction. The P application modules can be some or all of the initialized application modules.
[0187] The recycling process by the third-party application can be managed automatically or manually; this application does not impose any restrictions on this.
[0188] In another possible scenario, electronic devices can intelligently reclaim application modules based on memory watermarks. For example, three memory watermarks can be set: a minimum watermark, a low watermark, and a high watermark. It can be understood that when the memory watermark is below the low watermark but above the minimum watermark, a less severe memory reclamation operation can be triggered; when the memory watermark is below the minimum watermark, a more severe memory reclamation operation can be triggered to ensure the operation of critical tasks.
[0189] Optionally, at least one of the following can be recycled: pre-initialized but unused application modules, application modules marked as recyclable, and application modules that are no longer used. In one possible example, an application module marked as recyclable can be a pre-initialized application module that is not predicted to be used. For example, the modules corresponding to matching rules 4 and 5 in Figure 8 have been initialized. When the page corresponding to matching rule 3 is predicted to switch to the page corresponding to matching rule 4, the module corresponding to matching rule 4 is a pre-initialized application module that is predicted to be used, while the module corresponding to matching rule 5 is a pre-initialized application module that is not predicted to be used. Therefore, the module corresponding to matching rule 5 is marked as a recyclable module. It should be noted that the marking rules in this embodiment are not limited; for example, they can be determined based on marking instructions from a third-party application or by learning historical recycling behavior.
[0190] For example, intelligent recycling can be performed based on the priority of application modules. For instance, application modules marked as recyclable have a priority greater than pre-initialized but unused application modules, which in turn have a priority greater than those no longer used. It can be understood that application modules with higher priority are recycled first. For example, intelligent recycling can be used to indicate that recycling can be temporarily suspended when the memory waterline is not lower than the low waterline, that recycling can be performed according to priority when the memory waterline is lower than the low waterline, and that recycling can be discontinued according to priority when the memory waterline is no longer lower than the low waterline.
[0191] For ease of understanding, Figure 9 is an example diagram of recycling provided in an embodiment of this application. Figure 9 is based on the example shown in Figure 8, where the electronic device has initialized application modules based on matching rule 1, matching rule 2, matching rule 4, matching rule 5, and matching rule 3, and the last page displayed is the page corresponding to matching rule 3. In addition, the application module based on matching rule 5 is marked as a recyclable application module.
[0192] For example, the recyclable application modules and their priorities are as follows: application module based on matching rule 5 > application module based on matching rule 4 > application module based on matching rule 1 > application module based on matching rule 2. Among these, the application modules based on matching rule 1 and matching rule 2 are both no longer in use. Therefore, the application module initialized earlier has a higher priority than the application module initialized later. That is, since the application module based on matching rule 1 was initialized earlier than the application module based on matching rule 2, the application module based on matching rule 1 has a higher priority than the application module based on matching rule 2.
[0193] Additionally, referring to Figure 9, application modules based on matching rule 1 can include: module A1, module A2, and module D, which is depended upon by modules A1 and A2; application modules based on matching rule 2 can include: module B, and module D, which is depended upon by module B; application modules based on matching rule 3 can include: module C, and module D, which is depended upon by module C. Optionally, application modules based on matching rules typically only configure directly related application modules, that is, application modules based on matching rule 1 only configure modules A1 and A2; application modules based on matching rule 2 only configure module B; and application modules based on matching rule 3 only configure module C. The dependent application modules can be automatically initialized according to the dependency relationships indicated by the startup task configuration file.
[0194] It is understandable that during the recycling of application modules, an application module will only be recycled when all matching rules to which the dependent modules belong have been recycled. For example, as shown in Figure 9, when both the application module based on matching rule 1 and the application module based on matching rule 2 are recycled, module D is still dependent on module C based on matching rule 3, so module D will not be recycled.
[0195] It should be noted that, in this embodiment of the application, not only can the pre-initialization described above be performed, but also the memory reclamation described above can be performed, thereby facilitating flexible memory adjustment.
[0196] The method provided in this application embodiment can initialize application modules on demand according to the application startup method, thereby reducing the application startup load, improving application startup performance, and reducing memory usage. Furthermore, the method also provides implementations for pre-initializing and / or intelligently recycling application modules, facilitating flexible memory management, ensuring the normal operation of critical tasks such as those running in the foreground, and reducing the probability of background applications being completely deleted.
[0197] Based on the same inventive concept, Figure 10 is a schematic flowchart of an application launch method provided in an embodiment of this application. This method can be applied to a device and includes the following steps:
[0198] Step 1001: In response to the first operation of launching the first application through the first entry point, determine the first target page; wherein, the first entry point is used to directly jump to the first target page.
[0199] For example, the first entry point can be any of the possible configurations shown in Figures 1A to 1E.
[0200] Step 1002: Initialize M application modules related to the first target page. The application includes N application modules, and the M application modules are configured to display the first target page, where M is less than N.
[0201] For example, the M application modules can correspond to the required modules on the sports page as shown in Figure 6A, or to the required modules on the activity record page as shown in Figure 6B. The N application modules can correspond to the required modules on the homepage as shown in Figure 5.
[0202] Step 1003: Display the first target page. It can be understood that the display of the first target page is based on the initialization of M application modules; at this point, some application modules may not yet be initialized.
[0203] The specific implementation process of steps 1001 to 1003 can be found in the previous description and will not be repeated here.
[0204] Based on the same inventive concept, Figure 11 is another schematic flowchart of an application launch method provided in an embodiment of this application. This method can be applied to a device and includes the following steps:
[0205] Step 1101: Display the application card of the first application on the desktop.
[0206] Among them, the application card is the sports card 100A shown in (A) of Figure 6A.
[0207] Step 1102: In response to the first operation on the application card, initialize M application modules related to the first target page; wherein, the application card is used to directly jump to the first target page; the first application includes N application modules, and the M application modules are configured to display the first target page, where M is less than N.
[0208] Among them, M application modules are shown as application module (C) in Figure 6A. N application modules are shown as application modules in Figure 5.
[0209] Step 1103: Display the first target page.
[0210] The first target page is shown in (B) of Figure 6A.
[0211] The specific implementation process of steps 1101 to 1103 can be found in the previous description and will not be repeated here.
[0212] Based on the above embodiments, this application also provides a device comprising multiple functional modules; the multiple functional modules interact to realize the functions performed by the device in the methods described in the embodiments of this application. These multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and can be arbitrarily combined or divided based on specific implementations. For example, steps 701 to 702 are executed by the device in the embodiment shown in FIG. 7; steps 1001 to 1003 are executed by the device in the embodiment shown in FIG. 10; and steps 1101 to 1103 are executed by the device in the embodiment shown in FIG. 11.
[0213] Based on the above embodiments, this application also provides a device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions. When the device is running, the at least one processor performs the functions performed by the device in the various methods described in the embodiments of this application. For example, steps 701 to 702 performed by the device in the embodiment shown in FIG. 7, steps 1001 to 1003 performed by the device in the embodiment shown in FIG. 10, and steps 1101 to 1103 performed by the device in the embodiment shown in FIG. 11.
[0214] Based on the above embodiments, this application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes the methods described in the embodiments of this application to be executed.
[0215] Based on the above embodiments, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program (also referred to as code or instructions), which, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application.
[0216] Based on the above embodiments, this application also provides a chip. The chip is used to read a computer program stored in a memory and implement the methods described in the embodiments of this application.
[0217] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible embodiment, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may be composed of chips or may include chips and other discrete devices. Those skilled in the art will understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0218] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0219] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0220] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0221] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An application starting method characterized by comprising: When applied in a device, the method includes: In response to a first operation of launching a first application through a first entry point, a first target page is determined; wherein, the first entry point is used to directly jump to the first target page; Initialize M application modules related to the first target page. The application includes N application modules, and the M application modules are configured to display the first target page, where M is less than N. Display the first target page.
2. The method of claim 1, wherein, The method further includes: After initializing the M application modules or displaying the first target page, initialize O application modules. The N application modules include the M application modules and the O application modules, and the O application modules include the application module that displays the homepage; or, In response to a second operation of switching the first target page, the O application modules are not initialized; wherein the second operation includes: returning to the desktop, switching to the second application, or exiting the first application.
3. The method according to claim 1 or 2, characterized in that, Initialize the M application modules related to the first target page, including: From the application startup parameters of the first application, obtain the matching rules, which are pre-stored and used to indicate the M application modules; or, A request message is sent to the first application, and the M application modules are determined based on the response message from the first application; wherein the request message is used to obtain the matching rules.
4. The method of claim 3, wherein, The matching rule corresponds to M1 application modules, and the M1 application modules are the application modules directly associated with the first target page; The M application modules also include M2 indirectly associated application modules, which are used to indicate the application modules that are depended upon by any of the M1 application modules.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Based on the pre-initialization instruction from the first application, L application modules corresponding to the second target page are pre-initialized. The second target page is either the next-level page predicted to switch from the first target page, or a page that can be directly accessed based on the predicted operation of the first control on the first target page. The L application modules are a portion of the N application modules included in the first application; or... Based on the learning of historical initialization behavior, the L application modules corresponding to the second target page are pre-initialized.
6. The method of claim 5, wherein, The method further includes: In response to the operation of switching from the first target page to the second target page, it is determined that the L application modules have been initialized.
7. The method of claim 5, wherein, The method further includes: In response to the operation of switching to a third target page, M' application modules related to the third target page are initialized. The third target page is different from the second target page, and the M' application modules are a portion of the N application modules included in the first application.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Based on the memory waterline, some application modules are reclaimed; wherein, the memory waterline is used to indicate the maximum usage of the memory pool, and the partial application modules include at least one of the following: pre-initialized but unused application modules, application modules marked as reclaimable, and application modules that are no longer in use.
9. The method of claim 8, wherein, The recycling of certain application modules is carried out according to the following priority: Application modules marked as recyclable; Pre-initialized but unused application modules; Application modules that are no longer in use.
10. The method according to claim 8 or 9, characterized in that, The process of recycling certain application modules based on memory waterlines includes: When the memory waterline is lower than the first memory threshold, the application modules that meet the conditions are reclaimed. When the memory threshold is detected to be greater than the second memory threshold, the recycling of application modules that meet the conditions is stopped; wherein the second memory threshold is greater than or equal to the first memory threshold.
11. The method according to any one of claims 1 to 10, characterized in that, The first target page is a second-level or third-level interface.
12. An application starting method characterized by comprising: When applied in a device, the method includes: Display the application card of the first application on the desktop; In response to a first operation on the application card, M application modules related to the first target page are initialized; wherein, the application card is used to directly jump to the first target page; the first application includes N application modules, and the M application modules are configured to display the first target page, where M is less than N; Display the first target page.
13. The method of claim 12, wherein, The method further includes: After initializing the M application modules or displaying the first target page, initialize O application modules. The N application modules include the M application modules and the O application modules, and the O application modules include the application module that displays the homepage; or, In response to a second operation of switching the first target page, the O application modules are not initialized; wherein the second operation includes: returning to the desktop, switching to the second application, or exiting the first application.
14. The method according to claim 12 or 13, characterized in that, The method further includes: In response to the operation of switching from the first target page to the second target page, L application modules related to the second target page are initialized, wherein the L application modules are a portion of the N application modules included in the first application.
15. The method according to any one of claims 12 to 14, characterized in that, The first target page is not the homepage of the first application.
16. An apparatus, comprising: The method includes at least one processor coupled to at least one memory, the at least one processor being configured to read and execute a computer program stored in the at least one memory to cause the method as claimed in any one of claims 1 to 11 to be executed, or the method as claimed in any one of claims 12 to 15 to be executed.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 11, or the method as claimed in any one of claims 12 to 15.
18. A computer program product comprising instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 11, or the method as described in any one of claims 12 to 15.
