Frequency adjustment method and device, electronic equipment and computer readable medium
By obtaining and scoring the operation, lag and resource information of smart hardware devices, and determining and adjusting the processor frequency strategy, the problem of untimely frequency adjustment of smart hardware devices in variable scenarios is solved, and more reasonable performance and power consumption are achieved balance.
Patent Information
- Application Number
- CN202411230121.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119225956A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile terminal technology, and more specifically, to a frequency adjustment method, device, electronic device and computer-readable medium. Background Art
[0002] At present, the performance optimization of smart hardware devices (such as smart phones, smart tablets, etc.) usually relies on relevant preset configuration files or the chip's own frequency modulation algorithm, that is, the processor frequency of the device is adjusted through the configuration file or frequency modulation algorithm. However, the current method of adjusting the processor frequency is not set reasonably enough. Summary of the invention
[0003] The present application proposes a frequency adjustment method, device, electronic device and computer-readable medium to improve the above-mentioned defects.
[0004] In a first aspect, the present application provides a frequency adjustment method, which is applied to an electronic device, and the method includes: obtaining operation information, lag information and resource information of the electronic device, wherein the operation information corresponds to different types of operations; based on the operation information, lag information and resource information, determining multiple frequency strategies corresponding to specified operations, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to resolve the lag caused by the specified operation; determining a performance score and a power consumption score for each frequency strategy corresponding to the specified operation; based on the performance score and the power consumption score for each frequency strategy corresponding to the specified operation, determining a target frequency strategy corresponding to the specified operation; within a first time period, when the specified operation is detected, adjusting the processor frequency of the electronic device based on the target frequency strategy.
[0005] In a second aspect, the present application also provides a frequency adjustment device, which is applied to an electronic device, and the device includes: an acquisition unit, a first determination unit, a scoring unit, a second determination unit, and a processing unit. The acquisition unit is used to acquire operation information, jamming information, and resource information of the electronic device, wherein the operation information corresponds to different types of operations. The first determination unit is used to determine multiple frequency strategies corresponding to a specified operation based on the operation information, jamming information, and resource information, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to solve the jamming caused by the specified operation. The scoring unit is used to determine the performance score and power consumption score of each frequency strategy corresponding to the specified operation. The second determination unit is used to determine the target frequency strategy corresponding to the specified operation based on the performance score and power consumption score of each frequency strategy corresponding to the specified operation. The processing unit is used to adjust the processor frequency of the electronic device based on the target frequency strategy when the specified operation is detected within a first time period.
[0006] In a third aspect, the present application also provides an electronic device comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.
[0007] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0008] The frequency adjustment method, device, electronic device and computer-readable medium provided by the present application obtain the operation information, jamming information and resource information of the electronic device, wherein the operation information corresponds to different types of operations; based on the operation information, jamming information and resource information, determine multiple frequency strategies corresponding to the specified operation, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to solve the jamming caused by the specified operation; determine the performance score and power consumption score of each frequency strategy corresponding to the specified operation; based on the performance score and power consumption score of each frequency strategy corresponding to the specified operation, determine the target frequency strategy corresponding to the specified operation; within a first duration, when the specified operation is detected, adjust the processor frequency of the electronic device based on the target frequency strategy. Therefore, it is possible to determine multiple frequency strategies that can solve the jamming caused by the specified operation, and then obtain a target frequency strategy based on the performance score and power consumption score of each frequency strategy, so that within the first duration, for the specified operation, the target frequency strategy used is the result after combining performance and power consumption evaluation, which can reflect the characteristics of performance and power consumption, making the setting of the target frequency strategy more reasonable.
[0009] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1A method flow chart of a frequency adjustment method provided by an embodiment of the present application is shown;
[0012] Figure 2 A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0013] Figure 3 A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0014] Figure 4 A module block diagram of a frequency adjustment device provided by an embodiment of the present application is shown;
[0015] Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;
[0016] Figure 6 A storage unit for storing or carrying program codes for implementing the method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0017] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0018] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0019] At present, the performance optimization of smart hardware devices (such as smart phones, smart tablets, etc.) usually relies on relevant preset configuration files or the chip's own frequency modulation algorithm, that is, the processor frequency of the device is adjusted through the configuration file or the frequency modulation algorithm.
[0020] Specifically, the method of adjusting the processor frequency by means of a preset configuration file is generally to fix a specific chip frequency under a specific operation. For example, in relation to the CPU, when sliding, the CPU is configured with a minimum frequency of 1.5g and a maximum frequency of 2g; and when touching, the CPU is configured with a minimum frequency of 1g, a maximum frequency of 2g, and a duration of 300ms. Only under a specific operation, the operating frequency of the processor is adjusted by a frequency between the preset minimum frequency and the maximum frequency.
[0021] The methods of using algorithms to adjust the chip include: On-Demand: This is the most common CPU frequency adjustment algorithm, which dynamically adjusts the frequency based on the CPU load. When the load is high, the frequency will increase to provide higher performance; when the load is low, the frequency will decrease to save energy. This algorithm responds quickly and is suitable for most usage scenarios. Conservative: Compared with On-Demand, the frequency adjustment of the Conservative algorithm is more gradual and smooth. It does not immediately increase or decrease the frequency when the load changes, but adjusts it gradually to avoid frequent frequency switching. This algorithm is suitable for use in power-sensitive scenarios. Performance: This algorithm locks the CPU frequency at the highest gear, always providing maximum performance regardless of the load. This setting is often used in situations that require high-performance computing, such as games, video editing, etc. Powersave: In contrast to Performance, the Powersave algorithm locks the CPU frequency at the lowest gear to maximize energy saving. This is often used in devices that require long standby times, such as mobile devices or battery-powered embedded systems. Schedutil: This algorithm is smarter and combines information from the CPU scheduler to determine frequency adjustments. Schedutil can better predict short-term load changes, thus achieving a balance between performance and energy efficiency. Interactive: Commonly used in Android devices, this algorithm dynamically adjusts the frequency based on user interaction, such as rapidly increasing the frequency when touching the screen to ensure smooth user operations. However, it maintains a lower frequency in a non-interactive state to save energy.
[0022] However, the inventors found in their research that the above method is not reasonable enough. Specifically, performance resource allocation is performed through a preset fixed configuration file, which is difficult to flexibly adjust in the face of changing application scenarios and user behaviors. When a problem occurs, the configuration file in the mobile phone can only be changed by changing the version of the electronic device (for example, the user's mobile phone), such as OTA upgrades and other measures. The chip frequency modulation algorithm changes the frequency modulation strategy based on the kernel load. The frequency modulation will only be performed when the load reaches the threshold. There are often problems such as untimely frequency modulation and insufficient frequency modulation, which leads to abnormal freezes.
[0023] Therefore, in order to overcome the above defects, the present application can provide a frequency modulation strategy that is more in line with performance and power consumption. Specifically, Figure 1 As shown, a frequency adjustment method provided in an embodiment of the present application is shown, and the method is applied to an electronic device, and the electronic device may be a smart phone, a tablet computer, a computer device or a wearable device, etc. The electronic device includes a processor, and the method includes: S101 to S105.
[0024] S101: Acquire operation information, freeze information, and resource information of the electronic device.
[0025] As an implementation, the operation information of the electronic device may include first information generated by the user's operation of the electronic device and second information related to the application scenario of the electronic device. For example, the first information may include the user's touch operation on the screen, such as sliding, clicking, and long pressing; voice input information, such as voice commands entered by the user through a voice assistant or a recording function; keyboard input information, such as text or numbers entered by the user through a virtual keyboard; sensor data, such as data collected by an accelerometer, gyroscope, or position sensor, such as moving direction, screen rotation; system feedback information, such as tactile feedback (vibration), sound prompts, notifications or warnings displayed on the screen. The second information may include data generated by specific business scenarios executed by the electronic device, such as navigation, photography, social media, health monitoring, played audio, played video, etc.
[0026] It is understandable that the operation information, whether it is the first information or the second information, can correspond to different types of operations, such as touch operations such as sliding, clicking, or voice commands, etc. Therefore, the operation information corresponds to different types of operations, and the different types of operations can be recorded by the electronic device lock, and each operation corresponds to a timestamp, which is used to characterize the system time when the electronic device detects the operation, and the timestamp also belongs to the operation information. Exemplarily, the operation information may include the user's touch operation on the screen and the timestamp corresponding to each touch operation, wherein the touch operation includes different types of touch, such as sliding, clicking, long pressing, etc. Of course, the operation information may also include operations such as the electronic device playing videos, playing audio, running specified applications, etc. and corresponding timestamps, which are not specifically limited here.
[0027] It should be noted that the freeze of electronic devices can usually include abnormal screen refresh, delayed operation response and slow system response, among which, abnormal screen refresh means that the image or interface elements on the screen fail to update in time, causing the picture to appear to lag or delay, that is, picture lag, and in video playback or animation effects, the number of picture frames fails to update at a predetermined speed, causing the picture to skip frames or freeze. Operation response delay can be input delay, that is, the user's touch, click or slide operation does not respond immediately, resulting in inconsistency with the time of user operation, and startup delay, that is, the delay when the application or functional module is started, or the operation response within the application or functional module is slow. Slow system response can include menu switching delay and system action lag, among which menu switching delay means that the switching effect is not smooth when switching between different applications or interfaces, and system action lag can be the system response delay when opening the notification bar, quick setting panel or task manager.
[0028] Exemplarily, the jamming information of an electronic device is used to record each jamming of the electronic device and related information. The jamming information of the electronic device may include frame loss time, frame loss package name, frame loss number, user operation type (slide, touch, click), jamming type (continuous jamming, major jamming). Exemplarily, frame loss time refers to the failure of the screen or interface to refresh at the expected frame rate during the operation, causing visual pauses or delays. Since the aforementioned different jamming situations can be expressed through changes in the interface or screen, the frame loss time is equivalent to the timestamp corresponding to the jamming, which is used to characterize the time when the jamming phenomenon occurs. The number of frame losses refers to the total number of frame loss events recorded within a specific time period. User operation type: refers to the user's operation method when the jamming occurs, such as sliding, touching or clicking. Jamming types specifically include continuous jamming (long-term or continuous jamming) and major jamming (significant, single large-scale performance degradation).
[0029] As an implementation method, the resource information may include memory resources, CPU frequency, CPU big core resources, CPU priority resources, GPU frequency, etc. Among them, memory resources refer to the currently used and remaining RAM (random access memory), CPU frequency refers to the operating speed of the processor, CPU big core resources: in a multi-core processor, some cores (big cores) have higher performance. Big core resources show the usage of these high-performance cores. CPU priority resources refer to the CPU resources that the system allocates to certain tasks or processes first when allocating resources to optimize the performance of critical tasks. GPU frequency is used to characterize the operating speed of the GPU and affects the performance of graphics rendering and image processing.
[0030] S102: Determine multiple frequency strategies corresponding to the specified operation based on the operation information, freeze information and resource information.
[0031] It can be seen from the aforementioned operation information, jamming information and resource information that the electronic device can obtain the operation information and resource information of the electronic device when the electronic device jams by means of the operation information, jamming information and resource information. For example, the electronic device can obtain the type of touch operation performed by the user on the electronic device when the electronic device jams, as well as the CPU frequency of the electronic device, etc. Therefore, it can be obtained accordingly how the CPU frequency should be adjusted when the electronic device jams under a certain operation, that is, whether to increase or decrease, how to set the increased frequency and the decreased frequency, etc. Therefore, a frequency strategy that can solve the jam under a specified operation can be summarized.
[0032] Therefore, based on the operation information, lag information and resource information, it is possible to determine the frequency strategy used to resolve the lag when the electronic device is stuck under a specified operation, as multiple frequency strategies corresponding to the specified operation, wherein the specified operation is at least one type of operation of different types of operations. Exemplarily, the operation may be a touch operation, and the specified operation may be a sliding, touching or clicking operation. When there are multiple specified operations, the target frequency strategy subsequently obtained is the target frequency strategy corresponding to each specified operation, and the frequency strategy for each specified operation is used to resolve the lag caused by the specified operation.
[0033] S103: Determine a performance score and a power consumption score of each frequency strategy corresponding to the specified operation.
[0034] As an implementation method, the performance score is used to evaluate the ability of a frequency strategy to improve system performance, that is, the ability of the frequency strategy to solve the problem of lag. The power consumption score is used to evaluate the power consumption capability brought by a frequency strategy, that is, whether it causes an increase or decrease in power consumption.
[0035] Exemplarily, the performance scoring method can be to first determine the performance indicators, such as response time, frame rate, processing speed, etc., then perform a benchmark test before applying the frequency strategy, record the performance data under different loads, and after implementing the frequency strategy, perform an operational test to evaluate the effectiveness of the strategy. Use tools or built-in functions to collect performance data, such as the actual frequency of the CPU and GPU, response time, and freeze frequency. Compare the performance data before and after the implementation of the strategy and calculate the improvement. According to the predetermined standards or algorithms, convert the performance improvement data into a score to evaluate the effectiveness of the frequency strategy.
[0036] As an implementation mode, it can also be measured based on the number of freezes that occur in the electronic device and the number of calls to the frequency strategy within a certain period of time. For details, please refer to the subsequent embodiments.
[0037] In addition, the power consumption score can be obtained by determining the power consumption generated by the electronic device within a preset time length after the electronic device uses the frequency strategy, and determining the power consumption score of the strategy based on the power consumption. The higher the power consumption, the higher the power consumption score, and the lower the power consumption, the lower the power consumption score. Exemplarily, when applying different frequency strategies, a power consumption monitoring tool or device is used to record the power consumption data of each strategy, which can include the power consumption of components such as the CPU, GPU, and memory. Then, the power consumption score is obtained based on the power consumption scoring formula: POWER_SCORE=POWER_CONSUMED / TIME, where POWER_CONSUMED: total power consumption during the application of the strategy, TIME: time period for applying the strategy.
[0038] S104: Determine a target frequency strategy corresponding to the specified operation based on the performance score and the power consumption score of each frequency strategy corresponding to the specified operation.
[0039] It should be noted that, through the aforementioned performance score and power consumption score, the performance of each frequency strategy in terms of performance improvement and power consumption reduction can be obtained. Therefore, based on the performance score and power consumption score of each frequency strategy, a frequency strategy that meets the requirements of both performance improvement and power consumption reduction can be found as the target frequency strategy, that is, the target frequency strategy corresponding to each specified operation can be obtained. Among them, the requirement can be set based on actual use or scenario, and there is no limitation on this.
[0040] S105: Within a first time period, upon detecting the designated operation, adjusting the processor frequency of the electronic device based on the target frequency strategy.
[0041] After the target frequency strategy is determined, it means that a frequency strategy that meets the usage requirements for the specified operation has been found in terms of performance improvement (for example, effectively solving lag problems) and power consumption reduction. Then, within the first time period, when the specified operation is detected, the processor frequency of the electronic device is adjusted based on the target frequency strategy.
[0042] It should be noted that the first duration refers to the duration corresponding to the time period set for automatically adjusting the processor frequency based on the target frequency strategy after detecting the specified operation. In the embodiment of the present application, two states can be set, namely, the exploration state and the stable state. In the exploration state, the aforementioned process of obtaining the performance score and the power consumption score and obtaining the target frequency strategy is performed. After obtaining the target frequency strategy, the stable state can be entered. In the stable state, when the specified operation is detected, the processor frequency of the electronic device is adjusted based on the target frequency strategy. The duration of the stable state is the aforementioned first duration.
[0043] It can be understood that, when the specified operation is detected, the implementation methods of adjusting the processor frequency of the electronic device based on the target frequency strategy can include two methods. The first method is that after the specified operation is detected, regardless of whether a lag occurs currently, the operation of adjusting the processor frequency of the electronic device based on the target frequency strategy is executed. That is, without detecting whether a lag occurs, the operation of adjusting the processor frequency of the electronic device based on the target frequency strategy is directly executed; the second method is that after the specified operation is detected, it is determined whether a lag occurs. If a lag occurs, the operation of adjusting the processor frequency of the electronic device based on the target frequency strategy is executed; if no lag occurs, the operation of adjusting the processor frequency of the electronic device based on the target frequency strategy is not executed.
[0044] For the first method, since the operation of adjusting the processor frequency of the electronic device based on the target frequency strategy is performed regardless of whether a freeze occurs, the processor frequency can be adjusted in advance, that is, the electronic device can be prevented from freezing due to a specified operation. For the second method, when a freeze occurs due to a specified operation, a target frequency strategy that takes both function and performance into consideration can be selected to adjust the processor frequency of the electronic device.
[0045] It can be understood that when there are multiple specified operations, the target frequency strategy corresponding to each specified operation can be obtained, and then, when a certain specified operation is detected, the target frequency strategy corresponding to the specified operation is determined, and then, the processor frequency of the electronic device is adjusted based on the target frequency strategy corresponding to the specified operation.
[0046] Therefore, the embodiment of the present application can determine multiple frequency strategies that can solve the lag caused by specified operations, and then obtain a target frequency strategy based on the performance score and power consumption score of each frequency strategy, so that within the first time period, for the specified operation, the target frequency strategy used is the result of combining performance and power consumption evaluation, which can reflect the characteristics of performance and power consumption, making the setting of the target frequency strategy more reasonable.
[0047] like Figure 2 As shown, a frequency adjustment method provided in an embodiment of the present application is shown. The method is applied to the aforementioned electronic device. Specifically, the method includes: S201 to S208.
[0048] S201: Acquire operation information, freeze information, and resource information of the electronic device.
[0049] As an implementation mode, the embodiment of the present application can set corresponding target frequency policies for different applications. That is, in response to a user's specified operation on a certain application, the target frequency policy can be used to adjust the frequency of the processor accordingly.
[0050] Exemplarily, the electronic device has a system monitoring module, which can detect the gesture operations such as sliding, touching, clicking, etc. input by the user in the specified application in real time by using the system monitoring module. At the same time, the electronic device is also provided with a buried point acquisition module, which can collect the information of the specified application in the system monitoring module, the user gesture operation information, the CPU frequency information, etc. Among them, the specified application can be one of the multiple applications installed in the electronic device, which refers to the application for which the target frequency strategy is currently determined. It can also be understood that the multiple applications installed in the electronic device correspond to a white list, and the application in the white list is a specified application, that is, the application in the white list needs to be set with a corresponding target frequency strategy, so that when the electronic device runs the specified application, it can be based on the detected specified operation for the specified application, and the target frequency strategy corresponding to the specified operation of the specified application is used to adjust the processor frequency, that is, the same type of operation, its corresponding application is different, and its corresponding target frequency strategy may also be different.
[0051] It should be noted that the meanings of the operation information, freeze information and resource information can be referred to in the aforementioned embodiments and will not be repeated here.
[0052] S202: Based on the freeze timestamp and the operation timestamp, determine an operation timestamp that matches the freeze timestamp as a target timestamp.
[0053] Under the premise of providing performance resources, reducing the jam rate and increasing power consumption. First, through continuous exploration, multiple frequency strategies are generated and the strategies are scored. Then, the stable state is entered, that is, the scores are summarized and the minimum score is maintained for a period of time. In the embodiment of the present application, the method of determining multiple frequency strategies in the exploration state is further explained.
[0054] It should be noted that the freeze information includes the freeze timestamp corresponding to each freeze event, and the operation information includes the operation timestamp of each detection of the specified operation. As mentioned above, the freeze timestamp can be understood as the aforementioned frame loss time, and the operation time frame can refer to the moment when the touch operation input by the user is detected, wherein the touch operation can include operations such as clicking, sliding, and long pressing.
[0055] It can be understood that the operation timestamp matching the jamming timestamp represents the specified operation input by the user within the preset time range of the jamming timestamp, and its purpose is to find the specified operation that causes the electronic device to jam. In an embodiment of the present application, based on the jamming timestamp and the operation timestamp, the implementation method of determining the operation timestamp matching the jamming timestamp can be, for each operation timestamp, searching for a jamming timestamp whose time difference with the operation timestamp is less than a specified time threshold, as the jamming timestamp matching the operation timestamp, wherein the specified time threshold can be a pre-set duration, used to characterize that the operation timestamp is not much different from the jamming timestamp and almost overlaps. For example, the specified time threshold can be 50-200ms. Among them, the time difference with the operation timestamp is less than the specified time threshold means that the time difference with the operation timestamp is a positive number, that is, greater than zero, and less than the specified time threshold. Exemplarily, the time difference with the operation timestamp may refer to the difference between the operation timestamp and the freeze timestamp, which indicates that the specified operation timestamp is before the freeze timestamp. Of course, it may also be the difference between the freeze timestamp and the operation timestamp, or it may refer to the absolute value of the difference between the operation timestamp and the freeze timestamp as the time difference.
[0056] S203: Determine a target frequency corresponding to each target timestamp based on the resource information.
[0057] It can be understood that the target frequency can characterize the processor frequency of the electronic device when the electronic device freezes under the specified operation. Specifically, after determining the operation timestamp that matches the freeze timestamp, it is possible to align the moment when the user inputs the specified operation with the moment when the freeze occurs, thereby determining the moment when the electronic device detects the freeze caused by the specified operation, that is, the target timestamp. The resource information includes the processor frequency of the electronic device corresponding to different moments, thereby determining the processor frequency of the electronic device under the target timestamp, thereby determining the processor frequency of the electronic device when the specified operation causes freezes, that is, the target frequency, and when there are multiple target timestamps, each target timestamp corresponds to a target frequency.
[0058] That is to say, the CPU frequency cpu_cur_freq when the lag occurs under the current operation is obtained according to the user operation information and the lag information. For example, if the user operation time is close to the lag time (within 200 milliseconds), it is judged as lag, that is, since the frame loss occurs after the user clicks, and the number of frame losses is large, it can be inferred that the lag occurs under the click operation.
[0059] S204: Based on the target frequency, obtain multiple frequency strategies corresponding to the designated operation.
[0060] Since the frequency adjustment strategy is related to the current processor frequency of the electronic device, assuming that a correspondence between frequency strategies corresponding to different processor frequencies is pre-set, when the lag is caused by the specified operation determined above, the processor frequency of the electronic device, combined with the correspondence, can determine the frequency strategy used for the specified operation, thereby obtaining multiple frequency strategies corresponding to the specified operation.
[0061] As an implementation mode, as mentioned above, the configuration file specifies the available frequency ranges corresponding to different operation types. For example, when sliding, the CPU is configured with a minimum frequency of 1.5 GHz and a maximum frequency of 2 GHz, while when touching, the CPU is configured with a minimum frequency of 1 GHz, a maximum frequency of 2 GHz, and a duration of 300 ms. It can be seen that there are frequency adjustment ranges corresponding to different operation types.
[0062] Therefore, based on the configuration file obtained in advance, the frequency adjustment range corresponding to the specified operation is determined, and then, based on the target frequency and the frequency adjustment range, multiple frequency strategies corresponding to the specified operation are obtained. Since the frequency adjustment range can be regarded as a constraint on frequency adjustment, that is, the adjustment amplitude corresponding to the frequency adjustment strategy should not exceed the frequency adjustment range, the frequency adjustment range can be used to guide the generation of the frequency strategy.
[0063] In an embodiment of the present application, at least three frequency strategies may be generated. Exemplarily, the frequency adjustment range is divided into three sub-ranges, namely, a first sub-range including the lower limit of the frequency adjustment range, a second sub-range including the upper limit of the frequency adjustment range, and a third sub-range including the middle value of the frequency adjustment range, that is, assuming that the frequency adjustment range includes an upper limit value, a middle value, and a lower limit value, then the first sub-range may include the lower limit value, the second sub-range includes the upper limit value, and the second sub-range includes the middle value. The numerical ranges of the first sub-range, the second sub-range, and the third sub-range may be set based on actual usage requirements and are not limited here.
[0064] For the specified operation, when the electronic device freezes due to the specified operation, the operations performed include: if the target frequency is within the first sub-range, the processor frequency is increased by the first value or the second value, wherein the second value is greater than the first value; if the target frequency is within the second sub-range, the processor frequency is reduced by the third value or the fourth value, wherein the fourth value is greater than the third value; if the target frequency is within the third sub-range, the processor frequency is reduced by the fifth value or increased by the sixth value. In other words, it can be seen that the frequency strategy includes at least the first strategy, the second strategy and the third strategy, wherein the first strategy is to increase the processor frequency by the first value or the second value, and the corresponding use condition is that the target frequency is within the first sub-range; the second strategy is to reduce the processor frequency by the third value or the fourth value, and the corresponding use condition is that the target frequency is within the second sub-range; the third strategy is to reduce the processor frequency by the fifth value or increase the sixth value, and the corresponding use condition is that the target frequency is within the third sub-range.
[0065] It can be understood that the second numerical value is greater than the first numerical value. For example, the second numerical value can be twice the first numerical value. Similarly, the fourth numerical value is greater than the third numerical value. The fourth numerical value can be twice the third numerical value. The fifth numerical value and the sixth numerical value can be the same. Further, the first numerical value, the third numerical value, the fifth numerical value and the sixth numerical value are all the same, and the second numerical value and the fourth numerical value are the same. As an embodiment, a gear value can be set for the frequency adjustment range. When adjusting the frequency, it can be adjusted based on the gear value, that is, the processor frequency is adjusted N times the gear value, where N is a positive integer. Among them, the setting of the gear number value can be set based on the frequency adjustment range. For example, it can be one tenth of the numerical width of the frequency adjustment range.
[0066] Exemplarily, assuming that the frequency adjustment range of the configuration file corresponding to the specified operation is avail_freq_list, and the target frequency cpu_cur_freq is an element in avail_freq_list, there are at least 3 frequency strategies to be generated. When cpu_cur_freq is at the bottom of avail_freq_list, two performance-oriented strategies are generated, namely, strategies of raising the frequency by one gear and raising the frequency by two gears; when cpu_cur_feq is at the top of avail_freq_list, two power consumption-oriented strategies are generated, namely, strategies of lowering the frequency by one gear and lowering the frequency by two gears; when cpu_cur_feq is in the middle of avail_freq_list, one performance-oriented strategy and one power consumption-oriented strategy are generated, namely, strategies of raising the frequency by one gear and lowering the frequency by one gear.
[0067] It can be understood that the above strategy includes two adjustment methods. For example, if the target frequency is within the first sub-range, the processor frequency is increased by a first value or a second value. Then increasing the processor frequency by a first value or a second value is two adjustment methods, namely increasing the processor frequency by a first value and increasing the processor frequency by a second value. Which method to use, that is, whether to increase the first value or the second value, can be selected randomly, or can be selected based on the jamming situation, or can be determined based on the difference between the target frequency and the lower limit value, or can be determined based on the status information of the electronic device, and is not specifically limited here.
[0068] S205: Determine a performance score and a power consumption score of each frequency strategy corresponding to the specified operation.
[0069] S206: Determine a target frequency strategy corresponding to the specified operation based on the performance score and the power consumption score of each frequency strategy corresponding to the specified operation.
[0070] S207: Within a first time period, upon detecting the designated operation, adjusting the processor frequency of the electronic device based on the target frequency strategy.
[0071] After obtaining multiple frequency strategies, S205 and S206 are executed in the exploration state, and then S207 is executed in the stable state.
[0072] Therefore, in an embodiment of the present application, multiple frequency strategies corresponding to specified operations can be determined based on the operation information, lag information, resource information and configuration file of the electronic device, that is, the frequency strategy used by the electronic device when it is actually in a lag situation caused by the specified operation is obtained.
[0073] like Figure 3 As shown, a frequency adjustment method provided in an embodiment of the present application is shown. The method is applied to the aforementioned electronic device. Specifically, the method includes: S301 to S309.
[0074] S301: Obtain operation information, freeze information, and resource information of the electronic device.
[0075] S302: Determine multiple frequency strategies corresponding to the specified operation based on the operation information, freeze information and resource information.
[0076] S303: Determine the first number of times the electronic device freezes when detecting a specified operation within a second time period and the second number of times each of the frequency strategies is called.
[0077] As an implementation, the second duration may refer to the duration of the exploration state, for example, it may be three days. Exemplarily, the electronic device can be based on the timestamp of the electronic device freezing during the second duration, that is, the freezing timestamp, and then, based on the freezing timestamp, it can count the number of freezing occurrences, that is, the first number. Similarly, it is also possible to detect the number of times the electronic device calls each frequency strategy, that is, the second number. For example, the multiple frequency strategies include a first strategy, a second strategy, and a third strategy. The second number corresponding to the first strategy is a, the second number corresponding to the second strategy is b, and the second number corresponding to the third strategy is c, each of which guarantees the number of times it is called.
[0078] S304: Determine a performance score of each of the frequency strategies based on the first number of times and the second number of times of each of the frequency strategies.
[0079] It can be understood that the first number represents the number of times the electronic device freezes, and the second number represents the number of times each frequency strategy is called. Usually, when an electronic device freezes, it will call a strategy from multiple frequency strategies to solve the freeze. In this case, a certain frequency strategy is called more times, which can represent that the frequency strategy can more effectively solve the freeze problem of the electronic device, and it can bring better performance improvement. Similarly, if a certain frequency strategy is called less times, it means that it cannot effectively solve the freeze problem, that is, the electronic device does not rely on the strategy to solve the freeze problem, and the performance that can be improved is relatively limited. Based on this principle, the performance score of each frequency strategy can be determined according to the first number of times and the second number of each frequency strategy.
[0080] As an implementation method, the configuration information static_info.json (i.e., the aforementioned configuration file), the UAH event log uah.json, and the freeze event log gfx.json are obtained, wherein the UAH event log is used to record the aforementioned operation information, for example, it may include the operation type, i.e., the user's operation behavior, such as clicking, sliding, inputting, etc.; the time of each operation, accurate to milliseconds, etc.
[0081] Set an intermediate variable, that is,<package,event> is an intermediate variable of the key. Assuming that the second time period is three days, the intermediate variable can be retained for at least T, T-1, and T-2 three days. Package represents an application, and event represents a specific event or operation of the application, such as user touch, interface refresh, call of a specific function, etc. For example, event refers to different operations such as clicking and sliding. In the embodiment of the present application, the event is the aforementioned specified operation.
[0082] Let JANK(t) represent the day corresponding to t.<package,event> JANK(t) means the jamming situation in the day corresponding to t.<package,event> As an implementation method, align uah.json with gfx.json and associate jank with each uah, that is, associate the jank (rendering lag) event in gfx.json with the relevant user activity or system health data in uah.json, that is, record the user's operation behavior every time a lag occurs in a day. Then, the sum of all the jank frame loss (i.e., lag) times obtained by this method is obtained to obtain the value JANK(t).
[0083] Assume that FREQUENCY(t) represents the day corresponding to t.<package,event> The number of times the UAH strategy (e.g., frequency strategy) is activated is the number of times each frequency strategy is called. It can be understood that FREQUENCY(t) can be characterized by<package,event> The frequency (i.e., importance) of<package,event> .
[0084] Setting, SCORE(t) = JANK(t) / FREQUENCY(t) characterization<package,event> The severity of the jam, i.e. the performance score.
[0085] It is understandable that JANK(t) indicates the severity of jamming during time t. Usually this may be the frequency of jamming or the degree of jamming. FREQUENCY(t) indicates the number of times or frequency of frequency policy activation during time t, that is, the number of frequency adjustment policies adopted when jamming occurs. SCORE(t) is the ratio of the severity of jamming (JANK(t)) to the number of policy activations (FREQUENCY(t)). A higher SCORE(t) may mean that the severity of jamming is relatively high or the number of policy activations is relatively low. If SCORE(t) is low, it means that jamming occurs less frequently or the number of policy activations is high per unit time. Generally, this indicates that the frequency adjustment policy is more effective because frequent policy activations effectively reduce jamming. If SCORE(t) is high, it means that although the number of policy activations may be large, the jamming is still severe. This may indicate that the frequency adjustment policy is not effective or that the policy is frequently applied but fails to effectively solve the jamming problem. In other words, the relationship between SCORE(t) and performance resource improvement is inversely proportional. A lower SCORE(t) indicates a better performance resource improvement, while a higher SCORE(t) indicates a poor performance resource improvement. In other words, the higher the SCORE(t) ratio of a strategy, the more severe the jamming caused by the strategy each time it is called, and the worse the performance improvement effect. Conversely, a lower SCORE(t) indicates that the strategy is more effective in reducing jams and has a better performance improvement effect.
[0086] S305: Based on the frequency strategy called each time by the electronic device within the second time period and the power consumption data of the electronic device under each frequency strategy called, obtain a power consumption score of each frequency strategy.
[0087] As an implementation method, COST(t) represents the uah configuration corresponding to one day of t.<package,event> The corresponding power consumption score. The power consumption can be calculated in the aforementioned embodiment and will not be described in detail here.
[0088] In addition, STATUS(t) can be set to represent the day corresponding to t.<package,event> What state is it in? Among them, EXPLORATION represents the exploration state: in this state, individual strategies will be experimentally adjusted to observe the performance effect. Each strategy corresponds to a trial state, and the trial state can be set to a certain length until effective results are observed. EXPLOITATION represents the stable state. Specifically, after the trial state ends, the stable state is entered. Depending on the effect of the trial state, it is decided whether to apply the adjustment of the trial state and whether to continue the trial in the next time period. PATIENCE(t) indicates how many days the exploration state will continue after the end of today.
[0089] As an implementation method, align uah.json and gfx.json, specifically, arrange the jank events in chronological order, arrange the uah events in chronological order, and for each uah event, associate it with the jank events in the ongoing process and divide them into<package,event> Add up and get each<package,event> The corresponding JANK(t=T) and FREQUENCY(t=T), where SCORE(t=T)=JANK(t=T) / FREQUENCY(t=T) is<package,event> The corresponding severity of the jam, which can reflect the performance score;<package,event> Sort by FREQUENCY(t=T) from large to small and check the status one by one.<package,event> Currently still in exploration state: if PATIENCE(t)>0, PATIENCE(t+1)=PATIENCE(t)-1; if PATIENCE(t)=0, STATUS(t)=EXPLOITATION.
[0090] S306: Search for a frequency strategy corresponding to the specified operation, the performance score of which is less than a first threshold and the power consumption score of which is less than a second threshold, as a candidate frequency strategy corresponding to the specified operation.
[0091] As an implementation method, among multiple frequency strategies corresponding to a specified operation, a frequency strategy with a performance score less than a first threshold and a power consumption score less than a second threshold is searched as an alternative frequency strategy corresponding to the specified operation. As mentioned above, the lower the performance score, the higher the performance improvement of the frequency strategy. The purpose of setting the performance score less than the first threshold is to select a frequency strategy with better performance, that is, a frequency strategy whose performance meets the usage requirements. Similarly, the purpose of setting the power consumption score less than the second threshold is to select a frequency strategy with relatively low power consumption.
[0092] S307: Obtain a comprehensive score of the candidate frequency strategy based on the performance score and the power consumption score of the candidate frequency strategy corresponding to the specified operation.
[0093] As an implementation method, when it is determined that the alternative frequency strategy satisfies the performance score less than the first threshold and the power consumption score is less than the second threshold, it can be ensured that the determined alternative frequency strategy can meet the usage requirements in terms of performance and power consumption, and then, based on the performance score and power consumption score of each alternative frequency strategy, a comprehensive score of each alternative frequency strategy is obtained.
[0094] As an implementation method, a first weight and a second weight are determined, and for each alternative frequency strategy, the product of the first weight and the performance score is determined as the first value, the product of the power consumption score and the second weight is determined as the second value, and the sum of the first value and the second value is used as the comprehensive score. The first weight and the second weight may be set based on experience or actual usage requirements, or the user may be allowed to set the first weight and the second weight.
[0095] S308: Using the candidate frequency strategy whose comprehensive score meets the specified condition as the target frequency strategy corresponding to the specified operation.
[0096] As an implementation mode, the alternative frequency strategy with the smallest comprehensive score is used as the target frequency strategy corresponding to the specified operation. Of course, the alternative frequency strategy with the second smallest comprehensive score can also be used as the target frequency strategy corresponding to the specified operation, and there is no limitation on this.
[0097] S309: Within a first time period, when the designated operation is detected, the processor frequency of the electronic device is adjusted based on the target frequency strategy.
[0098] As an implementation method, the way of setting the first threshold and the second threshold can be set based on the application corresponding to the specified operation, which enables the method of the present application to design special optimization strategies for different types of applications (such as games, video playback, office software, etc.) and realize hierarchical optimization under a unified framework. Specifically, before searching for a frequency strategy in which the performance score is greater than the first threshold and the power consumption score is greater than the second threshold as an alternative frequency strategy, determine the application corresponding to the specified operation; determine the first threshold and the second threshold based on the application. For example, for applications such as game applications that require more performance improvement, that is, first-class applications, compared with other types of applications, the corresponding first threshold is smaller, and for applications that have higher requirements for battery life, that is, second-class applications, compared with other types of applications, the corresponding first threshold is smaller.
[0099] Therefore, the embodiments of the present application have the following advantages: by collecting the jamming point information and CPU frequency information of specific apps under specific operations on a daily basis, targeted performance resource tilt is provided, so that the jamming rate of specific applications under specific operations is reduced, the device performance is improved, and the user's smooth experience is improved; the solution takes into account both performance improvement and battery life, and provides a comprehensive device performance improvement solution through comprehensive optimization of performance scoring and power consumption scoring; information collection and training are repeated in a cycle, and optimization and adjustment are achieved in 3 to 5 days, without relying on OTA upgrades, and timely adjustments can be made on the terminal side for preset information; different configurations are achieved for different users based on the user's actual usage habits and environment tuning on the terminal side.
[0100] Further, the method provided in the embodiment of the present application is not only applicable to mobile devices such as smart phones and tablet computers, but can also be extended to various types of smart devices such as smart watches and smart home devices to achieve collaborative optimization between multiple devices. In addition, special optimization strategies are designed for different types of applications (such as games, video playback, office software, etc.) to achieve hierarchical optimization under a unified framework. Further, by uploading the collected fine-grained information, the cloud server analyzes and processes the data of a large number of user devices, provides a customized optimization solution for each user device, and achieves personalized optimization effects. Furthermore, it is compatible with devices of different operating systems (such as Android, iOS, Windows, etc.) and provides a unified optimization algorithm across platforms.
[0101] See also Figure 4 , which shows a structural block diagram of a frequency adjustment device 400 provided in an embodiment of the present application. The device may include: an acquisition unit 401, a first determination unit 402, a scoring unit 403, a second determination unit 404 and a processing unit 405.
[0102] The acquisition unit 401 is used to acquire operation information, freeze information and resource information of the electronic device, wherein the operation information corresponds to different types of operations.
[0103] The first determination unit 402 is used to determine multiple frequency strategies corresponding to the specified operation based on the operation information, jamming information and resource information, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to solve the jamming caused by the specified operation.
[0104] Furthermore, the first determination unit 402 is also used to determine an operation timestamp that matches the freeze timestamp as a target timestamp based on the freeze timestamp and the operation timestamp; determine a target frequency corresponding to each target timestamp based on the resource information, wherein the target frequency is used to characterize the processor frequency of the electronic device when the electronic device freezes under the specified operation; and obtain multiple frequency strategies corresponding to the specified operation based on the target frequency.
[0105] Furthermore, the first determining unit 402 is further configured to determine a frequency adjustment range corresponding to the specified operation based on a pre-acquired configuration file; and obtain multiple frequency strategies corresponding to the specified operation based on the target frequency and the frequency adjustment range.
[0106] Furthermore, the first determination unit 402 is also used to increase the processor frequency by a first value or a second value if the target frequency is within the first sub-range, wherein the second value is greater than the first value; if the target frequency is within the second sub-range, reduce the processor frequency by a third value or a fourth value, wherein the fourth value is greater than the third value; if the target frequency is within the third sub-range, reduce the processor frequency by a fifth value or increase it by a sixth value.
[0107] Furthermore, the first determining unit 402 is further configured to search, for each operation timestamp, a freeze timestamp whose time difference with the operation timestamp is less than a specified time threshold, as a freeze timestamp matching the operation timestamp.
[0108] The scoring unit 403 is used to determine the performance score and the power consumption score of each frequency strategy corresponding to the specified operation.
[0109] Furthermore, the scoring unit 403 is also used to determine the first number of times the electronic device freezes when detecting a specified operation within a second time period and the second number of times each of the frequency strategies is called; determine the performance score of each of the frequency strategies based on the first number of times and the second number of times each of the frequency strategies is called; and obtain the power consumption score of each of the frequency strategies based on each frequency strategy called by the electronic device within the second time period and the power consumption data of the electronic device under each frequency strategy called.
[0110] Furthermore, the scoring unit 403 is further configured to obtain a ratio of the first number of times to the second number of times of each of the frequency strategies to obtain a ratio of each frequency strategy; and based on the ratio of each frequency strategy, obtain a performance score of each of the frequency strategies.
[0111] The second determining unit 404 is configured to determine a target frequency strategy corresponding to the specified operation based on the performance score and the power consumption score of each frequency strategy corresponding to the specified operation.
[0112] Furthermore, the second determination unit 404 is also used to find a frequency strategy whose performance score corresponding to the specified operation is less than a first threshold and whose power consumption score is less than a second threshold, as an alternative frequency strategy corresponding to the specified operation; obtain a comprehensive score of the alternative frequency strategy based on the performance score and power consumption score of the alternative frequency strategy corresponding to the specified operation; and use the alternative frequency strategy whose comprehensive score meets the specified conditions as the target frequency strategy corresponding to the specified operation.
[0113] Furthermore, the second determining unit 404 is further configured to use the candidate frequency strategy with the smallest comprehensive score as the target frequency strategy corresponding to the specified operation.
[0114] Furthermore, the second determination unit 404 is also used to find a frequency strategy in which the performance score is greater than the first threshold and the power consumption score is greater than the second threshold as an alternative frequency strategy, determine the application corresponding to the specified operation; and determine the first threshold and the second threshold based on the application.
[0115] The processing unit 405 is configured to adjust the processor frequency of the electronic device based on the target frequency strategy when the designated operation is detected within a first time period.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0117] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0118] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0119] Please refer to Figure 5 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0120] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0121] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0122] Please refer to Figure 6 , which shows a structural block diagram of a computer-readable medium provided in an embodiment of the present application. The computer-readable medium 600 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0123] The computer readable medium 600 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable medium 600 includes a non-transitory computer-readable storage medium. The computer readable medium 600 has storage space for program code 610 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 610 can be compressed, for example, in an appropriate form.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A frequency adjustment method, characterized in that: Applied to electronic equipment, the method comprises: Acquire operation information, freeze information, and resource information of the electronic device, wherein the operation information corresponds to different types of operations; Determine, based on the operation information, the jam information and the resource information, a plurality of frequency strategies corresponding to a specified operation, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to resolve the jam caused by the specified operation; Determine a performance score and a power consumption score for each frequency strategy corresponding to the specified operation; Determine a target frequency strategy corresponding to the specified operation based on a performance score and a power consumption score of each frequency strategy corresponding to the specified operation; Within a first time period, when the designated operation is detected, the processor frequency of the electronic device is adjusted based on the target frequency strategy.
2. The method according to claim 1, characterized in that The jamming information includes a jamming timestamp corresponding to each jamming event, the operation information includes an operation timestamp for each detection of the specified operation, the resource information includes a processor frequency of the electronic device corresponding to different moments, and the determining, based on the operation information, the jamming information, and the resource information, a plurality of frequency strategies corresponding to the specified operation type includes: Based on the jam timestamp and the operation timestamp, determine the operation timestamp that matches the jam timestamp as the target timestamp; Based on the resource information, determine a target frequency corresponding to each target timestamp, wherein the target frequency is used to characterize a processor frequency of the electronic device when a freeze occurs in the electronic device under the specified operation; Based on the target frequency, a plurality of frequency strategies corresponding to the designated operation are obtained.
3. The method according to claim 2, characterized in that The obtaining, based on the target frequency, a plurality of frequency strategies corresponding to the specified operation includes: Determining a frequency adjustment range corresponding to the specified operation based on a pre-acquired configuration file; Based on the target frequency and the frequency adjustment range, a plurality of frequency strategies corresponding to the designated operation are obtained.
4. The method according to claim 3, characterized in that The frequency adjustment range includes three sub-ranges, namely a first sub-range including a lower limit of the frequency adjustment range, a second sub-range including an upper limit of the frequency adjustment range, and a third sub-range including an intermediate value of the frequency adjustment range. The obtaining, based on the target frequency and the frequency adjustment range, a plurality of frequency strategies corresponding to the specified operation includes: If the target frequency is within the first sub-range, increasing the processor frequency by a first value or a second value, wherein the second value is greater than the first value; If the target frequency is within the second sub-range, reducing the processor frequency by a third value or a fourth value, wherein the fourth value is greater than the third value; If the target frequency is within the third sub-range, the processor frequency is reduced by a fifth value or increased by a sixth value.
5. The method according to claim 2, characterized in that: The determining, based on the jam timestamp and the operation timestamp, an operation timestamp that matches the jam timestamp includes: For each operation timestamp, find a jam timestamp whose time difference with the operation timestamp is less than a specified time threshold, and use it as the jam timestamp that matches the operation timestamp.
6. The method according to claim 1, characterized in that The determining a performance score and a power consumption score of each frequency strategy corresponding to the specified operation includes: Determine a first number of times that the electronic device freezes when detecting a specified operation within a second time period and a second number of times each of the frequency strategies is invoked; determining a performance score of each of the frequency strategies based on the first number of times and the second number of times of each of the frequency strategies; Based on the frequency strategy called each time by the electronic device within the second time period and the power consumption data of the electronic device under each frequency strategy called, a power consumption score of each frequency strategy is obtained.
7. The method according to claim 6, characterized in that Determining a performance score of each of the frequency strategies based on the first number of times and the second number of times of each of the frequency strategies includes: Obtaining a ratio of the first number of times to the second number of times of each of the frequency strategies, to obtain a ratio of each frequency strategy; Based on the ratio of each frequency strategy, a performance score of each frequency strategy is obtained.
8. The method according to claim 1, characterized in that The determining, based on the performance score and the power consumption score of each frequency strategy corresponding to the specified operation, a target frequency strategy corresponding to the specified operation includes: Searching for a frequency strategy corresponding to the specified operation, wherein the performance score is less than a first threshold and the power consumption score is less than a second threshold, as an alternative frequency strategy corresponding to the specified operation; Obtaining a comprehensive score of the alternative frequency strategy based on the performance score and the power consumption score of the alternative frequency strategy corresponding to the specified operation; The alternative frequency strategy whose comprehensive score meets the specified condition is used as the target frequency strategy corresponding to the specified operation.
9. The method according to claim 8, characterized in that The alternative frequency strategy whose comprehensive score satisfies the specified condition is used as the target frequency strategy corresponding to the specified operation, including: The alternative frequency strategy with the smallest comprehensive score is used as the target frequency strategy corresponding to the specified operation.
10. The method according to claim 8, characterized in that Before searching for a frequency strategy in which the performance score is greater than the first threshold and the power consumption score is greater than the second threshold as an alternative frequency strategy, the method further includes: Determine an application corresponding to the specified operation; The first threshold and the second threshold are determined based on the application.
11. A frequency adjustment device, characterized in that: Applied to electronic equipment, the device comprises: An acquisition unit, configured to acquire operation information, freeze information, and resource information of the electronic device, wherein the operation information corresponds to different types of operations; A first determining unit, configured to determine, based on the operation information, the jam information, and the resource information, a plurality of frequency strategies corresponding to a specified operation, wherein the specified operation is at least one type of operation among different types of operations, and the frequency strategy is used to resolve the jam caused by the specified operation; A scoring unit, used to determine a performance score and a power consumption score of each frequency strategy corresponding to the specified operation; A second determining unit, configured to determine a target frequency strategy corresponding to the specified operation based on a performance score and a power consumption score of each frequency strategy corresponding to the specified operation; The processing unit is used to adjust the processor frequency of the electronic device based on the target frequency strategy when the designated operation is detected within a first time period.
12. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-10.
13. A computer readable medium, characterized in that The computer-readable medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 10.
