Application starting control method and device, storage medium and program product
By dynamically adjusting the CPU frequency and optimizing process scheduling during the Android application startup process, the problem of high power consumption during application startup is solved. The CPU frequency is reduced in time after the application is completed, reducing the power consumption during the startup process.
Patent Information
- Application Number
- CN202410431388.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2025-10-17
AI Technical Summary
The existing technology has the problem of high power consumption during the startup process of Android applications, especially after the application is completely started, the CPU is still maintained at the maximum frequency, resulting in unnecessary power consumption increase.
When receiving an application startup operation, the CPU frequency is switched to a preset frequency greater than or equal to the current frequency, and after the application startup is completed, it is switched to a target frequency less than or equal to the preset frequency. At the same time, processes are scheduled through priority scheduling and binding CPU cores to optimize CPU resource allocation.
This effectively reduces power consumption during application startup, avoids unnecessary power consumption caused by the CPU remaining at maximum frequency after the application is completed, and improves resource utilization efficiency.
Smart Images

Figure CN120803553A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of electronic information technology, and in particular, to a control method and device for application startup, a storage medium and a program product. BACKGROUND
[0002] With the popularity of mobile devices and the increase of application programs, how to reduce the startup power consumption of Android application programs has become the focus of developers. At present, application logic optimization, preloading, background cold start and application program cold storage technologies are usually used to improve the startup speed and reduce the power consumption of application programs, so as to improve the user experience. However, the application logic optimization technology depends on the initiative of the developer to simplify, resulting in poor universality, and the preloading, background cold start and application program cold storage technologies will bring additional memory occupation and consume system resources. SUMMARY
[0003] To overcome the problems in the related art, the present disclosure provides a control method and device for application startup, a storage medium and a program product.
[0004] According to a first aspect of an embodiment of the present disclosure, a control method for application startup is provided, comprising:
[0005] In response to receiving a startup operation of a target application, switching the frequency of a CPU from a current frequency to a preset frequency, and starting the target application based on the preset frequency; the preset frequency is greater than or equal to the current frequency;
[0006] In a case where it is determined that the target application is started, switching the frequency of the CPU from the preset frequency to a target frequency, the target frequency being less than or equal to the preset frequency.
[0007] Optionally, the method further comprises:
[0008] After the CPU has passed a preset scheduling period, if a target process corresponding to the target application has not been scheduled, performing a preset process scheduling on the target process, the preset process scheduling comprising priority scheduling and / or binding a core of the CPU.
[0009] Optionally, the preset process scheduling comprises priority scheduling; and the step of, after the CPU has passed a preset scheduling period, if a target process corresponding to the target application has not been scheduled, performing a preset process scheduling on the target process comprises:
[0010] After the CPU has passed a preset scheduling period, if the target process has not been scheduled, increasing the priority of the target process to a preset priority.
[0011] Optionally, the method further comprises:
[0012] acquiring a load of the CPU according to a preset period;
[0013] the step of, if the target process is not scheduled after the CPU passes a preset scheduling period, increasing a priority of the target process to a preset priority.
[0014] the step of, if the target process is not scheduled after the CPU passes a preset scheduling period and the load of the CPU is greater than or equal to a preset load threshold, increasing a priority of the target process to the preset priority.
[0015] Optionally, the method further comprises:
[0016] the step of, if the load of the CPU is less than the preset load threshold, restoring the priority of the target process to an original priority, the original priority being the priority of the target process before being increased to the preset priority.
[0017] Optionally, the preset process scheduling comprises binding a core of the CPU; and the step of, if the target process corresponding to the target application is not scheduled after the CPU passes a preset scheduling period, performing a preset process scheduling on the target process comprises:
[0018] the step of, if the target process is not scheduled after the CPU passes a preset scheduling period, binding the target process with a large core of the CPU.
[0019] Optionally, the method further comprises:
[0020] the step of acquiring a load of the CPU according to a preset period.
[0021] the step of, if the target process is not scheduled after the CPU passes a preset scheduling period, binding the target process with a large core of the CPU.
[0022] the step of, if the target process is not scheduled after the CPU passes a preset scheduling period and the load of the CPU is greater than or equal to a preset load threshold, binding the target process with a large core of the CPU.
[0023] Optionally, the method further comprises:
[0024] the step of, if the load of the CPU is less than the preset load threshold, unbinding the target process from the large core of the CPU.
[0025] Optionally, the completion of starting of the target application is determined by:
[0026] in response to all interface elements of a starting interface of the target application being loaded, determining that the target application is started.
[0027] Optionally, the target frequency is determined by:
[0028] In a case where the target application is started successfully, a load of the CPU is acquired;
[0029] According to the load of the CPU, the target frequency is determined.
[0030] According to a second aspect of the embodiments of the present disclosure, a control device for application starting is provided, comprising:
[0031] A starting module configured to, in response to receiving a starting operation of a target application, switch a frequency of a CPU from a current frequency to a preset frequency, and start the target application based on the preset frequency; the preset frequency is greater than or equal to the current frequency;
[0032] A switching module configured to, in a case where it is determined that the target application is started successfully, switch the frequency of the CPU from the preset frequency to a target frequency, the target frequency being less than or equal to the preset frequency.
[0033] Optionally, the device further comprises:
[0034] A scheduling module configured to, after the CPU passes a preset scheduling period, if a target process corresponding to the target application is not scheduled, perform a preset process scheduling on the target process, the preset process scheduling comprising priority scheduling and / or binding a core of the CPU.
[0035] Optionally, the preset process scheduling comprises priority scheduling; the scheduling module is configured to:
[0036] After the CPU passes the preset scheduling period, if the target process is not scheduled, increase a priority of the target process to a preset priority.
[0037] Optionally, the device further comprises:
[0038] A first acquiring module configured to acquire a load of the CPU according to a preset period;
[0039] The scheduling module is configured to:
[0040] After the CPU passes the preset scheduling period, if the target process is not scheduled and the load of the CPU is greater than or equal to a preset load threshold, increase the priority of the target process to the preset priority.
[0041] Optionally, the scheduling module is further configured to:
[0042] In a case where the load of the CPU is less than the preset load threshold, the priority of the target process is restored to an original priority, the original priority being the priority of the target process before being raised to the preset priority.
[0043] Optionally, the preset process scheduling comprises binding a core of the CPU; and the scheduling module is configured to:
[0044] In a case where the target process is not scheduled after the CPU goes through a preset scheduling period, the target process is bound to a big core of the CPU.
[0045] Optionally, the apparatus further comprises:
[0046] a second obtaining module configured to obtain the load of the CPU according to a preset period.
[0047] the scheduling module is configured to:
[0048] In a case where the target process is not scheduled after the CPU goes through a preset scheduling period and the load of the CPU is greater than or equal to a preset load threshold, the target process is bound to a big core of the CPU.
[0049] Optionally, the scheduling module is further configured to:
[0050] In a case where the load of the CPU is less than the preset load threshold, the target process is unbound from the big core of the CPU.
[0051] Optionally, the completion of starting of the target application is determined in the following manner:
[0052] In response to all interface elements of a starting interface of the target application being loaded, it is determined that the target application is started.
[0053] Optionally, the target frequency is determined in the following manner:
[0054] In a case where the target application is started, the load of the CPU is obtained;
[0055] According to the load of the CPU, the target frequency is determined.
[0056] According to a third aspect of embodiments of the present disclosure, an apparatus for controlling starting of an application is provided, comprising:
[0057] a processor;
[0058] a memory for storing processor-executable instructions;
[0059] wherein the processor is configured to:
[0060] In response to receiving the starting operation of the target application, the frequency of the CPU is switched from a current frequency to a preset frequency, and the target application is started based on the preset frequency; the preset frequency is greater than or equal to the current frequency.
[0061] In a case where it is determined that the starting of the target application is completed, the frequency of the CPU is switched from the preset frequency to a target frequency, and the target frequency is less than or equal to the preset frequency.
[0062] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, and the computer readable storage medium stores computer program instructions. The computer program instructions are executed by a processor to implement the steps of the method according to the first aspect of the embodiments of the present disclosure.
[0063] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, and the computer program product includes a computer program. The computer program is executed by a processor to implement the steps of the method according to the first aspect of the embodiments of the present disclosure.
[0064] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: in a case where a starting operation of a target application is received, the frequency of a CPU is switched from a current frequency to a preset frequency greater than or equal to the current frequency, and the target application is started based on the preset frequency. In a case where it is determined that the starting of the target application is completed, the frequency of the CPU is switched from the preset frequency to a target frequency less than or equal to the preset frequency. When it is determined that the starting of the target application is completed, the frequency of the CPU is adjusted in a timely manner, which avoids the problem that the CPU continues to be maintained at the maximum frequency after the application is started, and can effectively reduce the power consumption in the starting of the application.
[0065] It should be understood that the general description above and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0066] The accompanying drawings, which are incorporated into and form part of the specification, illustrate one embodiment consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0067] Figure 1 is a flowchart of a control method of application starting according to an exemplary embodiment.
[0068] Figure 2 is a flowchart of another control method of application starting according to an exemplary embodiment.
[0069] Figure 3 is a flowchart of another control method of application starting according to an exemplary embodiment.
[0070] Figure 4is a flowchart of another control method of application launch according to an exemplary embodiment.
[0071] Figure 5 is a flowchart of another control method of application launch according to an exemplary embodiment.
[0072] Figure 6 is a flowchart of another control method of application launch according to an exemplary embodiment.
[0073] Figure 7 is a schematic diagram of launching a target application according to an exemplary embodiment.
[0074] Figure 8 is a block diagram of a control apparatus of application launch according to an exemplary embodiment.
[0075] Figure 9 is a block diagram of another control apparatus of application launch according to an exemplary embodiment.
[0076] Figure 10 is a block diagram of another control apparatus of application launch according to an exemplary embodiment.
[0077] Figure 11 is a block diagram of another control apparatus of application launch according to an exemplary embodiment.
[0078] Figure 12 is a block diagram of yet another control apparatus of application launch according to an exemplary embodiment. DETAILED DESCRIPTION
[0079] The exemplary embodiments will be described in detail herein below with reference to the drawings. In the following description, the same drawings reference numbers are used to denote like or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure, as detailed in the appended claims.
[0080] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure, as detailed in the appended claims.
[0081] It should be noted that all actions of acquiring signals, information or data in the present disclosure are performed in compliance with the corresponding data protection regulations policy of the country where the device is located, and with the authorization given by the corresponding device owner.
[0082] Before introducing the application startup control method, device, storage medium and program product shown in the embodiments of the present disclosure, the application scenarios related to the embodiments of the present disclosure are introduced first.
[0083] With the popularity of mobile devices and the increase of application programs, how to reduce the startup power consumption of Android application programs has become the focus of developers. In the past few years, many technical modules have appeared on the Android platform to solve this problem.
[0084] 1. Application logic optimization: Application cold start usually needs to load and initialize many resources, resulting in high power consumption. In order to reduce the power consumption of cold start, developers have taken a series of measures, such as reducing resource loading during startup, delaying initialization, etc. However, application logic optimization relies on developers to actively simplify, and the system side cannot intervene, resulting in poor universality.
[0085] 2. Preloading technology: In order to speed up the startup speed of application programs, developers began to use preloading technology. Preloading technology allows application programs to load some resources in advance before the user actually starts, in order to reduce the delay during startup. For example, application programs can preload some commonly used data or interface elements in the background to improve user experience.
[0086] 3. Background cold start: In order to further reduce the startup power consumption, Android introduces background cold start technology. Background cold start allows application programs to perform part of the startup process in the background, rather than completely restarting. This can avoid some time-consuming initialization operations, thereby reducing power consumption.
[0087] 4. Application cold storage: Application cold storage is a technology that temporarily freezes application programs. When an application program is in a cold storage state, all its processes and services will be suspended to reduce power consumption. Only when the user opens the application program again will it be unfrozen and resume normal operation.
[0088] However, preloading, background cold start and application cold storage technologies can bring additional memory occupation and consume system resources.
[0089] Currently, in order to speed up the application startup speed, the CPU frequency of the Android system is fixed to the maximum, and the startup duration is kept for a period of time according to the preset startup duration. The specific startup duration is set by each manufacturer. However, due to the differences in the implementation logic of each application, the actual startup duration of different applications is long or short. If the application completes the cold start in advance within the preset startup duration, but the CPU frequency still remains at the maximum frequency, it will cause power consumption increase and performance waste.
[0090] Figure 1is a flowchart of a control method of application startup according to an exemplary embodiment, as Figure 1 shown, the method can include the following steps.
[0091] In step S101, in response to receiving a startup operation of a target application, the frequency of the CPU is switched from a current frequency to a preset frequency, and the target application is started based on the preset frequency. Wherein, the preset frequency is greater than or equal to the current frequency.
[0092] For example, the scenario of starting the target application disclosed in the present disclosure includes but is not limited to the cold start scenario of the target application, and can be applied to any startup scenario of the target application. The startup operation of the target application can be an operation of a user clicking an icon of the target application. When the user's finger clicks the icon of the target application and lifts up, the terminal receives the startup operation of the target application. In order to improve the startup speed of the target application, the frequency of the CPU can be switched to a preset frequency greater than or equal to the current frequency, wherein the current frequency can be understood as the frequency of the CPU when the startup operation of the target application is received. The preset frequency can be the maximum frequency of the CPU, or slightly less than the maximum frequency, which is not limited in the present disclosure. If the current frequency is less than the preset frequency, the frequency of the CPU can be increased from the current frequency to the preset frequency to improve the startup speed of the target application. If the current frequency is already relatively high and equal to the preset frequency, the frequency of the CPU can be kept unchanged.
[0093] After the frequency of the CPU is increased from the current frequency to the preset frequency, the CPU can start the target application at the preset frequency, that is, the frequency of the CPU can be maintained at the preset frequency during the startup of the target application.
[0094] In step S102, in the case where it is determined that the target application is started, the frequency of the CPU is switched from the preset frequency to a target frequency. Wherein, the target frequency is less than or equal to the preset frequency.
[0095] For example, in the case where it is detected that the startup interface of the target application is completely displayed, it can be determined that the target application is started. Wherein, the completely displayed startup interface can be understood as that the interface elements of the startup interface of the target application are all loaded. If it is determined that the target application is started, the frequency of the CPU can be switched from the preset frequency to the target frequency less than or equal to the preset frequency immediately without waiting for the preset startup duration, so as to reduce the power consumption generated in the process of starting the target application.
[0096] In some embodiments, the target frequency can be equal to the current frequency. That is, if it is determined that the target application has completed startup, the CPU frequency can be switched back to the frequency before the target application was launched. For example, if the current frequency is 1.8 GHz and the preset frequency is 2.5 GHz, the CPU frequency is 1.8 GHz before the target application is launched, and 2.5 GHz during the application startup process. If it is determined that the target application has completed startup, the CPU frequency can be switched back from 2.5 GHz to 1.8 GHz.
[0097] In other embodiments, the target frequency can be determined based on the CPU load when the target application is started. For example, when the target application is started, the CPU load can be obtained, and based on the CPU load, the target frequency can be determined by a preset correspondence, wherein the preset correspondence can include a correspondence between the CPU load and the frequency. If the CPU load when the target application is started is greater than the CPU load before the target application is started, then the target frequency can be greater than the current frequency. If the CPU load when the target application is started is equal to the CPU load before the target application is started, then the target frequency can be equal to the current frequency. If the CPU load when the target application is started is less than the CPU load before the target application is started, then the target frequency can be less than the current frequency.
[0098] For example, the user clicks on the application icon to trigger the start of the target application. After receiving the start-up operation, the system can switch the CPU frequency to the target frequency and start the target application based on the target frequency. In the process of starting the target application, the system can first check whether the application has been installed through PackageManagerService (PackageManager service) and obtain the information of the target application. Then the system can create a process for the target application and allocate resources for the target application. The target application can call the onCreate() method of Application to perform initialization operations. Finally, the system calls the lifecycle methods of the Activity of the target application, such as onStart(), onResume(), etc. After the target application completes the drawing operation, the startup interface is fully displayed to the user, which means that the startup of the target application is completed. At this time, the CPU frequency can be switched from the preset frequency to the target frequency.
[0099] In one possible implementation, a stub can be inserted at the source code location corresponding to the operation of detecting the user clicking and lifting the target application icon, and at the source code location where the startup interface is fully displayed, so as to accurately identify the start and completion moments of the target application. When the target application is completed, the CPU frequency is promptly switched from the preset frequency to a target frequency that is less than or equal to the preset frequency, which can effectively reduce the power consumption generated in the process of starting the target application.
[0100] In summary, the present disclosure switches the frequency of the CPU from the current frequency to the preset frequency greater than or equal to the current frequency in the case of receiving the start operation of the target application, and starts the target application based on the preset frequency. In the case of determining that the target application is started, the frequency of the CPU is switched from the preset frequency to the target frequency less than or equal to the preset frequency. The present disclosure timely adjusts the frequency of the CPU when it is determined that the target application is started, avoiding the problem that the CPU continues to maintain at the maximum frequency after the application is started, and can effectively reduce the power consumption in the application start.
[0101] Figure 2 is a flowchart of another application start control method according to an exemplary embodiment, as shown in Figure 2 The method can further include:
[0102] In step S103, if the target process is not scheduled after the CPU passes the preset scheduling period, the target process is scheduled by the preset process scheduling, and the preset process scheduling includes priority scheduling and / or binding the core of the CPU.
[0103] For example, in the process of starting the target application based on the preset frequency, the scheduling period of the target process corresponding to the target application waiting for the CPU scheduling can be monitored, wherein the target process corresponding to the target application can be understood as the main process of the target application. If the scheduling period of the target process waiting for the CPU scheduling is greater than the preset scheduling period, that is, if the target process is not scheduled after the CPU passes the preset scheduling period, it means that the target process waits for the CPU scheduling for too long, which affects the start time of the target application. In this case, in order to save the start time of the target application, the target process corresponding to the target application can be scheduled by the preset process scheduling. Taking 2 VSYNC (English: Vertical Synchronization, Chinese: vertical synchronization) periods as the preset scheduling period for example, if the target process is not scheduled after the CPU passes 2 VSYNC periods, that is, the scheduling period of the target process waiting for the CPU scheduling is greater than 2 VSYNC periods, the target process can be scheduled by the preset process scheduling.
[0104] In other embodiments, in the process of starting the target application based on the preset frequency, the load of the CPU can be acquired in real time, and the target process corresponding to the target application can be further scheduled by the preset process scheduling in the case that the load of the CPU is greater than the preset load threshold and the scheduling period of the target process waiting for the CPU scheduling is greater than the preset scheduling period.
[0105] The preset process scheduling can include priority scheduling, can include binding a core of a CPU, or can include both priority scheduling and binding a core of a CPU. The priority scheduling can be, for example, increasing the priority of the target process, and the binding a core of a CPU can be, for example, binding the target process to a large core of the CPU.
[0106] In some embodiments, the preset process scheduling can include priority scheduling. One implementation of step S103 can be:
[0107] After the CPU has passed the preset scheduling period, if the target process is not scheduled, the priority of the target process is increased to the preset priority.
[0108] For example, in general, the priority of the CPU ranges from 0 to 139, where 0-99 is the priority range of real-time processes (such as processes of an operating system), and 100-139 is the priority range of normal processes. The smaller the priority number, the higher the priority, i.e., from 0 to 139, the priority decreases in turn, and the process with the higher priority is scheduled by the CPU first. The preset priority in the embodiments of the present disclosure can be selected from 95-105, for example, 98, to increase the priority of the target process as much as possible without affecting real-time processes.
[0109] For example, with a preset scheduling period of 2 VSYNC periods and a preset priority of 98, if the target process is not scheduled after the CPU has passed 2 VSYNC periods, i.e., the scheduling period of the target process waiting for the CPU to schedule is greater than 2 VSYNC periods, the priority of the target process can be increased to 98.
[0110] Figure 3 FIG. 4 is a flowchart of another application startup control method according to an example embodiment, as shown in FIG. 4, the method can further include: Figure 3
[0111] In step S104, the load of the CPU is obtained according to a preset period.
[0112] Correspondingly, one implementation of step S103 can be:
[0113] After the CPU has passed the preset scheduling period, if the target process is not scheduled, and the load of the CPU is greater than or equal to the preset load threshold, the priority of the target process is increased to the preset priority.
[0114] In an example, in the process of starting the target application based on the preset frequency, the load of the CPU can be acquired according to the preset period. In a case where the load of the CPU is greater than the preset load threshold and the scheduling period of the target process waiting for CPU scheduling is greater than the preset scheduling period, it is indicated that the scheduling period of the target process waiting for CPU scheduling is too long due to the too high load of the CPU. Therefore, the current priority of the target process can be recorded as the original priority, and the priority of the target process can be increased to the preset priority, so that the CPU schedules the target process preferentially, thereby shortening the starting time of the target application.
[0115] Figure 4 FIG. 6 is a flowchart of another control method of application starting according to an example embodiment. As shown in FIG. 6, the method can further include: Figure 4
[0116] In step S105, in a case where the load of the CPU is less than the preset load threshold, the priority of the target process can be restored to the original priority, where the original priority is the priority of the target process before being increased to the preset priority.
[0117] In an example, the priority of the target process can be increased to the preset priority, and the load of the CPU can be continuously monitored. If the load of the CPU is less than the preset load threshold, it is indicated that the current load of the CPU is low, and the CPU can schedule the target process in time. Therefore, the priority of the target process can be restored to the original priority, so as to avoid affecting the scheduling of other processes.
[0118] In another example, if the load of the CPU is continuously greater than the preset load threshold, the priority of the target process can be restored to the original priority after the target application is started, so as to avoid affecting the scheduling of other processes.
[0119] In another example, the priority of the target process can be increased to the preset priority, and the scheduling period of the target process waiting for CPU scheduling can be continuously monitored. If the scheduling period of the target process waiting for CPU scheduling is less than the preset scheduling period, it is indicated that the target process can be scheduled by the CPU in time. Therefore, the priority of the target process can be restored to the original priority, so as to avoid affecting the scheduling of other processes.
[0120] In another example, the priority of the target process can be increased to the preset priority, and the load of the CPU and the scheduling period of the target process waiting for CPU scheduling can be continuously monitored. If the load of the CPU is less than the preset load threshold and the scheduling period of the target process waiting for CPU scheduling is less than the preset scheduling period, it is indicated that the current load of the CPU is low, and the target process can be scheduled by the CPU in time. Therefore, the priority of the target process can be restored to the original priority, so as to avoid affecting the scheduling of other processes.
[0121] In some embodiments, the preset process scheduling comprises binding the cores of the CPU. One implementation of step S103 can be:
[0122] After the CPU passes the preset scheduling period, if the target process is not scheduled, the target process is bound to the large core of the CPU.
[0123] For example, if the CPU passes the preset scheduling period and the target process is still not scheduled, i.e., the scheduling period for which the target process waits for the CPU to schedule is greater than the preset scheduling period, it indicates that the target process waits for the CPU to schedule for too long. Therefore, the target process can be bound to the large core of the CPU, so that the large core of the CPU continuously processes the target process, avoiding the problem that the target application takes too long to start due to the switching of the target process between multiple cores of the CPU, and the start-up time of the target application can be shortened.
[0124] For example, taking 2 VSYNC periods as the preset scheduling period, if the CPU passes 2 VSYNC periods and the target process is not scheduled, i.e., the scheduling period for which the target application waits for the CPU to schedule is greater than 2 VSYNC periods, the target process can be bound to the large core of the CPU.
[0125] Figure 5 is a flowchart of another method for controlling application start-up according to an example embodiment, as shown in Figure 5 The method can further comprise:
[0126] In step S106, the load of the CPU is obtained according to a preset period.
[0127] Correspondingly, one implementation of step S103 can be:
[0128] After the CPU passes the preset scheduling period, if the target process is not scheduled, and the load of the CPU is greater than or equal to the preset load threshold, the target process is bound to the large core of the CPU.
[0129] For example, in the process of starting the target application based on the preset frequency, the load of the CPU can be obtained according to a preset period. In the case where the load of the CPU is greater than the preset load threshold, and the scheduling period for which the target process waits for the CPU to schedule is greater than the preset scheduling period, it indicates that the scheduling period for which the target process waits for the CPU to schedule is too long due to the high load of the CPU. Therefore, the target process can be bound to the large core of the CPU, so that the large core of the CPU continuously processes the target process, thereby shortening the start-up time of the target application.
[0130] Figure 6 is a flowchart of another method for controlling application start-up according to an example embodiment, as shown in Figure 6 The method can further comprise:
[0131] In step S107, if the load of the CPU is less than the preset load threshold, the target process is unbound from the large core of the CPU.
[0132] For example, after the priority of the target process is raised to the preset priority, the load of the CPU can continue to be monitored. If the load of the CPU is less than the preset load threshold, it indicates that the current load of the CPU is low, and the CPU can schedule the target process in time. Then, the target process can be unbound from the large core of the CPU, so as to avoid affecting the scheduling of other processes.
[0133] In some other embodiments, if the load of the CPU is continuously greater than the preset load threshold, the target process can be unbound from the large core of the CPU after the target application is started, so as to avoid affecting the scheduling of other processes.
[0134] In some other embodiments, after the priority of the target process is raised to the preset priority, the scheduling period of the target process waiting for the CPU scheduling can continue to be monitored. If the scheduling period of the target process waiting for the CPU scheduling is less than the preset scheduling period, it indicates that the target process can be scheduled by the CPU in time. Then, the target process can be unbound from the large core of the CPU, so as to avoid affecting the scheduling of other processes.
[0135] In some other embodiments, after the priority of the target process is raised to the preset priority, the load of the CPU and the scheduling period of the target process waiting for the CPU scheduling can continue to be monitored. If the load of the CPU is less than the preset load threshold, and the scheduling period of the target process waiting for the CPU scheduling is less than the preset scheduling period, it indicates that the current load of the CPU is low, and the target process can be scheduled by the CPU in time. Then, the target process can be unbound from the large core of the CPU, so as to avoid affecting the scheduling of other processes.
[0136] It should be noted that the preset process scheduling can include both the priority scheduling and the binding of the core of the CPU. In this case, the specific implementation manners of the priority scheduling and the binding of the core of the CPU can refer to the above embodiments, which will not be described here. That is, the above embodiments can be freely combined to implement the method for application starting shown in the embodiments of the present disclosure.
[0137] For example, as shown in FIG. 6, the method for application starting shown in FIG. 5 can be combined with the method for application starting shown in FIG. 4. Figure 7As shown, the user triggers the target application to start by clicking the application icon with a finger, and the system switches the frequency of the CPU to the target frequency after receiving the start operation, and starts the target application based on the target frequency. The load of the CPU and the period of the target process waiting for CPU scheduling are detected in real time during the application startup process. In the case that the load of the CPU is greater than the preset load threshold, and the scheduling period of the target process waiting for CPU scheduling is greater than the preset scheduling period, the priority of the target process is increased to the preset priority, and the target process is bound to the large core of the CPU, thereby shortening the startup time of the target application. Then the load of the CPU is continuously detected in real time, and in the case that the load of the CPU is less than the preset load threshold, the priority of the target process is restored to the original priority, and the target process is unbound from the large core of the CPU. In the case that the startup interface of the target process is completely displayed, it can be determined that the target process is started, and at this time the frequency of the CPU can be switched from the preset frequency to the target frequency to realize timely frequency reduction, thereby reducing the power consumption in the startup process of the target application.
[0138] In summary, the present disclosure switches the frequency of the CPU from the current frequency to the preset frequency greater than or equal to the current frequency in the case of receiving the start operation of the target application, and starts the target application based on the preset frequency. In the case of determining that the target application is started, the frequency of the CPU is switched from the preset frequency to the target frequency less than or equal to the preset frequency. The present disclosure timely adjusts the frequency of the CPU when it is determined that the target application is started, avoiding the problem that the CPU still maintains at the maximum frequency after the application is started, and can effectively reduce the power consumption in the application startup.
[0139] Figure 8 is a block diagram of a control device for application startup according to an exemplary embodiment, as shown in Figure 8 The device 200 can include:
[0140] The start module 201 is configured to switch the frequency of the CPU from the current frequency to the preset frequency in response to receiving the start operation of the target application, and start the target application based on the preset frequency. The preset frequency is greater than or equal to the current frequency.
[0141] The switching module 202 is configured to switch the frequency of the CPU from the preset frequency to the target frequency in the case of determining that the target application is started, and the target frequency is less than or equal to the preset frequency.
[0142] Figure 9 is a block diagram of another control device for application startup according to an exemplary embodiment, as shown in Figure 9 The device 200 can further include:
[0143] The scheduling module 203 is configured to, if the target process is not scheduled after the CPU passes the preset scheduling period, perform preset process scheduling on the target process, the preset process scheduling including priority scheduling and / or binding a core of the CPU.
[0144] In some embodiments, the preset process scheduling can include priority scheduling. The scheduling module 203 is configured to:
[0145] If the target process is not scheduled after the CPU passes the preset scheduling period, the priority of the target process is increased to a preset priority.
[0146] Figure 10 is another application startup control device block diagram according to an exemplary embodiment, as shown in Figure 10 The device 200 can further include:
[0147] The first acquisition module 204 is configured to acquire the load of the CPU according to a preset period.
[0148] Correspondingly, the scheduling module 203 is configured to:
[0149] If the target process is not scheduled after the CPU passes the preset scheduling period, and the load of the CPU is greater than or equal to a preset load threshold, the priority of the target process is increased to a preset priority.
[0150] In other embodiments, the scheduling module 203 is further configured to:
[0151] In the case where the load of the CPU is less than the preset load threshold, the priority of the target process is restored to an original priority, the original priority being the priority of the target process before being increased to the preset priority.
[0152] In other embodiments, the preset process scheduling includes binding a core of the CPU. The scheduling module 203 is configured to:
[0153] If the target process is not scheduled after the CPU passes the preset scheduling period, the target process is bound to a large core of the CPU.
[0154] Figure 11 is another application startup control device block diagram according to an exemplary embodiment, as shown in Figure 11 The device 200 further includes:
[0155] The second acquisition module 205 is configured to acquire the load of the CPU according to a preset period.
[0156] Correspondingly, the scheduling module 203 is configured to:
[0157] If the target process is not scheduled and the load of the CPU is greater than or equal to the preset load threshold after the CPU passes through the preset scheduling period, the target process is bound to the large core of the CPU.
[0158] In some embodiments, the scheduling module 203 is further configured to:
[0159] In the case that the load of the CPU is less than the preset load threshold, the target process is unbound from the large core of the CPU.
[0160] In some embodiments, the completion of the startup of the target application is determined by:
[0161] In response to the fact that all interface elements of the startup interface of the target application are loaded, it is determined that the startup of the target application is completed.
[0162] In some embodiments, the target frequency is determined by:
[0163] In the case that the startup of the target application is completed, the load of the CPU is obtained.
[0164] According to the load of the CPU, the target frequency is determined.
[0165] As to the apparatus in the above embodiments, the specific manners in which the modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0166] In summary, in the case that the startup operation of the target application is received, the frequency of the CPU is switched from the current frequency to a preset frequency greater than or equal to the current frequency, and the target application is started based on the preset frequency. In the case that the startup of the target application is determined to be completed, the frequency of the CPU is switched from the preset frequency to a target frequency less than or equal to the preset frequency. When the startup of the target application is determined to be completed, the frequency of the CPU is adjusted in time, which avoids the problem that the CPU continues to be kept at the maximum frequency after the startup of the application is completed, and can effectively reduce the power consumption in the startup of the application.
[0167] The present disclosure also provides a computer readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the steps of the control method for application startup provided by the present disclosure.
[0168] Figure 12 is a block diagram of an apparatus for controlling application startup according to an exemplary embodiment. For example, the apparatus 300 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0169] Reference is made to Figure 12The device 300 can include one or more of the following components: a processing component 302, a memory 304, a power supply component 306, a multimedia component 308, an audio component 310, an input / output (I / O) interface 312, a sensor component 314, and a communication component 316.
[0170] The processing component 302 typically controls overall operations of the device 300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 302 can include one or more processors 320 to execute instructions stored in the memory 304 to complete all or a part of steps of the above-mentioned application startup control method. In addition, the processing component 302 can include one or more modules to facilitate interaction between the processing component 302 and other components. For example, the processing component 302 can include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.
[0171] The memory 304 is configured to store various types of data to support operations of the device 300. Examples of these data include instructions for any application or methods operating on the device 300, contact data, phonebook data, messages, pictures, videos, and so on. The memory 304 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic or optical disk.
[0172] The power supply component 306 supplies electrical power for the various components of the device 300. The power supply component 306 can include a power supply management system, one or more power supplies, and other components associated with generating, managing, and distributing electrical power for the device 300.
[0173] The multimedia component 308 includes a screen providing an output interface between the device 300 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors for sensing a touch, a slide and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 308 includes a front camera and / or a rear camera. When the device 300 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0174] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC) that receives an external audio signal when the device 300 is in an operation mode, such as a call mode, a recording mode and a voice recognition mode. The received audio signal can be further stored in the memory 304 or transmitted via the communication component 316. In some embodiments, the audio component 310 further includes a speaker for outputting audio signals.
[0175] The input / output interface 312 provides an interface between the processing component 302 and peripheral interface modules, which can include a keypad, a click wheel, buttons and so on. The buttons can include, but are not limited to, a home button, a volume button, a start button and a lock button.
[0176] The sensor component 314 includes one or more sensors for providing status assessments of various aspects of the device 300. For example, the sensor component 314 can detect an open / closed position of the device 300, relative positioning of components, such as a display and a keypad of the device 300, a change in position of the device 300 or a component of the device 300, the presence or absence of user contact with the device 300, the orientation or acceleration / deceleration of the device 300, and a temperature change of the device 300, among a plethora of other examples. The sensor component 314 can include a proximity sensor configured to detect the presence of a nearby object without any physical touch. The sensor component 314 can further include a light sensor (e.g., a CMOS or CCD image sensor) configured to work in conjunction with the camera component 308. In some embodiments, the sensor component 314 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0177] The communication component 316 is configured to facilitate wired or wireless communication between the device 300 and other devices. The device 300 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0178] In an exemplary embodiment, the device 300 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described control method of application launch.
[0179] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 304 including instructions, is also provided, which can be executed by the processor 320 of the device 300 to complete the above-described control method of application launch. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0180] In another exemplary embodiment, a computer program product is also provided, which contains a computer program capable of being executed by a programmable device, and the computer program has code portions for executing the above-described control method of application launch when executed by the programmable device.
[0181] Those skilled in the art can understand that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether the functions are implemented by hardware or software depends on the specific application and design requirements of the whole system. Those skilled in the art can implement the functions in various ways for each specific application, but such implementation should not be construed as beyond the scope of the embodiments of the present application.
[0182] In the detailed description above, reference is made to the accompanying drawings, which form a part hereof, and in which are shown by way of illustration specific aspects in which the disclosure can be practiced. In this regard, directional terminology, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "back," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and other commonly used terms, are used herein for the purpose of illustration only and are not intended to be limiting. Because the described devices can be positioned in a number of different orientations, the directional terminology can be used for illustration purposes only and is not limiting. It is to be understood that other aspects can be utilized and structural or logical changes can be made without departing from the scope of the present disclosure. The following detailed description, therefore, is not to be taken in a limiting sense.
[0183] It is to be understood that the features of the various aspects of the present disclosure described herein can be combined with each other, unless specifically noted otherwise. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items; similarly, "at least one of' includes any and all combinations of one or more of the associated listed items.
[0184] It should be understood that, unless otherwise specifically stated and limited, the terms "joined," "attached," "mounted," "connected," "linked," "fixed," and the like, as used in the embodiments of the present disclosure, are to be construed to be broad terms, for example, can be fixed attachments, or detachable attachments, or integral connections; can be mechanical, electrical, or communicative connections between the elements, or interactions between the elements; can be direct connections, or indirect connections through intermediaries, unless specifically stated and limited otherwise. The specific meaning of the above terms can be understood by those of ordinary skill in the art according to the specific context in which the terms are used.
[0185] Further, the word "over" as used in reference to a component, element, or material layer "over" another component, element, or material layer, is used herein to mean that the component, element, or material layer is positioned "indirectly" on the other component, element, or material layer such that one or more additional components, elements, or layers are arranged between the other component, element, or material layer and the component, element, or material layer. However, the word "over" as used in reference to a component, element, or material layer "over" another component, element, or material layer can optionally also mean that the component, element, or material layer is positioned "directly" on the other component, element, or material layer, e.g., in direct contact with the other component, element, or material layer.
[0186] Although terms such as "first", "second", and "third" can be used herein to describe various elements, components, regions, layers or sections, these elements, components, regions, layers or sections should not be limited to the terms. Instead, these terms are used only to distinguish one element, component, region, layer or section from another element, component, region, layer or section. Thus, the first element, component, region, layer or section mentioned in the examples described herein can also be referred to as the second element, component, region, layer or section without departing from the teachings of the examples. In addition, the terms "first", "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description herein, the meaning of "a plurality" is at least two, for example, two, three, etc., unless otherwise explicitly specified.
[0187] It should be understood that spatially relative terms, such as "above", "upper", "below", and "lower", among others, are used herein for describing the relationship between one element and another element as shown in the figures. In addition to the orientation depicted in the figures, such spatially relative terms are intended to encompass different orientations of the device in use or operation. For example, if the device in the figures is turned over, an element described as above or upper relative to another element would then be below or lower relative to the other element. Accordingly, the term "above" encompasses both the above and below orientations. The device can have other ways of orientation (e.g., rotated 90 degrees or at other orientations), and the spatially relative terms used herein should be interpreted accordingly.
[0188] In addition, the word "exemplary" is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as "exemplary" is not necessarily to be construed as advantageous over other aspects or designs. Rather, the exemplary aspects are used to illustrate concepts. As used in this document, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless specified otherwise, or clear from context, "X employs A or B" is intended to mean any of the natural inclusive permutations. That is, if X employs A; X employs B; or X employs both A and B, then "X employs A or B" is satisfied under any of the foregoing instances. In addition, the articles "a" and "an" as used in this application and the appended claims should generally be construed to mean "one or more" unless specified otherwise or clear from context to be directed to a singular form. Thus, use of the articles in this application and the appended claims is not limiting.
[0189] Likewise, although the present disclosure has been described and illustrated with respect to one or more implementations, equivalent alterations and modifications will become apparent to those skilled in the art in view of the description and illustrations. The present disclosure includes all such modifications and alterations and is only limited by the scope of the claims. In particular, with respect to the various functions described above, unless otherwise specified, the terms "comprise", "comprises" and "comprising" are to be construed as meaning "including, but not limited to". Likewise, the terms "comprise", "comprises" and "comprising" are to be construed as meaning "including, but not limited to", unless otherwise specified. Further, to the extent that the terms "include", "have", "with", "contain", or variants thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term "comprise" as an open-ended term (without limitation). Similarly, the terms "coupled", "coupling", "connected", "connecting", or variants thereof are used herein to generally refer to the connection of two or more elements or modules together, either directly or indirectly via one or more other elements or modules. Such terms are not used herein to mean directly connected rather than indirectly connected unless otherwise specifically stated.
[0190] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following the general principles thereof and including such departures from the present disclosure as come within known use or custom in the art. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
[0191] It is understood that the present disclosure is not limited to the precise structures herein described and illustrated and that various modifications and changes can be made by those skilled in the art without departing from the scope of this present disclosure. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. A method for controlling application startup, characterized in that: include: In response to receiving a start-up operation of a target application, switching the frequency of the CPU from a current frequency to a preset frequency, and starting the target application based on the preset frequency; The preset frequency is greater than or equal to the current frequency; When it is determined that the target application is started, the frequency of the CPU is switched from the preset frequency to a target frequency, where the target frequency is less than or equal to the preset frequency.
2. The method according to claim 1, characterized in that The method further comprises: After the CPU passes a preset scheduling cycle, if the target process corresponding to the target application is not scheduled, preset process scheduling is performed on the target process, and the preset process scheduling includes priority scheduling and / or binding the CPU core.
3. The method according to claim 2, characterized in that The preset process scheduling includes priority scheduling; after the CPU passes a preset scheduling period, if the target process corresponding to the target application is not scheduled, performing the preset process scheduling on the target process includes: After the CPU has passed a preset scheduling cycle, if the target process is not scheduled, the priority of the target process is increased to a preset priority.
4. The method according to claim 3, characterized in that The method further comprises: Obtaining the CPU load according to a preset period; If the target process is not scheduled after the CPU has completed a preset scheduling period, raising the priority of the target process to a preset priority level includes: After the CPU has passed a preset scheduling cycle, if the target process is not scheduled and the load of the CPU is greater than or equal to a preset load threshold, the priority of the target process is increased to the preset priority.
5. The method according to claim 4, characterized in that The method further comprises: When the load of the CPU is less than the preset load threshold, the priority of the target process is restored to the original priority, where the original priority is the priority of the target process before being increased to the preset priority.
6. The method according to claim 2, characterized in that The preset process scheduling includes binding the core of the CPU; after the CPU passes a preset scheduling period, if the target process corresponding to the target application is not scheduled, performing the preset process scheduling on the target process includes: After the CPU passes a preset scheduling cycle, if the target process is not scheduled, the target process is bound to a large core of the CPU.
7. The method according to claim 6, characterized in that The method further comprises: The CPU load is obtained according to a preset period. After the CPU has passed a preset scheduling period, if the target process is not scheduled, binding the target process to the large core of the CPU includes: After the CPU passes a preset scheduling cycle, if the target process is not scheduled and the load of the CPU is greater than or equal to a preset load threshold, the target process is bound to a large core of the CPU.
8. The method according to claim 7, characterized in that The method further comprises: When the load of the CPU is less than the preset load threshold, the target process is unbound from the large core of the CPU.
9. The method according to claim 1, characterized in that The target application startup completion is determined by: In response to the completion of loading of interface elements of the startup interface of the target application, it is determined that startup of the target application is completed.
10. The method according to any one of claims 1 to 9, characterized in that The target frequency is determined by: When the target application is started, obtaining the CPU load; The target frequency is determined according to the load of the CPU.
11. A control device for application startup, characterized in that: include: a startup module configured to, in response to receiving a startup operation of a target application, switch the frequency of the CPU from a current frequency to a preset frequency, and start the target application based on the preset frequency; The preset frequency is greater than or equal to the current frequency; The switching module is configured to switch the frequency of the CPU from the preset frequency to a target frequency when it is determined that the target application has been started, and the target frequency is less than or equal to the preset frequency.
12. A control device for application startup, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: In response to receiving a start-up operation of a target application, switching the CPU frequency from a current frequency to a preset frequency, and starting the target application based on the preset frequency; the preset frequency is greater than or equal to the current frequency; When it is determined that the target application is started, the frequency of the CPU is switched from the preset frequency to a target frequency, where the target frequency is less than or equal to the preset frequency.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 10 when the computer program is executed by a processor.
Citation Information
Patent Citations
Method and device for application starting
CN103324508A
Method and device for running application programs
CN106155733A
Task scheduling method and electronic equipment
CN108241527A
Method for adjusting CPU frequency and terminal equipment
CN117149409A