An application launch 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 and memory management are achieved.

CN123114567APending Publication Date: 2026-11-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510637669.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

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.

Method used

Instead of full initialization, the application modules required by the target page are determined and initialized in response to different launch entry points. This is achieved by combining pre-configured matching rules and dependencies to enable on-demand initialization.

Benefits of technology

It reduces the load when the application starts, improves startup performance, reduces memory usage, and enhances the flexibility and accuracy of memory management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114567A_ABST
    Figure CN123114567A_ABST
Patent Text Reader

Abstract

This application provides an application startup method and device to initialize application modules on demand based on the way the application is triggered to start. In scenarios where the user directly jumps to a first target page that is not the homepage, M application modules out of N application modules are initialized according to the requirements of the first target page, where M is less than N. Then, the first target page is displayed based on the initialization of the M application modules. This method can initialize only the required application modules according to the requirements of the first target page, without having to initialize all application modules, thereby reducing the load during application startup, improving application startup performance, and reducing memory usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an application startup method and device. Background Technology

[0002] 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.

[0003] 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.

[0004] 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

[0005] 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.

[0006] 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.

[0007] 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.

[0008] In one possible scenario, the method further includes any of the following scenarios:

[0009] 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.

[0010] 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.

[0011] 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.

[0012] 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.

[0013] 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.

[0014] 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.

[0015] 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.

[0016] 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.

[0017] 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.

[0018] 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.

[0019] In this scenario, the pre-initialization process can speed up the switching efficiency when actually switching to the second target page.

[0020] 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.

[0021] 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.

[0022] 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.

[0023] 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.

[0024] 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.

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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.

[0029] 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.

[0030] 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.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] 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.

[0038] 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.

[0039] 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

[0040] Figure 1A This is one of the interface display diagrams that provides direct access to a function;

[0041] Figure 1B The second diagram shows an interface display for a function that provides direct access.

[0042] Figure 1C The third diagram shows an interface display that provides direct access to a function.

[0043] Figure 1D The fourth diagram shows an interface display that provides direct access to a function.

[0044] Figure 1E The fifth diagram shows an interface display that provides direct access to a function.

[0045] Figure 2 A schematic diagram of the hardware architecture of a device provided in an embodiment of this application;

[0046] Figure 3 A software system architecture block diagram of a device provided in an embodiment of this application;

[0047] Figure 4 A scenario diagram provided for an embodiment of this application;

[0048] Figure 5 This is a schematic diagram of a sports and health module provided in an embodiment of this application;

[0049] Figure 6AA scenario example diagram illustrating an application launch method provided in an embodiment of this application;

[0050] Figure 6B This is another scenario example diagram illustrating an application launch method provided in an embodiment of this application;

[0051] Figure 7 A flowchart illustrating an application startup method provided in an embodiment of this application;

[0052] Figure 8 Example diagrams of pre-initialization provided for embodiments of this application;

[0053] Figure 9 Example diagrams of recycling provided for embodiments of this application;

[0054] Figure 10 This is another flowchart illustrating an application startup method provided in an embodiment of this application;

[0055] Figure 11 This is another flowchart illustrating an application startup method provided in an embodiment of this application. Detailed Implementation

