Method, device and storage medium for application startup scheduling
Patent Information
- Application Number
- CN202510182244.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2026-08-18
AI Technical Summary
并且,对于冷启动启动方式,还需要涉及很多进程的创建
Smart Images

Figure CN122593915A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic device technology, and in particular to a scheduling method, device and storage medium for application startup. Background Technology
[0002] With the development of electronic device technology, electronic devices can provide more and more types of applications (APPs; also known as applications), and the functions available to users are becoming more and more abundant.
[0003] Currently, when users launch applications from the system desktop or other entry points on their electronic devices, the devices need to load not only the application's initial frame, interface framework, and content, but also, for cold start methods, the creation of numerous processes. This results in slow application startup in some scenarios, impacting user experience and battery life. Therefore, there is an urgent need to provide a scheduling method for application startup that can improve user experience and battery life. Summary of the Invention
[0004] To address the aforementioned technical issues, embodiments of this application provide an application startup scheduling method, device, and storage medium. The aim is to dynamically adjust the scheduling duration based on the actual load of the application being started, making the scheduling strategies and resources used during application startup more suitable for the currently starting application. This ensures startup speed while also considering the performance and power consumption of electronic devices, thereby improving the user's smoothness and battery life experience.
[0005] In a first aspect, embodiments of this application provide an application startup scheduling method. This method is applied to an electronic device and includes: upon receiving an operation to start a first application, recording a first time point, where the first time point is the start time of scheduling; the operation to start the first application includes a first-stage operation and a second-stage operation; executing the first-stage operation to start the first application according to a first scheduling duration and a first frequency modulation scheduling strategy, where the first scheduling duration is preset and is the estimated scheduling duration to be taken by the electronic device from the first time point to the end of the second-stage scheduling; recording a second time point upon completion of the first-stage operation; determining a first duration corresponding to the first stage based on the first and second time points, where the first duration is the first frame startup delay of the first application; estimating a second scheduling duration for the first application based on the first duration, where the second scheduling duration is calculated by a fitting algorithm based on the first duration and is the estimated content loading completion delay of the first application; determining a second duration based on the second scheduling duration and the first duration, where the second duration is the duration required for the electronic device to execute the second-stage operation; and executing the second-stage operation according to the second duration and a second frequency modulation scheduling strategy, where the first and second frequency modulation scheduling strategies are different.
[0006] Therefore, based on the actual load of the launched application, the first-frame startup latency of the first stage corresponding to the application is statistically determined. Then, based on the first-frame startup latency, the content loading completion latency required by the application is estimated. Finally, based on the statistically determined first-frame startup latency and the estimated content loading completion latency, the second duration corresponding to the second stage in the current scenario is determined, so that subsequent operations related to the second stage can be scheduled according to the determined second duration. In addition, during the application startup process, by assigning different frequency modulation scheduling strategies to the first and second stages, precise scheduling that conforms to the load characteristics of the corresponding stage can be executed according to different scheduling durations and frequency modulation scheduling strategies in different stages. In this way, the scheduling strategies and resources used during the application startup process are more suitable for the application currently being launched, thereby ensuring startup speed while taking into account the performance and power consumption of electronic devices, improving the user's smoothness and battery life experience.
[0007] According to the first aspect, based on the first duration, the second scheduling duration of the first application is estimated, including: based on the first duration and a target fitting function, the second scheduling duration is estimated, the second scheduling duration includes the first duration and the second duration, and the target fitting function describes the relationship between the first duration and the second scheduling duration.
[0008] The first scheduling duration refers to the preset fixed scheduling duration, which is the preset time to load all the content of the first application (which can be expressed as the preset content loading delay of the first application).
[0009] The first duration is the statistically determined duration of the first phase. The first duration is subject to the first scheduling duration limit.
[0010] The first scheduling duration limit is the maximum duration for performing frequency modulation scheduling in the first phase. Therefore, if the first duration is less than or equal to the first scheduling duration limit, the first duration is the actual scheduling duration corresponding to the first phase (the first actual scheduling duration); if the first duration is greater than the first scheduling duration limit, the first actual scheduling duration corresponding to the first phase is the first scheduling duration limit.
[0011] The second scheduling duration is the estimated total duration of all content in the first application, based on the first duration (which can be expressed as the estimated loading delay of the first application's content). Therefore, the second scheduling duration includes the first duration corresponding to the first phase and the second duration corresponding to the second phase. Thus, if the first duration is less than or equal to the first scheduling duration limit, the second duration = second scheduling duration - first duration. Conversely, if the first duration is greater than the first scheduling duration limit, the second duration = second scheduling duration - first scheduling duration limit.
[0012] In addition, the second duration is subject to the second scheduling duration limit value.
[0013] The second scheduling duration limit is the maximum duration for performing frequency modulation scheduling in the second phase. Therefore, if the second duration is less than or equal to the second scheduling duration limit, the second duration is the actual scheduling duration corresponding to the second phase (the second actual scheduling duration); if the second duration is greater than the second scheduling duration limit, the second actual scheduling duration corresponding to the second phase is the second scheduling duration limit.
[0014] In addition, for a description of the target fitting function, please refer to [link / reference]. Figures 9A to 9D ,as well as Figure 10 The description of the corresponding embodiments will not be repeated here.
[0015] According to the first aspect, or any implementation of the first aspect above, the target fitting function is obtained by training a fitting algorithm on sample data. The sample data includes a first sample time point recorded when the sample application is started, a second sample time point recorded when the first stage of the sample application is completed, and a third sample time point recorded when the second stage of the sample application is completed. The process of training the fitting algorithm on the sample data to obtain the target fitting function includes: determining the first sample duration corresponding to the first stage of the sample application based on the first and second sample time points; determining the second sample duration corresponding to the second stage of the sample application based on the second and third sample time points; and training the fitting algorithm on the first and second sample durations to construct a fitting function describing the relationship between the first sample duration and the content loading completion delay of the sample application, thereby obtaining the target fitting function.
[0016] For a description of the target fitting function, please refer to [link / reference]. Figures 9A to 9D ,as well as Figure 10 The description of the corresponding embodiments will not be repeated here.
[0017] Based on the first aspect, or any implementation of the first aspect above, and based on the following target fitting function, the second scheduling duration of the first application is estimated according to the first duration:
[0018]
[0019] delay = BaseTime × C
[0020] Where BaseTime is the first duration, T is the second scheduling duration, C is a constant coefficient, and offset is a constant time value.
[0021] For a description of the above formula, please refer to the description of formula (6) in the following embodiments, which will not be repeated here.
[0022] According to the first aspect, or any implementation of the first aspect above, the second stage operation is performed according to the second duration and the second frequency modulation scheduling strategy, including: determining whether the second duration is less than or equal to the second scheduling duration limit value corresponding to the second stage; if the second duration is less than or equal to the second scheduling duration limit value, the second stage operation is performed according to the second duration and the second frequency modulation scheduling strategy.
[0023] For information on setting the scheduling duration limit, please refer to [link / reference]. Figure 14 The description of step S105 in the illustrated embodiment will not be repeated here.
[0024] According to the first aspect, or any implementation of the first aspect above, the second phase of operation is performed according to the second duration and the second frequency modulation scheduling strategy, including: determining the remaining scheduling duration based on the second scheduling duration and the first actual scheduling duration corresponding to the first phase; determining a third time point based on the second time point and the remaining scheduling duration, wherein the third time point is the time point after the electronic device has completed the remaining scheduling duration from the second time point; triggering the start of the second phase of scheduling service based on the second time point, and setting a timer for the remaining scheduling duration, wherein the timer triggers the stop of the scheduling service at the third time point; and performing the second phase of operation according to the second frequency modulation scheduling strategy before the timer is triggered to stop the scheduling service.
[0025] Therefore, by triggering the start of the second phase of scheduling services based on the second time point, setting the scheduling duration of the timer based on the remaining scheduling duration, and triggering the stop of scheduling services based on the third time point, the second phase of operations can be executed within the second duration determined based on the current actual load, according to a suitable second frequency modulation scheduling strategy. This ensures startup speed while taking into account the performance and power consumption of electronic devices, thereby improving the user's smoothness and battery life experience.
[0026] According to the first aspect, or any implementation of the first aspect above, the method further includes: if the second duration is greater than the second scheduling duration limit, performing the second stage operation according to the second scheduling duration limit and the second frequency modulation scheduling strategy.
[0027] Therefore, when the second duration determined based on the current actual load exceeds the second scheduling duration limit, the second scheduling duration limit is used as the end time. Within the second scheduling duration limit, the second stage operation is executed according to the appropriate second frequency modulation scheduling strategy. This ensures startup speed while taking into account the performance and power consumption of electronic devices, thereby improving the user's smoothness and battery life experience.
[0028] According to the first aspect, or any implementation of the first aspect above, before receiving the operation to start the first application, the method further includes: upon receiving a power-on instruction, executing a power-on process; during the execution of the power-on process, determining the chip system information of the electronic device; loading the first scheduling duration of different startup methods that match the chip system information in the local storage medium into a scheduling duration cache; wherein the read / write speed of the scheduling duration cache is faster than the read / write speed of the local storage medium.
[0029] For specific implementation details regarding this aspect, please refer to [link / reference]. Figure 13 The descriptions of the platform adaptation module and the configuration file loading module in the illustrated embodiment will not be repeated here.
[0030] According to the first aspect, or any implementation of the first aspect above, upon receiving an operation to start the first application, a first time point is recorded, including: upon receiving an operation to start the first application, recording the first time point, obtaining the first scheduling duration corresponding to the current startup method of the first application, and the first frequency modulation scheduling strategy corresponding to the first stage.
[0031] For specific implementation details regarding this aspect, please refer to [link / reference]. Figure 14 The description of step S101 in the illustrated embodiment will not be repeated here.
[0032] Secondly, embodiments of this application provide an electronic device. The electronic device includes: a memory and a processor, the memory and the processor being coupled; the memory stores program instructions, which, when executed by the processor, cause the electronic device to perform the methods of the first aspect or any possible implementation thereof.
[0033] Thirdly, embodiments of this application provide a computer-readable medium for storing a computer program, the computer program including instructions for performing the method in the first aspect or any possible implementation of the first aspect.
[0034] Fourthly, embodiments of this application provide a computer program including instructions for performing the method in the first aspect or any possible implementation thereof.
[0035] Fifthly, embodiments of this application provide a chip including a processing circuit and transceiver pins. The transceiver pins and the processing circuit communicate with each other via an internal connection path. The processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive signals and to control the transmitting pin to transmit signals. Attached Figure Description
[0036] Figure 1This is a schematic diagram illustrating the cold start process as an example.
[0037] Figure 2 This is an example illustration of the startup time for different applications under a fixed scheduling duration;
[0038] Figure 3 This is an illustrative diagram showing the startup time of lightly loaded and heavily loaded business applications under a fixed scheduling duration.
[0039] Figure 4A This is an example of an interface diagram involving the startup process of a lightly loaded business application under a fixed scheduling duration;
[0040] Figure 4B This is an example of an interface diagram involving the startup process of a heavy-load business application under a fixed scheduling duration;
[0041] Figure 5 This is an example of a scheduling method for application startup based on before and after optimization, and a schematic diagram showing the setting of the scheduling duration for the application.
[0042] Figure 6 This is an example of an application startup scheduling method based on an embodiment of this application, illustrating the interface diagram involved in the startup of a lightly loaded business application;
[0043] Figure 7 This is an example of an application startup scheduling method based on an embodiment of this application, illustrating the interface diagram involved in the startup of a reloaded business application;
[0044] Figure 8A This is a schematic diagram illustrating the relationship between the various stages in an application startup process, as exemplified.
[0045] Figure 8B This is an example of a data distribution diagram corresponding to the first frame startup delay and the frame loading completion delay, and a data distribution diagram corresponding to the first frame startup delay and the content loading completion delay;
[0046] Figures 9A to 9D This is an example illustration of a fitting function that determines the dynamic scheduling duration based on data corresponding to the first frame start delay and content loading completion delay.
[0047] Figure 10 As an example, one based on Figures 9A to 9D The curve shown is a schematic diagram of the fitting function for a fixed dynamic scheduling duration;
[0048] Figure 11 This is an example illustration of the startup time for different applications under dynamic scheduling duration;
[0049] Figure 12 A schematic diagram of the hardware structure of an electronic device as an example;
[0050] Figure 13 A schematic diagram of the software structure of an electronic device as an example;
[0051] Figure 14 This is an exemplary illustration of an application startup scheduling method based on an embodiment of this application, showing a flowchart of the application startup process. Detailed Implementation
[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0054] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.
[0055] In the description of the embodiments of this application, the words "exemplary," "for example," or "optionally" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "exemplary," "for example," or "optionally" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary," "for example," or "optionally" is intended to present the relevant concepts in a specific manner.
[0056] In the description of the embodiments of this application, the names of various controls, areas, options, and entry points are for illustrative purposes only and are not intended to limit the embodiments of this application. That is, in actual use, they may also be described with other names.
[0057] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.
[0058] In the description of the embodiments in this application, unless otherwise stated, only one user interface can be displayed at a time. For example, if interface 100 is displayed, interface 200 will not be displayed on the current screen. Conversely, if interface 200 is displayed, interface 100 will not be displayed on the current screen. However, the elements included in different interfaces may be the same.
[0059] In the description of the embodiments of this application, unless otherwise stated, the dashed lines appearing in the drawings are for illustration only. That is, they are not shown in actual use.
[0060] To facilitate understanding, before describing the technical solutions provided in the embodiments of this application, the relevant terms involved in the embodiments of this application will be introduced below.
[0061] (1) Startup methods involved in the application startup process
[0062] Cold start: This is the launch method used by an electronic device to launch an application when the application's process does not already exist in the system. When launching an application using the cold start method, a process for the application needs to be created.
[0063] Regarding the task flow involved in the cold start method, it can be seen as follows: Figure 1 As shown. For example, when a user launches an app that doesn't have a corresponding process in the system (e.g., by clicking the app's icon or launching an entry point), based on a cold start method, the electronic device needs to load a blank window, then create the app and a new process, and assign the newly created process to the app. Next, the thread corresponding to the app is started, creating the app's main interface (MainActivity). This allows the layout of MainActivity to be loaded and displayed on the electronic device's screen, thus completing operations such as drawing the first frame, loading the interface framework, and loading the interface content.
[0064] Warm start: This is the launch method used by electronic devices when an app that needs to be launched already exists in the system, but its Activity may be reclaimed due to insufficient memory. When launching an app using warm start, there is no need to recreate the app's process; the required Activity can be launched (created) using the existing process.
[0065] It should be noted that when a user presses the Home button (the button to return to the home screen) or uses other methods to switch the app to the background, the electronic device will use a warm start method when the app needs to be launched.
[0066] Warm start: This is a launch method used by electronic devices when an app that needs to be launched already exists in the system, and the app's Activity is still present in the content and has not been recycled. When launching an app using the warm start method, the system simply brings the app's Activity to the foreground.
[0067] In other words, when using the cold start method for an app, it is necessary to execute... Figure 1 All aspects of the process; when launching the app using the warm start method, you can start from... Figure 1 The process begins with creating the main interface. When launching the app using a warm start method, you can start from... Figure 1 The process begins after the main interface is created, such as loading the layout. Therefore, starting the app using a warm start is the fastest, starting it using a cold start is the slowest, and starting it using a warm start is somewhere in between.
[0068] (2) Time concepts involved in the application startup process
[0069] First frame startup latency:
[0070] In this application embodiment, the first frame startup delay refers to the time (duration) from when the user clicks the application icon to when the electronic device displays the first frame of the application after running the application's code. For example, from Figure 1 The time between launching the app and completing the first frame drawing is shown in the diagram.
[0071] Framework loading completion delay:
[0072] In this embodiment, the frame loading completion delay refers to the time from when the user clicks the application icon, to when the first frame appears, and then continues drawing the application's interface framework, until the overall interface framework of the application is completed. That is, the frame loading completion delay includes the first frame startup delay and the time for drawing the interface framework. Specifically, the time for drawing the interface framework = frame loading completion delay - first frame startup delay.
[0073] Content loading completion delay:
[0074] In this embodiment, the content loading completion latency refers to the time from when the user clicks the application icon, to the appearance of the first frame, to the completion of the interface framework drawing, to the loading of the interface content, such as images, text, and videos. That is, the content loading completion latency includes the framework loading completion latency and the time for loading the interface content, or in other words, the content loading completion latency includes the first frame launch latency, the time for drawing the interface framework, and the time for loading the interface content. Specifically, the time for loading the interface content = content loading completion latency - framework loading completion latency = content loading completion latency - first frame launch latency - time for drawing the interface framework.
[0075] It should be noted that the time concepts involved in the application startup process mentioned above are for illustrative purposes only. In practical applications, these time concepts can also be represented by other names. For example, the first frame startup latency can be called the startup first frame latency or application first frame startup latency; the frame loading completion latency can be called the startup completion latency or application startup completion latency; the content loading completion latency can also be called the startup loading completion latency or application startup loading completion latency, etc.
[0076] The following combination Figure 2 , Figure 3 , Figure 4A and Figure 4B The scenarios in which the technical solutions provided in the embodiments of this application are generated will be described.
[0077] With the development of electronic device technology, electronic devices can provide more and more types of applications, and the functions available to users are becoming increasingly rich.
[0078] Currently, when users launch applications from the system desktop or other entry points on their electronic devices, the devices not only need to load the application's initial frame, interface framework, and content, but also, depending on the launch method, other operational steps are required. This results in slow application launches in some scenarios, impacting user experience and battery life. Therefore, there is an urgent need to provide a scheduling method for application launches that can improve user experience and battery life.
[0079] Furthermore, in some implementations, when an electronic device loads an application that needs to be launched, it typically loads the first frame, interface framework, and interface content of the application according to a fixed scheduling duration (the application launch scheduling method before optimization). That is, the loading of the first frame, interface framework, and interface content is completed within a fixed scheduling duration.
[0080] Exemplarily, in some implementations, the setting of the fixed scheduling duration can be determined according to the type and startup mode of the electronic device. For example, for high-end model electronic devices, the fixed scheduling duration corresponding to a warm start can be T1, the fixed scheduling duration corresponding to a warm start can be T2, and the fixed scheduling duration corresponding to a cold start can be T3; for mid-end model electronic devices, the fixed scheduling duration corresponding to a warm start can be T4, the fixed scheduling duration corresponding to a warm start can be T5, and the fixed scheduling duration corresponding to a cold start can be T6; for low-end model electronic devices, the fixed scheduling duration corresponding to a warm start can be T7, the fixed scheduling duration corresponding to a warm start can be T8, and the fixed scheduling duration corresponding to a cold start can be T9.
[0081] Among them, for the same type of electronic device, the fixed scheduling durations corresponding to cold start, warm start, and hot start can be different. The fixed scheduling durations corresponding to cold start, warm start, and hot start for different types of electronic devices can also be different. In this scenario, T1 to T9 can satisfy the relationships of T1 < T2 < T3, T4 < T5 < T6, T7 < T8 < T9, and T1 < T4 < T7.
[0082] Among them, for the same type of electronic device, the fixed scheduling durations corresponding to cold start and warm start can be the same; the fixed scheduling durations corresponding to cold start and warm start for different types of electronic devices are different; the fixed scheduling durations corresponding to hot start for different types of electronic devices can be the same or different. In this scenario, T1 to T9 can satisfy the relationships of T1 < T2 ≤ T3, T4 < T5 ≤ T6, T7 < T8 ≤ T9, and T1 ≤ T4 < T7.
[0083] Taking the high-end, mid-end, and low-end models of the Honor series as examples of electronic devices, in some scenarios, T1 to T9 can satisfy T1 = T4 = 400 milliseconds (ms), T2 = T3 = 1500 ms, T5 = T6 = 3000 ms, T7 = 800 ms, T8 = T9 = 7000 ms, as shown in Table 1 for example.
[0084] Table 1 Fixed Scheduling Duration Table for Electronic Devices of Different Device Types
[0085] Equipment type warm start warm start cold start High-end models 400ms 1500ms 1500ms Mid-range models 400ms 3000ms 3000ms low-end models 800ms 7000ms 7000ms
[0086] For example, in some other implementations, the fixed scheduling duration can be determined based on the chip system and startup method used by the electronic device. For instance, for all electronic devices using the first chip system, the fixed scheduling duration for cold start and warm start can be T10, and the fixed scheduling duration for hot start can be T11; for all electronic devices using the second chip system, the fixed scheduling duration for cold start and warm start can be between T12 and T13, and the fixed scheduling duration for hot start can be between T14 and T15.
[0087] Taking T10 = 2000ms, T11 = 800ms, T12 = 1000ms, T13 = 1500ms, T14 = 400ms, and T15 = 600ms as examples, the fixed scheduling duration of electronic devices with different chip systems can be shown in Table 2.
[0088] Table 2 Fixed Scheduling Duration of Electronic Devices with Different Chip Systems
[0089] electronic devices cold start warm start warm start The electronic device of the first chip system 2000ms 2000ms 800ms Electronic devices with a second chip system 1000ms~1500ms 1000ms~1500ms 400ms~600ms
[0090] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0091] As described above, the process of loading the first frame, interface framework, and content of an application to be launched based on a fixed scheduling time typically considers the device type and launch method, or the chip system and launch method, without taking into account the load requirements of the application. However, in real-world usage scenarios, the scheduling time required to launch applications with different load requirements varies significantly.
[0092] For example, for lightweight business applications (such as applications that require loading a framework or have little content), such as Figure 2 Apps 1, 2, 4, 5, 7, 8, and 9, which require less content to load, complete their first frame rendering, interface framework loading, and interface content loading before the fixed scheduling duration (e.g., 1500ms) ends. For example, they have already started and displayed their corresponding main interface (the user interface displayed after application startup). That is, the actual time taken to load the interface is less than the fixed scheduling duration, but the time between displaying the main interface and the end of the fixed scheduling duration (e.g., 1500ms) is significantly shorter. Figure 3 The resources (such as processor CPU0) shown in the figure are still occupied.
[0093] Taking a mobile phone as an example, a lightly loaded image gallery application as an example, a cold start method as the startup method, and a fixed scheduling duration of 1500ms as an example. Figure 4A In the scenario shown for launching the gallery application, when the user clicks icon 101 on interface 100, the phone responds to the user's action and will proceed according to... Figure 1 The cold start process shown starts the gallery application. For example, the first frame is drawn at the end of the first frame start delay, displaying interface 200. The interface frame is loaded at the end of the frame loading completion delay (or the frame loading completion time point), displaying interface 300. The interface content is loaded at the end of the content loading completion delay (or the content loading completion time point), displaying interface 400.
[0094] See also Figure 4A For example, if the time between the user clicking icon 101 and the completion of content loading on the gallery application's main screen is 550ms, then the resources occupied when starting the gallery application after the fixed scheduling time of 1500ms will be as follows: Figure 3 CPU0 will also be occupied for 950ms (Tw = 950ms).
[0095] In other words, starting up lightly loaded business applications can lead to a waste of resources.
[0096] Furthermore, in scenarios where lightly loaded business applications are continuously launched, prolonged resource waste can lead to problems such as rapid power loss and overheating of electronic devices, thereby affecting device power consumption and user experience.
[0097] For example, for heavy-load business applications (such as applications that need to load large frameworks and a lot of content), such as Figure 2 Apps like APP3, APP6, and APP10, due to the large amount of content they need to load, may experience issues such as the first frame not being drawn and / or the interface framework and / or the interface content not being fully loaded after the fixed scheduling duration (e.g., 1500ms). For example, if the reloaded application has not yet started at the end of the fixed scheduling duration, and the initial interface has not yet been displayed, the reloaded application may only start after time Td, meaning the actual time for the interface to load is longer than the fixed scheduling duration. Figure 3 As shown.
[0098] Taking a mobile phone as an example, a lightly loaded video application as an example, a cold start as the startup method, and a fixed scheduling duration of 1500ms as an example. Figure 4B In the scenario shown for launching the gallery application, when the user clicks icon 102 on interface 100, the phone responds to the user's action and will proceed according to... Figure 1 The cold start process shown starts the video application. For example, the first frame is drawn at the end of the first frame start delay, and the screen displays 500. The interface frame is loaded at the end of the frame loading completion delay (or the frame loading completion time point), and the screen displays 600. The interface content is loaded at the end of the content loading completion delay (or the content loading completion time point), and the screen displays 700.
[0099] See also Figure 4B For example, if the time between the user clicking icon 102 and the completion of content loading on the video application's main screen is 1800ms, then to start the video application after the 1500ms fixed scheduling timeout, corresponding resources (such as...) are still required. Figure 3 In this scenario, the CPU (7) ms (Td = 300ms) may be slow to start, causing users to perceive the application as lagging and making them feel that the electronic device's performance is insufficient.
[0100] To mitigate this issue, some implementations employ frame dropping for animations to ensure a smooth user experience during application startup. This might involve increasing the frequency of animations and discarding some of the data frames that need to be drawn. However, frame dropping causes discontinuous animation rendering throughout the startup process. For instance, to display interface 700 at the end of a fixed 1500ms schedule, after the user clicks icon 102, the data frames corresponding to interfaces 500 and / or 600 might be dropped. This makes the user perceive the interface change as abrupt, lacking transition, and discontinuous.
[0101] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0102] In view of this, the present application provides an application startup scheduling method, which aims to dynamically adjust the scheduling duration according to the actual load requirements of the application to be started, so that the scheduling strategy and resources used in the application startup process are more suitable for the application that needs to be started at the moment, thereby ensuring the startup speed while taking into account the performance and power consumption of electronic devices, and improving the user's smoothness and battery life experience.
[0103] Specifically, in the application startup scheduling method (optimized application startup scheduling method) provided in this application embodiment, the content loading completion delay is estimated based on the first frame startup delay corresponding to the application to be started, and then the scheduling duration is adjusted according to the estimated content loading completion delay, such as setting the content loading completion delay as the scheduling duration. In this way, the scheduling duration can be dynamically adjusted according to the actual load requirements of the application to be started.
[0104] For example Figure 5 As shown, for lightly loaded business applications, such as APP1, when the first frame startup latency is short, the estimated content loading completion latency may be less than the fixed scheduling time.
[0105] Using a mobile phone as the electronic device, APP1 is a gallery application, the launch method is cold start, and the initial scheduling duration is a fixed duration, such as 1500ms. Figure 6 As shown, in the scenario of launching the gallery application based on the optimized solution, when the user clicks icon 101, interface 200 will be displayed after the initial frame launch delay, with an estimated content loading completion delay, for example, 800ms. In this case, by changing the scheduling duration from a fixed duration (e.g., 1500ms) to the estimated content loading completion delay (800ms), the end time of the dynamic scheduling duration can be determined based on the time icon 101 is clicked and 800ms. Thus, before the end time of the dynamic scheduling duration is reached, the interface framework can be loaded, leading to the display of interface 300, and the content can be loaded, leading to the display of interface 400.
[0106] Compared to the original solution, the optimized solution, by modifying the scheduling duration to the estimated loading delay of the content corresponding to APP1, can release the resources occupied when starting APP1 in advance, thereby reducing power consumption.
[0107] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0108] For example Figure 5 As shown, for heavy-load business applications, such as APP2, if the first frame startup delay is long, the estimated content loading delay may be greater than the fixed scheduling delay.
[0109] Using a mobile phone as the electronic device and APP2 as the video application, the startup method is cold start, and the initial scheduling duration is a fixed duration, such as 1500ms. Figure 7 As shown, in the scenario of launching the gallery application based on the optimized solution, when the user clicks icon 102, interface 500 will be displayed after the initial frame launch delay, with an estimated content loading completion delay, for example, 2000ms. In this case, by changing the scheduling duration from a fixed duration (e.g., 1500ms) to the estimated content loading completion delay (2000ms), the end time of the dynamic scheduling duration can be determined based on the time icon 101 was clicked and 2000ms. Thus, before the end time of the dynamic scheduling duration is reached, the interface frame can be loaded, leading to the display of interface 600, and the content can be loaded, leading to the display of interface 700.
[0110] Compared to the original solution, the optimized solution avoids frame drops in animations and improves performance by modifying the scheduling duration to the estimated loading delay of the content corresponding to APP2.
[0111] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0112] As can be seen from the above description, in the embodiments of this application, during the application startup process, the changes in the interface may include the interface displayed after the first frame is drawn (first frame startup delay) (such as interface 200, interface 500, etc.), the interface displayed after the interface framework is loaded (frame loading completion delay) (such as interface 300, interface 600, etc.), and the interface displayed after the interface content is loaded (content loading completion delay) (such as interface 400, interface 700, etc.).
[0113] The first frame rendering latency can be considered as the first stage of application startup, such as... Figure 8A As shown. This stage involves system behavior, specifically the time when the user clicks the application's corresponding icon / entry point and the time when the first frame is completed, which the system can know. Thus, based on these two time points, the duration of the first stage, i.e., the first frame startup latency, can be accurately determined.
[0114] The time interval between loading the UI framework and loading the UI content can be considered the second stage of application startup, such as... Figure 8A As shown, this interface represents application behavior, therefore the system cannot know the specific end time. Thus, in the original technical solution, a fixed scheduling duration was typically set. In the optimized technical solution, however, the dynamic scheduling duration is determined based on the duration of the first stage (i.e., the first frame startup delay) and a pre-fitted function.
[0115] Specifically, by testing and recording the first-frame startup latency, frame loading completion latency, and content loading completion latency during the startup process of different applications, sample data `data_f` representing the relationship between the first-frame startup latency and the frame loading completion latency, and sample data `data_c` representing the relationship between the first-frame startup latency and the content loading completion latency, can be obtained. By normalizing the sample data `data_f` and sample data `data_c`, for example... Figure 8B The diagram showing the distribution of sample data_f in (1) and Figure 8B The diagram in (2) shows the distribution of the sample data data_c.
[0116] For example, by fitting sample data `data_f` and sample data `data_c` respectively, it was found that the fitting function derived from sample data `data_f` is not well applicable to different electronic devices and applications. However, the fitting function derived from sample data `data_c` is well applicable to different electronic devices and applications.
[0117] Therefore, in the optimized technical solution, a fitting function can be fitted based on the sample data data_c. Since the fitting function fitted based on the sample data data_c can describe the relationship between the first frame start latency and the content loading completion latency, the content loading completion latency can be estimated based on the pre-fitted fitting function and the duration of the first stage, i.e., the first frame start latency. Then, based on the start time of the first stage and the estimated content loading completion latency, the end time of the second stage can be determined, achieving the effect of dynamically adjusting the arrival time.
[0118] To better understand the process of fitting a fitting function based on sample data_c, which characterizes the relationship between the first frame startup latency and the content loading completion latency, the following combines... Figures 9A to 9D ,as well as Figure 10 Please provide a detailed explanation.
[0119] See Figure 9A For example, in some implementations, the original sample data data_c1 (sample data data_c without removing smaller and larger values) can be fitted to obtain a fitting curve between the sample data data_c1 that can characterize the delay of the first frame start-up and the delay of content loading completion.
[0120] See Figure 9A For example, when the sample data data_c1 is fitted, the resulting fitting curve new_1 cannot well reflect the relationship between the sample data data_c1 corresponding to the first frame start delay and the content loading completion delay. For instance, the sample data data_c1 with the first frame start delay between 0.4s and 0.8s cannot be evenly distributed around the fitting curve new_1.
[0121] Furthermore, in Figure 9A Based on this, sample data_c1 with a first-frame startup latency between 0.4s and 0.8s and a relatively small content loading completion latency can be deleted, such as... Figure 9BThe sample data is data_c_min. Then, the sample data data_2 (sample data_c1 after deleting sample data_c_min) is fitted to obtain a fitting curve between the sample data data_c2 that can characterize the latency of the first frame start-up and the latency of content loading completion.
[0122] See Figure 9B For example, the fitting curve new_2 obtained by performing fitting processing may still not be able to reflect the relationship between the sample data data_c2 corresponding to the first frame start delay and the content loading completion delay. For example, the sample data data_c with the first frame start delay between 0.5s and 0.7s cannot be evenly distributed around the fitting curve new_2.
[0123] Furthermore, in Figure 9B Based on this, sample data_c with a first-frame startup latency between 0.5s and 0.7s and a large content loading completion latency can be deleted, such as... Figure 9C The sample data is data_c_max. Then, the sample data data_c3 (the sample data data_c2 after deleting the sample data data_c_max) is fitted to obtain a fitting curve between the sample data data_c3 that can characterize the latency of the first frame start-up and the latency of content loading completion.
[0124] See Figure 9C For example, the fitting curve new_3 obtained by the fitting process can well reflect the relationship between the sample data data_c3 corresponding to the first frame start delay and the content loading completion delay. For example, the sample data data_c3 with the first frame start delay between 0.0s and 1.0s can be evenly distributed around the fitting curve new_3.
[0125] At this point, the fitting function corresponding to the fitting curve new_3 can be used as the final fitting function for dynamically adjusting the scheduling time (hereinafter referred to as: the target fitting function).
[0126] For example, in some other implementations, to make the target fitting function better adaptable to different electronic devices and applications, the fitting curve new_3 can be shifted upwards by a set value on the Y-axis. That is, the content loading completion delay is increased by a set value. The fitting curve new_3 after shifting upwards by the set value can then become... Figure 9DThe fitted curve new_4 is shown in the figure. By using the fitted curve new_4 as the target fitting function for dynamically adjusting the scheduling time, it can be ensured that the dynamically adjusted scheduling duration can better adapt to different electronic devices and different applications, thereby ensuring the resources and power consumption of electronic devices while taking into account performance and user experience.
[0127] It should be noted that the sample data (data_c1, data_c2, data_c3, etc.) can be determined based on different similar electronic devices and the applications installed on those devices. That is, in practical applications, tests can be conducted in advance on different device types and electronic devices with different applications installed, and the corresponding sample data can be recorded, and then... Figures 9A to 9D The fitting method shown is used to fit the target fitting function.
[0128] For example, in some implementations, the fitting function corresponding to the fitted curve fitted at each stage can be represented by a binary Nth-degree equation.
[0129] Where N can be an integer greater than or equal to 1.
[0130] For example, in some implementations, N can be 4. In this scenario, based on the sample data corresponding to the electronic device, the binary quartic equations corresponding to the fitted curves new_1, new_2, new_3, and new_4 can be as shown in formula (1).
[0131] y = ax 4 +bx 3 +cx 2 +dx+e (1)
[0132] Where x represents the latency of starting the first frame; y represents the estimated latency of completing content loading; and a, b, c, d, and e are constants, which depend on the sample data. That is, the values of a, b, c, d, and e can be different for different sample data.
[0133] For example, in some implementations, based on the sample data corresponding to the electronic device, the fitting function corresponding to the fitted curve new_1 can be as shown in formula (2), the fitting function corresponding to the fitted curve new_2 can be as shown in formula (3), the fitting function corresponding to the fitted curve new_3 can be as shown in formula (4), and the fitting function corresponding to the fitted curve new_4 can be as shown in formula (5).
[0134] y = 1.375x 4 +(-1.224x 3 )+(-0.190x2 )+0.937x+(-0.007) (2)
[0135] y = 3.714x 4 +(-10.476x 3 )+8.276x 2 +(-0.777x)+0.056 (3)
[0136] y = 5.672x 4 +(-13.908x 3 +10.056x 2 +(-0.909x)+0.062 (4)
[0137] y = 5.627x 4 +(-13.908x 3 +10.056x 2 +(-0.909x)+0.202 (5)
[0138] For example, in some other implementations, the above formula (1) can be simplified so that the scheduling duration dynamically adjusted according to the first frame start-up delay and the target fitting function can be better adapted to different electronic devices and different applications, thereby ensuring the resources and power consumption of electronic devices while taking into account performance and user experience.
[0139] For example, when monitoring formula (1), a Gaussian model can be used to process the fitted curves new_1, new_2, new_3, and new_4 to obtain the fitted curves fitted using the Gaussian model, such as... Figure 10 The fitted curve Gaussian is shown in (1). Then, a piecewise fitting function matching the fitted curve Gaussian is determined.
[0140] For example, in some implementations, the piecewise fitting function may include, for instance, Figure 10 The fitting function corresponding to the fitting curve 500 and the fitting function corresponding to the fitting curve 800 are shown in (2). That is, the piecewise fitting function can be expressed as formula (6).
[0141]
[0142] Where T represents the estimated content loading completion delay; BaseTime represents the first frame startup delay; delay = BaseTime × C; C is a constant, and in some implementations, C can be 0.8, i.e., C = 0.8; offset is a constant, and in some implementations, offset can be 500ms, i.e., offset = 500.
[0143] See also Figure 10 In (2), for example, when the startup delay BaseTime of the first frame is less than offset, the estimated content loading completion delay T = BaseTime + delay + offset = BaseTime + BaseTime × 0.8 + 500.
[0144] See also Figure 10 In (2), for example, when the startup delay BaseTime of the first frame is greater than or equal to the offset, the estimated content loading completion delay T = BaseTime + delay = BaseTime + BaseTime × 0.8.
[0145] Based on the above formula (6), for electronic devices with APP1 to APP5 installed, the relationship between the content loading completion delay estimated by formula (6) based on the first frame startup delay and the actual content loading completion delay can be as follows: Figure 11 As shown. Figure 11 As shown, based on the optimized technical solution, the average dynamic scheduling time is around 1100ms. Compared to the fixed scheduling time of 1500ms, starting the application based on the optimized technical solution can balance performance and user experience as much as possible while ensuring the resources and power consumption of electronic devices.
[0146] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0147] After constructing the target fitting function suitable for different devices, the target fitting function can be integrated into the corresponding electronic device, and a corresponding fixed scheduling duration can be preset in the electronic device's configuration file. Thus, upon initial application launch, application scheduling can be performed based on the preset fixed scheduling duration. After obtaining the first frame launch delay, the content loading completion delay can be estimated based on the first frame launch delay and the target fitting function. Finally, based on the start time of the first frame launch delay and the estimated content loading completion delay, the end point of the scheduling duration can be determined, achieving dynamic adjustment of the scheduling duration.
[0148] The preset fixed scheduling duration and target fitting function can be preset before the electronic device leaves the factory (Method 1), or they can be obtained from the corresponding server after the electronic device is powered on for the first time (Method 2).
[0149] For example, in practice, the fixed scheduling duration and target fitting function can be updated periodically based on the system version of the electronic device, in addition to obtaining them from the server.
[0150] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation on this embodiment. For ease of explanation, this application embodiment uses Method 1 as an example.
[0151] Furthermore, it should be noted that the above method of fitting the objective function is applicable to any startup method. That is, the constructed objective fitting function can be determined based on the source of the sample data. For example, when the sample data is obtained in a scenario corresponding to a cold start, the constructed objective fitting function is suitable for the cold start method. Similarly, when the sample data is obtained in a scenario corresponding to a warm start, the constructed objective fitting function is suitable for the warm start method. And again, when the sample data is obtained in a scenario corresponding to a hot start, the constructed objective fitting function is suitable for the hot start method.
[0152] In other words, the fixed scheduling duration and target fitting function preset in the electronic device can include those adapted to cold start, warm start, and hot start, respectively.
[0153] Furthermore, in order to better understand the technical solutions provided in the embodiments of this application, before describing the technical solutions in the embodiments of this application, the hardware and software structures of the electronic devices to which the embodiments of this application are applicable will first be described in conjunction with the accompanying drawings.
[0154] Among them, electronic devices can be any mobile device with a display screen, such as mobile phones, tablets, smartwatches, laptops, etc.
[0155] See Figure 12 The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0156] The processor 110 may include one or more processing units, which may be independent devices or integrated into one or more processors.
[0157] For example, in some implementations, processor 110 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), etc., which will not be listed here, and this application does not limit them.
[0158] The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0159] The processor 110 may also include a memory for storing instructions and data. In some implementations, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly.
[0160] The processor 110 may also include one or more interfaces. These interfaces may include inter-integrated circuit (I2C) interfaces, inter-integrated circuit sound (I2S) interfaces, pulse code modulation (PCM) interfaces, universal asynchronous receiver / transmitter (UART) interfaces, mobile industry processor interfaces (MIPI), general-purpose input / output (GPIO) interfaces, subscriber identity module (SIM) interfaces, and / or universal serial bus (USB) interfaces, etc., and are not listed here; this application does not impose any limitations on these.
[0161] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage.
[0162] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function. The data storage area may store data created during the use of the electronic device 100, such as fixed scheduling durations.
[0163] For example, in some implementations, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0164] The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0165] Among them, the mobile communication module 150 can provide wireless communication solutions for electronic devices 100, including second-generation wireless telephone technology (2G), third-generation mobile communication technology (3G), fourth-generation mobile communication technology (4G), and fifth-generation mobile communication technology (5G).
[0166] The wireless communication module 160 can provide solutions for wireless communication applied to the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0167] In some implementations, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. For example, electronic device 100 can access a mobile network through mobile communication module 150, and then, based on the mobile network and antenna 1, access a corresponding server to obtain a fixed scheduling duration and / or a target fitting function. Alternatively, it can access a wireless network through wireless communication module 160, and then, based on the wireless network and antenna 2, access a corresponding server to obtain a fixed scheduling duration and / or a target fitting function.
[0168] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some implementations, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. Specifically, in the technical solution provided in this application embodiment, the display screen can display various interfaces involved in the application startup process, such as interface 200, interface 300, interface 400, or interface 500, interface 600, interface 700, etc.
[0169] The audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, etc.
[0170] The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc., which will not be listed here, and this application does not limit them.
[0171] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment and is not intended to specifically limit the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, or software, or a combination of software and hardware.
[0172] In addition, it should be noted that, in Figure 12 The electronic device 100 shown also runs an operating system on its components. Examples include Apple's iOS operating system, Google's Android open-source operating system, and Microsoft's Windows operating system. These operating systems can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
[0173] For ease of explanation, this application uses the layered architecture of the Android system as an example to illustrate the software structure of the electronic device 100.
[0174] It should be noted that although the embodiments of this application are described using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
[0175] See Figure 13 The diagram illustrates, for example, the software architecture of an electronic device. Figure 13 As shown, the layered architecture of the electronic device 100 divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments of this application, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the Hardware Abstraction Layer (HAL), and the kernel layer.
[0176] The application layer can include a series of application packages. For example... Figure 13 As shown, the application package may include applications such as Smart Management (which may be called iAware), Desktop Launcher, SystemUI (a system application), and Settings, etc., which will not be listed here, and this application does not impose any restrictions on them.
[0177] For example, in some implementations, intelligent management applications may include a scene information acquisition module, a battery information acquisition module, a temperature control information acquisition module, and an operation decision module.
[0178] The scene information acquisition module is used to acquire information such as the current operating status of the electronic device and send this information to the operation decision module. For example, the scene information acquisition module can acquire the screen on / off status, screen brightness, and screen refresh rate of the electronic device; the on / off status of functions such as Bluetooth, WiFi, and 5G; and the volume, application running status, and CPU running status of the electronic device.
[0179] The battery information acquisition module is used to acquire battery information such as power supply voltage, power supply current, and remaining power, and then sends the acquired battery information to the operation decision module.
[0180] The temperature control information acquisition module is used to acquire information such as battery temperature and send the acquired battery temperature to the operation decision module.
[0181] The operation decision module, when the battery's remaining power is low, can determine multiple operations to reduce the battery's supply current by combining battery information, temperature information, and the current operating state of the electronic device. It then sends operation instructions instructions to the corresponding execution modules in each layer. For example, it might send the corresponding operation instructions to the Launcher and SystemUI in the application framework layer. Upon receiving the operation instructions, the Launcher and SystemUI execute the operations carried in those instructions.
[0182] Launcher and SystemUI are both important components of the user interface, together forming the main interface for user interaction with electronic devices. Launcher is responsible for desktop management and application startup, while SystemUI is responsible for system-level user interface elements such as the status bar, navigation bar, and lock screen. Specifically, in the embodiments provided in this application, application startup requires the use of Launcher and SystemUI.
[0183] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. In some implementations, these APIs and frameworks can be described as functions. For example... Figure 13 As shown, the application framework layer may include system services (SystemServer), display effect adjustment modules, activity management services (ActivityManagerService, AMS), etc., which will not be listed here, and this application does not impose any restrictions on them.
[0184] System services can be used to determine the launch method of the currently running application, user-triggered operations, etc.
[0185] The display effect adjustment module can be seen as a programming interface (e.g., UniperfJava Interface) provided by the application framework layer to the Launcher and SystemUI of the application layer for accessing the scheduler client system in the Android runtime and system libraries.
[0186] The Activity Management Service is responsible for starting, switching, and scheduling the four main components of the system, as well as managing and scheduling application processes. Specifically, in the embodiments provided in this application, when a user clicks the application's icon / entry point, the Launcher and / or SystemUI can interact with AMS to determine the time point when the application's icon / entry point is clicked, and also to determine the time point when the first frame is completed.
[0187] For example, in some implementations, the determination of the above two time points can be achieved through the threshold-based start stub and first frame stub. Understandably, in this embodiment, these two stubs do not affect the application's startup operation and are used to determine the invocation time point when invoked. Specifically, the start stub is invoked when the user clicks the application's icon / entry point, and the first frame stub is invoked when the first frame is completed.
[0188] The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.
[0189] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0190] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0191] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0192] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0193] Understandably, the 2D graphics engine mentioned above is a 2D drawing engine.
[0194] Specifically, in the technical solutions provided in the embodiments of this application, operations such as first frame drawing, interface framework loading, and interface content loading can be implemented by functional modules in the system library.
[0195] In addition, the system library may also include a scheduler client system (uniperfClient-system). The scheduler client system is used to send received operation instructions to the application scheduling hardware abstraction layer in the hardware abstraction layer to implement operations such as determining the first frame start-up latency, estimating the content loading completion latency, dynamically adjusting the frequency modulation duration, and switching the frequency modulation scheduling strategy.
[0196] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel (kernel layer) and the hardware circuitry. Its purpose is to isolate the application framework layer from the kernel so that Android does not become overly dependent on the kernel, thereby allowing the development of the application framework layer to be carried out without considering drivers.
[0197] In the improved technical solution of this application embodiment, the hardware abstraction layer may include an application scheduling hardware abstraction layer. This application scheduling hardware abstraction layer is used to implement various scheduling matters during the application startup process. For example, it determines the first frame startup latency, estimates the content loading completion latency, dynamically adjusts the frequency modulation duration, and switches the frequency modulation scheduling strategy.
[0198] See Figure 13 For example, the application scheduling hardware abstraction layer may include a platform adaptation module, a configuration file loading module, a parameter parsing module, a target fitting function management module, a scheduling duration management module, a frequency modulation scheduling strategy module, and an adaptation execution module.
[0199] The platform adaptation module is used to determine the chip system used by the electronic device when the electronic device is powered on.
[0200] The configuration file loading module is used to load a fixed scheduling duration that matches the chip system determined by the platform adaptation module from the configuration file (which may be located in the internal memory) when the electronic device is powered on, and cache the loaded fixed scheduling duration in the corresponding scheduling duration cache for use when the application is started later.
[0201] Understandably, the scheduling duration cache can be a region of memory within the processor (such as cache memory). That is, a fixed scheduling duration loaded from a configuration file can be cached in the processor's cache memory.
[0202] The parameter parsing module is used to parse the instruction information issued by the uniperfClient-system, and then determine the application that needs to be launched (based on the identification information, such as CMID), the time point when the application icon / entry point is clicked, the scheduling start time point (first time point), and the time point when the first frame is drawn (second time point), and send this information to the target fitting function management module.
[0203] The target fitting function management module is used to select a suitable target fitting function according to the startup method, and determine the corresponding first frame startup delay according to the first time point and the second time point. Then, based on the selected target fitting function and the determined first frame startup delay, it estimates the content loading completion delay (such as the second scheduling duration) and sends the estimated content loading completion delay corresponding to the application to the parameter parsing module.
[0204] The parameter parsing module is also used to parse the information fed back by the target fitting function management module, and send the parsed estimated content loading completion delay and corresponding application information to the scheduling duration management module.
[0205] The scheduling duration management module is used to read the fixed scheduling duration (such as the first scheduling duration) from the scheduling duration cache before receiving the estimated content loading completion delay sent by the parameter parsing module, and to notify the frequency modulation scheduling strategy module to select the first frequency modulation scheduling strategy.
[0206] The scheduling duration management module is also used to determine the duration of the second stage operation (such as the second duration) based on the estimated content loading completion delay sent by the parameter parsing module after receiving the estimated content loading completion delay, and to notify the frequency modulation scheduling strategy module to select the second frequency modulation scheduling strategy.
[0207] For example, in some other implementations, the scheduling duration management module can also, after receiving the estimated content loading completion delay sent by the parameter parsing module, adjust the scheduling duration cached in the scheduling duration cache from a fixed scheduling duration to the estimated content loading completion delay, and notify the frequency modulation scheduling strategy module to select the second frequency modulation scheduling strategy. In this use case, if the electronic device is not restarted, when the application is launched again, the first stage operation will be executed based on the second scheduling duration read from the scheduling duration cache and the first frequency modulation scheduling strategy. After the content loading completion delay is re-estimated based on the actual scheduling duration spent at the end of the first stage scheduling, the second scheduling duration is adjusted based on the re-estimated content loading completion delay, and the duration of the second stage operation is determined based on the re-estimated content loading completion delay and the actual scheduling duration spent at the end of the first stage scheduling. Finally, the second stage operation is executed based on the second frequency modulation scheduling strategy and the re-determined duration of the second stage operation.
[0208] The adaptation execution module is used to select the functional interface provided by the chip system used by the electronic device, and send the currently used scheduling duration and frequency modulation scheduling strategy, such as the second duration and the second frequency modulation scheduling strategy, to the processor driver. The processor driver then drives the corresponding processor so that the processor can perform application scheduling and start the application according to the currently used scheduling duration and frequency modulation scheduling strategy.
[0209] The kernel layer is the layer between hardware and software. The kernel layer can include at least processor drivers, display drivers, microphone drivers, speaker drivers, and so on. For example, a processor driver can drive the corresponding processor, enabling the processor to schedule and launch applications according to the scheduling duration and frequency modulation scheduling strategy determined by the application scheduling hardware layer.
[0210] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to limit the specific operating system of the electronic device 100. In other embodiments of this application, the operating system of the electronic device 100 may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0211] about Figure 12 The hardware structure shown and Figure 13 When the electronic device with the software structure shown launches an application based on the application launch scheduling method provided in the embodiments of this application, the specific implementation process can be as follows: Figure 14 As shown.
[0212] See Figure 14The diagram illustrates a flowchart of an application startup scheduling method. In this embodiment, the specific flow of the application startup scheduling method may include:
[0213] S101: Upon receiving the operation to start the first application, record the first time point and execute the operation to start the first application according to the first scheduling duration and the first frequency modulation scheduling strategy.
[0214] The first application can be either a light-load service application or a heavy-load service application, as described in the above embodiments.
[0215] The received action to launch the first application could be that the user clicked the application icon / entry point of the first application. For example, in the display... Figure 4A or Figure 6 When interface 100 is displayed, the user's click on icon 101 is received; or, when displaying... Figure 4B or Figure 7 When the interface is at 100, it receives the user's click on icon 102.
[0216] The first recorded time point is, for example, the time when the startup stub in AMS is invoked after the user clicks the application icon of the first application. That is, the scheduling start time.
[0217] In this embodiment of the application, the first application is called for the first time after the electronic device is powered on. In this scenario, the first scheduling duration is the fixed scheduling duration that is read from the configuration file stored in the local storage medium and loaded into the scheduling duration cache by the configuration file loading module when the electronic device is powered on and the boot process is executed.
[0218] Understandably, this fixed scheduling duration can be a configuration file pre-set in the local storage medium of the electronic device before it leaves the factory. That is, the first scheduling duration can be understood as the estimated duration pre-set for the electronic device, from the start time of scheduling to the end of the second stage of scheduling.
[0219] The read / write speed of the scheduling duration cache is faster than that of the local storage medium. The first scheduling duration stored in the local storage medium cannot be modified, while the first scheduling duration stored in the scheduling duration cache can be modified.
[0220] Understandably, the fixed scheduling duration loaded into the scheduling duration cache is the fixed scheduling duration matched to the chip system determined by the platform adaptation module. Furthermore, this fixed scheduling duration includes the fixed scheduling durations corresponding to different startup methods (such as cold start, warm start, and lukewarm start). In this scenario, the first scheduling duration loaded into the scheduling duration cache can be as shown in Table 2 of the above embodiments, and will not be repeated here.
[0221] For example, in some other implementations, the fixed scheduling duration loaded into the scheduling duration cache is a fixed scheduling duration that matches the device type determined by the platform adaptation module. Similarly, this fixed scheduling duration includes the fixed scheduling duration corresponding to different startup methods. In this scenario, the first scheduling duration loaded into the scheduling duration cache can be as shown in Table 1 of the above embodiments, and will not be repeated here.
[0222] Correspondingly, the first scheduling duration used when executing the operation port to start the first application is the fixed scheduling duration that the scheduling duration management module obtains from the scheduling duration cache, which is suitable for the current startup method.
[0223] The operation of launching the first application may include a first-stage operation and a second-stage operation.
[0224] The first stage, for example Figure 8A The stage shown is for performing the first frame drawing operation. Accordingly, the operation of the first stage is, for example, the first frame drawing operation.
[0225] The second stage, for example Figure 8A The diagram illustrates the stages for performing interface frame loading and interface content loading operations. Correspondingly, the second stage operations include, for example, interface frame loading and interface content loading operations.
[0226] Specifically, in this embodiment of the application, in order to make the scheduling of the application startup process more reasonable, two different frequency modulation scheduling strategies can be preset. For example, a first frequency modulation scheduling strategy suitable for the first stage, and a frequency modulation scheduling strategy suitable for the second stage.
[0227] The first frequency modulation scheduling strategy can be a more aggressive one. In some implementations, the first frequency modulation scheduling strategy can instruct the minimum frequency modulation bandwidth to be set to the maximum frequency modulation bandwidth. That is, MinFreq = MaxFreq. In this way, the first stage of operation can be completed quickly, that is, the first frame is drawn, and then the first frame interface is displayed, such as interface 200 or interface 500 in the above embodiment.
[0228] The second frequency modulation scheduling strategy can be configured based on the system's optimal energy efficiency ratio, so that when the second stage of operation is performed according to the second frequency modulation scheduling strategy, the performance of electronic devices and the smoothness and battery life of users can be taken into account.
[0229] Upon receiving an operation to launch the first application, the frequency modulation scheduling strategy module can select the corresponding frequency modulation scheduling strategy based on the stage to which the currently executed operation belongs. For example, if the current operation is in the first stage, the frequency modulation scheduling strategy module selects the first frequency modulation scheduling strategy. If the current operation is in the second stage, the frequency modulation scheduling strategy module selects the second frequency modulation scheduling strategy.
[0230] S102, when the first stage of operation is completed, record the second time point.
[0231] The second recorded time point is, for example, the time point when the scheduling starts after the user clicks the application icon of the first application and the first frame of the first application is drawn, when the first frame stub in AMS is called.
[0232] Furthermore, understandably, the first stage of the operation refers to the operation of starting the first frame of the first application. Correspondingly, when the operation of the first node is completed, the second time point is recorded, which is the time point corresponding to when the first frame of the first application is drawn.
[0233] S103, determine the first duration corresponding to the first stage based on the first time point and the second time point.
[0234] The first duration is the startup delay of the first frame of the first application.
[0235] Information such as the first time point and the second time point related to the first application is, for example, transmitted by the display effect adjustment module and the scheduler client system to the parameter parsing module in the application scheduling hardware abstraction layer, parsed by the parameter parsing module, and sent to the target fitting function management module.
[0236] For example, in some implementations, such as when the parameter parsing module receives information including the "CMID" field, the "Proa" field, and the "Timestamp" field, it can parse the application identifier of the first application currently launched, the stub information, and the timestamp (time point) of the event described by the stub information from these fields.
[0237] For example, if the parsed information includes "CMID: 4099, Proa: 0, Timestamp: 1705470450", the target fitting function management module can determine that the currently launched application is the first application with application identifier 4099, the current stub information indicates that the launched stub is being called, and the first time point that called the launched stub is 1705470450 (January 17, 2024, 13:47:30).
[0238] For example, if the parsed information includes "CMID: 4099, Proa: -1, Timestamp: 1705470451", the target fitting function management module can determine that the currently launched application is the first application with application identifier 4099, the current piling information indicates that the first frame piling is being called, and the second time point that calls the launch piling is 1705470451 (January 17, 2024, 13:47:31).
[0239] Accordingly, in this scenario, the first duration determined based on the first and second time points is, for example, 1 second, or 1000 ms.
[0240] The target fitting function management module also manages target fitting functions applicable to different startup methods. For example, there are target fitting functions suitable for cold starts, target fitting functions suitable for warm starts, and target fitting functions suitable for hot starts.
[0241] The form of the target fitting function applicable to different start-up methods can be as described in the above embodiments, such as formula (1) or formula (6).
[0242] The target fitting function, as shown in formula (1), can be obtained through four fitting stages. For example, first, based on the fitting algorithm, the original sample data data_c1 is fitted to obtain the fitting curve new_1; then, based on the fitting algorithm, the sample data data_c2, after removing samples with smaller content loading delays, is fitted to obtain the fitting curve new_2; then, based on the fitting algorithm, the sample data data_c3, after removing samples with both smaller and larger content loading delays, is fitted to obtain the fitting curve new_3; finally, the content loading delay corresponding to the fitting curve new_3 is shifted upwards to obtain the fitting curve new_4. Finally, the fitting function corresponding to the fitting curve new_4 is used as the target fitting function.
[0243] Regarding the target fitting function in the form shown in formula (6), after going through the above four fitting stages, we can obtain fitting curves new_1, new_2, new_3, and new_4. Then, we can perform Gaussian processing on these four fitting curves to obtain the fitting curve gaussian. After segmenting the fitting curve gaussian, we can obtain fitting curves 500 and 800. Then, based on fitting curves 500 and 800, we can simplify formula (1) to obtain the target fitting function in the form shown in formula (6).
[0244] S104, based on the first duration, estimate the second scheduling duration of the first application.
[0245] The second scheduling duration is calculated by the fitting algorithm based on the first duration, and the second scheduling duration is the delay when the content of the first application is loaded.
[0246] In this embodiment, the target fitting function management module can estimate the second scheduling duration of the first application based on the first duration and the selected target fitting function.
[0247] The second scheduling duration includes a first duration and a second duration. The first duration is the time required for the electronic device to perform the first stage operation, and the second duration is the time required for the electronic device to perform the second stage operation.
[0248] The first duration, for example, is the first frame startup delay mentioned in the above embodiment. In this embodiment, the first duration is the actual time spent by the electronic device performing the first stage of operation, calculated based on the first time point and the second time point.
[0249] Based on the above relationship, the second duration is the difference between the second scheduling duration and the first duration. For example... Figure 8A The time required for the UI framework and UI content to be loaded.
[0250] In other words, the second scheduling duration can be the content loading completion delay mentioned in the above embodiments.
[0251] For example, in some implementations, the estimated second scheduling duration, i.e. the content loading completion duration, can be directly used as the second scheduling duration when launching the first application.
[0252] For example, in some other implementations, a set duration can be added to the second duration, and then the second scheduling duration with the added set duration can be used as the second scheduling duration when the first application is launched.
[0253] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0254] In addition, it should be noted that the first scheduling duration refers to the preset fixed scheduling duration, that is, the preset time to load all the content of the first application (which can be expressed as the preset content loading completion delay of the first application); the first duration is the corresponding duration of the first stage as calculated, and the first duration is limited by the first scheduling duration limit value (the first scheduling duration limit value is the maximum duration of frequency modulation scheduling in the first stage). The first duration, the first scheduling duration limit value and the first actual scheduling duration satisfy the following relationship.
[0255] Wherein, if the first duration is less than or equal to the first scheduling duration limit, the first duration is the first actual scheduling duration corresponding to the first stage; if the first duration is greater than the first scheduling duration limit, the first actual scheduling duration corresponding to the first stage is the first scheduling duration limit.
[0256] Furthermore, it should be noted that the second scheduling duration is the estimated duration of all content of the first application based on the first duration (which can be expressed as the estimated content loading completion delay of the first application). Therefore, the second scheduling duration includes the first duration corresponding to the first phase and the second duration corresponding to the second phase. Thus, if the first duration is less than or equal to the first scheduling duration limit, the second duration = second scheduling duration - first duration. Conversely, if the first duration is greater than the first scheduling duration limit, the second duration = second scheduling duration - first scheduling duration limit.
[0257] In addition, the second duration is subject to the second scheduling duration limit value.
[0258] The second scheduling duration limit is the maximum duration for frequency modulation scheduling in the second phase. Therefore, the second duration, the second scheduling duration limit, and the second actual scheduling duration satisfy the following relationship.
[0259] Specifically, if the second duration is less than or equal to the second scheduling duration limit, the second duration is the second actual scheduling duration corresponding to the second stage; if the second duration is greater than the second scheduling duration limit, the second actual scheduling duration corresponding to the second stage is the second scheduling duration limit.
[0260] Therefore, based on the above relationship, we can determine the actual scheduling time for different stages during the startup process of the first application, as well as the total scheduling time.
[0261] For example, after estimating the second scheduling duration of the first application, the target fitting function management module can send the second scheduling duration to the parameter parsing module.
[0262] For example, taking the application identifier of the first application as "4099" as an example, in some implementations, the information parsed by the parameter parsing module may include "CMID: 4099, Proa: -2, duration: T". Among them, "Proa: -2" indicates that the stub information is the content loading completion delay or scheduling duration, and "duration: T" indicates that the estimated second scheduling duration is "T".
[0263] For example, in some implementations, after parsing the above information, the parameter parsing module can send the above information to the scheduling duration management module. The scheduling duration management module determines the duration of the second stage operation (such as the second duration) based on the start time of the first frame and the estimated content loading completion delay, and notifies the frequency modulation scheduling strategy module to select the second frequency modulation scheduling strategy.
[0264] For example, in some other implementations, after parsing the above information, the parameter parsing module can send the above information to the scheduling duration management module. The scheduling duration management module determines the duration of the second stage operation (such as the second duration) based on the startup time of the first frame and the estimated content loading completion delay, and notifies the frequency modulation scheduling strategy module to select the second frequency modulation scheduling strategy, and modifies the first scheduling duration cached in the scheduling duration cache that is suitable for the current startup mode of the first application to the second scheduling duration.
[0265] S105, determine the second duration based on the second scheduling duration and the first duration, and execute the second stage operation according to the second duration and the second frequency modulation scheduling strategy.
[0266] For example, in some implementations, the end time of the scheduling duration can be dynamically adjusted by modifying the remaining scheduling duration of the timer. The specific implementation operations of this method may include: determining the remaining scheduling duration based on the second scheduling duration and the first actual scheduling duration corresponding to the first stage; determining a third time point based on the second time point and the remaining scheduling duration, where the third time point is the time point after the electronic device has completed the remaining scheduling duration from the second time point; triggering the start of the second stage scheduling service based on the second time point, and setting a timer for the remaining scheduling duration, with the timer triggering the termination of the scheduling service at the third time point; and executing the second stage operations according to the second frequency modulation scheduling strategy before the timer triggers the termination of the scheduling service.
[0267] Therefore, by triggering the start of the second phase of scheduling services based on the second time point, setting the scheduling duration of the timer based on the remaining scheduling duration, and triggering the stop of scheduling services based on the third time point, the second phase of operations can be executed within the second duration determined based on the current actual load, according to a suitable second frequency modulation scheduling strategy. This ensures startup speed while taking into account the performance and power consumption of electronic devices, thereby improving the user's smoothness and battery life experience.
[0268] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0269] Furthermore, it should be noted that, in order to balance performance, user experience, and battery life, and to avoid excessively long second call durations that would cause users to wait a long time for the application to start, some implementations allow setting a scheduling duration limit for each stage of the application startup process. For example, setting a scheduling duration limit for the first stage and another for the second stage.
[0270] In this way, when performing the second phase of operation according to the second duration and the second frequency modulation scheduling strategy, it can be determined first whether the second duration is less than or equal to the second scheduling duration limit value.
[0271] Accordingly, if the second duration is less than or equal to the scheduling duration limit, the second stage operation can be performed according to the second scheduling duration and the second frequency modulation scheduling strategy, as described above, by setting the timer or using the timer method.
[0272] Conversely, if the second duration exceeds the second scheduling duration limit, the second phase of operation can be performed according to the second scheduling duration limit and the second frequency modulation scheduling strategy.
[0273] Understandably, the scheduling duration limit can be determined based on large data samples from electronic devices. For example, the scheduling duration limit for the first stage can be set to 2000ms, and the scheduling duration limit for the second stage can be set to 2500ms.
[0274] In other implementations, the scheduling duration limit can also be determined based on a first scheduling duration stored in the electronic device, i.e., a fixed scheduling duration. In some implementations, the sum of the scheduling duration limit for the first stage and the second scheduling duration limit can be slightly greater than the first scheduling duration. For example, in a scenario where the first scheduling duration is 1500ms, the sum of the scheduling duration limit for the first stage and the second scheduling duration limit could be 2500ms. In this case, scheduling duration limits can be assigned to the first and second stages according to the actual situation, for example, setting the scheduling duration limit for the first stage to 1000ms and the second scheduling duration limit to 1500ms.
[0275] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the only limitation of this embodiment.
[0276] In addition, it should be noted that after changing the first scheduling duration cached in the scheduling duration cache to the second scheduling duration, in the scenario where the electronic device is not turned off, when the first application is restarted later, the first stage operation can be performed according to the scheduling duration cached in the scheduling duration cache (the scheduling duration cached when the first application was last started), such as the second scheduling duration and the first frequency modulation scheduling strategy.
[0277] Furthermore, it should be noted that when restarting the first application, if the launch method of the first application changes, and a second scheduling duration matching the current launch method exists in the scheduling duration cache, then that second scheduling duration is read from the scheduling duration cache. Otherwise, the first scheduling duration matching the current launch method is read.
[0278] Therefore, based on the actual load of the launched application, the first frame startup latency of the first stage corresponding to the application is calculated. Then, based on the first frame startup latency, the content loading completion latency required by the application is estimated. Based on the calculated first frame startup latency and the estimated content loading completion latency, the second duration corresponding to the second stage in the current scenario is determined, so that subsequent operations related to the second stage can be scheduled according to the determined second duration.
[0279] Furthermore, by assigning different frequency modulation scheduling strategies to the first and second stages during application startup, precise scheduling tailored to the load characteristics of each stage can be executed according to different scheduling durations and frequency modulation strategies. This makes the scheduling strategies and resources used during application startup more suitable for the application currently being launched, thus ensuring startup speed while also considering the performance and power consumption of electronic devices, improving user experience in terms of smoothness and battery life.
[0280] Furthermore, it is understood that, in order to achieve the aforementioned functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Based on the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware-driven or software-driven manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0281] Furthermore, it should be noted that in practical application scenarios, the element hierarchy position adjustment methods provided in the above embodiments, implemented by electronic devices, can also be executed by a chip system included in the electronic device. This chip system may include a processor. The chip system may be coupled to a memory, enabling it to call computer programs stored in the memory during runtime to implement the steps executed by the electronic device. The processor in the chip system can be an application processor or a non-application processor.
[0282] In addition, this application embodiment also provides a computer-readable storage medium storing computer instructions, which, when executed on an electronic device, cause the electronic device to perform the aforementioned related method steps to implement the methods in the above embodiments.
[0283] In addition, this application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the aforementioned related steps to implement the methods described in the above embodiments.
[0284] Additionally, embodiments of this application also provide an apparatus. This apparatus may be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory stores computer execution instructions, and when the apparatus is running, the processor executes the computer execution instructions stored in the memory to cause the chip to perform the methods described in the above-described method embodiments.
[0285] Furthermore, as can be seen from the above description, the electronic devices, computer-readable storage media, computer program products, or chips provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0286] Furthermore, through the description of the above embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0287] Furthermore, it is understood that the apparatuses and methods disclosed in the several embodiments provided in this application can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0288] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A scheduling method for application startup, characterized in that, Applied to electronic devices, the method includes: Upon receiving an operation to start the first application, a first time point is recorded. The first time point is the time point at which scheduling begins. The operation to start the first application includes a first-stage operation and a second-stage operation. According to the first scheduling duration and the first frequency modulation scheduling strategy, the first stage operation of starting the first application is executed. The first scheduling duration is preset to be the estimated scheduling duration that the electronic device will spend from the first time point to the end of the second stage of scheduling. Record the second time point when the first stage of the operation is completed; Based on the first time point and the second time point, the first duration corresponding to the first stage is determined, and the first duration is the first frame startup delay of the first application; Based on the first duration, the second scheduling duration of the first application is estimated. The second scheduling duration is calculated by a fitting algorithm based on the first duration. The second scheduling duration is the estimated content loading completion delay of the first application. Based on the second scheduling duration and the first duration, a second duration is determined, wherein the second duration is the duration required for the electronic device to perform the operation of the second stage; The second stage of operation is performed according to the second duration and the second frequency modulation scheduling strategy, wherein the first frequency modulation scheduling strategy and the second frequency modulation scheduling strategy are different.
2. The method according to claim 1, characterized in that, The step of estimating the second scheduling duration of the first application based on the first duration includes: Based on the first duration and the target fitting function, the second scheduling duration is estimated. The second scheduling duration includes the first duration and the second duration. The target fitting function describes the relationship between the first duration and the second scheduling duration.
3. The method according to claim 2, characterized in that, The target fitting function is obtained by training the fitting algorithm on the sample data. The sample data includes a first sample time point recorded when the sample application is started, a second sample time point recorded when the first stage of the operation of the sample application is completed, and a third sample time point recorded when the second stage of the operation of the sample application is completed. The process of training the sample data using the fitting algorithm to obtain the target fitting function includes: Based on the first sample time point and the second sample time point, determine the first sample duration corresponding to the first stage of the sample application; Based on the second sample time point and the third sample time point, determine the second sample duration corresponding to the second stage of the sample application; The fitting algorithm is used to train the duration of the first sample and the duration of the second sample to construct a fitting function that describes the relationship between the duration of the first sample and the content loading completion delay of the sample application, thereby obtaining the target fitting function.
4. The method according to claim 2, characterized in that, Based on the following target fitting function, and according to the first duration, the second scheduling duration of the first application is estimated: delay = BaseTime × C Where BaseTime is the first duration, T is the second scheduling duration, C is a constant coefficient, and offset is a constant time value.
5. The method according to claim 1, characterized in that, The operation of the second stage, performed according to the second duration and the second frequency modulation scheduling strategy, includes: Determine whether the second duration is less than or equal to the second scheduling duration limit value corresponding to the second stage; If the second duration is less than or equal to the second scheduling duration limit, the operation of the second stage shall be performed in accordance with the second duration and the second frequency modulation scheduling strategy.
6. The method according to claim 5, characterized in that, The operation of the second stage, performed according to the second duration and the second frequency modulation scheduling strategy, includes: The remaining scheduling duration is determined based on the second scheduling duration and the first actual scheduling duration corresponding to the first stage; Based on the second time point and the remaining scheduling duration, a third time point is determined, wherein the third time point is the time point after the electronic device has completed the remaining scheduling duration from the second time point; Based on the second time point, the scheduling service of the second phase is triggered to start, and a timer for the remaining scheduling duration is set. The timer triggers the scheduling service to stop at the third time point. Before the timer is triggered and the scheduled service stops, the second phase of the operation is performed according to the second frequency modulation scheduling strategy.
7. The method according to claim 5, characterized in that, The method further includes: If the second duration exceeds the second scheduling duration limit, the second phase operation is performed according to the second scheduling duration limit and the second frequency modulation scheduling strategy.
8. The method according to any one of claims 1 to 7, characterized in that, Before receiving the operation to launch the first application, the method further includes: Upon receiving a power-on command, the power-on process is executed; During the power-on process, the chip system information of the electronic device is determined; The first scheduling duration of different boot modes that match the chip system information in the local storage medium is loaded into the scheduling duration cache; wherein the read and write speed of the scheduling duration cache is faster than the read and write speed of the local storage medium.
9. The method according to claim 8, characterized in that, Upon receiving an operation to launch the first application, recording the first time point includes: Upon receiving an operation to launch the first application, record the first time point, obtain the first scheduling duration corresponding to the current launch mode of the first application, and the first frequency modulation scheduling strategy corresponding to the first stage.
10. An electronic device, characterized in that, The electronic device includes: a memory and a processor, the memory and the processor being coupled; the memory stores program instructions, which, when executed by the processor, cause the electronic device to perform the application startup scheduling method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that, The computer program, when running on an electronic device, causes the electronic device to perform the application startup scheduling method as described in any one of claims 1 to 9.