Application program starting method, system and equipment and medium

By obtaining the application's immediate task queue and delayed task queue, and determining whether the tasks in the delayed task queue need to be delayed execution based on the device configuration parameters, dynamically adjusting the startup strategy, the problem of long application startup time is solved, and the startup time is minimized and functional integrity is achieved.

CN120123019APending Publication Date: 2025-06-10SICHUAN SHENZHOUXING NETWORK CAR-HAILING SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510298254.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In the prior art, the startup time of the application program is relatively long, and due to the hardware performance and the allocation of startup phase tasks, it is difficult to complete startup and enter the available state in the shortest time.

Method used

Dynamically adjust the startup strategy to optimize the startup time by obtaining the immediate task queue and delayed task queue when the application starts, and determining whether the tasks in the delayed task queue need to be delayed according to the device configuration parameters.

Benefits of technology

Ensure that the application can be started and entered into available state in the shortest possible time, minimize startup time, and ensure the integrity of application functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123019A_ABST
    Figure CN120123019A_ABST
Patent Text Reader

Abstract

The invention provides an application program starting method, system and device and a medium, and the starting method comprises the steps: obtaining an immediate task queue and a delayed task queue of an application program when the application program is started; executing the starting task in the immediate task queue through a thread; judging whether the starting tasks in the delay task queue need to be executed in a delayed manner or not based on configuration parameters of equipment where the application program is located: when the delay execution is not needed, immediately executing the starting tasks in the delay task queue through a thread when all the starting tasks in the immediate task queue are executed; and when delay execution is needed, after all the starting tasks in the immediate task queue are executed, and a preset delay condition is met, immediately executing the starting tasks in the delay task queue through a thread. According to the method, the starting strategy is dynamically adjusted, so that the minimization of the starting time is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile devices, and particularly to a method, system, device and medium for starting an application program. Background Art

[0002] In the current mobile application environment, users have higher and higher requirements for the startup speed of application programs (Apps), and expect to see the interface of the application program and start using its functions in the shortest time. However, in actual situations, the startup time of the application program is not only affected by the time-consuming tasks executed during the startup phase inside it, but also limited by the hardware performance of the running device. Therefore, how to reasonably allocate and optimize the tasks executed during the startup phase of the application program to ensure that the application program can be started and enter the available state in the shortest possible time has become an urgent problem to be solved. Summary of the Invention

[0003] In view of the above-mentioned disadvantages of the prior art, the purpose of the present invention is to provide a method, system, device and medium for starting an application program, which is used to solve the problem that in the prior art, during the startup phase of the application program, it is necessary to reasonably allocate and execute startup tasks.

[0004] To achieve the above object and other related objects, the present invention provides a method for starting an application program, the method comprising:

[0005] When the application program starts, obtain the immediate task queue and the delayed task queue of the application program;

[0006] Execute the startup tasks in the immediate task queue through a thread;

[0007] Based on the configuration parameters of the device where the application program is located, determine whether the startup tasks in the delayed task queue need to be delayed for execution:

[0008] When no delay is required for execution, when all the startup tasks in the immediate task queue are completed, immediately execute the startup tasks in the delayed task queue through the thread;

[0009] When delay is required for execution, after all the startup tasks in the immediate task queue are completed, after reaching the preset delay condition, immediately execute the startup tasks in the delayed task queue through the thread.

[0010] In an embodiment of the present invention, the step of determining whether the startup tasks in the delayed task queue are delayed for execution based on the configuration parameters of the device where the application program is located includes:

[0011] Compare the configuration parameters of the device where the application program is located with the preset parameters to obtain a parameter comparison result;

[0012] Based on the result of the parameter comparison, determine whether the start tasks in the delayed task queue are executed with delay.

[0013] In an embodiment of the present invention, in the step of executing the start tasks in the delayed task queue after reaching a preset delay condition:

[0014] After reaching the preset delay time, execute the start tasks in the delayed task queue.

[0015] In an embodiment of the present invention, the step of executing the start tasks in the immediate task queue includes:

[0016] Obtain the priorities corresponding to the start tasks in the immediate task queue, and sort the multiple start tasks based on the priorities;

[0017] Execute the sorted start tasks in the immediate task queue in sequence.

