Application program starting method and device, electronic equipment, medium and product
By pre-creating a list of target processes and resources, the application's cold start process is directly loaded, solving the problem of slow cold start speed and improving startup speed and user experience.
Patent Information
- Application Number
- CN202411117925.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2026-03-03
AI Technical Summary
The application's slow cold start speed results in long waiting times for users, impacting the user experience.
The target process is pre-created and associated with the target resource list, directly determining the process of the target application and loading resource data, avoiding repeated process creation and resource loading time.
It improves the cold start speed of applications, reduces user waiting time, and enhances the user experience.
Smart Images

Figure CN121597294A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic device technology, and more particularly to a method, apparatus, electronic device, medium, and product for launching an application. Background Technology
[0002] Application startup response time is a crucial metric for users, and it's a key factor influencing user experience. Based on different startup methods, application startup processes can be categorized as cold start, warm start, and hot start.
[0003] During an application's cold start process, when the AMS component in the SystemServer process (system service process) receives the application's launch command, the electronic device starts the Zygote process. The Zygote process then uses a Fork operation to create a process corresponding to the application. The electronic device can then bind the application's process to the application and create an Activity component, binding the application's process to the Activity component to achieve a cold start. However, creating the application's process takes a significant amount of time. Therefore, the application's cold start is slow, requiring users to wait for a long time, resulting in a poor user experience. Summary of the Invention
[0004] To overcome the problems existing in the related technologies, this disclosure provides a method, apparatus, electronic device, medium and product for launching an application.
[0005] According to a first aspect of the present disclosure, a method for launching an application is provided, comprising:
[0006] Based on the received startup command of the target application, a target process corresponding to the target application is determined; the target process is a pre-created process, and the target process is associated with a target resource list, which is used to indicate the target resource data that needs to be loaded during the startup process of the target application;
[0007] Based on the target process and the target resource list, the target application is launched and the interface of the target application is displayed.
[0008] In some embodiments, the method further includes:
[0009] Based on the received launch command of the target application, the launch status of the target application is determined; the launch status is used to indicate whether the target application is being launched for the first time.
[0010] When the startup state indicates that the target application is starting for the first time, a new process is created for the target application to execute the startup process, and the target resource list is obtained during the startup process of the target application.
[0011] In some embodiments, the method further includes:
[0012] When the startup status indicates that the target application is not being launched for the first time, the target process corresponding to the target application is determined to execute the startup process.
[0013] In some embodiments, launching the target application and displaying the interface of the target application based on the target process and the target resource list includes:
[0014] Based on the target resource list, the target resource data is loaded to launch the target application;
[0015] Create the interface for the target application;
[0016] Establish the association between the target process and the interface of the target application, and display the interface of the target application.
[0017] In some embodiments, after the target application is launched, the method further includes:
[0018] The usage status of the target application is obtained, which indicates whether the target application is in an exited state. When the target application is in an exited state, a cold start is required when the application is used.
[0019] When the usage status is characterized as an exit status, the loaded target resource data is cleared.
[0020] In some embodiments, the method further includes:
[0021] When the usage status is characterized as not exiting, obtain the memory resource occupancy status;
[0022] When the occupancy status indicates that the available memory resources are scarce, the loaded target resource data is cleared.
[0023] In some embodiments, the method further includes:
[0024] When the occupancy status indicates that the available memory resources are sufficient, the duration of continuous use of the target application is obtained;
[0025] When the continuous usage duration is greater than or equal to the preset duration, the loaded target resource data is cleared.
[0026] In some embodiments, the method further includes:
[0027] Monitor usage parameters for each of multiple applications;
[0028] Based on the usage parameters of each application, a preset application is determined among the plurality of applications; the preset application includes a high-frequency application, which is used to characterize an application whose usage frequency is greater than or equal to a preset frequency threshold within a preset duration.
[0029] The preset application that receives the launch command is identified as the target application.
[0030] According to a second aspect of the present disclosure, an application launching device is provided, characterized in that it includes:
[0031] The determination module is configured to determine the target process corresponding to the target application based on the received startup command of the target application; the target process is a pre-created process, and the target process is associated with a target resource list, which is used to indicate the target resource data that needs to be loaded during the startup process of the target application;
[0032] The startup module is configured to launch the target application and display the interface of the target application based on the target process and the target resource list.
[0033] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0034] processor;
[0035] Memory used to store processor-executable instructions;
[0036] The processor is configured to execute the application startup method as described in the first aspect of this disclosure.
[0037] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the application launch method as described in the first aspect of the present disclosure.
[0038] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the application startup method described in the first aspect of the present disclosure.
[0039] The method described in this disclosure has the following advantages: It can directly determine the pre-created target process corresponding to the target application, saving time in process creation. Furthermore, the target process in this disclosure is associated with the target resource list, thus saving time in loading resource data during the cold start process of the target application. Therefore, this disclosure can improve the cold start speed of the target application, reduce user waiting time, and improve the user experience.
[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0041] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0042] Figure 1 This is a flowchart illustrating an application launch method according to an exemplary embodiment.
[0043] Figure 2 This is a flowchart illustrating an application launch method according to an exemplary embodiment.
[0044] Figure 3 This is a schematic diagram illustrating a target resource list according to an exemplary embodiment.
[0045] Figure 4 This is a flowchart illustrating an application launch method according to an exemplary embodiment.
[0046] Figure 5 This is a flowchart illustrating an application launch method according to an exemplary embodiment.
[0047] Figure 6 This is a flowchart illustrating an application launch method according to an exemplary embodiment.
[0048] Figure 7 This is a block diagram illustrating an application launch device according to an exemplary embodiment.
[0049] Figure 8This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0050] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0051] Application startup response time is a crucial metric for users, significantly impacting user experience. Based on different startup methods, application startup can be categorized into cold start, warm start, and hot start. A cold start occurs when the application is created from scratch, meaning no background process exists for the application. In a cold start scenario, the device creates a new process and Activity to launch the application. A warm start occurs when the application process exists in the background, but its Activity components are destroyed. Upon application startup, the device recreates the corresponding Activity components. A hot start occurs when both the application process and Activity components exist in the background, allowing the device to launch the application directly. It's important to note that the Activity component is the entry point for user interaction with the application; it represents a component with a user interface. Creating an Activity component signifies the creation of a new screen using the Activity class, which can include both the user interface and logic.
[0052] During the application cold start process, electronic devices can use a socket listener to monitor whether the application is starting in real time. When the AMS (ActivityManagerService) component in the SystemServer process (system service process) receives the application's start command, that is, when the socket listener detects the application starting, the electronic device starts the Zygote process and uses the Zygote process to create a process corresponding to the application through a Fork operation. Then, the electronic device can bind the application's corresponding process to the application and create an Activity component, binding the application's process to the Activity component to achieve the application's cold start. The socket listener monitors whether the application is starting. The SystemServer process is a crucial part of the system startup process, responsible for starting and running the system's core services, thus ensuring the normal operation of the operating system. For example, the SystemServer process can include multiple service components, each responsible for different system functions. The AMS component is a service component that handles process management services; for example, the AMS component can start, stop, and monitor application processes, as well as manage system memory and resource allocation. The Zygote process is responsible for incubating application processes. For example, when a new application is launched, the Zygote process can create a new process through the Fork operation. The Fork operation is a system call that creates a process. The Fork call copies the existing process that called it and generates a new process based on the existing process.
[0053] However, creating the corresponding process for an application takes a significant amount of time. Therefore, the application's cold start is slow, requiring users to wait for a long time, resulting in a poor user experience.
[0054] To address the aforementioned problems, this disclosure provides an application startup method. This method determines the target process corresponding to the target application based on a received startup command. The target process is a pre-created process, and it is associated with a target resource list, which indicates the target resource data that needs to be loaded during the target application's startup. Based on the target process and the target resource list, the target application is started, and its interface is displayed. This disclosure directly determines the pre-created target process corresponding to the target application, saving time in process creation. Furthermore, the association between the target process and the target resource list in this disclosure saves time loading resource data during the cold start process of the target application. Therefore, this disclosure can improve the cold start speed of the target application, reduce user waiting time, and improve the user experience.
[0055] This disclosure provides an exemplary embodiment of an application launch method, applicable to electronic devices such as mobile phones, tablets, laptops, smart robots, and smart wearable devices. Furthermore, the electronic device also includes various hardware resources and energy storage devices that provide power for the operation of these hardware resources. It should be noted that this disclosure can be applied to application cold start scenarios, which may include: a user manually deleting an application and then relaunching it; an electronic device actively scanning and killing an application and then relaunching it; or an application being actively launched by the electronic device through broadcast or service activation. Applications actively launched by the electronic device through broadcast or service activation may include self-starting applications, such as applications activated by the electronic device via power-on broadcast or splash screen broadcast.
[0056] like Figure 1 As shown in this embodiment, the application launch method includes:
[0057] S101. Based on the received startup command of the target application, determine the target process corresponding to the target application.
[0058] S102. Based on the target process and target resource list, start the target application and display the target application's interface.
[0059] In step S101, the target process is a pre-created process, which is an empty process. Each target application has a corresponding target process. The target process is associated with a target resource list, which indicates the target resource data that needs to be loaded during the startup of the target application.
[0060] In one example, the target resource data may include application configuration data, such as application settings and initialization parameters; it may also include application interface resource data, such as application layout files, image resources (icons, button files), fonts and color schemes.
[0061] In some embodiments, the launch command may be generated based on a first user action, which characterizes the action of launching the target application. For example, the first action may be a click or double-click operation by the user on the target application. The launch command may also be generated by the electronic device itself. For example, if the electronic device automatically launches the target application, it may generate the launch command for the target application.
[0062] In some embodiments, a target process corresponding to a target application can be determined based on first configuration information and the target application. The first configuration information characterizes the correspondence between applications and processes. For example, the first configuration information includes application A and its corresponding process a, application B and its corresponding process b. When the target application is application B, the target process is process b.
[0063] In some embodiments, a target resource list associated with the target process can be determined based on the second configuration information and the target process. The second configuration information is used to characterize the correspondence between the target process and the target resource list.
[0064] In some embodiments, when a launch command for a target application is received, the electronic device binds the target process to the target application. In some embodiments, the Zygote process can pre-create multiple application-specific processes via a Fork operation. Each process maintains corresponding application information and resource data. For example, the process corresponding to application 1 includes application information Empty_APP1 and resource data 1ListInfo; the process corresponding to application x includes application information Empty_APPx and resource data xListInfo; and the process corresponding to application n includes application information Empty_APPn and resource data nListInfo. When the socket listener corresponding to the target application detects that the target application is launching, the electronic device binds the target process to the target application. For example, when the socket listener corresponding to the target application APPx detects that the target application APPx is launching, the electronic device binds the target process (including the process containing application information Empty_APPx and resource data xListInfo) to the target application APPx.
[0065] In step S102, in some embodiments, target resource data can be loaded based on the target resource list to start the target application, then the interface of the target application can be created, the association between the target process and the interface of the target application can be established, and the interface of the target application can be displayed.
[0066] In some embodiments, target resource data can be loaded into memory based on a target resource list, thus saving time in loading resource data during the cold start process of the target application.
[0067] In some embodiments, a target process can be bound to an Activity component to display the interface of the target application.
[0068] This embodiment can directly determine the pre-created target process corresponding to the target application, saving time in process creation. Furthermore, the target process in this disclosure is associated with the target resource list, thus saving time in loading resource data during the cold start process of the target application. Therefore, this disclosure can improve the cold start speed of the target application, reduce user waiting time, and improve the user experience.
[0069] According to an exemplary embodiment, such as Figure 2 As shown, this embodiment provides a method for launching an application, including:
[0070] S201. Based on the received startup command of the target application, determine the startup status of the target application.
[0071] S202. When the startup status indicates that the target application is starting for the first time, a new process is created for the target application to execute the startup process, and the target resource list is obtained during the startup process of the target application.
[0072] S203. When the startup status indicates that the target application is not starting for the first time, determine the target process corresponding to the target application and execute the startup process.
[0073] S204. Based on the target process and target resource list, start the target application and display the target application's interface.
[0074] Step S204 is the same as step S102 in the above embodiment, and will not be described again here.
[0075] In step S201, the startup status is used to indicate whether the target application is being launched for the first time.
[0076] Optionally, the first launch of the application may include the following: launching the application after the electronic device has installed the application for the first time; launching the application after the application has been updated; launching the application after the application has been reinstalled.
[0077] In some embodiments, a startup instruction can be used to indicate the startup status of a target application. For example, the startup instruction may include a status code indicating the startup status of the target application, based on which the startup status of the target application can be determined.
[0078] Additionally, it should be noted that electronic devices can monitor target applications. When the startup process of a target application is detected to match the conditions for the first launch of an application, the startup state is determined to indicate that the target application is launching for the first time. Conversely, when the startup process of a target application is detected to match the conditions for the first launch of an application, the startup state is determined to indicate that the target application is not launching for the first time.
[0079] In step S202, the new process can refer to a process created by the Zygote process through a Fork operation. Correspondingly, this new process can be used to execute the startup process. When the startup state indicates that the target application is launching for the first time, creating a new process for the target application to execute the startup process can include: creating a new process using the Zygote process, where the Zygote process creates a new process corresponding to the target application based on a Fork operation, then binds the new process to the target application through bindapplication, creates an Activity component, binds the new process to the Activity component, displays the target application's interface, and completes the startup of the target application. bindapplication can refer to a method of establishing a connection between application components (such as services) and system services or other components.
[0080] In some embodiments, the target resource list can be used to indicate the hot-spot resource data that needs to be loaded during the startup of the target application. Hot-spot resource data refers to resource data that is frequently accessed or used by the application during the startup phase. Thus, by loading hot-spot resource data, memory usage can be reduced and the probability of disk crashes during the application's cold start process can be lowered, effectively improving the application's cold start speed.
[0081] In some embodiments, hotspot region resource data may include resource data involved in file-related system call operations that occur during the startup process of the target application. In some embodiments, the electronic device may monitor file-related system call operations that occur during the startup process of the target application and obtain a list of target resources based on the system call operations. Optionally, system call operations may include openat, read, write, and mmap operations, etc. Here, openat can refer to an open operation, which can open a file or directory and obtain a file descriptor; read operation refers to a read operation, which can be used to read a file into a preset area, such as reading the file into memory; write operation refers to a write operation, which can write data from a preset area to a file, or write data from memory to a file to achieve data storage or updating; mmap operation refers to a mapping operation, which can be used to map a file or other object into the address space of a process to achieve efficient access to the file.
[0082] In some embodiments, the offset of the file involved in the system call operation, the length of the file, and the specific path of the file can be determined, and the data determined above can be used as the target resource data. For example... Figure 3 The diagram shows a target resource list, which includes the offsets, lengths, and paths of multiple files. Here, offset represents the offset, length represents the file length, and path represents the file path.
[0083] In step S203, when the startup status indicates that the target application is not starting for the first time, the startup process can be executed using the target process. The specific process for determining the target process can be found in step S101 above, and will not be repeated here.
[0084] Currently, when a target application is launched for the first time, the electronic device loads all the resource data required for the application to start. However, this embodiment loads the resource data of the hot spot area required for the application to start, thereby reducing the memory space occupied and reducing the probability of disk crash during the application's cold start process, effectively improving the application's cold start speed.
[0085] According to an exemplary embodiment, such as Figure 4 As shown, this embodiment provides a method for launching an application, including:
[0086] S401. Based on the received startup command of the target application, determine the target process corresponding to the target application.
[0087] S402. Based on the target process and target resource list, start the target application and display the target application's interface.
[0088] S403, Obtain the usage status of the target application.
[0089] S404. Determine whether the target application's usage status indicates an exit status. If yes, proceed to step S405; otherwise, proceed to step S406.
[0090] S405. Clear the already loaded target resource data.
[0091] S406. Obtain the memory resource occupancy status.
[0092] S407. Determine whether the memory resource occupancy status indicates that the available memory resources are strained. If yes, proceed to step S405; otherwise, proceed to step S408.
[0093] S408. Obtain the duration of continuous use of the target application.
[0094] S409. Determine whether the continuous usage time of the target application is greater than or equal to the preset duration. If yes, proceed to step S405; otherwise, proceed to step S403.
[0095] Steps S401-S402 are the same as steps S101-S102 in the above embodiment, and will not be described again here.
[0096] In step S403, the state is used to characterize whether the target application is in an exit state. When the target application is in an exit state, a cold start is required when the application is used.
[0097] In some embodiments, the usage status of a target application can be determined by the running status of the target application. Optionally, the application monitoring program can monitor applications running in the foreground and applications running in the background.
[0098] In step S404, in one example, an application monitoring program can be used to monitor applications running in the foreground and applications running in the background. When the target application is running in the foreground or background, the usage status can be determined as not exiting; conversely, when the target application is neither running in the foreground nor in the background, the usage status can be determined as exiting.
[0099] In step S405, when the status is represented as an exit status, it indicates that the target application has been completely closed. Therefore, the loaded target resource data can be cleared to reduce the resource consumption of memory space and solve the problem of memory space shortage.
[0100] It should be noted that clearing target resource data refers to deleting the target resource data from the memory space.
[0101] In step S406, in some embodiments, when the usage state is characterized as an exit state, it indicates that the target application is in a running state (which may be a foreground running state or a background running state). At this time, the memory resource occupancy status can be obtained. The memory resource occupancy status can characterize the memory space usage of the electronic device.
[0102] In one example, the occupancy status of memory resources can be determined based on the available size of memory resources. That is, the occupancy status can be determined based on the remaining space in the memory area. In another example, the occupancy status can be determined based on the already occupied space in the memory area.
[0103] Optionally, the remaining or occupied memory space can be determined using preset commands or settings in the electronic device's management program. Preset commands are those related to determining memory space size. For example, for Linux systems, the preset command could be the `free` command, which displays memory usage; similarly, for Windows systems, the preset command could be the `wmic` command, which retrieves the free and total memory space.
[0104] In step S407, in some embodiments, when the remaining space of the memory is less than a first preset threshold, the memory resource occupancy status is determined to be characterized as a shortage of available memory resources. The size of the first preset threshold can be set and selected based on actual needs. Correspondingly, in some embodiments, when the remaining space of the memory is greater than a second preset threshold, the memory resource occupancy status is determined to be characterized as a sufficient supply of available memory resources. The size of the second preset threshold can be set and selected based on actual needs.
[0105] Similarly, in some embodiments, when the occupied memory space is less than a third preset threshold, the memory resource occupancy status is determined to indicate that the available memory resources are sufficient. The third preset threshold can be set and selected based on actual needs. Correspondingly, in some embodiments, when the occupied memory space is greater than a fourth preset threshold, the memory resource occupancy status is determined to indicate that the available memory resources are strained. The fourth preset threshold can be set and selected based on actual needs.
[0106] When the usage status is characterized as not exiting and the occupied status is characterized as memory resource shortage, useless target resource data will occupy memory space. Therefore, in order to solve the problem of memory space shortage, the already loaded target resource data can be cleared.
[0107] In step S408, in some embodiments, an application monitoring program can be used to monitor the continuous usage duration of the target application. Optionally, a timing program can start timing after the target application starts, and the continuous usage duration of the target application can be determined by acquiring the duration data of the timing program. It should be noted that if the target application exits midway, the timing program will restart timing the next time the target application starts. For example, if the timing program collects that the continuous usage duration of the target application X is 2 hours, and the target application X exits at this time, the timing program can be reset to zero and the timing will restart when the target application X starts the next time.
[0108] Optionally, if there are multiple target applications running simultaneously, a corresponding timer can be set for each target application, and the continuous usage duration of the corresponding target application can be collected using the timer. For example, after target application D starts, the continuous usage duration of target application D is collected using the timer d corresponding to target application D. At this time, if target application D switches from running in the foreground to running in the background, and target application E is running in the foreground, then timer d continues to time until the usage status of target application D is indicated as an exit state, and the timer e corresponding to target application E starts to time until the usage status of target application E is indicated as an exit state.
[0109] In step S409, the obtained continuous usage time of the target application can be compared with a preset time to determine the steps to be executed. It should be noted that when the continuous usage time of the target application is less than the preset time, the process can return to step S403, thereby cyclically monitoring the status of the target application and the electronic device to ensure the normal operation of the electronic device.
[0110] When the continuous usage duration is greater than or equal to the preset duration, it indicates that the target application has been running for some time. Continuing to retain the loaded target resource data would cause irrelevant data to occupy memory space, leading to memory shortages. In one example, when the continuous usage duration is greater than or equal to the preset duration, the loaded target resource data can be cleared.
[0111] This embodiment can determine whether to clear the already loaded target resource data through multiple judgment processes. By clearing the already loaded target resource data, the problem of insufficient memory space can be solved.
[0112] According to an exemplary embodiment, such as Figure 5 As shown, this embodiment provides a method for launching an application, including:
[0113] S501: Monitors usage parameters for each of multiple applications.
[0114] S502. Based on the usage parameters of each application, determine the preset application among multiple applications.
[0115] S503. The preset application that received the startup command is identified as the target application.
[0116] S504. Based on the received startup command of the target application, determine the target process corresponding to the target application.
[0117] S505. Based on the target process and target resource list, start the target application and display the target application's interface.
[0118] Steps S504-S505 are the same as steps S101-S102 in the above embodiment, and will not be described again here.
[0119] In step S501, the electronic device is equipped with an application monitoring program. In some embodiments, the application monitoring program can monitor the usage parameters of each of multiple applications.
[0120] Optionally, usage parameters can refer to user habits, which may include parameters such as usage duration, usage time period, or usage frequency. Usage duration refers to the total time an application is used within a preset time period. For example, an application might be used for 5 hours within 24 hours. Usage time period refers to the duration of an application's use over a long period, such as multiple days, months, or years. For example, if a user opens a radio application to listen to the radio every morning from 5:00 to 5:30, then the radio application's usage time period is 5:00-5:30 AM. Similarly, if a user opens a shopping application multiple times every night from 10:00 PM to 11:00 PM, then the shopping application's usage time period is 10:00-11:00 PM. Usage frequency refers to the number of times an application is used within a unit of time, and can be determined by a preset time period and the total number of uses.
[0121] In step S502, optionally, the preset applications include high-frequency applications. High-frequency applications are used to characterize applications whose usage frequency is greater than or equal to a preset frequency threshold within a preset duration period. Alternatively, high-frequency applications are used to characterize applications whose usage duration within a preset duration period is greater than or equal to a preset duration threshold. For example, if an application is used for 10 hours (greater than the preset duration threshold) within 24 hours (preset duration period), then that application can be identified as a high-frequency application / preset application. Or, for example, if an application is used 20 times within 24 hours (preset duration period), meaning its usage frequency is 20 times per day (the application's usage frequency is greater than the preset frequency threshold), then that application can be identified as a high-frequency application / preset application.
[0122] Optionally, a preset application can refer to a high-frequency application during a certain time period. For example, as shown above, a broadcast application is a high-frequency application during the time period of 5:00-5:30 AM. Similarly, as shown above, a shopping application is a high-frequency application during the time period of 10:00-11:00 PM.
[0123] In step S503, it should be noted that for a high-frequency application within a certain time period, a preset application that receives the start command within that time period can be identified as the target application. For example, during 5:00-5:30 AM, a broadcast application can be identified as the target application. Conversely, for other times outside of this time period, if the application is a non-high-frequency application, the preset application that receives the start command will not be identified as the target application.
[0124] In some embodiments, the preset application that receives the launch command can be identified as the target application. That is, the electronic device determines a pre-created target process for each preset application. In this way, after receiving the launch command of the preset application, the preset application can be launched based on the target process and target resource list corresponding to the preset application, thereby achieving fast launch of the preset application, saving the startup time of the preset application, and improving the user experience.
[0125] This embodiment can determine a preset application from multiple applications based on the usage parameters of each application, and identify the preset application that receives the launch command as the target application. Thus, for the preset application, during the cold start process of the preset application, steps S101-S102 can be followed to achieve rapid launch of the preset application, thereby reducing user waiting time and improving the user experience.
[0126] like Figure 6 The flowchart shown is a method for launching an application. A complete embodiment is given below:
[0127] S601. Determine the startup status of the target application based on the received startup command of the target application.
[0128] S602. Determine whether the startup status indicates that the target application is starting for the first time. If yes, proceed to step S603; otherwise, proceed to step S604.
[0129] S603. Create a new process for the target application to execute the startup process, and obtain the target resource list during the startup process of the target application.
[0130] S604. Determine the target process corresponding to the target application to execute the startup process.
[0131] S605. Based on the target resource list, load the target resource data to start the target application.
[0132] S606, Create the interface for the target application.
[0133] S607. Establish the association between the target process and the target application's interface, and display the target application's interface.
[0134] Exemplary embodiments of this disclosure provide an application launch device, such as... Figure 7 The present disclosure presents a block diagram of an application launch device.
[0135] The block diagram includes a determination module 71 and a startup module 72. The determination module 71 is configured to determine the target process corresponding to the target application based on the received startup command of the target application; the target process is a pre-created process, and the target process is associated with a target resource list, which indicates the target resource data that needs to be loaded during the startup process of the target application. The startup module 72 is configured to start the target application based on the target process and the target resource list, and display the target application's interface.
[0136] In some embodiments, the determining module 71 is further configured to:
[0137] Based on the received launch command of the target application, determine the launch status of the target application; the launch status is used to indicate whether the target application is launching for the first time.
[0138] When the startup status indicates that the target application is starting for the first time, a new process is created for the target application to execute the startup process, and the target resource list is obtained during the startup process of the target application.
[0139] In some embodiments, the determining module 71 is further configured to:
[0140] When the startup status indicates that the target application is not starting for the first time, the target process corresponding to the target application is determined to execute the startup process.
[0141] In some embodiments, the startup module 72 is configured to:
[0142] Based on the target resource list, load the target resource data to launch the target application;
[0143] Create the interface for the target application;
[0144] Establish the association between the target process and the target application's interface, and display the target application's interface.
[0145] In some embodiments, after the target application starts, the determining module 71 is further configured to:
[0146] Get the usage status of the target application. The usage status is used to indicate whether the target application is in an exited state. When the target application is in an exited state, a cold start is required when the application is used.
[0147] When the status is indicated as an exit status, clear the target resource data that has been loaded.
[0148] In some embodiments, the determining module 71 is further configured to:
[0149] When the usage status is represented as not exiting, obtain the memory resource occupancy status;
[0150] When the occupancy status indicates that available memory resources are scarce, clear the target resource data that has already been loaded.
[0151] In some embodiments, the determining module 71 is further configured to:
[0152] When the occupancy status indicates that there are sufficient available memory resources, obtain the duration of continuous use of the target application.
[0153] When the continuous usage duration is greater than or equal to the preset duration, clear the already loaded target resource data.
[0154] In some embodiments, the determining module 71 is further configured to:
[0155] Monitor usage parameters for each of multiple applications;
[0156] Based on the usage parameters of each application, preset applications are determined among multiple applications; preset applications include high-frequency applications, which are used to characterize applications whose usage frequency is greater than or equal to a preset frequency threshold within a preset duration.
[0157] The preset application that receives the launch command is identified as the target application.
[0158] Figure 8 This is a block diagram of an electronic device 800 according to an exemplary embodiment.
[0159] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0160] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0161] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0162] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0163] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0164] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0165] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0166] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0167] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0168] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0169] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0170] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform an application startup method provided by an exemplary embodiment of this disclosure.
[0171] A computer program product includes computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform an application launch method provided in an exemplary embodiment of this disclosure.
[0172] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0173] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for launching an application, characterized in that, include: Based on the received launch command of the target application, determine the target process corresponding to the target application; The target process is a pre-created process, and the target process is associated with a target resource list. The target resource list is used to indicate the target resource data that needs to be loaded during the startup of the target application. Based on the target process and the target resource list, the target application is launched and the interface of the target application is displayed.
2. The application launch method according to claim 1, characterized in that, The method further includes: Based on the received launch command of the target application, the launch status of the target application is determined; the launch status is used to indicate whether the target application is being launched for the first time. When the startup state indicates that the target application is starting for the first time, a new process is created for the target application to execute the startup process, and the target resource list is obtained during the startup process of the target application.
3. The application launch method according to claim 2, characterized in that, The method further includes: When the startup status indicates that the target application is not being launched for the first time, the target process corresponding to the target application is determined to execute the startup process.
4. The application launch method according to claim 1, characterized in that, The step of launching the target application and displaying its interface based on the target process and the target resource list includes: Based on the target resource list, the target resource data is loaded to launch the target application; Create the interface for the target application; Establish the association between the target process and the interface of the target application, and display the interface of the target application.
5. The application launch method according to claim 4, characterized in that, After the target application is launched, the method further includes: The usage status of the target application is obtained, which indicates whether the target application is in an exited state. When the target application is in an exited state, a cold start is required when the application is used. When the usage status is characterized as an exit status, the loaded target resource data is cleared.
6. The application launch method according to claim 5, characterized in that, The method further includes: When the usage status is characterized as not exiting, obtain the memory resource occupancy status; When the occupancy status indicates that the available memory resources are scarce, the loaded target resource data is cleared.
7. The application launch method according to claim 6, characterized in that, The method further includes: When the occupancy status indicates that the available memory resources are sufficient, the duration of continuous use of the target application is obtained; When the continuous usage duration is greater than or equal to the preset duration, the loaded target resource data is cleared.
8. The application launch method according to claim 1, characterized in that, The method further includes: Monitor usage parameters for each of multiple applications; Based on the usage parameters of each application, a preset application is determined among the plurality of applications; the preset application includes a high-frequency application, which is used to characterize an application whose usage frequency is greater than or equal to a preset frequency threshold within a preset duration. The preset application that receives the launch command is identified as the target application.
9. A device for launching an application, characterized in that, include: The determination module is configured to determine the target process corresponding to the target application based on the received launch command of the target application; The target process is a pre-created process, and the target process is associated with a target resource list. The target resource list is used to indicate the target resource data that needs to be loaded during the startup of the target application. The startup module is configured to launch the target application and display the interface of the target application based on the target process and the target resource list.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the application startup method as described in any one of claims 1-8.
11. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the application startup method as described in any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the application startup method as described in any one of claims 1 to 8.