[0056] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0057] (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.

[0058] (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.

[0059] (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.

[0060] (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.

[0061] For example, application modules can be function packages, shared packages, shared library files, etc. For example, the shared library can be an .so file.

[0062] (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.

[0063] 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.

[0064] 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.

[0065] (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.

[0066] For example, multiple applications on electronic devices can offer the ability to create cards on the desktop. These cards can display information about the application or provide some of its functions. By interacting with the cards, users can directly jump to the page corresponding to the card, without having to manually navigate to the target page after the application's homepage is displayed. For example, Figure 1A This is a graphical representation of an interface that provides direct access to a specific function. For example... Figure 1A As shown in (A), the fitness app can provide a fitness card 100A, which can be displayed on the desktop; the phone responds to... Figure 1A Clicking on the sports card 100A in (A) will directly jump to the display as shown in the image. Figure 1A The interface shown in (B) is used to display the exercise page in the fitness app.

[0067] For example, by activating the voice assistant on 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 example, Figure 1B This is an alternative interface display for a function that provides direct access. For example... Figure 1B As shown in (A), the mobile phone responds to the voice command 100B collected by the voice assistant and directly jumps to the display. Figure 1B The interface shown in (B) is an example of a voice command 100B, such as "View payment bills from the payment application." Figure 1B (B) shows the details page of the payment bill.

[0068] For example, through sharing operations between applications, it's also possible to directly redirect to the target application's share-receiving interface, without displaying the homepage of the application corresponding to the sharing operation and then requiring the user to manually navigate to the target page. For example, Figure 1C This is another interface display diagram that provides direct access to a function. For example... Figure 1C As shown in (A), this can be the sharing interface triggered by a sharing operation. In response to the sharing operation on page 100C, the mobile phone directly jumps to the display. Figure 1C The interface shown in (B) is as follows. Among them, as... Figure 1C (B) shows the chat window page, which includes message 100D, which instructs the user to... Figure 1C Page 100C in (A) is sent to the chat partner.

[0069] Alternatively, for example, electronic devices can directly jump to the interface corresponding to the notification message in response to an action in the notification bar, without displaying the home page of the application associated with the notification and requiring the user to manually navigate to the target page. For example, Figure 1D This is an interface display that provides direct access to one function. For example... Figure 1D As shown in (A), the notification bar can include chat messages 100E; the phone responds in Figure 1D Clicking on chat message 100E in (A) will directly redirect to the page displaying the message. Figure 1D The interface shown in (B) is used to display the chat page, which may include new message 100F.

[0070] For example, the lock screen or notification bar of an electronic device can provide shortcuts. In response to user interaction with these shortcuts, the system can directly jump to the interface corresponding to the shortcut, without displaying the home page of the application containing the shortcut and requiring the user to manually navigate to the target page. For instance, Figure 1E This is a diagram showing another interface that provides direct access to a function. For example, Figure 1E This is an interface display that provides direct access to one function. For example... Figure 1E As shown in (A), the notification bar interface can include a scan shortcut for the payment software (100G); the phone responds in... Figure 1E Clicking the 100G shortcut for the payment software's scan function in (A) will directly redirect to the page displaying... Figure 1E The interface shown in (B) is used to display the QR code scanning page.

[0071] (7) The entry point for launching the application can include traditional launch methods, such as clicking on an icon displayed on the desktop of an electronic device; it can also be a launch method corresponding to the content of the function access description, such as... Figure 1A The image shows the action of clicking on the sports card. Figure 1B The example shown is an intent call via a voice assistant. Figure 1C The trigger shown is through the sharing operation. Figure 1D The diagram shows the operation on the notification message. Figure 1E The example shown illustrates operations performed on shortcuts, etc.

[0072] 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.

[0073] 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.

[0074] 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.

[0075] 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).

[0076] Figure 2 A schematic diagram of the hardware structure of a possible device is shown. For example... Figure 2As shown, 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, an antenna 1, an 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.

[0077] 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.

[0078] 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 (WLANs) (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.

[0079] 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.

[0080] 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.

[0081] 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.

[0082] Understandable, Figure 2 The components shown do not constitute a specific limitation on the mobile phone. A 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 following text is incomplete and likely refers to a different embodiment]. Figure 2 The device 200 shown is used as an example for introduction.

[0083] 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.

[0084] Figure 3 This is a software system architecture block diagram of a device provided in an embodiment of this application. For example... Figure 3As shown, the device's software system architecture can be a layered architecture, for example, the software can be divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into five layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, the kernel layer, and the hardware layer.

[0085] The application layer can include a series of application packages and various user interaction entry points. For example... Figure 3 As shown, the application layer may include a camera, settings, third-party applications, etc. These third-party applications may include fitness and health apps, payment apps, music apps, call apps, video apps, memo apps, etc. In this embodiment, the application layer may 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.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] 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.

[0090] 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. For example... Figure 3 As shown, the application framework layer may include an activity manager, window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0091] 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.

[0092] 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.

[0093] 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.

[0094] 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.

[0095] The phone manager is used to provide communication functions for the device, such as managing call status (including connection, hang-up, etc.).

[0096] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0097] 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.

[0098] 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.

[0099] 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.

[0100] The Surface Manager is used to manage the display subsystem and provides the blending of two-dimensional and three-dimensional layers for multiple applications.

[0101] 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.

[0102] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0103] A 2D graphics engine is a drawing engine for 2D drawing.

[0104] 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.

[0105] 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.

[0106] The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, and touch sensors.

[0107] 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.

[0108] It should be understood that the hardware structure of the device can be as follows: Figure 2 As shown, the software system architecture can be as follows: Figure 3As shown, the software programs and / or modules corresponding to the software system architecture in the device can be stored in the internal memory 221, and 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 this application embodiment.

[0109] To facilitate understanding of the application launch method provided in this application, the following is combined with... Figures 4 to 9 The content shown describes the implementation process of the method provided in this application.

[0110] First, the terms that may be used in the following embodiments will be introduced for easy distinction:

[0111] (1) N application modules refer to the modules included in the application. Where N represents the maximum number of modules included in the application.

[0112] (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.

[0113] Optionally, the M application modules may include the following directly related modules and indirectly related modules.

[0114] (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.

[0115] (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.

[0116] It is understandable that M equals the sum of M1 and M2.

[0117] (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.

[0118] 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.

[0119] 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.

[0120] (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.

[0121] 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.

[0122] (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.

[0123] 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.

[0124] 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.

[0125] For ease of understanding, Figure 4This is a schematic diagram of a scenario provided for an embodiment of this application. For example... Figure 4 As shown, three possible application launch points are used as examples:

[0126] (1) The desktop icon is the launch entry point, typically used to display the application's homepage. It's understandable that displaying the application's homepage usually requires initializing all N application modules included in the application. For example... Figure 4 If the application includes modules 1 to 8, then in the scenario where the application is launched through the desktop image launch entry, all application modules need to be initialized.

[0127] (2) Card-based entry point is a direct access method for functions, 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's homepage, but rather a page within the application. This page may only be related to a portion of the application's modules, thus requiring only M application modules to be initialized. For instance, through... Figure 4 If the target page for the card-based startup entry can be related to module 5 and module 6, then only module 5 and module 6 need to be initialized.

[0128] Another example is that indirectly related modules can also be obtained by using the dependencies between modules recorded in the startup task configuration file. For example... Figure 4 As shown, modules 5 and 6 have no dependent modules, so no additional modules need to be initialized.

[0129] (3) Intent-based entry point invocation 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's homepage, but rather a page within the application. This page may only be related to a portion of the application modules included in the application; therefore, only M application modules need to be initialized. For example, through... Figure 4 If the target page to which the intent call to start the program jumps can be directly associated with module 4, then module 4 needs to be initialized.

[0130] Another example is that indirectly related modules can also be obtained by using the dependencies between modules recorded in the startup task configuration file. For example... Figure 4 As shown, 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.

[0131] Taking sports and health apps as an example, Figure 5 This is a schematic diagram of a sports and health module provided in an embodiment of this application. Figure 5 As shown, a sports and health application may include the following modules:

[0132] (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.

[0133] The logging module can be used to record application logs, which facilitates application debugging, error location, and runtime status monitoring.

[0134] Container modules can be used for page layout, component lifecycle management, or initialization of modular views.

[0135] The database module can be used to read data.

[0136] The configuration module is used to implement global configuration management for the application, such as reading configuration files and dynamically switching themes.

[0137] (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,

[0138] 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.

[0139] The end-to-cloud synchronization module is used to achieve bidirectional data synchronization between local devices and cloud servers, ensuring consistency across multiple devices.

[0140] The map module is used to provide maps.

[0141] 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.

[0142] 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.

[0143] 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.

[0144] The World Wide Web (WWW) module is used to initialize H5 pages or interact with Web services.

[0145] based on Figure 5 The sports and health applications introduced include various modules. Below are some examples of how to directly display the target page of sports and health through direct access to functions.

[0146] Example 1: Sports cards

[0147] For example, Figure 6A This is a scenario example diagram illustrating an application launch method provided in an embodiment of this application. For example... Figure 6A As shown in (A), this is the phone's home screen, including the fitness card 100A from the fitness and health app. Figure 6A In (A), in response to the operation on the sports card 100A, M application modules are initialized, and the display is... Figure 6A (B) in the middle; where M application modules are configured to display as shown in the image. Figure 6A Module (B) in the document. For example... Figure 6A As shown in (B) above, the page may include information such as a map 600A and user account information 600B. Based on this, as... Figure 6A As shown in (C) in the example, the relevant M application modules can include, in addition to... Figure 5 The application entry module includes modules such as... Figure 5 The homepage includes: account module, cloud-end synchronization module, map module, and location module. In addition to the required modules, the NFC module, badge module, and Web module can have delayed initialization, for example, after the initialization of the M application modules or after displaying the... Figure 6A After (B) in the middle; or, if the user does not perform any further operations on the interface, the NFC module, badge module, and Web module may not need to be initialized.

[0148] Example 2: Intent to invoke activity record

[0149] For example, Figure 6B This is another scenario example diagram illustrating an application launch method provided in an embodiment of this application. For example... Figure 6B As shown in (A), this is the phone's desktop, including a semi-modal window for displaying the voice assistant page. Figure 6B In (A), in response to the received voice command 600C, M application modules are initialized, and the display is... Figure 6B (B) in the middle; where M application modules are configured to display as shown in the image. Figure 6B Module (B) in the document. For example... Figure 6B As shown in (A), voice command 600C could be, for example, "Open the activity record page for Sports and Health". Figure 6B As shown in (B) above, the page may include user account information such as 600D. Based on this, as... Figure 6B As shown in (C) in the example, the relevant M application modules can include, in addition to... Figure 5 The application entry module in the middle should include modules such as Figure 5The homepage section includes: Account module and End-to-Cloud synchronization module. In addition to the required modules, the Map module, Location module, NFC module, Badge module, and Web module can have delayed initialization, for example, after initializing the aforementioned M application modules or displaying the... Figure 6B After (B) in the middle; or, if the user does not perform any further operations on the interface, the map module, location module, NFC module, badge module, and web module may not need to be initialized.

[0150] It should be noted that, Figure 6A and Figure 6B These are merely possible examples. The modules required for different pages are not limited in this application embodiment and can be determined according to business needs or pre-configuration.

[0151] Based on the foregoing Figures 4 to 6B 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.

[0152] For example, Figure 7 This is a flowchart illustrating an application startup method provided in an embodiment of this application. This method can be applied to devices, specifically in scenarios involving device startup tasks. The process of this method may include:

[0153] 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.

[0154] 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. Figure 1A The interface shown is not the homepage of Sports & Health, but rather the Sports page, which can be a second-level or third-level page, etc.; for example... Figure 1B The interface shown is not the homepage of the payment application, but rather the details screen of the payment bill. This details screen can be a second-level or third-level page, etc.; or as shown... Figures 1C to 1E The interfaces shown are not the application's homepage, but rather second-level or third-level pages, etc.

[0155] The methods for directly accessing functions may include, but are not limited to: jumping to a specific location by clicking on a card, such as... Figure 1A The jump method shown; jumps are made based on the intent recognized by the voice command, such as... Figure 1B The redirection methods shown; redirection triggered by a sharing operation, such as... Figure 1C The jump methods shown; jumps triggered by operations on notification messages, such as... Figure 1D The jump methods shown; jumps triggered by operations on shortcuts, such as... Figure 1E The jump method shown. Combined with... Figures 1A to 1E As shown, directly redirecting to the target page via the entry point avoids multiple user steps from the homepage, reducing operational complexity. Building on this scenario, and considering that the target page typically requires fewer application modules than the homepage, the implementation process described later allows for the initialization of the M application modules needed for the target page, thereby improving application startup performance in such scenarios.

[0156] 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.

[0157] For example, M application modules can be identified in a variety of ways.

[0158] Method (A): Determine M application modules from the application startup parameters.

[0159] 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:

[0160] Table 1

[0161] Matching rules Page ID Related application modules Matching rule 1 Page 1 Module A, Module B Matching rule 1 Page 2 Module A, Module B Matching rule 2 Page 1 Module B, Module C Matching rule 3 Page 3 Module D

[0162] 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.

[0163] 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.

[0164] 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.

[0165] Method (B): Based on the instructions of the third-party application, identify M application modules.

[0166] 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.

[0167] In order to improve efficiency, in addition to Figure 7 The initialization of M application modules shown in this application embodiment can also be implemented for the pre-initialization of L application modules.

[0168] 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.

[0169] For example, in performing the above Figure 7 Before the steps shown, 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.

[0170] 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.

[0171] 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.

[0172] 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.

[0173] 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.

[0174] Another example is in performing the above Figure 7 Following the steps shown, 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. These L application modules are modules required by another target page.

[0175] The pre-initialization of third-party applications can be managed automatically or manually; this application does not limit this.

[0176] 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.

[0177] For example, based on such Figure 7 The historical initialization behavior shown in the process can learn which modules are actually initialized under different user operations. This allows electronic devices to learn and perform intelligent pre-initialization. For example, 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 initializing 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.

[0178] For ease of understanding, Figure 8 Example diagrams of pre-initialization provided for embodiments of this application. For example... Figure 8 As shown, 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 initializing the application module based on matching rule 1 can be found in [reference needed]. Figure 7 The process is shown below. By learning from historical initialization behaviors, electronic devices can pre-initialize application modules 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.

[0179] 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.

[0180] 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.

[0181] 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.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] For example, in performing the above Figure 7 Following the steps shown, when the electronic device receives a recycling instruction from a third-party application, it can recycle the P application modules according to the instruction. The P application modules can be some or all of the initialized application modules.

[0186] The recycling process by the third-party application can be managed automatically or manually; this application does not impose any restrictions on this.

[0187] 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.

[0188] Optionally, at least one of the following can be reclaimed: pre-initialized but unused application modules, application modules marked as reclaimable, and application modules that are no longer used. In one possible example, an application module marked as reclaimable could be a pre-initialized application module that is not predicted to be used. For example, Figure 8The modules corresponding to matching rules 4 and 5 have already 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 an application module that has been pre-initialized but is predicted to be used, while the module corresponding to matching rule 5 is an application module that has been pre-initialized but is predicted not 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 third-party applications, or they can be marked by learning historical recycling behavior.

[0189] 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.

[0190] For ease of understanding, Figure 9 Example diagram of recycling provided for embodiments of this application. Figure 9 Based on Figure 8 The example shown illustrates an electronic device that has already initialized application modules based on matching rule 1, matching rule 2, matching rule 4, matching rule 5, and matching rule 3, with the final displayed page corresponding to matching rule 3. Furthermore, the application module based on matching rule 5 is marked as a recyclable application module.

[0191] 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.

[0192] In addition, combined Figure 9As shown, 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.

[0193] It's understandable that during application module recycling, an application module will only be recycled when all matching rules for the modules it depends on have been recycled. For example... Figure 9 As shown, when both the application module based on matching rule 1 and the application module based on matching rule 2 are recycled, module D is also dependent on module C based on matching rule 3, so module D will not be recycled.

[0194] 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.

[0195] 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.

[0196] Based on the same inventive concept Figure 10 This is a flowchart illustrating an application launch method provided in an embodiment of this application. The method can be applied to a device and includes the following steps:

[0197] 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.

[0198] For example, the first entry point could be... Figures 1A to 1E Any possible way.

[0199] 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.

[0200] For example, M application modules can be as follows: Figure 6A The motion page shown corresponds to the required module, or you can... Figure 6B The activity log page shown corresponds to the required modules. N application modules can be configured as follows: Figure 5 The homepage corresponds to the required module.

[0201] 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.

[0202] The specific implementation process of steps 1001 to 1003 can be found in the previous description and will not be repeated here.

[0203] Based on the same inventive concept Figure 11 This is another schematic flowchart illustrating an application launch method provided in an embodiment of this application. The method can be applied to a device and includes the following steps:

[0204] Step 1101: Display the application card of the first application on the desktop.

[0205] Among them, application cards such as Figure 6A The sports card 100A shown in (A) is shown in the figure.

[0206] 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.

[0207] Among them, M application modules are as follows Figure 6A The application module shown in (C) is N. The application modules are as follows: Figure 5 The application modules shown.

[0208] Step 1103: Display the first target page.

[0209] The first target page is as follows: Figure 6A The page shown in (B) is shown in the image.

[0210] The specific implementation process of steps 1101 to 1103 can be found in the previous description and will not be repeated here.

[0211] Based on the above embodiments, this application also provides a device comprising multiple functional modules; the multiple functional modules interact to implement 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 the multiple functional modules can be arbitrarily combined or divided based on specific implementations. For example, [the following is an example of implementation details]. Figure 7 Steps 701 to 702 performed by the device in the illustrated embodiment are as follows: Figure 10 In the illustrated embodiment, the device performs steps 1001 to 1003, or, for example, performs... Figure 11 Steps 1101 to 1103 are performed by the device in the illustrated embodiment.

[0212] Based on the above embodiments, this application also provides a device including 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 methods described in the embodiments of this application. Figure 7 Steps 701 to 702 performed by the device in the illustrated embodiment are as follows: Figure 10 In the illustrated embodiment, the device performs steps 1001 to 1003, or, for example, performs... Figure 11 Steps 1101 to 1103 are performed by the device in the illustrated embodiment.

[0213] 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.

[0214] 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.

[0215] 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.

[0216] 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.

[0217] 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.

[0218] 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.

[0219] 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.

[0220] 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 launch method, characterized in that, 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 according to claim 1, characterized in that, 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 according to claim 3, characterized in that, 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 according to claim 5, characterized in that, 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 according to claim 5, characterized in that, 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 according to claim 8, characterized in that, 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 launch method, characterized in that, 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 according to claim 12, characterized in that, 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. A device, characterized in that, 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 10, or the method as described in any one of claims 12 to 15.