[0018] In an embodiment of the present invention, the thread is the main thread, and the immediate task queue and the delayed task queue of the application program are pre-configured, specifically including:

[0019] Obtain multiple start tasks of the application program;

[0020] Add the start tasks related to the interface element configuration of the application program to the task queue of the main thread;

[0021] Divide the task queue of the main thread into the immediate task queue of the main thread and the delayed task queue of the main thread according to whether the start tasks are immediately executed in the start phase.

[0022] In an embodiment of the present invention, the thread is an asynchronous thread, and the steps of dividing the immediate task queue and the delayed task queue of the application program are pre-configured, specifically including:

[0023] Obtain multiple start tasks of the application program;

[0024] Add the start tasks unrelated to the interface element configuration of the application program to the task queue of the asynchronous thread;

[0025] Divide the task queue of the asynchronous thread into the immediate task queue of the asynchronous thread and the delayed task queue of the asynchronous thread according to whether the start tasks are immediately executed in the start phase.

[0026] In an embodiment of the present invention, the thread includes the main thread and the asynchronous thread;

[0027] When a delayed execution is required, after all the startup tasks in the immediate task queue of the main thread are completed and all the startup tasks in the immediate task queue of the asynchronous thread are completed, in the main thread, the startup tasks in the main thread delayed task queue are executed; in the asynchronous thread, the startup tasks in the asynchronous thread delayed task queue are executed.

[0028] The present invention also provides a startup system for an application program, the system comprising:

[0029] An acquisition unit, configured to acquire the immediate task queue and the delayed task queue of the application program when the application program is started;

[0030] A monitoring unit, configured to execute the startup tasks in the immediate task queue through a thread;

[0031] A judgment unit, configured to judge whether the startup tasks in the delayed task queue need to be delayed based on the configuration parameters of the device where the application program is located;

[0032] A first execution unit, configured to, when the startup tasks in the delayed task queue do not need to be delayed, immediately execute the startup tasks in the delayed task queue through the thread when all the startup tasks in the immediate task queue are completed;

[0033] A second execution unit, configured to, when the startup tasks in the delayed task queue need to be delayed, immediately execute the startup tasks in the delayed task queue through the thread after a preset delay condition is reached after all the startup tasks in the immediate task queue are completed.

[0034] The present invention also provides an electronic device, the electronic device comprising:

[0035] One or more processors;

[0036] A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the electronic device to implement the startup method of the application program as described in any one of the above.

[0037] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor of a computer, enables the computer to execute the startup method of the application program as described in any one of the above.

[0038] As described above, a method, system, device, and medium for starting an application according to the present invention rationally allocate and optimize tasks executed during the startup phase of the application. On the premise of ensuring the functional integrity of the application, the startup strategy is dynamically adjusted to ensure that the application can be started and enter the available state in the shortest possible time, so as to minimize the startup time. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 FIG. 1 is a schematic flowchart of a method for starting an application according to an embodiment of the present invention.

[0040] Figure 2 FIG. 2 is a schematic flowchart of task division during startup in an application according to an embodiment of the present invention.

[0041] Figure 3 FIG. 3 is a schematic flowchart of task execution during startup in an application according to an embodiment of the present invention.

[0042] Figure 4 FIG. 4 is a block diagram of the structure of a startup system for an application according to an embodiment of the present invention.

[0043] Figure 5 FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The following specific examples illustrate the embodiments of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0045] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention schematically. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0046] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0047] Please refer to Figures 1 to 5 , the present invention provides a method, system, device and medium for starting an application program, which can be applied in the field of mobile devices, such as the startup items of application programs (Apps) on personal computers, tablet computers, and mobile phones. By reasonably allocating and optimizing the tasks executed during the startup phase of the application program, considering the hardware differences such as the central processing unit (CPU) and memory of different devices, the present invention ensures that the application program can be started and enter the available state in the shortest possible time. On the premise of ensuring the functional integrity and user experience of the application program, the present invention dynamically adjusts the startup strategy according to different hardware environments to minimize the startup time.

[0048] Please refer to Figure 1 , the present invention provides a method for starting an application program, which may include the following steps.

[0049] Step S10: When the application program starts, obtain the immediate task queue and the delayed task queue of the application program.

[0050] Step S20: Execute the startup tasks in the immediate task queue through a thread.

