Processor frequency determination method and device and electronic equipment
By dynamically adjusting the processor frequency to match the requirements of the application startup phase, the power consumption and delay issues caused by processor frequency presets are resolved, and synchronization and performance optimization of application startup are achieved.
Patent Information
- Application Number
- CN202510897156.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-14
AI Technical Summary
In the prior art, if the processor frequency is preset too high, it will cause increased power consumption and heat generation of the electronic device; if it is preset too low, it will cause application startup delays and performance abnormalities, and it cannot be dynamically adjusted to optimize the application startup speed.
By obtaining the first stage information of application startup, combining the reference processor frequency and expected startup completion time, the processor frequency is dynamically adjusted to match the requirements of different stages of application startup, ensuring that the application is completed when the application startup animation ends.
The application startup is completed at the same time as the startup animation is played, avoiding increased power consumption and response delay of electronic devices and improving application startup performance.
Smart Images

Figure CN120780476A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a method, device and electronic device for determining processor frequency. Background Art
[0002] With the popularization of electronic devices and the development of mobile Internet, the number and types of applications in electronic devices are increasing. Application startup is a high-frequency operation when users use electronic devices.
[0003] In related technologies, the speed of application launch can be controlled by presetting the processor frequency, that is, controlling the time from when a user clicks an application icon to when the application content is displayed. However, if the presetting processor frequency is too high, it will increase the power consumption of the operating system in the electronic device, causing the electronic device to overheat and consume high power. Conversely, if the presetting processor frequency is too low, it will cause a delay in responding to the user's click on the application icon, prolonging the time it takes to display the application content, and causing application startup anomalies. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method, device and electronic device for determining processor frequency, which can dynamically adjust the processor frequency to improve application startup performance.
[0005] In a first aspect, an embodiment of the present application provides a method for determining a processor frequency, comprising:
[0006] When receiving a first input from the user on the application icon, obtaining first startup information of a first stage of startup of the application;
[0007] Based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application, the second processor frequency of the electronic device in the second stage of application startup is determined; wherein the first startup information includes a first load ratio, the first load ratio is the share of the load of the first stage in the total load of the application startup, the reference processor frequency is the average processor frequency of the previous application startup stage, and the expected startup completion time is the time when the application startup animation display ends.
[0008] In a second aspect, an embodiment of the present application provides a processor frequency determination device, comprising:
[0009] an acquisition module, configured to acquire first startup information of a first stage of application startup upon receiving a first input from a user on an application icon;
[0010] The determining module is configured to determine a second processor frequency of the electronic device in a second stage of application startup according to the first startup information of the first stage, a reference processor frequency, and an expected startup completion time of the application; the first startup information comprises a first load proportion, the first load proportion is a proportion of a load in the first stage in total loads in the application startup, the reference processor frequency is an average processor frequency of a last application startup stage, and the expected startup completion time is a time at which an application startup animation display ends.
[0011] In a third aspect, an electronic device is provided, which comprises a processor, a memory, and a program or instruction stored in the memory and executable in the processor. When the program or instruction is executed by the processor, the steps of the processor frequency determination method according to the first aspect are implemented.
[0012] In a fourth aspect, a readable storage medium is provided, which stores a program or instruction. When the program or instruction is executed by the processor, the steps of the processor frequency determination method according to the first aspect are implemented.
[0013] In a fifth aspect, a chip is provided, which comprises a processor and a display interface. The display interface is coupled to the processor. The processor is configured to execute a program or instruction, so as to implement the steps of the processor frequency determination method according to the first aspect.
[0014] In a sixth aspect, a computer program product is provided, which is stored in a storage medium. The program product is executed by at least one processor to implement the steps of the processor frequency determination method according to the first aspect.
[0015] In the embodiments of the present application, in the case that the first input of the user to the application icon is received, the first start information of the first stage of the application start is acquired; the second processor frequency of the electronic device in the second stage of the application start is determined according to the first start information of the first stage, the reference processor frequency and the expected start completion time of the application; wherein the first start information includes the first load proportion, the first load proportion is the proportion of the load in the first stage in the total load of the application start, the reference processor frequency is the average processor frequency of at least two stages of the last application start, and the expected start completion time is the time when the application start animation display ends. In this way, the load fluctuation of the electronic device can be perceived in real time through the load proportion of the current first stage of the application start, and the second processor frequency of the second stage of the application start in the first stage is determined in combination with the time when the application start animation display ends, so that the processor frequency of the electronic device is adjusted to the second processor frequency before the application is in the second stage, the completion time of the application start is aligned with the time when the application start animation display ends, and the application start is completed at the same time when the start animation is played. In this way, by dynamically adjusting the processor frequency of different stages of the application start, the application start speed is reasonably controlled, which is beneficial for the light-load application to align the time when the application start animation display ends through the lower processor frequency and power consumption, and for the heavy-load application to quickly respond to the user's operation of clicking the application icon through the higher processor frequency, so as to avoid the application start anomaly. BRIEF DESCRIPTION OF DRAWINGS
[0016] FIG. 1(a) is a schematic diagram of the relationship between the processor frequency and time in the application start stage in the processor frequency determination method provided by some embodiments of the present application;
[0017] FIG. 1(b) is a schematic diagram of the relationship between the processor frequency and time in the application start stage in the processor frequency determination method provided by some embodiments of the present application;
[0018] FIG. 1(c) is a schematic diagram of the relationship between the processor frequency and time in the application start stage in the processor frequency determination method provided by some embodiments of the present application;
[0019] FIG. 1(d) is a schematic diagram of the relationship between the processor frequency and time in the application start stage in the processor frequency determination method provided by some embodiments of the present application;
[0020] Figure 2 The flowchart of the processor frequency determination method provided by some embodiments of the present application is shown in FIG. 2;
[0021] Figure 3 The flowchart of the frequency rationality verification in the processor frequency determination method provided by some embodiments of the present application is shown in FIG. 3;
[0022] Figure 4A structural schematic diagram of a processor frequency determination device provided by an embodiment of the present application is shown in FIG. 1.
[0023] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 2.
[0024] Figure 6 A hardware structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0026] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", and the like are generally of a kind and are not limited in number, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.
[0027] In order to solve the problems in the related art, the embodiments of the present application consider that the processor (Central Processing Unit, CPU) frequency and time have different relationships under different circumstances, in order to analyze the relationship between the CPU frequency and the control of the application startup speed, and the specific analysis process is as follows.
[0028] First, as shown in FIG. 4, the application startup speed is controlled by the CPU frequency, and the application startup speed is inversely proportional to the CPU frequency. Figures 1(a) to 1(d)F1 is used to represent the CPU frequency adjustment situation after the processor frequency determination method provided by the embodiments is intervened; F2 is used to represent the situation that the preset CPU frequency in the related art is too high; F3 is used to represent the situation that the preset CPU frequency in the related art is too low; T1 is used to represent the time when the application startup animation display ends, that is, T1 is used to represent the completion time of the application startup after the processor frequency determination method provided by the embodiments is intervened; T2 is used to represent the completion time of the application startup when the application is started at the CPU frequency F2; T3 is used to represent the completion time of the application startup when the application is started at the CPU frequency F3; T4 is used to represent the fixed completion time of the application startup when the application is started at the preset CPU frequency; L1 is used to represent the work situation using the CPU frequency F1, and the green area is the total load of the application startup completion; L2 is used to represent the work situation using the CPU frequency F2, and the red area is the total load of the application startup completion; L3 is used to represent the work situation using the CPU frequency F3, and the blue area is the total load of the application startup completion.
[0029] As shown in FIG. 1(b), it is assumed that F1 acts on the application startup process, and the application startup speed is ideally controlled to be consistent with the time T1 when the application startup animation display ends, which is a relatively optimal energy efficiency and takes into account relatively high application startup performance, and the L1 green shaded area is the total load of the application startup completion and represents the total work of the CPU required for the application startup completion. As can be seen, as shown in FIG. 1(c), in the case of the CPU frequency F2, the performance is excessive, the application startup completion time point is T2, the CPU does work on the L2 red shaded area, the application startup completion time T2 is faster than the application animation startup completion time T1, and the CPU frequency F2 will continue to act until the fixed time T4, which will increase the power consumption of the operating system in the electronic device and cause the electronic device to heat up, consume power, and the like.
[0030] As can also be seen, as shown in FIG. 1(d), in the case of the CPU frequency F3, the performance is insufficient, the application startup completion time point is T3, the CPU does work on the L3 blue shaded area, the startup completion time T3 is slower than the application animation startup completion time T1, and in the case that the CPU frequency F3 no longer acts after the T4 time point, the application has not yet been completed, there is a significant performance deficiency, which will cause a delay in responding to the user's click on the application icon operation, prolong the time of displaying the application content, and result in poor application startup performance.
[0031] Based on this, the embodiments of the present application provide a method, device, electronic device, storage medium and program product for determining the processor frequency. The load fluctuation of the electronic device can be perceived in real time through the load proportion of the current stage of application startup, and the processor frequency of the next stage of application startup can be determined in combination with the time when the application startup animation ends. The completion time of the application startup can be aligned with the time when the application startup animation ends, so that the application startup is completed at the same time as the startup animation is played. In this way, by dynamically adjusting the processor frequency at different stages of application startup, the application startup speed can be reasonably controlled. For lightly loaded applications, it is beneficial to catch up with the time when the application startup animation ends through a lower processor frequency and power consumption. For heavily loaded applications, a higher processor frequency can be used to quickly respond to the user's click on the application icon, avoiding application startup abnormalities, such as response delays that extend the time to display the application content, loading the application content before the startup animation is finished playing, increasing the power consumption of the operating system in the electronic device, reducing the operating system performance, and other problems, thereby improving application startup performance.
[0032] In the description Figure 2 Before describing the processor frequency determination method, the technical terms appearing in the embodiments of the present application are described in detail.
[0033] Application startup speed refers to the time from when the user clicks the application icon to when the application content is displayed, which is the internal loading process of each application.
[0034] Application startup animation refers to the process from the user clicking the application icon to the startup animation being enlarged until it fills the screen, which is achieved by the desktop drawing of the operating system.
[0035] A standard score (z-score) is the difference between a number and the mean divided by the standard deviation.
[0036] Application startup load refers to the workload and resource consumption of the electronic device's operating system during the application startup process. Specifically, it includes indicators such as CPU usage, memory utilization, and the number of disk I / O requests. These indicators reflect the system resource usage of the application during startup.
[0037] The following is combined with Figures 2 to 3 , the processor frequency determination method provided in the embodiment of the present application is described in detail through specific embodiments and application scenarios.
[0038] First, combine Figure 2 A method for determining processor frequency provided in an embodiment of the present application is described in detail.
[0039] Figure 2A flowchart of a processor frequency determination method provided for some embodiments of the present application.
[0040] As shown in Figure 2 The execution subject of the processor frequency determination method provided by the embodiments of the present application can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted device, and the like. Based on this, the processor frequency determination method provided by the embodiments of the present application will be described in detail below. Figure 2 The processor frequency determination method provided by the embodiments of the present application can include steps 210 and 220, which are specifically shown as follows.
[0041] Based on this, the processor frequency determination method can include steps 210 and 220, which are specifically shown as follows.
[0042] Step 210: In the case that a first input of a user to an application icon is received, first start information of a first stage of application starting is acquired; step 220: according to the first start information of the first stage, a reference processor frequency, and an expected start completion time of the application, a second processor frequency of the electronic device in a second stage of the application starting is determined; wherein the first start information includes a first load proportion, the first load proportion is a share of the load of the first stage in the total load of the application starting, the reference processor frequency is an average processor frequency of the last application starting stage, and the expected start completion time is a time at which an application starting animation display ends.
[0043] In this way, the load proportion of the current first stage of the application starting can be used to realize real-time sensing of the fluctuation of the load of the electronic device, and the second processor frequency of the second stage of the application starting in the first stage of the application starting is determined in combination with the time at which the application starting animation display ends, so that the processor frequency of the electronic device can be adjusted to the second processor frequency before the application is in the second stage, the completion time of the application starting can be aligned with the time at which the application starting animation display ends, and the application starting is completed at the same time as the starting animation is played. In this way, by dynamically adjusting the processor frequency of different stages of the application starting, the application starting speed is reasonably controlled, which is beneficial for aligning the time at which the application starting animation display ends by using a lower processor frequency and power consumption for a light-load application, and for quickly responding to the user's operation of clicking the application icon by using a higher processor frequency for a heavy-load application, so that application starting abnormity is avoided.
[0044] It should be noted that the processor frequency determination method in the embodiments of the present application can be applied to application cold starting, application hot starting, page switching, and other application starting scenarios in which the starting speed is limited by the CPU frequency. Specifically, the application hot starting and the page switching can be divided into a fixed number of stages according to the starting process, and then the load proportion of the current stage can be determined in the starting process, and the processor frequency of the electronic device running the next stage is determined, so that the processor frequency of each stage can be adjusted in real time in advance, thereby controlling the application starting speed.
[0045] The above steps are described in detail as follows.
[0046] Firstly, in relation to step 210, in some embodiments of the present application, the application startup can be divided into at least two stages according to the steps of executing the task flow, and the application startup is taken as the application cold startup for example in the embodiments of the present application. The five stages of the application cold startup are, for example, the stage from startup start to Zygote end (start To Zygote End), the stage from Zygote end to Main method end (zygote End To Main End), the stage from Main method end to Make method end (main End To Real Make End), the stage from Make method end to Bind application end (real Make End To Bind End), and the stage from Bind application end to application content drawing end (Bind End To Finish Draw).
[0047] The startup information in the embodiments of the present application can include at least one of the following: the running time consumption of the running stage of the electronic device, the processor frequency of the running stage of the electronic device. In the embodiments of the present application, the startup information can include the startup information of each stage of the electronic device, that is, if the running stage of the electronic device includes at least two stages, and the at least two stages include a first stage and a second stage, the startup information can include first startup information of the first stage, which can include at least one of the following: the first running time consumption of the electronic device running the first stage, the first processor frequency of the electronic device running the first stage. The second stage is the same, the startup information can include second startup information of the second stage, which can include at least one of the following: the second running time consumption of the electronic device running the second stage, the second processor frequency of the electronic device running the second stage, and so on.
[0048] Next, in relation to step 220, in some embodiments of the present application, the first startup information further includes the first running time consumption of the electronic device running the first stage, based on which the step 220 can specifically include steps 2201 to 2203, as shown below.
[0049] Step 2201, determining the estimated residual load of the first stage according to the first load ratio, the reference processor frequency and the expected startup completion time.
[0050] Step 2202, determining the remaining startup duration of the application startup according to the expected startup completion time and the first running time consumption.
[0051] Step 2203, determining the ratio of the estimated residual load and the residual start duration as the second processor frequency of the second stage.
[0052] Exemplarily, the first load ratio is denoted as p i , the reference processor frequency is denoted as f0, and the expected start completion time T, the first running time t i , based on which, the following formula (1) can be realized:
[0053]
[0054] Wherein, j represents the first stage, i represents the second stage, n represents the total number of stages, f i is the second processor frequency, is the ideal predicted load of the second stage, is the ideal predicted time consumption of the second stage.
[0055] Here, if the first stage is the start to Zygote end stage, then the second stage is the next stage of the first stage, i.e. the Zygote end to Main method end stage.
[0056] It should be noted that in an ideal case, the stable CPU frequency is shown by the following formula But since the actual load fluctuates during the application start process, it is necessary to make real-time adjustment of the CPU frequency according to the speed of the application start in stages, combined with the actual load formula, i.e. i f i t i . In this way, when at least the jth stage (j>1) is reached, the second processor frequency of the second stage can be calculated by the above formula (1).
[0057] Based on this, the above formula (1) can be expressed in a simple way as follows: the second processor frequency of the second stage = estimated residual load / residual start duration = (reference processor frequency*ideal predicted time consumption of the second stage) / (expected start completion time-first running time) = reference processor frequency*expected start completion time*(1-first load ratio) / (expected start completion time-first running time).
[0058] Therefore, by dynamically adjusting the processor frequency of different stages of the application start, the application start speed is reasonably controlled, which is beneficial for light-load applications to catch up with the time of the end of the application start animation display through lower processor frequency and power consumption, and for heavy-load applications to quickly respond to the user's clicking of the application icon operation through higher processor frequency, avoiding the problem of prolonged display of application content caused by response delay, and improving the application start performance.
[0059] In some embodiments of the present application, before step 220, the processor frequency determination method can further include a process of determining a first load ratio, based on which the first start information in the embodiments of the present application further includes a first processor frequency at which the electronic device runs in the first stage and a first running time consumption, and based on which, before step 220, the processor frequency determination method can further include steps 3101 and 3102, which are specifically as follows.
[0060] Step 3101, determining the load in the first stage according to the first processor frequency and the first running time consumption.
[0061] Step 3102, determining the ratio of the load in the first stage to the total load in the last application start stage as the first load ratio.
[0062] The total load in the application start stage is determined by the processor frequency and the running time consumption in the application start stage. It should be noted that the number of the last application start stages in the embodiments of the present application can be at least two, that is, the ratio of the load in the first stage to the total load in the last two application start stages can be determined as the first load ratio.
[0063] Exemplarily, the load in the corresponding stage is l, the CPU frequency in the corresponding stage is f, the running time consumption in the corresponding stage is t, the stage number is i, there are n stages in total, and the load ratio in the corresponding stage is p. Based on this, the first load ratio can be calculated by the following formula (2) and formula (3):
[0064] l i =f i t i (2)
[0065]
[0066] For example, the last two application start stages are taken as an example, the above formula (3) can be expressed in a simple way as follows: the first load ratio = the load in the first stage / the total load in the application start = the first processor frequency * the first running time consumption / (the processor frequency in the first stage of the last two application start stages * the running time consumption in the first stage) + (the processor frequency in the second stage of the last two application start stages * the running time consumption in the second stage).
[0067] Therefore, the load ratio of the current first stage in the application start can be used to realize real-time sensing of the fluctuation of the load of the electronic device, real-time calculation of the load ratio in different stages, and improvement of the accuracy of the determination of the processor frequency.
[0068] In some embodiments of the present application, before step 220, the processor frequency determination method can further include a process of determining a reference processor frequency, based on which, before step 220, the processor frequency determination method can further include steps 3201 to 3204, as shown below.
[0069] In step 3201, second start information of each stage of the last application start is obtained, the second start information including a second load ratio and a second running time consumption.
[0070] For example, the second load ratio can be calculated by the above formula (2) and formula (3), which will not be repeated here.
[0071] In step 3202, a processor frequency of each stage of the last application start is determined according to the second start information, a third processor frequency and a time when the last application start animation display ends, wherein the third processor frequency is a set initial processor frequency or an average processor frequency of at least two stages of the last application start.
[0072] For example, the processor frequency of each stage can be calculated by the above formula (1), which will not be repeated here.
[0073] In step 3203, an average processor frequency of at least two stages of the last application start is calculated according to the processor frequency of each stage of the last application start.
[0074] For example, the processor frequency of each stage can be weightedly averaged to obtain the average processor frequency of at least two stages of the last application start.
[0075] In step 3204, the average processor frequency is determined as the reference processor frequency.
[0076] Therefore, the average processor frequency of at least two stages of the last application start can be used to participate in the calculation of the processor frequency of each stage of the current application start, which can improve the accuracy of the processor frequency of each stage of at least two stages of the current electronic device.
[0077] In some embodiments of the present application, in order to ensure the accuracy of the average processor frequency, the processor frequency of each stage of the last application start can be re-verified before step 3203, based on which, before step 3203, the processor frequency determination method can further include steps 3205 and 3206 or steps 3207 and 3208, as shown below.
[0078] In step 3205, the processor frequency of each stage of the last application start is verified by a standard score to obtain a verification result.
[0079] In step 3206, in a case where the verification result includes that the relative standard distance between the processor frequency of each stage of the last application start and the reference average processor frequency is less than or equal to a preset threshold, the average processor frequency of at least two stages of the last application start is calculated according to the processor frequency of each stage of the last application start.
[0080] Alternatively, in step 3207, in a case where the verification result includes that the relative standard distance between the processor frequency of each stage of the last application start and the reference average processor frequency is greater than a preset threshold, the fourth processor frequency with the relative standard distance greater than the preset threshold from the reference average processor frequency is deleted.
[0081] In step 3208, the average processor frequency of at least two stages of the last application start is calculated according to the processor frequency other than the fourth processor frequency.
[0082] For example, in combination with the previously calculated processor frequency, it is determined whether the current processor frequency is abnormally mutated, the z-score is used to determine the abnormality of the current processor frequency, and if the current processor frequency is mutated too much, the fourth processor frequency with the abnormality is selected to be deleted.
[0083] Therefore, the abnormal processor frequency can be removed by the standard score, and the accuracy of the processor frequency of each stage is ensured.
[0084] In some embodiments of the present application, before step 220, it can be determined whether to trigger the execution of determining the second processor frequency of the second stage of the second electronic device in combination with whether the user has turned off the application start animation. If the user turns off the application start animation, the step of determining the second processor frequency of the second stage of the second electronic device does not need to be executed, otherwise, if the user does not turn off the application start animation, the step of determining the second processor frequency of the second stage of the second electronic device can be executed. The purpose is to align the completion time of the application start with the end time of the application start animation display, and to realize that the application start is completed at the same time as the start of the animation is played. Based on this, the processor frequency determination method can further include steps 3301 and 3302, which are specifically as follows.
[0085] In step 3301, in a case where the electronic device is in the first stage and the application start animation is played, it is determined whether a second input of the user for exiting the playing of the application start animation is received.
[0086] In step 3302, in a case where the second input of the user for exiting the playing of the application start animation is not received, the second processor frequency of the second stage of the application start of the electronic device is determined according to the first start information of the first stage, the reference processor frequency and the expected start completion time of the application.
[0087] Thus, the completion time of the application startup can be aligned with the time when the application startup animation display ends, so that the application startup is completed at the same time as the startup animation is played. In this way, by dynamically adjusting the processor frequency in different stages of the application startup, the application startup speed is reasonably controlled. For a light-load application, it is beneficial to align the application startup animation display end time by using a lower processor frequency and power consumption. For a heavy-load application, a higher processor frequency can be used to quickly respond to the user's clicking of the application icon operation, avoiding the problem of prolonged display of application content caused by response delay, and improving the application startup performance.
[0088] Then, after step 220, the second processor frequency of the electronic device in the second stage of the application startup has been obtained, so that the processor frequency determination method can further include:
[0089] Step 230: adjusting the processor frequency of the electronic device to the second processor frequency before the application is in the second stage.
[0090] Thus, the completion time of the application startup can be aligned with the time when the application startup animation display ends, so that the application startup is completed at the same time as the startup animation is played.
[0091] In some embodiments of the present application, before step 230, in order to effectively ensure the smoothness of the application startup animation in various complex scenarios without damaging or minimizing the power consumption, and to control the application startup speed while ensuring that the application startup animation does not drop frames, based on this, the first startup information in the embodiments of the present application further includes the first processor frequency at which the electronic device runs the first stage and the average time consumption for playing N frames of images in the application startup animation in the first stage, N being an integer greater than 1, and the processor frequency determination method can further include step 2401 and step 2402 or step 2403, as shown below.
[0092] Step 2401: determining a critical processor frequency of the electronic device for playing M frames of images in the application startup animation in the second stage according to the first processor frequency, the average time consumption, and the maximum playing time consumption of each frame of image in the application startup animation, M being an integer greater than 1.
[0093] For example, for a completed application startup animation process, the load of each frame of the startup animation task itself is relatively constant, and the fluctuations of other loads are also converted into disturbances of the application startup speed, so that the critical processor frequency f 临界 That is, the critical processor frequency of the next stage for playing multiple frames of images in the application startup animation is predicted from the CPU frequency and time consumption for playing multiple frames of images in the application startup animation in the current stage. The critical processor frequency can be calculated by using the above formula (4) and formula (5), and the specific content is as follows:
[0094]
[0095] wherein f i is the first processor frequency, the average time consumption t i and the maximum playing time consumption t 临界 of each frame image in the application startup animation.
[0096] Step 2402, in the case where the second processor frequency is greater than or equal to the critical processor frequency, adjusting the processor frequency of the electronic device to the second processor frequency before the application is in the second stage.
[0097] Step 2403, in the case where the second processor frequency is less than the critical processor frequency, adjusting the processor frequency of the electronic device to the critical processor frequency before the application is in the second stage.
[0098] Thus, in the embodiments of the present application, the animation fluency in various complex scenarios can be effectively ensured without damaging or with minimum energy consumption, the application startup speed is controlled, the application startup animation is ensured not to drop frames, the situation of animation fluctuation or even frame drop caused by the change of load at any time can be coped with, and the problem of damaging the animation fluency caused by the CPU frequency reduction due to the power saving strategy can be solved.
[0099] In order to better understand the processor frequency determination method provided by the embodiments of the present application, taking the application startup as the application cold startup as an example, the Figure 3 processor frequency determination method provided by the embodiments of the present application is described in detail.
[0100] Figure 3 The flowchart of the processor frequency determination method provided by some embodiments of the present application is shown.
[0101] As shown in Figure 3 step 301, receiving the first input of the user to the application icon.
[0102] Step 302, in response to the first input, acquiring the 5 stages of the application cold startup, such as the startup start to Zygote end stage, Zygote end to Main method end stage, Main method end to Make method end stage, Make method end to Bind application end stage, and Bind application end to application content drawing out stage.
[0103] Step 303, in the case that the electronic device is in the first stage such as the start to Zygote end stage and plays N frames of images of the application startup animation, it is determined whether a second input of the user for exiting the playing of the application startup animation is received. In the case that the second input of the user for exiting the playing of the application startup animation is not received, step 304 is executed; in the case that the second input of the user for exiting the playing of the application startup animation is received, step 310 is executed.
[0104] It should be noted that, in addition to determining whether to execute step 304 according to the second input in the embodiments of the present application, whether to execute step 304 can also be determined according to whether the time length of the cold startup of the application is abnormal, for example, if the running time of the first stage is greater than or equal to 500 ms, step 310 is executed, if the running time of the first stage is less than 500 ms, step 304 is executed. In addition, whether to execute step 304 can also be determined according to the order of the stages, for example, if the five stages are not executed in the order of the stages, step 310 is executed, if the five stages are executed in the order of the stages, step 304 is executed.
[0105] Step 304, according to the first startup information of the start to Zygote end stage, the reference processor frequency and the expected startup completion time of the application, the second processor frequency of the electronic device running the second stage, that is, the next stage of the first stage such as the Zygote end to Main method end stage, is determined by step 220.
[0106] Step 305, according to the first processor frequency, the average time consumption and the maximum playing time consumption of each frame of image in the application startup animation, the critical processor frequency of the electronic device for playing M frames of images in the application startup animation when running the second stage is determined.
[0107] Step 306, it is judged whether the second processor frequency is greater than or equal to the critical processor frequency, if the second processor frequency is greater than or equal to the critical processor frequency, step 307 is executed; if the second processor frequency is less than the critical processor frequency, step 308 is executed.
[0108] Step 307, before the application is in the second stage, the processor frequency of the electronic device is adjusted to the second processor frequency.
[0109] Step 308, before the application is in the second stage, the processor frequency of the electronic device is adjusted to the critical processor frequency to prevent frame dropping.
[0110] Step 309, in the case of the application being in the Zygote end to Main method end stage, the Zygote end to Main method end stage is taken as the first stage, and the Main method end to Make method end stage is taken as the second stage, and steps 303 to 308 are executed in a loop.
[0111] According to the order of the stages, step 310 is executed until the application has no stage to enter, so that the application startup is completed at the same time as the startup animation is played.
[0112] Therefore, the embodiments of the application can enable the application to complete startup in the expected time, that is, the application startup is completed at the same time as the startup animation is played, so as to dynamically adjust the processor frequency and improve the application startup performance. For a single application startup process, irregular fluctuations in load can be effectively coped with, the frequency is increased when the current startup time is longer, and the frequency is reduced when the current time is shorter, so as to adjust the total startup time and guarantee the single startup time. In addition, after each application startup is completed, the average processor frequency of the whole application startup process is calculated, and the reference processor frequency of the application startup is dynamically adjusted between multiple application startups, so as to realize stable and reasonable CPU frequency adjustment in the long term. In this way, by dynamically adjusting the processor frequency of different stages of the application startup, the application startup speed is reasonably controlled, which is beneficial for light-load applications to keep up with the time of displaying the end of the application startup animation through lower processor frequency and power consumption, and for heavy-load applications to quickly respond to the user's operation of clicking the application icon by using higher processor frequency, thereby avoiding application startup abnormity.
[0113] The processor frequency determination method provided by the embodiments of the application can be executed by a processor frequency determination device. In the embodiments of the application, the processor frequency determination method is executed by the processor frequency determination device as an example to illustrate the device of the processor frequency determination method provided by the embodiments of the application.
[0114] The application further provides a processor frequency determination device. The processor frequency determination device will be described in detail in combination with Figure 4 .
[0115] Figure 4 A structural schematic diagram of the processor frequency determination device provided by the embodiments of the application is shown in FIG. 4.
[0116] As shown in FIG. 4, the processor frequency determination device 40 can be applied to an electronic device, and the processor frequency determination device 40 can specifically include: Figure 4 The acquisition module 401 is configured to acquire first startup information of a first stage of application startup in the case of receiving a first input of a user on an application icon.
[0117]
[0118] The determining module 402 is configured to determine a second processor frequency of the electronic device in a second stage of application startup according to first startup information of the first stage, a reference processor frequency, and an expected startup completion time of the application, wherein the first startup information comprises a first load proportion, the first load proportion is a proportion of the load in the first stage in total load in the application startup, the reference processor frequency is an average processor frequency of a last application startup stage, and the expected startup completion time is a time when the application startup animation display ends.
[0119] The processor frequency determination apparatus 40 in the embodiments of the present application is described in detail as follows.
[0120] In some embodiments of the present application, the determining module 402 can be further configured to, in a case where the first startup information further comprises a first processor frequency of the electronic device running in the first stage and an average time consumption of playing N frames of images in the application startup animation in the first stage, N being an integer greater than 1, determine a critical processor frequency of the electronic device for playing M frames of images in the application startup animation in the second stage according to the first processor frequency, the average time consumption, and a maximum time consumption of playing each frame of image in the application startup animation, M being an integer greater than 1.
[0121] The processor frequency determination apparatus 40 in the embodiments of the present application can further comprise an adjusting module configured to, in a case where the second processor frequency is greater than or equal to the critical processor frequency, adjust the processor frequency of the electronic device to the second processor frequency before the application is in the second stage.
[0122] In some embodiments of the present application, the determining module 402 can be further configured to, in a case where the first startup information further comprises a first processor frequency of the electronic device running in the first stage and a first running time consumption, determine the load in the first stage according to the first processor frequency and the first running time consumption.
[0123] The ratio of the load in the first stage to total load in the last application startup stage is determined as the first load proportion, wherein the total load in the application startup stage is determined by the processor frequency and the running time consumption in the application startup stage.
[0124] In some embodiments of the present application, the determining module 402 can be further configured to, in a case where the electronic device is in the first stage and the application startup animation is played, determine whether a second input of the user for exiting the playing of the application startup animation is received.
[0125] In a case where the second input of the user for exiting the playing of the application startup animation is not received, the second processor frequency of the electronic device in the second stage of the application startup is determined according to the first startup information of the first stage, the reference processor frequency, and the expected startup completion time of the application.
[0126] In some embodiments of the present application, the determination module 402 may be specifically configured to determine an estimated remaining load in the first stage based on the first load ratio, the reference processor frequency, and the expected startup completion time, when the first startup information further includes a first operation duration of the first stage of the electronic device;
[0127] Determine the remaining startup time of the application based on the expected startup completion time and the first run duration;
[0128] The ratio of the estimated remaining load to the remaining startup time is determined as the second processor frequency in the second stage.
[0129] The processor frequency determination device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.
[0130] The processor frequency determination device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0131] The device coordination apparatus provided in the embodiment of the present application can achieve Figures 2 to 3 The various processes implemented in the embodiment of the processor frequency determination method shown achieve the same technical effect, and will not be described again here to avoid repetition.
[0132] Based on this, the processor frequency determination apparatus provided in the embodiments of the present application can acquire first start information of a first stage of application starting in the case of receiving a first input of a user to an application icon; determine a second processor frequency of the electronic device in a second stage of the application starting according to the first start information of the first stage, a reference processor frequency and an expected start completion time of the application; wherein the first start information comprises a first load proportion, the first load proportion is a share of the load of the first stage in the total load of the application starting, the reference processor frequency is an average processor frequency of at least two stages of the last application starting, and the expected start completion time is a time of ending of the application starting animation display. In this way, the load fluctuation of the electronic device can be perceived in real time through the load proportion of the current first stage of the application starting, and the second processor frequency of the second stage of the application starting in the first stage is determined in combination with the time of ending of the application starting animation display, so that the processor frequency of the electronic device is adjusted to the second processor frequency before the application is in the second stage, the completion time of the application starting is aligned with the time of ending of the application starting animation display, and the application starting is completed at the same time of playing the starting animation. In this way, the processor frequency of different stages of the application starting is dynamically adjusted, the application starting speed is reasonably controlled, the completion time of the application starting is aligned with the time of ending of the application starting animation display for a light-load application through a lower processor frequency and power consumption, and the application starting is quickly responded to the user's operation of clicking the application icon through a higher processor frequency for a heavy-load application, so that the application starting abnormality is avoided.
[0133] Optionally, as shown in Figure 5 The embodiments of the present application also provide an electronic device 50, which comprises a processor 501 and a memory 502, the memory 502 stores programs or instructions executable on the processor 501, the programs or instructions are executed by the processor 501 to implement each step of the processor frequency determination method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.
[0134] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0135] Figure 6 A hardware structure schematic diagram of an electronic device is provided in the embodiments of the present application.
[0136] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 605, a processor 610 and the like.
[0137] Those skilled in the art will understand that the electronic device 600 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0138] In an embodiment of the present application, the processor 610 is configured to obtain first startup information for the first phase of application startup upon receiving a first input from a user to an application icon. The processor 610 may also be configured to determine a second processor frequency of the electronic device in the second phase of application startup based on the first startup information of the first phase, a reference processor frequency, and an expected startup completion time of the application; wherein the first startup information includes a first load percentage, which is the share of the load of the first phase in the total load of the application startup, the reference processor frequency being the average processor frequency of the previous application startup phase, and the expected startup completion time being the time when the application startup animation display ends.
[0139] The electronic device 600 is described in detail below.
[0140] In some embodiments of the present application, the processor 610 may further be configured to, when the first startup information further includes a first processor frequency of the electronic device during the first phase of operation and an average time taken to play N frames of the application startup animation during the first phase, where N is an integer greater than 1, determine, based on the first processor frequency, the average time taken, and the maximum time taken to play each frame of the application startup animation, a critical processor frequency for playing M frames of the application startup animation during the second phase of operation, where M is an integer greater than 1;
[0141] When the second processor frequency is greater than or equal to the critical processor frequency, before the application is in the second stage, the processor frequency of the electronic device is adjusted to the second processor frequency.
[0142] In some embodiments of the present application, the processor 610 may further be configured to, when the first startup information further includes a first processor frequency and a first operation duration of the electronic device in the first stage of operation, determine the load of the first stage according to the first processor frequency and the first operation duration;
[0143] Determine the total load of the application startup based on the total processor frequency and total running time of at least two stages of the previous application startup;
[0144] The ratio of the load in the first stage to the total load in the previous application startup stage is determined as a first load ratio, wherein the total load in the application startup stage is determined by the processor frequency and running time in the application startup stage.
[0145] In some embodiments of the present application, the processor 610 may further be configured to, when the electronic device is in the first stage and the application startup animation is playing, determine whether a second input from the user to exit the playing of the application startup animation is received;
[0146] Without receiving the second input from the user to exit the application startup animation, the electronic device determines the second processor frequency of the second stage of the application startup based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application.
[0147] In some embodiments of the present application, the processor 610 may further be configured to, when the first startup information further includes a first operation duration of the first stage of the electronic device, determine an estimated remaining load in the first stage based on the first load ratio, the reference processor frequency, and the expected startup completion time;
[0148] Determine the remaining startup time of the application based on the expected startup completion time and the first run duration;
[0149] The ratio of the estimated remaining load to the remaining startup time is determined as the second processor frequency in the second stage.
[0150] It should be understood that the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of the static image or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel, and the display panel may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of the other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch display. Other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as a volume display button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0151] The memory 605 can be used to store software programs and various data, and can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 605 can include a volatile memory or a non-volatile memory, or the memory 605 can include both a volatile memory and a non-volatile memory. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 605 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0152] The processor 610 can include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes a wireless display signal, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 610.
[0153] The embodiments of the present application also provide a readable storage medium, and the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize each process of the processor frequency determination method embodiments, and the same technical effects can be achieved, and thus details are not repeated here.
[0154] The processor is a processor in the electronic device in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disc, or an optical disc, etc.
[0155] In addition, the embodiment of the present application further provides a chip, which comprises a processor and a display interface. The display interface is coupled with the processor. The processor is used for running programs or instructions to realize the processes of the processor frequency determination method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0156] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.
[0157] The embodiment of the present application provides a computer program product stored in a storage medium. The program product is executed by at least one processor to realize the processes of the processor frequency determination method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0158] It should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0159] In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing the functions in the order shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part that contributes to the prior art, which is stored in a storage medium (such as a ROM / RAM, a magnetic disc, an optical disc), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present application.
[0161] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, but not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.
Claims
1. A method for determining processor frequency, characterized in that: include: Upon receiving a first input from a user on an application icon, obtaining first startup information of a first stage of startup of the application; Determine the second processor frequency of the electronic device in the second stage of the application startup based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application; wherein, the first startup information includes a first load ratio, the first load ratio is the share of the load of the first stage in the total load of the application startup, the reference processor frequency is the average processor frequency of the last application startup stage, and the expected startup completion time is the time when the application startup animation display ends.
2. The method according to claim 1, characterized in that The first startup information also includes a first processor frequency of the electronic device during the first phase of operation and an average time taken to play N frames of the application startup animation during the first phase, where N is an integer greater than 1. The method further includes: determining, based on the first processor frequency, the average playback time, and the maximum playback time of each frame of the application startup animation, a critical processor frequency for playing M frames of the application startup animation when the electronic device is running the second stage, where M is an integer greater than 1; When the second processor frequency is greater than or equal to the critical processor frequency, before the application is in the second stage, the processor frequency of the electronic device is adjusted to the second processor frequency.
3. The method according to claim 1, characterized in that The first startup information further includes a first processor frequency and a first operation time consumed by the electronic device during the first stage of operation; the method further includes: determining a load of the first stage according to the first processor frequency and the first operation duration; The ratio of the load in the first stage to the total load in the last application startup stage is determined as the first load ratio, wherein the total load in the application startup stage is determined by the processor frequency and running time in the application startup stage.
4. The method according to claim 1, wherein Before determining the second processor frequency of the electronic device in the second stage of starting the application based on the first startup information of the first stage, the reference processor frequency, and the expected startup completion time of the application, the method further includes: When the electronic device is in the first stage and the application startup animation is playing, determining whether a second input from the user to exit playing the application startup animation is received; Without receiving the second input from the user to exit playing the application startup animation, the second processor frequency of the electronic device running the second stage is determined based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application.
5. The method according to claim 1 or 4, characterized in that The first startup information also includes a first running time consumed by the electronic device in the first stage; and determining a second processor frequency of the electronic device in the second stage of application startup based on the first startup information of the first stage, a reference processor frequency, and an expected startup completion time of the application, includes: determining an estimated remaining load of the first stage according to the first load proportion, the reference processor frequency, and the expected startup completion time; Determining a remaining startup time for the application startup based on the expected startup completion time and the first running time; A ratio of the estimated remaining load to the remaining startup time is determined as the second processor frequency of the second stage.
6. A processor frequency determination device, characterized in that: include: an acquisition module, configured to acquire first startup information of a first stage of startup of the application when receiving a first input from a user on an application icon; A determination module is used to determine the second processor frequency of the electronic device in the second stage of the application startup based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application; wherein, the first startup information includes a first load ratio, the first load ratio is the share of the load of the first stage in the total load of the application startup, the reference processor frequency is the average processor frequency of the last application startup stage, and the expected startup completion time is the time when the application startup animation display ends.
7. The device according to claim 6, characterized in that The determining module is further configured to, when the first startup information further includes a first processor frequency of the electronic device during the first phase of operation and an average time consumed to play N frames of the application startup animation during the first phase, where N is an integer greater than 1, determine, based on the first processor frequency, the average time consumed, and the maximum time consumed to play each frame of the application startup animation, a critical processor frequency for playing M frames of the application startup animation during the second phase of operation of the electronic device, where M is an integer greater than 1; The processor frequency determination device further includes an adjustment module for adjusting the processor frequency of the electronic device to the second processor frequency before the application enters the second stage when the second processor frequency is greater than or equal to the critical processor frequency.
8. The device according to claim 6, characterized in that The determining module is further configured to, when the first startup information further includes a first processor frequency and a first operation duration of the electronic device in the first stage, determine the load of the first stage according to the first processor frequency and the first operation duration; The ratio of the load in the first stage to the total load in the last application startup stage is determined as the first load ratio, wherein the total load in the application startup stage is determined by the processor frequency and running time in the application startup stage.
9. The device according to claim 6, characterized in that The determining module is further configured to, when the electronic device is in the first stage and the application startup animation is being played, determine whether a second input from the user to exit playing the application startup animation is received; Without receiving the second input from the user to exit playing the application startup animation, the second processor frequency of the electronic device running the second stage is determined based on the first startup information of the first stage, the reference processor frequency and the expected startup completion time of the application.
10. The device according to claim 6 or 9, characterized in that The determining module is further configured to, when the first startup information further includes a first operation time consumed by the electronic device in the first stage, determine an estimated remaining load of the first stage based on the first load proportion, the reference processor frequency, and the expected startup completion time; Determining a remaining startup time for the application startup based on the expected startup completion time and the first running time; A ratio of the estimated remaining load to the remaining startup time is determined as the second processor frequency of the second stage.
11. An electronic device, characterized in that: include: A processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the processor frequency determination method according to any one of claims 1 to 5.