[0051] Step S30: Based on the configuration parameters of the device where the application program is located, determine whether the startup tasks in the delayed task queue need to be delayed.

[0052] Step S40: When no delay is required, when all the startup tasks in the immediate task queue are completed, immediately execute the startup tasks in the delayed task queue through a thread.

[0053] Step S50: When delay is required, after all the startup tasks in the immediate task queue are completed, when the preset delay condition is reached, immediately execute the startup tasks in the delayed task queue through a thread.

[0054] The following conducts a detailed analysis of the above steps through specific embodiments.

[0055] Step S10: When the application program starts, obtain the immediate task queue and the delayed task queue of the application program.

[0056] Specifically, the startup phase of the application program generally refers to the cold startup, from clicking the icon of the application program to the available phase where the home page of the application program is rendered. During the startup phase of the application program, the application program will execute a series of startup tasks, such as loading relevant dynamic libraries, setting up the application program environment, initializing third-party libraries, setting and loading the home page, etc.

[0057] Specifically, the startup tasks of an application are positively correlated with the project scale and complexity. Therefore, all startup tasks corresponding to the application startup phase can be listed. Then, according to the characteristics of each startup task, the startup tasks are divided into task queues of different threads, such as the main thread immediate task queue, the main thread delayed task queue, the asynchronous thread immediate task queue, and the asynchronous thread delayed task queue.

[0058] Step S20: Execute the startup tasks in the immediate task queue through threads.

[0059] Specifically, for an application, the startup tasks in the main thread immediate task queue are usually relatively fixed, such as environment setting tasks, network parameter setting tasks, home page loading tasks, etc. Therefore, in the main thread, execute the startup tasks in the main thread immediate task queue. When executing the corresponding startup tasks in the main thread, in the asynchronous thread, the startup tasks in the asynchronous thread immediate task queue will also be executed (executed in the background).

[0060] Step S30: Based on the configuration parameters of the device where the application is located, determine whether the startup tasks in the delayed task queue need to be delayed.

[0061] Specifically, for an application, the length of the application startup time is related not only to the time consumed by the startup tasks executed in the startup phase of the application project but also to the hardware performance of the running device. Based on the configuration parameters of the device where the application is located, determine whether the startup tasks in the delayed task queue need to be delayed.

[0062] In the case where the running device has low-configured hardware performance, the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue need to be delayed. In the case where the running device has high-configured hardware performance, the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue may not need to be delayed.

[0063] Step S40: When it does not need to be delayed, when all the startup tasks in the immediate task queue are completed, immediately execute the startup tasks in the delayed task queue through threads.

[0064] Specifically, in the case where the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue do not need to be delayed, after all the startup tasks in the main thread immediate task queue are completed, in the main thread, execute the startup tasks in the main thread delayed task queue; after all the startup tasks in the asynchronous thread immediate task queue are completed, in the asynchronous thread, execute the startup tasks in the asynchronous thread delayed task queue.

[0065] In this embodiment, when the running device has relatively high - configuration hardware performance, even if not all the startup tasks in the main - thread immediate task queue and all the startup tasks in the asynchronous - thread immediate task queue are completed, in the main thread, the startup tasks in the main - thread delayed task queue are executed, or in the asynchronous thread, the startup tasks in the asynchronous - thread delayed task queue are executed, it can still ensure that the startup phase of the application proceeds smoothly and there is no lag.

[0066] Step S50: When delayed execution is required, after all the startup tasks in the immediate task queue are completed, when the preset delay condition is met, the startup tasks in the delayed task queue are immediately executed by a thread.

[0067] Specifically, when the startup tasks in the main - thread delayed task queue and the asynchronous - thread delayed task queue need to be executed with a delay, after the preset delay condition is met, in the main thread, the startup tasks in the main - thread delayed task queue are executed, and in the asynchronous thread, the startup tasks in the asynchronous - thread delayed task queue are executed.

[0068] In this embodiment, since the running device has relatively low - configuration hardware performance, if not all the startup tasks in the main - thread immediate task queue and all the startup tasks in the asynchronous - thread immediate task queue are completed, that is, in the main thread, the startup tasks in the main - thread delayed task queue are executed, or in the asynchronous thread, the startup tasks in the asynchronous - thread delayed task queue are executed, lag is likely to occur.

[0069] Therefore, when the running device has relatively low - configuration hardware performance, it is necessary to consider starting from the premise that the application does not experience lag, that is, after the preset delay condition is met, then execute the startup tasks in the main - thread delayed task queue and execute the startup tasks in the asynchronous - thread delayed task queue.

[0070] Specifically, the delay condition can be that all the startup tasks in the main - thread immediate task queue and all the startup tasks in the asynchronous - thread immediate task queue are completed, or it can be a preset delay time, and the delay time is a non - zero constant.

[0071] Please refer to Figure 1 、 Figure 2 , in an embodiment of the present invention, the thread includes a main thread and an asynchronous thread, and the immediate task queue and the delayed task queue of the application are pre - configured. Specifically, the steps for dividing the main - thread immediate task queue, the main - thread delayed task queue, the asynchronous - thread immediate task queue, and the asynchronous - thread delayed task queue may include step S110, step S120, and step S130.

[0072] Step S110: Obtain multiple startup tasks of the application.

[0073] Step S120: Divide the multiple startup tasks into a main thread task queue and an asynchronous thread task queue according to whether the startup tasks are related to the interface element configuration of the application.

[0074] Specifically, if the startup tasks are related to the interface element configuration of the application, divide the multiple startup tasks into the main thread task queue. If the startup tasks are not related to the interface element configuration of the application, divide the multiple startup tasks into the asynchronous thread task queue.

[0075] Step S130: Divide the main thread task queue into a main thread immediate task queue and a main thread delayed task queue according to whether the startup tasks are immediately executed during the startup phase, and divide the asynchronous thread task queue into an asynchronous thread immediate task queue and an asynchronous thread delayed task queue.

[0076] Specifically, the main thread is mainly responsible for handling operations related to the user interface (UI), including updating views, processing user interaction events, etc. All interactions with interface elements must be carried out on the main thread, otherwise it may cause the application to crash or the user interface to display abnormally. The asynchronous thread is mainly used to execute operations that do not need to be completed immediately or may take a long time to complete, such as downloading files, parsing large datasets, executing complex algorithms, etc. This can avoid blocking the main thread and keep the application responsive.

[0077] Specifically, for an application, the startup tasks in the main thread immediate task queue are usually relatively fixed, such as environment setting tasks, network parameter setting tasks, home page loading tasks, etc. Similarly, the initialization tasks of third-party libraries are at least included in the asynchronous thread immediate task queue. The style setting task of the loading box is at least included in the main thread delayed task queue. The log upload task and the background data synchronization task are at least included in the asynchronous thread delayed task queue.

[0078] Please refer to Figure 1 , in an embodiment of the present invention, in step S20, the step of executing the startup tasks in the immediate task queue through a thread includes step S210 and step S220.

[0079] Step S210: Obtain the priorities corresponding to the startup tasks in the immediate task queue, and sort the multiple startup tasks based on the priorities.

[0080] Step S220: Execute the sorted startup tasks in the immediate task queue sequentially through a thread.

[0081] Specifically, first, obtain the priorities corresponding to the startup tasks in the immediate task queue of the main thread, and sort the multiple startup tasks based on the priorities. Obtain the priorities corresponding to the startup tasks in the immediate task queue of the asynchronous thread, and sort the multiple startup tasks based on the priorities. Then, sequentially execute the sorted startup tasks in the main thread in the main thread; sequentially execute the sorted startup tasks in the immediate task queue of the asynchronous thread in the asynchronous thread.

[0082] Specifically, during the startup phase of the application, the priorities of the startup tasks can be determined based on multiple factors, such as the importance and urgency related to the startup tasks, the impact on the user experience, and the time required to execute the startup tasks, etc.

[0083] Please refer to Figure 1 , Figure 3 , in an embodiment of the present invention, in step S30, the step of determining whether the startup tasks in the delayed task queue are to be executed with delay based on the configuration parameters of the device where the application is located may include step S310 and step S320.

[0084] Step S310: Compare the configuration parameters of the device where the application is located with the preset parameters to obtain a parameter comparison result.

[0085] Step S320: Based on the parameter comparison result, determine whether the startup tasks in the delayed task queue are to be executed with delay.

[0086] As Figure 2 shown, the configuration parameters may include the model of the device and the memory value. When the model of the device where the application is located is greater than or equal to the specified model and the memory value is greater than or equal to the specified memory value, the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue do not need to be executed with delay. When the model of the device where the application is located is less than the specified model or the memory value is less than the specified memory value, the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue need to be executed with delay.

[0087] Specifically, in the case where the running device has high - configuration hardware performance, even if not all the startup tasks in the immediate task queue of the main thread and all the startup tasks in the immediate task queue of the asynchronous thread are completed, and the startup tasks in the main thread delayed task queue are executed in the main thread or the startup tasks in the asynchronous thread delayed task queue are executed in the asynchronous thread, it can still ensure that the startup phase of the application proceeds smoothly and there will be no lag situation.

[0088] Therefore, when the running device has high-configuration hardware performance, that is, the configuration parameters of the device where the application is located are greater than or equal to the preset parameters, it can be determined that the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue do not need to be delayed.

[0089] Specifically, when the running device has low-configuration hardware performance, if all startup tasks in the main thread's immediate task queue and all startup tasks in the asynchronous thread's immediate task queue are not executed, that is, in the main thread, the startup tasks in the main thread's delayed task queue are executed, or in the asynchronous thread, the startup tasks in the asynchronous thread's delayed task queue are executed, lag is likely to occur.

[0090] Therefore, when the running device has low-configuration hardware performance, that is, when the configuration parameters of the device where the application is located are less than the preset parameters, it can be determined that the startup tasks in the main thread delayed task queue and the asynchronous thread delayed task queue need to be delayed.

[0091] See also Figure 1 In one embodiment of the present invention, in step S40, when all the start tasks in the immediate task queue are completed, the steps of starting the tasks in the delayed task queue are executed:

[0092] When all startup tasks in the main thread's immediate task queue are completed, the startup tasks in the main thread's delayed task queue are executed in the main thread; when all startup tasks in the asynchronous thread's immediate task queue are completed, the startup tasks in the asynchronous thread's delayed task queue are executed in the asynchronous thread.

[0093] See also Figure 1 In one embodiment of the present invention, in step S50, after the preset delay condition is met, in the step of immediately executing the start task in the delayed task queue by the thread:

[0094] After the preset delay time is reached, the start task in the delayed task queue is immediately executed by the thread.

[0095] Specifically, for an application, the startup tasks in the main thread's immediate task queue are usually relatively fixed, such as environment setting tasks, network parameter setting tasks, home page loading tasks, etc. Similarly, the asynchronous thread's immediate task queue includes at least the initialization task of the third-party library. The main thread's delayed task queue includes at least the style setting task of the loading box. The asynchronous thread's delayed task queue includes at least the log upload task and the background data synchronization task.

[0096] Therefore, for an application, when the startup tasks in the main thread immediate task queue and the asynchronous thread immediate task queue are relatively certain, it is possible to determine whether all the startup tasks in the main thread immediate task queue are executed first, or whether all the startup tasks in the asynchronous thread immediate task queue are executed first.

[0097] Taking the case where all the startup tasks in the main thread immediate task queue are executed first as an example, after all the startup tasks in the main thread immediate task queue are executed first and after reaching the preset delay time, it is possible to ensure that all the startup tasks in the asynchronous thread immediate task queue are executed. After that, in the main thread, the startup tasks in the main thread delay task queue are executed, and in the asynchronous thread, the startup tasks in the asynchronous thread delay task queue are executed. The advantage of this is that there is no need to continuously monitor whether there are unexecuted startup tasks in the main thread immediate task queue or the asynchronous thread immediate task queue.

[0098] Please refer to Figure 1 , in an embodiment of the present invention, in step S50, when delayed execution is required, after all the startup tasks in the immediate task queue are executed and after reaching the preset delay condition, in the step of immediately executing the startup tasks in the delay task queue by the thread:

[0099] The thread includes a main thread and an asynchronous thread;

[0100] When delayed execution is required, after all the startup tasks in the main thread immediate task queue are executed and all the startup tasks in the asynchronous thread immediate task queue are executed, in the main thread, the startup tasks in the main thread delay task queue are executed; in the asynchronous thread, the startup tasks in the asynchronous thread delay task queue are executed.

[0101] Specifically, for the startup tasks in the main thread delay task queue and the startup tasks in the asynchronous thread delay task queue, the monitoring of RunLoop can be enabled. When RunLoop is in the idle stage, that is, when RunLoop is about to enter the sleep or exit stage, the startup tasks in the main thread delay task queue and the startup tasks in the asynchronous thread delay task queue are taken out and executed to avoid problems such as lag and freeze.

[0102] Among them, RunLoop is a basic component for managing the event loop, which enables the main thread and the asynchronous thread to remain active while waiting for events. When it comes to optimizing the home page loading time of an application and ensuring a smooth user experience, using the idle stage of RunLoop to execute some non-critical but time-consuming tasks is an effective strategy.

[0103] For example, RunLoop listens for messages from the main thread and asynchronous threads, and distributes the events corresponding to the startup tasks in the immediate task queue of the main thread and the startup tasks in the immediate task queue of the asynchronous thread to the corresponding handlers. When there are no events of startup tasks to be processed, RunLoop enters the sleep state to save resources; once a new event arrives, it is awakened and continues to process.

[0104] Please refer to Figure 4 , in an embodiment of the present invention, a startup system for an application is proposed, which may include an acquisition unit 110, a monitoring unit 120, a judgment unit 130, a first execution unit 140, and a second execution unit 150.

[0105] The acquisition unit 110 is configured to acquire the immediate task queue and the delayed task queue of the application when the application starts up.

[0106] The monitoring unit 120 is configured to execute the startup tasks in the immediate task queue through a thread.

[0107] The judgment unit 130 is configured to judge whether the startup tasks in the delayed task queue need to be delayed based on the configuration parameters of the device where the application is located.

[0108] The first execution unit 140 is configured to, when the startup tasks in the delayed task queue do not need to be delayed, immediately execute the startup tasks in the delayed task queue through the thread when all the startup tasks in the immediate task queue are executed.

[0109] The second execution unit 150 is configured to, when the startup tasks in the delayed task queue need to be delayed, immediately execute the startup tasks in the delayed task queue through the thread after a preset delay condition is reached after all the startup tasks in the immediate task queue are executed.

[0110] Please refer to Figure 5 , in an embodiment of the present invention, an electronic device is proposed. The electronic device 11 may include a memory 12, a processor 13, and a bus, and may further include a computer program stored in the memory 12 and executable on the processor 13, such as a startup program for an application.

[0111] Among them, the memory 12 at least includes one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 11, such as the mobile hard disk of the electronic device 11. In other embodiments, the memory 12 can also be an external storage device of the electronic device 11, such as a plug-in mobile hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the electronic device 11. Further, the memory 12 can also include both the internal storage unit and the external storage device of the electronic device 11. The memory 12 can be used not only to store application software installed on the electronic device 11 and various types of data, such as the startup code of the application program, etc., but also to temporarily store the data that has been output or will be output.

[0112] In some embodiments, the processor 13 can be composed of integrated circuits. For example, it can be composed of a single packaged integrated circuit, or can be composed of multiple integrated circuits with the same or different functions, including the combination of one or more Central Processing Units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips, etc. The processor 13 is the control core (Control Unit) of the electronic device 11, connecting all components of the entire electronic device 11 through various interfaces and lines, and by running or executing the programs or modules stored in the memory 12 (such as the startup program of the application program, etc.), and calling the data stored in the memory 12, to execute various functions of the electronic device 11 and process data.

[0113] The processor 13 executes the operating system of the electronic device 11 and various installed application programs. The processor 13 executes the application program to implement the steps in the above-mentioned application program startup method.

[0114] Exemplarily, the computer program can be divided into one or more modules, and the one or more modules are stored in the memory 12 and executed by the processor 13 to complete this application. The one or more modules can be a series of computer program instruction segments that can complete specific functions, and these instruction segments are used to describe the execution process of the computer program in the electronic device 11. For example, the computer program can be divided into an acquisition unit 110, a first execution unit 120, a judgment unit 130, a second execution unit 140, and a third execution unit 150.

[0115] The integrated unit implemented in the form of software function modules can be stored in a computer-readable storage medium, which can be non-volatile or volatile. The above software function modules are stored in a storage medium and include several instructions for causing a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute part of the functions of the application program startup method described in various embodiments of the present application.

[0116] In summary, a method, system, device, and medium for starting an application program disclosed by the present invention. By reasonably allocating and optimizing the tasks executed during the startup phase of the application program, while ensuring the functional integrity of the application program, the startup strategy is dynamically adjusted to ensure that the application program can complete startup and enter the available state in the shortest possible time, so as to minimize the startup time. Therefore, the present invention effectively overcomes various drawbacks in the prior art and has high industrial utilization value.

[0117] The above embodiments are only illustrative of the principles and effects of the present invention and are not used to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.

Claims

1. A method for starting an application, characterized in that: The method comprises: When the application is started, obtaining the immediate task queue and delayed task queue of the application; Execute the startup task in the immediate task queue through a thread; Based on the configuration parameters of the device where the application is located, determine whether the start task in the delayed task queue needs to be delayed: When delayed execution is not required, when all the start tasks in the immediate task queue are completed, the start tasks in the delayed task queue are immediately executed by the thread; When delayed execution is required, after all the start tasks in the immediate task queue are executed, and after a preset delay condition is met, the start tasks in the delayed task queue are immediately executed by the thread.

2. The method for starting an application according to claim 1, characterized in that: The step of determining whether to delay execution of the start task in the delayed task queue based on the configuration parameters of the device where the application is located comprises: Compare the configuration parameters of the device where the application is located with the preset parameters to obtain a parameter comparison result; Based on the parameter comparison result, it is determined whether the start task in the delayed task queue is to be delayed in execution.

3. The method for starting an application according to claim 1, characterized in that: In the step of immediately executing the start task in the delayed task queue by the thread after the preset delay condition is met: After the preset delay time is reached, the start task in the delayed task queue is immediately executed by the thread.

4. The method for starting an application according to claim 1, characterized in that: The step of executing the start task in the immediate task queue through a thread includes: Obtaining the priorities corresponding to the startup tasks in the immediate task queue, and sorting the multiple startup tasks based on the priorities; The sorted startup tasks in the immediate task queue are executed in sequence through threads.

5. The method for starting an application according to claim 1, characterized in that: The thread is the main thread, and the immediate task queue and delayed task queue of the application are pre-configured, specifically including: Obtain multiple startup tasks of the application; Adding a startup task related to the configuration of the interface elements of the application to the task queue of the main thread; According to whether the startup task is executed immediately in the startup phase, the task queue of the main thread is divided into an immediate task queue of the main thread and a delayed task queue of the main thread.

6. The method for starting an application according to claim 1, characterized in that: The thread is an asynchronous thread, and the steps of dividing the immediate task queue and the delayed task queue of the application are pre-configured, specifically including: Obtain multiple startup tasks of the application; Adding a startup task that is not related to the configuration of the interface elements of the application to the task queue of the asynchronous thread; According to whether the startup task is executed immediately in the startup phase, the task queue of the asynchronous thread is divided into an immediate task queue of the asynchronous thread and a delayed task queue of the asynchronous thread.

7. The method for starting an application according to claim 1, characterized in that: The threads include a main thread and an asynchronous thread; When delayed execution is required, all the startup tasks in the immediate task queue of the main thread are executed, and all the startup tasks in the immediate task queue of the asynchronous thread are executed. Then, in the main thread, the startup tasks in the delayed task queue of the main thread are executed; In an asynchronous thread, a start task in a delayed task queue of the asynchronous thread is executed.

8. A system for launching an application, characterized in that: The system comprises: An acquisition unit, used to acquire an immediate task queue and a delayed task queue of the application when the application is started; A monitoring unit, used for executing the startup tasks in the immediate task queue through threads; A judging unit, configured to judge whether the start task in the delayed task queue needs to be delayed based on the configuration parameters of the device where the application is located; A first execution unit is used for immediately executing the startup tasks in the delayed task queue through the thread when all the startup tasks in the immediate task queue are completed when the startup tasks in the delayed task queue do not need to be delayed for execution; The second execution unit is used to immediately execute the startup tasks in the delayed task queue through the thread after all the startup tasks in the immediate task queue are completed and a preset delay condition is met when the startup tasks in the delayed task queue need to be delayed.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method for starting the application program as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method for starting the application program according to any one of claims 1 to 7.