Frequency adjustment method and device, electronic equipment and readable storage medium
By determining the load information of the target processor set and task load in the electronic device, combining the frequency and occupied information of the processor, using the adjustment model for frequency adjustment, it solves the problem that frequency adjustment is prone to excessive frequency increase or downs in the prior art. The problem of this achieves stable operation and low power consumption.
Patent Information
- Application Number
- CN202411579178.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is prone to excessive frequency increase or excessive frequency reduction when adjusting the processor frequency, resulting in lag in the operation of electronic equipment or waste of power consumption.
By determining the load information of the target processor set and task load, the frequency upper and lower limit information, operating frequency and occupied information of each processor are obtained. Based on this information, the processor that requires frequency adjustment and its adjustment strategy are determined based on the adjustment model, and Adjust processor frequency according to policy.
It effectively avoids excessive frequency regulation, ensures stable operation of electronic equipment, reduces power consumption, and achieves a balance between performance and power consumption.
Smart Images

Figure CN119472971A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of processor technology, and more specifically, to a frequency adjustment method, device, electronic device and readable storage medium. Background Art
[0002] At present, with the development of electronic information technology, electronic devices can perform various load tasks through the configured processors, although the frequency of the processor can be adjusted. However, the current method of adjusting the frequency of the processor is prone to excessive frequency increase or excessive frequency reduction, resulting in lag in the operation of electronic devices or waste of power consumption. Summary of the invention
[0003] The present application proposes a frequency adjustment method, device, electronic device and readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides a frequency adjustment method, which is applied to an electronic device, and the method includes: determining a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among a plurality of processors; obtaining first information of each of the first processors, the first information including upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and at least one of occupied information; based on the load information and the first information, determining a processor that needs to be frequency adjusted as a second processor through an adjustment model, and determining a target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; adjusting the frequency of the second processor based on the target adjustment strategy.
[0005] In a second aspect, an embodiment of the present application further provides a frequency adjustment method, which is applied to a cloud server, and the method comprises: obtaining sample data, wherein the sample data comprises sample load information of a sample task load and sample information of the same type as the first information, wherein the first information comprises upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and at least one of occupied information; inputting the sample data into a model to be trained, determining a processor that needs to be frequency adjusted as a third processor based on an output of the model to be trained, and determining an initial strategy for frequency adjustment of the third processor; adjusting the frequency of the third processor based on the initial strategy to obtain an intermediate frequency of the third processor; when the frequency of the third processor runs at the intermediate frequency, obtaining fluency information and power consumption information of executing the sample task load through a fourth processor, wherein the fourth processor is a set of processors in an electronic device for executing the sample task load; performing intensive training on the model to be trained to improve the fluency information and reduce the power consumption information, and using the model to be trained after the intensive training as the adjustment model; arranging the adjustment model on the electronic device so that the electronic device executes the method described in the first aspect based on the adjustment model.
[0006] In a third aspect, an embodiment of the present application further provides a frequency adjustment method, which is applied to a frequency adjustment system, wherein the frequency adjustment system includes an electronic device and a cloud server, wherein the electronic device is connected to the cloud server, and the method includes: the electronic device is used to determine a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among a plurality of processors; the electronic device is used to obtain first information of each of the first processors, wherein the first information includes upper and lower frequency limit information, an operating frequency of each first processor when executing the task load, and at least one of occupied information; the cloud server is used to obtain sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information; the cloud server is used to input the sample data into a model to be trained, and based on the output of the model to be trained, determine a processor that needs to be frequency adjusted as a third processor, and determine an initial strategy for frequency adjustment of the third processor; the cloud server is used to adjust the frequency of the third processor based on the initial strategy The frequency of the third processor is adjusted to obtain the intermediate frequency of the third processor; the cloud server is used to obtain the fluency information and power consumption information of the sample task load executed by the fourth processor when the frequency of the third processor runs at the intermediate frequency, wherein the fourth processor is a processor set in the electronic device for executing the sample task load; the cloud server is used to perform intensive training on the model to be trained to improve the fluency information and reduce the power consumption information, and use the model to be trained after the intensive training as the adjustment model; the cloud server is used to arrange the adjustment model in the electronic device so that the electronic device executes the method described in the first aspect based on the adjustment model; the electronic device determines, based on the load information and the first information, a processor that needs to be frequency adjusted as the second processor through the adjustment model, and determines a target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or reduce the frequency; the electronic device adjusts the frequency of the second processor based on the target adjustment strategy.
[0007] In a fourth aspect, an embodiment of the present application further provides a frequency adjustment device, which is applied to an electronic device, wherein the electronic device includes multiple processors, and the device includes: a first acquisition unit, a second acquisition unit, an adjustment information determination unit, and an adjustment unit. The first acquisition unit is used to determine the target processor set used by the electronic device to execute the task load and the load information of the task load, wherein the target processor set includes at least one first processor among multiple processors; the second acquisition unit is used to obtain the first information of each of the first processors, wherein the first information includes at least one of the upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and the occupied information; the adjustment information determination unit is used to determine the processor that needs to be frequency adjusted as the second processor through the adjustment model based on the load information and the first information, and determine the target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; the adjustment unit is used to adjust the frequency of the second processor based on the target adjustment strategy.
[0008] In the fifth aspect, an embodiment of the present application also provides an electronic device, comprising: one or more processors; a 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 programs are configured to execute the method described in the first aspect.
[0009] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the method described in the first aspect above.
[0010] The frequency adjustment method, device, electronic device and readable storage medium provided in the embodiment of the present application first determine the target processor set used by the electronic device to execute the task load and the load information of the task load, wherein the target processor set includes at least one first processor among the multiple processors; then obtain the first information of each first processor, wherein the first information includes at least one of the upper and lower frequency limit information, the operating frequency of each first processor when executing the task load, and the occupied information; then based on the load information and the first information, determine the processor that needs to be frequency adjusted as the second processor through the adjustment model, and determine the target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; thereby adjusting the frequency of the second processor based on the target adjustment strategy. In the present application, the second processor that needs to be frequency adjusted is comprehensively determined by combining the load information and the first information, and the frequency adjustment is not performed on all processors, so that it is less likely to over-adjust the frequency. And the target adjustment strategy for the second processor is also comprehensively determined in combination with the above-mentioned information, so that it can achieve the premise of ensuring that the electronic device does not freeze, and minimize the power consumption, and achieve a relative balance between performance and power consumption.
[0011] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments 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
[0012] 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.
[0013] Figure 1 An application scenario diagram of the frequency adjustment method provided in an embodiment of the present application is shown;
[0014] Figure 2 A method flow chart of a frequency adjustment method provided by an embodiment of the present application is shown;
[0015] Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;
[0016] Figure 4A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0017] Figure 5 The following is a block diagram of the architecture of the model to be trained provided by the embodiment of the present application;
[0018] Figure 6 A schematic diagram of a reward value curve provided in an embodiment of the present application is shown;
[0019] Figure 7 A frequency and time variation diagram of a second processor provided in an embodiment of the present application is shown;
[0020] Figure 8 shows a frequency and time variation diagram of a second processor provided by another embodiment of the present application;
[0021] Fig. 9 The frame duration and time variation diagram provided by the embodiment of the present application are shown;
[0022] Fig.10 A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0023] Fig.11 A schematic diagram of obtaining adjustment parameters provided in an embodiment of the present application is shown;
[0024] Fig.12 A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0025] Fig.13 A method flow chart of a frequency adjustment method provided by another embodiment of the present application is shown;
[0026] Fig.14 A structural block diagram of a frequency adjustment device provided in an embodiment of the present application is shown;
[0027] Fig.15 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;
[0028] Fig.16 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] 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.
[0030] 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.
[0031] At present, with the development of electronic information technology, electronic devices can perform various load tasks through the configured processor, although the frequency of the processor can be adjusted. However, the current method of adjusting the frequency of the processor is prone to excessive frequency increase or excessive frequency reduction, causing the electronic device to run stuck or waste power. How to reduce power consumption as much as possible while ensuring that the electronic device does not run stuck is an urgent problem to be solved.
[0032] At present, frequency modulation mechanisms and strategies can be used to manage parameters such as processor frequency and voltage, thereby adjusting the processing performance and power consumption of electronic devices. For example, the frequency of the processor can be increased or decreased accordingly based on a written algorithm. Specifically, schedutil can be used as the default frequency modulator. The frequency modulator uses a load change callback mechanism to register a callback function. When the load task running on the processor changes, the frequency modulation action of schedutil is triggered. When the processor load is low, the schedutil frequency modulator can reduce the processor frequency and voltage to reduce power consumption. When the processor load is high, the schedutil frequency modulator can increase the processor frequency and voltage to improve performance. The specific frequency modulation formula is shown in the following formula (1).
[0033] next_freq=1.25*max_freq*util / max (1)
[0034] Among them, next_freq represents the frequency at the next moment, max_freq represents the maximum frequency of the processor, util represents the utilization of the processor, and max represents the computing power of the processor.
[0035] However, the inventors discovered during their research that existing methods for adjusting the frequency of a processor do not take into account system operation information or processor status information, and thus are prone to excessive frequency adjustment, such as over-increasing or under-increasing the frequency.
[0036] Therefore, in order to solve or partially solve the above problems, the present application provides a frequency adjustment method, device, electronic device and readable storage medium.
[0037] See also Figure 1 , Figure 1 The application scenario diagram of the frequency adjustment method provided in the embodiment of the present application is shown, that is, the frequency adjustment scenario 100, and the frequency adjustment scenario 100 may include an electronic device 110 and a user 120, wherein: Figure 1 The electronic device 110 shown in the figure is a smart phone. It can be understood that the electronic device can also be a smart home device, such as a smart speaker, a smart refrigerator, etc.
[0038] The user 120 holds the electronic device 110 and runs an application through the electronic device 110. The application generates a task load during operation, so that the processor of the electronic device can execute the task load. The electronic device can adjust the frequency of the second processor according to the load information of the task load and the information related to the processor. The detailed frequency adjustment method can be referred to in the subsequent embodiments.
[0039] See also Figure 2 , Figure 2 A method flow chart of a frequency adjustment method provided in an embodiment of the present application is shown. The frequency adjustment method can be applied to Figure 1 The electronic device in the frequency adjustment scenario shown may specifically use a processor of the electronic device as an execution subject for executing the frequency adjustment method. The frequency adjustment method may include steps S110 to S140.
[0040] Step S110: Determine a target processor set used by the electronic device to execute the task load and load information of the task load, wherein the target processor set includes at least one first processor among the plurality of processors.
[0041] In some embodiments, the electronic device may be configured with multiple processors, so that each task load can be executed by the processor, so that the user can run different applications through the electronic device. The processor may include a core of a central processing unit (CPU) and may also include a core of a graphics processing unit (GPU). The task load may be a load corresponding to a task generated by an application.
[0042] Multiple processors in an electronic device can be divided into different processor sets. It is understandable that a processor set can also be referred to as a core cluster. Each processor set can include at least one processor, and the processor set can be used to execute a task load, that is, the processors included in the processor set can be used to execute the task load. Exemplarily, a corresponding processor set can be assigned to each task load, so that the corresponding task load is executed by the processor set.
[0043] Therefore, for some embodiments, in order to execute the task load, a target processor set of the electronic device for executing the task load may be first determined. The target processor set includes at least one first processor among the plurality of processors. That is, the target processor set may include at least one processor, and the processor included in the target processor set is the first processor, so that the task load may be executed by the first processor in the target processor set.
[0044] Exemplarily, the target processor set for executing the task load can be determined by the operating system running on the electronic device. For example, if the operating system detects that the load of the task load is large, a processor set including a large number of processors can be determined as the target processor set. In another exemplary embodiment, a processor set including processors with higher performance can also be determined as the target processor set. Among them, the processors in the electronic device can be divided into multiple processor sets, and the information of each processor set can be obtained through the shell, for example, which one or which processors are included in each processor set.
[0045] In another exemplary embodiment, a processor set where a rendering thread executing the task load is located in an operating system running on the electronic device may be obtained, and the processor set may be determined as the target processor set.
[0046] In addition, the load information of the task load can also be obtained. Among them, the load information can be used to characterize the amount of processor resources required to execute the task load. It can be understood that if the load amount of the task load is large, the load information of the task load characterizes that more processor resources are occupied; if the load amount of the task load is small, the load information of the task load characterizes that fewer processor resources are occupied. In some embodiments, the load information of the task load can be directly determined through each application running on the electronic device.
[0047] Optionally, the load information may also include the last-level cache miss rate (LLC Miss Rate) of the processor corresponding to the task load. When the processor needs to access data or instructions, it will first check the cache. If the data exists in the cache, it is a cache hit (Cache Hit), otherwise it is a cache miss (Cache Miss), and the data needs to be read from a slower memory. By obtaining the last-level cache miss rate and subsequently using the last-level cache miss rate as one of the reference information for determining the second processor, the rationality and accuracy of the determined second processor can be further improved.
[0048] Step S120: Acquire first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information.
[0049] For some implementations, first information of each first processor may be obtained, wherein the first information includes at least one of upper and lower frequency limit information, an operating frequency of each first processor when executing the task load, and occupied information.
[0050] It is understandable that the hardware information of an electronic device is the information corresponding to the hardware configured for the electronic device, and the hardware information generally does not change with the task load performed by the electronic device. For example, the hardware information may include the upper and lower frequency limit information of the first processor. From the foregoing introduction, it can be seen that the task load can be executed by the first processor, so the upper and lower frequency limit information of the first processor can be obtained first. Among them, the upper and lower frequency limit information of the first processor may include the upper limit information and the lower limit information of the frequency of the first processor, the upper limit information is used to characterize the maximum frequency that the first processor can run, and the lower limit information is used to characterize the minimum frequency that the first processor can run. It should be noted that the upper and lower frequency limit information of the first processor represents the maximum frequency or the minimum frequency that the first processor can run, rather than the current running frequency.
[0051] Exemplarily, hardware-related information can be captured from the system running the electronic device to obtain the upper and lower frequency limit information of the first processor. For example, the maximum frequency at which the first processor can run is 4.0Ghz, and the minimum frequency at which it can run is 0.8Ghz, so it can be known that the upper and lower frequency limit information of the first processor includes upper limit information 4.0Ghz and lower limit information 0.8Ghz. It should be noted that the upper and lower frequency limit information of the first processor can include the upper and lower frequency limit information of the central processing unit and the upper and lower frequency limit information of the image processor.
[0052] Optionally, the hardware information may also include information such as the model of the processor configured for the electronic device, the model of the display screen, the size of the memory capacity, etc.
[0053] Further, it is understandable that the first processor in the electronic device will execute the task load at a certain operating frequency, and the task load will generate a certain load on the first processor when executing the task load. Therefore, the operating frequency and occupancy information of each of the first processors when executing the task load can also be collected. Among them, the operating frequency is the frequency of the first processor when executing the task load, and the occupied information can be used to characterize the degree of load of the first processor when executing the task load. Exemplarily, the operating frequency can be 3.5Ghz, and the occupied information can be 80%, which indicates that the load occupancy of the first processor is high when executing the task load.
[0054] In some embodiments, the upper and lower frequency limit information of the first processor, the operating frequency of the first processor when executing the task load, and the occupied information can be collected by deploying a feature collection module in the electronic device. For example, the feature collection module can be a functional module written in C language and deployed in the kernel of the electronic device. Exemplarily, the feature collection module can be characterized by OSML.
[0055] Optionally, after deploying a feature acquisition module in the electronic device to collect the upper and lower frequency limit information of the first processor, the operating frequency of the first processor when executing the task load, and the occupancy information, the above information can also be preprocessed, filtered, normalized, and saved to facilitate the subsequent use of the obtained information as input to the model.
[0056] See also Figure 3 , Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application is shown. Figure 3The electronic device 110 shown in the figure includes an application layer 310, a framework layer 320 and a kernel layer 330. Among them, the application layer 310 can run various applications 311, and the framework layer 320 can be configured with an adjustment model. For example, the framework layer may include an osense module 321, so that the adjustment model can be set in the osense module 321. The kernel layer 330 can be configured with a feature information acquisition module 331, so that the load information, the operating frequency of each first processor when executing the task load, and the occupied information, etc. are obtained through the feature information acquisition module. Among them, the feature information acquisition module 331 can be connected to the osense module 321, so that the above-mentioned information collected is transmitted to the osense module 321 for use by the adjustment model. In some embodiments, the feature information acquisition module 331 and the osense module 321 can communicate through the netlink interface.
[0057] Optionally, in some implementations, the feature collection module may also be used to collect information such as the frequency of the memory and the temperature of each first processor when the electronic device executes the task load through the first processor.
[0058] It can be understood that the more types of information included in the first information, the more accurate the target adjustment strategy subsequently determined by the first information.
[0059] Step S130: Based on the load information and the first information, determine the processor that needs to be frequency adjusted as the second processor through the adjustment model, and determine the target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency.
[0060] After the load information and the first information are acquired, the second processor and the target adjustment strategy can be determined by the pre-acquired adjustment model. Specifically, the load information and the first information can be input into the adjustment model as input parameters of the adjustment model, so as to obtain the second processor and the target adjustment strategy based on the adjustment model. Exemplarily, in the case where the first information includes the upper and lower frequency limit information, the operating frequency and the occupied information of the core, the load information, the upper and lower frequency limit information, the operating frequency and the occupied information of the first processor can be input into the adjustment model as input parameters of the adjustment model, so as to obtain the second processor and the target adjustment strategy based on the adjustment model. Among them, the second processor is the processor that needs to be frequency adjusted, and the target adjustment strategy is a strategy for adjusting the frequency of the second processor, and the target adjustment strategy can be used to increase or decrease the frequency.
[0061] Optionally, a target adjustment strategy can also be used to maintain frequency.
[0062] The second processor can be at least part of the first processor, that is, one processor in the first processor can be determined as the second processor, or multiple processors in the first processor can be determined as the second processor. It is understandable that if the frequency of all processors in the electronic device is adjusted, it is easy to cause insufficient computing power of the electronic device, causing the execution of the task load to be stuck, or causing the power consumption of the electronic device to be high, that is, it is easy to over-increase or over-reduction. In the embodiment of the present application, the frequency of not all processors in the electronic device is adjusted to avoid over-increase or over-reduction.
[0063] The adjustment model can be pre-trained and can be used to determine the most suitable at least part of the processors from the multiple first processors to adjust the frequency. In addition, the target adjustment strategy output by the core adjustment module can also be used to determine how to adjust the frequency, specifically to increase or decrease the frequency.
[0064] In some implementations, the adjustment model may output an adjustment parameter, for example, the adjustment parameter may be a value within a certain range, and then the first processor corresponding to the value is further determined through value mapping as the second processor. Detailed method descriptions may refer to subsequent embodiments.
[0065] Step S140: adjusting the frequency of the second processor based on the target adjustment strategy.
[0066] After the second processor and the target adjustment strategy are acquired through the aforementioned steps, the frequency of the second processor may be adjusted according to the target adjustment strategy.
[0067] It is understandable that the target adjustment strategy determines whether to increase or decrease the frequency, that is, the target adjustment strategy can be used to determine whether the frequency of the second processor needs to be increased or decreased, but the specific degree of increasing or decreasing the frequency can be determined in combination with the target adjustment range. Therefore, in some implementations, the target adjustment range for frequency adjustment can be determined first, and then the frequency of the second processor can be adjusted in combination with the target adjustment strategy and the target adjustment range. For detailed description, please refer to the description of the subsequent embodiments.
[0068] In other embodiments, multiple default adjustment ranges may also be pre-set, for example, default adjustment ranges for multiple gears may be set, specifically, for example, default adjustment ranges for gears 1-4 may be set, wherein the default adjustment range for gear 1 is smaller than the default adjustment range for gear 4. Then, when the frequency of the second processor is adjusted by the target adjustment strategy, a default adjustment range for a gear may be selected for frequency adjustment. Exemplarily, the default adjustment range for gear 1 is 0.1Ghz, the default adjustment range for gear 2 is 0.2Ghz, the default adjustment range for gear 3 is 0.3Ghz, and the default adjustment range for gear 4 is 0.4Ghz. The target adjustment strategy is to increase the frequency. If the default adjustment range for gear 2 is selected, the frequency of the second processor may be increased by 0.2Ghz.
[0069] The frequency adjustment method provided in the embodiment of the present application first determines the target processor set used by the electronic device to execute the task load and the load information of the task load, wherein the target processor set includes at least one first processor among the multiple processors; then obtains the first information of each of the first processors, wherein the first information includes at least one of the upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and the occupied information; then based on the load information and the first information, the processor that needs to be frequency adjusted is determined as the second processor through the adjustment model, and the target adjustment strategy for the frequency adjustment of the second processor is determined, wherein the second processor is at least part of the first processor, and the target adjustment strategy is used to increase or reduce the frequency; thereby adjusting the frequency of the second processor based on the target adjustment strategy. In the present application, the second processor that needs to be frequency adjusted is comprehensively determined by combining the load information and the first information, and the frequency adjustment is not performed on all processors, so that it is less likely to over-adjust the frequency. And the target adjustment strategy for the second processor is also comprehensively determined in combination with the above-mentioned information, so that it can achieve the premise of ensuring that the electronic device does not freeze, and minimize the power consumption, and achieve a relative balance between performance and power consumption.
[0070] See also Figure 4 , Figure 4 A method flow chart of a frequency adjustment method provided in an embodiment of the present application is shown. The frequency adjustment method can be applied to Figure 1 The electronic device in the frequency adjustment scenario shown may specifically use a processor of the electronic device as an execution subject for executing the frequency adjustment method. The frequency adjustment method may include steps S210 to S290.
[0071] Step S210: Determine a target processor set used by the electronic device to execute the task load and load information of the task load, wherein the target processor set includes at least one first processor among the plurality of processors.
[0072] Step S220: Obtain first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information.
[0073] Among them, step S210 and step S220 have been introduced in detail in the above embodiments and will not be repeated here.
[0074] Step S230: Acquire sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information.
[0075] The model to be trained can be first obtained, and then the model to be trained can be enhanced through sample data to obtain the trained model to be trained as an adjustment model.
[0076] The sample data may include sample load information of the sample task load and sample information of the same type as the first information. Exemplarily, if the first information includes upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and occupied information, then the sample information may include upper and lower frequency limit information of the fourth processor, the sample operating frequency when the fourth processor executes the sample task load, and sample occupied information. The fourth processor is a set of processors in an electronic device for executing the sample task load. Similar to the target processor set, the sample processor set is a set of processors in an electronic device for executing the sample task load. The sample processor set includes at least one fourth processor among the plurality of processors. That is, the sample processor set may include at least one processor, and the processor included in the sample processor set is the fourth processor, so that the sample task load can be executed by the fourth processor in the sample processor set.
[0077] The sample load information can be used to characterize the amount of processor resources required to execute the sample task load. It is understandable that if the sample task load is large, the sample load information of the sample task load characterizes that more processor resources are occupied. In some embodiments, the sample load information of the sample task load can be directly determined through each application program running on the electronic device.
[0078] It should be noted that the sample task load may be a reference task load determined in advance by each application running on the electronic device. The number of the reference task load may be multiple, and each sample task load may correspond to a sample processor set. In some embodiments, the foreground application running on the electronic device may be set as a sample application, so that the sample application generates a corresponding sample task load. For example, the sample application may be an online video application. The sample task load may be a task load generated by a specified operation performed when running the sample application, such as randomly sliding an online video application.
[0079] The upper and lower frequency limit information of the fourth processor is similar to the upper and lower frequency limit information of the fourth processor described above, and may include upper limit information and lower limit information of the frequency of the fourth processor, the upper limit information is used to characterize the maximum frequency at which the fourth processor can run, and the lower limit information is used to characterize the minimum frequency at which the fourth processor can run.
[0080] The sample operation frequency is the frequency of the fourth processor when executing the sample task load; the sample occupancy information can be used to characterize the load level of the fourth processor when executing the sample task load.
[0081] Similar to the description of the aforementioned embodiment, the feature collection module may also be used to collect the upper and lower frequency limit information of the fourth processor, the sample operation frequency when the fourth processor executes the sample task load, and the sample occupancy information.
[0082] For some implementations, the operating temperature of the fourth processor may be detected before acquiring the sample data, so as to determine whether to perform the subsequent steps of acquiring the sample data based on the operating temperature. Specifically, step S230 may also include steps S231 to S234.
[0083] Step S231: Determine a sample processor set used by the electronic device to execute a sample task load, wherein the sample processor set includes at least one fourth processor among the plurality of processors.
[0084] The method for determining the sample processor set used by the electronic device to execute the sample task load can refer to the method for determining the target processor set for executing the task load introduced above, which will not be repeated here. The sample processor set includes at least one fourth processor among the plurality of processors.
[0085] Step S232: Obtain the operating temperature of each of the fourth processors.
[0086] Furthermore, the operating temperature of each fourth processor can be obtained. If the operating temperature is already high, subsequent acquisition of sample data and intensive training of the training model through the sample data will further increase the operating temperature of the processor, which will have a negative impact on the working stability and life of the processor.
[0087] Therefore, after obtaining the working temperature, the working temperature can be compared with the temperature threshold. If the working temperature is greater than the temperature threshold, it indicates that the working temperature is higher at this time, and you can jump to step S235; if each working temperature is less than or equal to the temperature threshold, it indicates that the working temperature is lower at this time, and you can jump to step S233.
[0088] Exemplarily, the temperature threshold may be 37 degrees Celsius.
[0089] Step S233: when each of the operating temperatures is less than or equal to the temperature threshold, obtaining sample load information of the sample task load.
[0090] Step S234: Obtain the upper and lower limit frequency information of each of the fourth processors, the sample running frequency of each of the fourth processors when executing the sample task load, and the sample occupied information, and use the sample load information, the upper and lower limit frequency information of the fourth processors, the sample running frequency of the fourth processors when executing the sample task load, and the sample occupied information as the sample data.
[0091] Taking the case where the first information includes upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and the occupied information as an example, when each of the operating temperatures is less than or equal to the temperature threshold, the sample load information of the sample task load can be further obtained. The upper and lower frequency limit information of each of the fourth processors and the sample operating frequency and sample occupied information of each of the fourth processors when executing the sample task load can also be obtained. Thus, the sample load information, the upper and lower frequency limit information of the fourth processor, the sample operating frequency of the fourth processor when executing the sample task load, and the sample occupied information can be used as the sample data. Among them, the method for obtaining the load information, the upper and lower frequency limit information of the fourth processor, the sample operating frequency, and the sample occupied information can refer to the above introduction, which will not be repeated here.
[0092] Step S235: when at least one of the operating temperatures is greater than the temperature threshold, wait for a specified time and then return to execute the steps of obtaining the operating temperature of each of the fourth processors and subsequent steps.
[0093] In the case that at least one of the operating temperatures is greater than the temperature threshold, the process may wait for a specified time and then return to execute the steps of obtaining the operating temperature of each of the fourth processors and subsequent steps.
[0094] Exemplarily, the specified time may be 2 minutes, 5 minutes, etc.
[0095] Optionally, in some embodiments, before obtaining the sample load information of the sample task load, it is also possible to first determine whether the electronic device is started normally and connected to the network normally. If it is detected that it is not started normally or is not connected to the network normally, it is possible to wait for a specified time and then recheck whether the electronic device is started normally and connected to the network normally.
[0096] Optionally, before obtaining the sample load information of the sample task load, it is also possible to detect whether the target storage space has been initialized, wherein the target storage space can be used to store training data, and the target storage space can be at least part of the storage space in the storage module in the electronic device. The initialization of the storage space can be to create a new storage space as the target storage space, or to format the existing storage space, so that the formatted storage space is used as the target storage space.
[0097] Optionally, in some embodiments, when the operating temperatures are all less than or equal to the temperature threshold, it can also be determined whether to subsequently perform steps related to obtaining sample load information based on whether the electronic device is being charged. Specifically, step S233 can also include steps S2331 to S2333.
[0098] Step S2331: When each of the operating temperatures is less than or equal to the temperature threshold, detect whether the electronic device is being charged.
[0099] Step S2332: When the electronic device is being charged, control the electronic device to stop charging and obtain sample load information of the sample task load.
[0100] Step S2333: When it is detected that the electronic device is not charged, obtain sample load information of the sample task load.
[0101] It is understandable that when an electronic device is being charged, the frequency upper and lower limit information of the processor of the electronic device may be different from the frequency upper and lower limit information of the processor when the electronic device is not being charged. When users use electronic devices in daily life, the electronic devices are generally not being charged. If the sample load information of the sample task load is obtained when the electronic device is being charged and subsequent steps are performed to perform intensive training on the training model, the accuracy of the second processor output by the core jump model obtained in the end may be low. Therefore, when each of the operating temperatures is less than or equal to the temperature threshold, it is possible to further detect whether the electronic device is being charged.
[0102] When the electronic device is being charged, the electronic device is controlled to stop charging and the sample load information of the sample task load is obtained. When it is detected that the electronic device is not being charged, the sample load information of the sample task load is obtained.
[0103] The electronic device may be equipped with a charging management module, so that whether the electronic device is charged can be managed and controlled by the charging management module, that is, the electronic device can be controlled to stop charging by the charging management module.
[0104] Step S240: input the sample data into the model to be trained, determine a processor that needs to be frequency adjusted as the third processor based on the output of the model to be trained, and determine an initial strategy for frequency adjustment of the third processor.
[0105] Step S250: adjusting the frequency of the third processor based on the initial strategy to obtain an intermediate frequency of the third processor.
[0106] Step S260: When the frequency of the third processor runs at the intermediate frequency, obtain the fluency information and power consumption information of executing the sample task load through the fourth processor, wherein the fourth processor is a processor set in the electronic device for executing the sample task load.
[0107] After the sample data is acquired, the processor that needs to be frequency adjusted can be determined as the third processor based on the output of the model to be trained, and an initial strategy for frequency adjustment of the third processor can be determined.
[0108] Among them, the model to be trained can be a reinforcement learning model, and an exemplary model can be a model based on the Deep Deterministic Policy Gradient algorithm (DDPG), a model based on the Twin Delayed Deep Deterministic Policy Gradient Algorithm (TD3), or a model based on the Proximal Policy Optimization (PPO) algorithm.
[0109] For example, take the model based on the deep deterministic policy gradient algorithm as an example, please refer to Figure 5 , Figure 5 The figure shows an architectural block diagram of the model to be trained provided in an embodiment of the present application. Figure 5 It includes state 511, action network 512, value network 513, value Q value 514, time difference error 515, state 521, action network 522, value network 523, value Q value 524 and reward value 525.
[0110] The action network 512 selects an action as output according to the state 511 and outputs it to the value network 513. The value network 513 also obtains the state 511 as input, and then generates the value Q value 514 corresponding to the action. Similarly, the value Q value 524 and the reward value 525 can be generated by the value network 523, and then the value Q value 514, the value Q value 524 and the reward value 525 are compared by the time difference error 515, so as to adjust the action network 522 and the value network 523. Among them, the state 521 represents the state after the action output by the action network 512 is adjusted.
[0111] It should be noted that, based on the output of the model to be trained, the processor that needs to be adjusted in frequency is determined as the third processor. The processor that needs to be adjusted can be directly output by the model to be trained as the third processor; or the adjustment parameter can be output by the model to be trained, and then the processor corresponding to the value is determined as the third processor through numerical mapping.
[0112] The model to be trained may be set by default or selected by the user, for example, a model based on a deep deterministic policy gradient algorithm or a model based on a proximal policy optimization algorithm.
[0113] Therefore, after the initial strategy and the third processor are obtained, the frequency of the third processor can be adjusted based on the initial strategy, and the frequency of the third processor adjusted according to the initial strategy is the intermediate frequency.
[0114] Furthermore, when the frequency of the third processor runs at the intermediate frequency, the fluency information and power consumption information of the sample task load executed by the fourth processor can be obtained, so that the intensive training of the training model can be guided based on the fluency information and power consumption information. The fourth processor is a processor set in an electronic device for executing the sample task load.
[0115] Among them, the fluency information can be used to characterize the fluency of the fourth processor when executing the sample task load. Exemplarily, the fluency information can be determined by whether frame drops occur when executing the sample task load. For example, if the refresh rate of the display screen of the electronic device is 60Hz, if the frame rate of the fourth processor when executing the sample task load is less than 60Fps, that is, the rendering time for each frame when executing the sample task load is greater than 16ms, it can be determined that frame drops occur, and the fluency information can be determined as not smooth.
[0116] In addition, it is understandable that the higher the frequency of the processor, the higher the voltage required, which will increase the power consumption of the processor. Therefore, the power consumption information of the fourth processor can be determined based on the frequency of the fourth processor.
[0117] Step S270: Obtain an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the electronic device or the cloud server.
[0118] From the above introduction, it can be known that by performing intensive training on the model to be trained, the fluency information obtained after each training can be improved, and the power consumption information obtained can be reduced. Subsequently, if the target conditions are met, the model to be trained after intensive training can be used as an adjustment model, thereby obtaining an adjustment model for intensive training of the model to be trained. The intensive training is performed on the electronic device or the cloud server.
[0119] The target condition may include that the training batch reaches a preset threshold.
[0120] Optionally, after completing each round of reinforcement training of the model to be trained, the model to be trained after reinforcement training can be saved and the electronic device can be restarted. After the electronic device is restarted, the model to be trained after reinforcement training saved previously can be reloaded to continue reinforcement training of the loaded model.
[0121] Thus, interference caused by the long-term background operation of electronic devices can be avoided to a certain extent, and problems such as memory fragmentation after the operating system has been running for a long time can be avoided.
[0122] It should be noted that the reinforcement training of the training model can be performed in an electronic device or in a cloud server, and the reinforcement training of the training model can be implemented through the Python language.
[0123] Exemplarily, in the case of intensive training of the model to be trained by an electronic device, the electronic device can perform intensive training on the model to be trained locally. In the case of intensive training of the model to be trained by a cloud server, the cloud server can obtain sample load information and sample information from an electronic device with a pre-established connection relationship. For example, the sample information may include the upper and lower limit information of the frequency of the fourth processor and the sample operation frequency and sample occupation information when each fourth processor executes the sample task load. In this way, intensive training of the model to be trained is performed on the cloud server. The cloud server can be a computer, etc.
[0124] In some embodiments, the electronic device may actively perform the step of collecting sample data, and then send the sample data to a cloud server, thereby performing enhanced training on the model to be trained in the cloud server.
[0125] In another exemplary embodiment, the cloud server may control the electronic device to start a thread through a shell, thereby controlling the feature acquisition module of the electronic device to collect sample data through the thread, and then controlling the electronic device to send the collected sample data to the cloud server.
[0126] It should be noted that before performing intensive training on the model to be trained, training parameters can also be read, and the training parameters can be set by the user in advance through the electronic device. Exemplarily, the training parameters may include the maximum duration of each round of training, whether it is currently in training mode or test mode, the model used as the model to be trained, the power consumption calculation method adopted, and the application program set to run in the background.
[0127] For some implementations, a reward value may also be constructed based on the fluency information and the power consumption information, so that the training model may be trained based on the reward value later. Specifically, step S270 may also include steps S271 to S273.
[0128] Step S271: when the fluency information satisfies a fluency threshold, determining an initial reward value based on the power consumption information, wherein the initial reward value is inversely correlated with the power consumption information.
[0129] Step S272: when the fluency information does not meet the fluency threshold, determining the initial reward value based on the fluency information, wherein the initial reward value is positively correlated with the fluency information.
[0130] Step S273: Perform reinforcement training on the model to be trained to increase the initial reward value, and use the model to be trained after the reinforcement training as the adjustment model.
[0131] The initial reward value may be further determined based on whether the fluency information meets the fluency threshold. Specifically, the initial reward value may be determined based on the power consumption information when the fluency information meets the fluency threshold, wherein the initial reward value is inversely correlated with the power consumption information. That is, the higher the power consumption information, the lower the initial reward value.
[0132] If the fluency information does not meet the fluency threshold, the initial reward value is determined based on the fluency information, wherein the initial reward value is positively correlated with the fluency information. That is, the smaller the fluency information, that is, the less fluent, the lower the initial reward value.
[0133] Therefore, after the initial reward value is constructed, the model to be trained can be subjected to intensive training based on the initial reward value. Specifically, the model to be trained can be subjected to intensive training to increase the initial reward value, and the model to be trained after intensive training is used as the adjustment model.
[0134] For some implementations, when the fluency information meets the fluency threshold, the initial reward value may be constructed in combination with the maximum power consumption information and the power consumption information of the electronic device. Specifically, step S271 may also include steps S2711 to S2713.
[0135] Step S2711: when the fluency information meets the fluency threshold, obtain the maximum power consumption information of the electronic device.
[0136] Step S2712: Obtain a ratio of the power consumption information to the maximum power consumption information.
[0137] Step S2713: Determine the initial reward value based on the ratio, wherein the initial reward value is negatively correlated with the ratio.
[0138] Specifically, when the fluency information satisfies the fluency threshold, the maximum power consumption information of the electronic device may be first obtained. The maximum power consumption information is used to characterize the maximum power consumption that the electronic device can reach during operation. Exemplarily, the maximum power consumption information may be directly obtained through the operating system running the electronic device.
[0139] Then, the ratio of the power consumption information to the highest power consumption information may be obtained, and the initial reward value may be determined based on the ratio, so that the initial reward value is negatively correlated with the ratio.
[0140] Therefore, in the subsequent process of strengthening the training model, the initial reward value is changed in an increasing direction, thereby reducing power consumption information and improving fluency information.
[0141] In some implementations, 1-the above ratio may be used as the initial reward value.
[0142] Optionally, in the method of performing intensive training on the to-be-trained model based on the initial reward value, the target condition may also include that the change amplitude of the initial reward value in the specified number of intensive trainings is less than or equal to the threshold amplitude. The change amplitude of the initial reward value in the specified number of intensive trainings is less than or equal to the threshold amplitude, which can indicate that the initial reward value has stabilized. Therefore, when the target condition is met, the to-be-trained model after intensive training can be used as an adjustment model.
[0143] Optionally, after each round of intensive training of the model to be trained, a reward value curve may be generated based on the initial reward value obtained for each round of intensive training of the model to be trained. Figure 6 , Figure 6 A schematic diagram of a reward value curve provided in an embodiment of the present application is shown. Figure 6 In the coordinates 600 shown in FIG. 1 , the horizontal axis is used to represent the training rounds, and the unit is times, and the vertical axis is used to represent the reward value. Curve 610 is a curve formed by connecting each initial reward value with the coordinates corresponding to each round of intensive training, and curve 620 is a curve obtained by smoothing curve 610.
[0144] Optionally, after the adjustment model is obtained by training the model to be tested, the adjustment model can be tested. It should be noted that during the test, only the information in the aforementioned steps is collected by the feature acquisition module and provided to the adjustment model as input, and there is no need to conduct intensive training on the adjustment model. After determining the processor that needs to be frequency adjusted as the second processor based on the adjustment model, and determining the target adjustment strategy for the frequency adjustment of the second processor, the frequency of the second processor is adjusted based on the target adjustment strategy, and then the frequency and time variation graph of the second processor can be generated and stored, so as to facilitate subsequent analysis.
[0145] For example, see Figure 7 , Figure 7 FIG. 1 shows a frequency and time variation diagram of the second processor provided in an embodiment of the present application. Figure 7 In the frequency and time variation graph 700 of the second processor, the second processor is processor 0 of the central processing unit, which can be represented as cpu0. Figure 7The horizontal axis is used to represent time, and the unit is ms, and the vertical axis is used to represent the frequency of processor 0, and the unit is GHz. Therefore, curve 710 is a curve representing the change of the frequency of processor 0 with time.
[0146] For another exemplary example, see Figure 8 , Figure 8 FIG. 1 shows a frequency and time variation diagram of the second processor provided in an embodiment of the present application. Figure 8 In the frequency and time variation diagram 800 of the second processor, the second processor is a processor of an image processor, which can be characterized as a GPU. Figure 8 The horizontal axis is used to represent time, and the unit is ms, and the vertical axis is used to represent the frequency of the image processor, and the unit is Ghz. Therefore, curve 810 is a curve representing the change of the frequency and time of the image processor.
[0147] Optionally, you can also generate a graph of the fluency over time during the test. For example, to characterize the fluency by frame duration, see Fig. 9 , Fig. 9 The frame duration and time variation diagram provided by the embodiment of the present application are shown. Fig. 9 In the frame duration and time variation diagram 900 shown, the frame duration can be represented by Frame duration, wherein the horizontal axis is used to represent time in ms, and the vertical axis is used to represent frame duration in us. Thus, curve 910 is a curve representing the variation of frame duration and time.
[0148] Furthermore, the adjustment model obtained after training the model to be tested can also be saved. Exemplarily, a tflite file corresponding to the adjustment model can be generated by a function of the model file, and the tflite file can be stored in the electronic device. The electronic device can complete the frequency adjustment by calling the adjustment model. For some embodiments, the adjustment model can be called by a code written in Java language in the electronic device.
[0149] Optionally, after obtaining the adjustment model, the electronic device may further perform intensive training on the adjustment model at specified intervals, thereby achieving the effect of adapting the adjustment model to the user's habits of using the electronic device, so that the adjustment models in different electronic devices have certain differences.
[0150] Step S280 determines the processor that needs to be frequency adjusted as the second processor through an adjustment model based on the load information and the first information, and determines a target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency.
[0151] Step S290: adjusting the frequency of the second processor based on the target adjustment strategy.
[0152] Among them, step S280 and step S290 have been introduced in detail in the above embodiments and will not be repeated here.
[0153] In the embodiment of the present application, the training model is subjected to intensive training through sample data to obtain an adjustment model, and then the target adjustment strategy and the second processor are obtained based on the adjustment model, so that the frequency of the second processor is adjusted through the target adjustment strategy, so that the frequency of the second processor can ensure the smooth operation of the task load as much as possible, and at the same time, the power consumption can be reduced to achieve a balance between the performance and power consumption of the processor. In addition, it is also possible to determine whether to perform intensive training based on the operating temperature of the fourth processor, thereby ensuring the working stability and long life of the processor.
[0154] See also Fig.10 , Fig.10 A method flow chart of a frequency adjustment method provided in an embodiment of the present application is shown. The frequency adjustment method can be applied to Figure 1 The electronic device in the frequency adjustment scenario shown may specifically use a processor of the electronic device as an execution subject for executing the frequency adjustment method. The frequency adjustment method may include steps S310 to S360.
[0155] Step S310: Determine a target processor set used by the electronic device to execute the task load and load information of the task load, wherein the target processor set includes at least one first processor among the plurality of processors.
[0156] Step S320: Obtain first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information.
[0157] Among them, step S310 and step S320 have been introduced in detail in the above embodiments and will not be repeated here.
[0158] Step S330: input the load information and the first information into the adjustment model to obtain the adjustment parameters output by the adjustment model.
[0159] Step S340: Based on a pre-acquired mapping table corresponding to the electronic device, determine a processor that matches the adjustment parameter as the second processor, and determine a target adjustment strategy that matches the adjustment parameter, wherein the mapping table includes multiple reference adjustment intervals, at least one processor corresponding to each of the reference adjustment intervals, and a reference adjustment strategy corresponding to each of the reference adjustment intervals.
[0160] For some implementations, the adjustment model can be controlled to output discrete values, and then through mapping, the output discrete values can represent the corresponding processor. Therefore, even for electronic devices with different processor architectures, there is no need to make major adjustments to the adjustment model. Only the mapping relationship between the values and the processors needs to be adjusted to achieve the effect of representing each processor through the values, avoiding the need to re-train the adjustment model and reducing the difficulty of adaptation for different platforms.
[0161] Therefore, the load information and the first information may be firstly used as input parameters and input into the adjustment model to obtain the adjustment parameters output by the adjustment model.
[0162] Exemplarily, an activation function may be added before adjusting the model output, so that the output of the adjustment model is a numerical value, which is the adjustment parameter. Specifically, for example, a hyperbolic tangent function (Tanh) may be used as the activation function, so that the adjustment parameter may be a numerical value between -1 and 1.
[0163] Furthermore, based on a pre-acquired mapping table corresponding to the electronic device, the second processor is determined according to the adjustment parameter, wherein the mapping table includes a plurality of reference adjustment intervals, at least one processor corresponding to each of the reference adjustment intervals, and a reference adjustment strategy corresponding to each of the reference adjustment intervals.
[0164] In some implementations, the adjustment parameter may be segmented and mapped to obtain multiple reference adjustment intervals, so that each reference adjustment interval may correspond to at least one processor, and then the processor corresponding to the adjustment parameter is determined according to the reference adjustment interval in which the adjustment parameter is located. In addition, each of the reference adjustment intervals may also correspond to a reference adjustment strategy, so that the adjustment strategy corresponding to the adjustment parameter may also be determined according to the reference adjustment interval in which the adjustment parameter is located.
[0165] Exemplarily, taking the processor of the electronic device as an example, which includes a processor with 8 central processing units and a processor with 1 image processing unit. Among them, the processor with 8 central processing units can be represented by cpu1, cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, and cpu8 respectively, and the processor with 1 image processing unit can be represented by gpu.
[0166] Taking output to represent the adjustment parameter, if output is a value in (-1, 1), then a = int(output * 10) can be defined. Thus, it can be known that a is an integer in (-10, 10). (-10, 10) can be segmented with a length of 1 to obtain multiple reference adjustment intervals, specifically including (-10, -9], (-9, -8]... (-2, -1], (-1, 0], (0, 1), [1, 2), [2, 3)... until [9, 10) multiple reference adjustment intervals. Among them, the reference adjustment strategies corresponding to the reference adjustment intervals (-10, -9], (-9, -8]... (-2, -1] are to reduce the frequency; the reference adjustment strategies corresponding to the reference adjustment intervals (-1, 0] and (0, 1) are to keep the frequency; the reference adjustment strategies corresponding to the reference adjustment intervals [1, 2), [2, 3)... until [9, 10) are to increase the frequency.
[0167] In addition, the processor corresponding to the reference adjustment intervals (-2, -1] and [1, 2) is cpu1; the processor corresponding to the reference adjustment intervals (-3, -2] and [2, 3) is cpu2; the processor corresponding to the reference adjustment intervals (-4, -3] and [3, 4) is cpu3; the processor corresponding to the reference adjustment intervals (-5, -4] and [4, 5) is cpu4; the processor corresponding to the reference adjustment intervals (-6, -5] and [5, 6) is cpu5; the processor corresponding to the reference adjustment intervals (-7, -6] and [6, 7) is cpu6; the processor corresponding to the reference adjustment intervals (-8, -7] and [7, 8) is cpu7; the processor corresponding to the reference adjustment intervals (-9, -8] and [8, 9) is cpu8; the processor corresponding to the reference adjustment intervals (-10, -9] and [9, 10) is gpu.
[0168] Thus, after adjusting the model to output the adjustment parameter, a is calculated through this adjustment parameter.
[0169] Since an integer operation is performed on a, when -0.1 < output < 0.1, the result of a is 0. When a is 0, it is determined that the target adjustment strategy matching the adjustment parameter is to keep the frequency, that is, no adjustment is made to the frequency of the second processor.
[0170] When a is 1, the second processor is determined to be cpu1, indicating that the target adjustment strategy is executed on cpu1, and the target adjustment strategy is to increase the frequency. Similarly, when a is 2, 3, 4, 5, 6, 7 or 8, the second processor is determined to be cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, cpu8, respectively, indicating that the target adjustment strategy is executed on cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, cpu8, and the target adjustment strategy is to increase the frequency; when a is 9, the second processor is determined to be gpu, indicating that the target adjustment strategy is executed on gpu, and the target adjustment strategy is to increase the frequency.
[0171] Similarly, when a is -1, the second processor is determined to be cpu1, indicating that the target adjustment strategy is executed on cpu1, and the target adjustment strategy is to reduce the frequency; similarly, when a is -2, -3, -4, -5, -6, -7 or -8, the second processor is determined to be cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, cpu8, respectively, indicating that the target adjustment strategy is executed on cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, cpu8, respectively, and the target adjustment strategy is to reduce the frequency; when a is -9, the second processor is determined to be gpu, indicating that the target adjustment strategy is executed on gpu, and the target adjustment strategy is to reduce the frequency.
[0172] Therefore, the second processor and the target adjustment strategy can be obtained through the mapping table, and the frequency of the second processor is subsequently adjusted based on the target adjustment strategy.
[0173] See also Fig.11 , Fig.11 A schematic diagram of obtaining adjustment parameters provided in an embodiment of the present application is shown. Fig.11 The method includes input parameters 1110, adjustment model 1120, adjustment parameters 1130 and a value 1140. The input parameters 1110 may include load information, upper and lower frequency limit information of the first processor, operating frequency and occupied information, etc. The method of obtaining the adjustment parameters 1130 and the a value 1140 can refer to the above introduction and will not be repeated here.
[0174] In another exemplary embodiment, if the processor of the electronic device includes 5 central processing unit processors and 1 image processing unit processor, the definition of a is adjusted to a=int(output*6), and then the mapping table is adjusted accordingly without the need to re-train the model.
[0175] Step S350: Determine a target adjustment amplitude for frequency adjustment.
[0176] Step S360: adjusting the frequency of the second processor based on the target adjustment strategy and the target adjustment range.
[0177] As can be seen from the above introduction, the target adjustment strategy determines whether to increase or decrease the frequency, that is, the target adjustment strategy can be used to determine whether the frequency of the second processor needs to be increased or decreased, but the specific degree of increasing or decreasing the frequency can be determined in combination with the target adjustment range. Therefore, the target adjustment range for frequency adjustment can be determined first.
[0178] Exemplarily, a default value of the target adjustment amplitude may be preset, for example, the default value is 0.2 GHz.
[0179] For some implementations, the target adjustment range may be determined in combination with the load information and the operating frequency. Specifically, step S360 may further include step S361.
[0180] Step S361: Determine a target adjustment amplitude for frequency adjustment based on the load information and the operating frequency.
[0181] As can be seen from the above introduction, the load information can be used to characterize the amount of processor resources required to execute the task load, and the operating frequency is the frequency of the first processor when executing the task load.
[0182] Therefore, if the operating frequency is low, and the load information indicates that the processor resources required to execute the task load are large, the target adjustment range can be determined to be a large value. In addition, if the operating frequency is high, and the load information indicates that the processor resources required to execute the task load are small, the target adjustment range can also be determined to be a large value. This achieves the effect of quickly adjusting the frequency.
[0183] Furthermore, if the operating frequency is low, and the load information indicates that the processor resources required to execute the task load are small, the target adjustment range can be determined to be a small value. In addition, if the operating frequency is high, and the load information indicates that the processor resources required to execute the task load are large, the target adjustment range can also be determined to be a small value. This makes the operation of the electronic device more stable.
[0184] Specifically, a first threshold and a second threshold may be preset, and if the operating frequency is less than or equal to the first threshold, and the load information indicates that the processor resources required to execute the task load are greater than the second threshold, then the target adjustment range may be determined to be the first value. In addition, if the operating frequency is greater than the first threshold, and the load information indicates that the processor resources required to execute the task load are less than or equal to the second threshold, then the target adjustment range may also be determined to be the first value.
[0185] Furthermore, if the operating frequency is less than or equal to the first threshold, and the load information indicates that the processor resources required to execute the task load are less than or equal to the second threshold, the target adjustment range can be determined to be a smaller value. In addition, if the operating frequency is greater than the first threshold, and the load information indicates that the processor resources required to execute the task load are greater than or equal to the second threshold, the target adjustment range can also be determined to be a smaller value. This makes the operation of the electronic device more stable.
[0186] It should be noted that the first value is a value greater than the second value, and both the first value and the second value can be preset values, for example, the first value is 0.8 GHz, and the second value is 0.2 GHz.
[0187] In an embodiment of the present application, the load information, the upper and lower frequency limit information, the operating frequency and the occupied information of the first processor are input into the adjustment model to obtain the adjustment parameters output by the adjustment model, and the processor matching the adjustment parameters is determined as the second processor based on the mapping table corresponding to the electronic device obtained in advance, and the target adjustment strategy matching the adjustment parameters is determined, wherein the mapping table includes multiple reference adjustment intervals, at least one processor corresponding to each of the reference adjustment intervals, and a reference adjustment strategy corresponding to each of the reference adjustment intervals. Thus, even for electronic devices with different processor architectures, there is no need to make major adjustments to the adjustment model. Only the mapping relationship between the adjustment value and the processor needs to be adjusted to achieve the effect of numerically characterizing each processor, avoiding the need to re-perform intensive training to obtain the adjustment model, and reducing the difficulty of adaptation for different platforms. In addition, the target adjustment amplitude for frequency adjustment can be determined based on the load information and the operating frequency. Thus, the effect of rapid frequency adjustment can be achieved, and the stability of the operation of the electronic device can be guaranteed.
[0188] The inventors have also verified through experiments the frequency adjustment methods provided in the various embodiments of the present application. Taking an electronic device running an online video application as an example, when the electronic device is set to run 35 applications in the background, the frequency adjustment method provided in the embodiments of the present application can bring more than 30% power consumption benefits.
[0189] Optionally, the feature acquisition module can also be used to collect relevant parameters of the hardware or operating system of the electronic device other than the information or parameters shown in the above embodiments, and use the collected parameters as input of another adjustment model, so as to adjust other operating parameters of the electronic device through the output of another model, such as memory frequency, display screen brightness, etc. It should be noted that the other model is a model that matches the other operating parameters that need to be adjusted.
[0190] See also Fig.12 , Fig.12 A method flow chart of a frequency adjustment method provided in an embodiment of the present application is shown. The frequency adjustment method can be applied to a cloud server. The frequency adjustment method can include steps S410 to S460.
[0191] Step S410: Obtain sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information, wherein the first information includes at least one of upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and occupied information.
[0192] Step S420: input the sample data into the model to be trained, determine a processor that needs to be frequency adjusted as the third processor based on the output of the model to be trained, and determine an initial strategy for frequency adjustment of the third processor.
[0193] Step S430: adjusting the frequency of the third processor based on the initial strategy to obtain an intermediate frequency of the third processor.
[0194] Step S440: When the frequency of the third processor runs at the intermediate frequency, obtain the fluency information and power consumption information of executing the sample task load through the fourth processor, wherein the fourth processor is a processor set in the electronic device for executing the sample task load.
[0195] Step S450: Obtain an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the cloud server.
[0196] Step S460: arranging the adjustment model on the electronic device, so that the electronic device executes the method described in the above embodiments based on the adjustment model.
[0197] Among them, the execution entity of steps S410 to S460 is a cloud server, and the cloud server can communicate with the electronic device through a pre-established communication link to execute the above steps.
[0198] After the cloud server performs intensive training on the model to be trained and uses the model to be trained after intensive training as the adjustment model, the adjustment model can also be arranged on the electronic device so that the electronic device executes the methods described in the above embodiments based on the adjustment model.
[0199] Exemplarily, the cloud server can directly send the adjustment model to the electronic device, so that the electronic device can deploy the adjustment model. In another exemplary embodiment, the cloud server can also send a configuration file corresponding to the core adjustment model to the electronic device, so that the electronic device can locally configure the model based on the configuration file, and then obtain the adjustment model, which can save network bandwidth and transmission time compared to directly transmitting the adjustment model.
[0200] Among them, the introduction of the above steps can refer to the introduction of the above embodiments, which will not be repeated here.
[0201] See also Fig.13 , Fig.13 A method flow chart of a frequency adjustment method provided by an embodiment of the present application is shown. The frequency adjustment method can be applied to a frequency adjustment system, the frequency adjustment system includes an electronic device and a cloud server, and the electronic device is connected to the cloud server. The frequency adjustment method may include steps S510 to S5100.
[0202] Step S510: The electronic device is used to determine a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among a plurality of processors.
[0203] Step S520: The electronic device is used to obtain first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information.
[0204] Step S530: The cloud server is used to obtain sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information.
[0205] Step S540: The cloud server is used to input the sample data into the model to be trained, determine the processor that needs to be frequency adjusted as the third processor based on the output of the model to be trained, and determine the initial strategy for the frequency adjustment of the third processor.
[0206] Step S550: The cloud server is used to adjust the frequency of the third processor based on the initial strategy to obtain the intermediate frequency of the third processor.
[0207] Step S560: The cloud server is used to obtain the fluency information and power consumption information of executing the sample task load through the fourth processor when the frequency of the third processor runs at the intermediate frequency, wherein the fourth processor is a set of processors in an electronic device for executing the sample task load.
[0208] Step S570: The cloud server is used to obtain an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the cloud server.
[0209] Step S580: The cloud server is used to deploy the adjustment model on the electronic device, so that the electronic device executes the method described in the above embodiments based on the adjustment model.
[0210] Step S590: Based on the load information and the first information, the electronic device determines through the adjustment model a processor that needs to be frequency adjusted as the second processor, and determines a target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency.
[0211] Step S5100: the electronic device adjusts the frequency of the second processor based on the target adjustment strategy.
[0212] Among them, the detailed description of steps S510 to S5100 can be found in the aforementioned embodiments, which will not be repeated here.
[0213] See also Fig.14 , Fig.14 A structural block diagram of a frequency adjustment device provided in an embodiment of the present application is shown. The frequency adjustment device 1400 includes: a first acquisition unit 1410 , a second acquisition unit 1420 , an adjustment information determination unit 1430 and an adjustment unit 1440 .
[0214] The first acquisition unit 1410 is used to determine a target processor set used by the electronic device to execute the task load and load information of the task load, wherein the target processor set includes at least one first processor among the multiple processors.
[0215] The second acquisition unit 1420 is used to acquire first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information.
[0216] The adjustment information determination unit 1430 is used to determine the processor that needs to be frequency adjusted as the second processor through the adjustment model based on the load information and the first information, and determine the target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency.
[0217] Optionally, the adjustment information determination unit 1430 can also be used to obtain sample data, wherein the sample data includes sample load information of the sample task load and sample information of the same type as the first information; input the sample data into the model to be trained, determine the processor that needs to be frequency adjusted as the third processor based on the output of the model to be trained, and determine the initial strategy for frequency adjustment of the third processor; adjust the frequency of the third processor based on the initial strategy to obtain the intermediate frequency of the third processor; when the frequency of the third processor runs at the intermediate frequency, obtain the fluency information and power consumption information of executing the sample task load through the fourth processor, wherein the fourth processor is a set of processors in an electronic device for executing the sample task load; obtain an adjustment model for intensive training of the model to be trained, wherein the intensive training is performed on the electronic device or a cloud server.
[0218] Optionally, the adjustment information determination unit 1430 can also be used to determine an initial reward value based on the power consumption information when the fluency information meets the fluency threshold, wherein the initial reward value is negatively correlated with the power consumption information; determine the initial reward value based on the fluency information when the fluency information does not meet the fluency threshold, wherein the initial reward value is positively correlated with the fluency information; perform intensive training on the model to be trained to increase the initial reward value, and use the model to be trained after the intensive training as the adjustment model.
[0219] Optionally, the adjustment information determination unit 1430 can also be used to obtain the maximum power consumption information of the electronic device when the fluency information meets the fluency threshold; obtain the ratio of the power consumption information to the maximum power consumption information; and determine the initial reward value based on the ratio, wherein the initial reward value is negatively correlated with the ratio.
[0220] Optionally, the adjustment information determination unit 1430 can also be used to determine a set of sample processors used by the electronic device to execute the sample task load, wherein the sample processor set includes at least one fourth processor among the multiple processors; obtaining the operating temperature of each of the fourth processors; when each of the operating temperatures is less than or equal to a temperature threshold, obtaining sample load information of the sample task load; obtaining upper and lower limit information of the frequency of each of the fourth processors and the sample operating frequency and sample occupied information of each of the fourth processors when executing the sample task load, and the sample load information, the upper and lower limit information of the frequency of the fourth processor, the sample operating frequency and sample occupied information of the fourth processor when executing the sample task load are used as the sample data.
[0221] Optionally, the adjustment information determination unit 1430 can also be used to detect whether the electronic device is charging when each of the operating temperatures is less than or equal to a temperature threshold; when the electronic device is charging, control the electronic device to stop charging and obtain sample load information of the sample task load; and when it is detected that the electronic device is not charging, obtain sample load information of the sample task load.
[0222] Optionally, the adjustment information determination unit 1430 can also be used to determine, based on the load information and the first information, a processor that needs to be frequency adjusted as a second processor through an adjustment model, and determine a target adjustment strategy for the frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency.
[0223] The adjustment unit 1440 is configured to adjust the frequency of the second processor based on the target adjustment strategy.
[0224] Optionally, the adjustment unit 1440 may also be configured to determine a target adjustment range for frequency adjustment; and adjust the frequency of the second processor based on the target adjustment strategy and the target adjustment range.
[0225] Optionally, the adjustment unit 1440 may also be configured to determine a target adjustment amplitude for frequency adjustment based on the load information and the operating frequency.
[0226] 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 units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0227] In several embodiments provided in the present application, the coupling between the units may be electrical, mechanical or other forms of coupling. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0228] See also Fig.15 , Fig.15 The block diagram of a structure of an electronic device provided in an embodiment of the present application is shown. The electronic device 110 may be a smart phone, a desktop computer, a vehicle-mounted computer, a server or a tablet computer, etc. The electronic device 110 in the present application may include one or more of the following components: a processor 111, a memory 112 and one or more application programs, wherein the processor 111 is electrically connected to the memory 112, and the one or more program configurations are used to execute the methods described in the aforementioned embodiments.
[0229] The processor 111 may include one or more processing cores. The processor 111 uses various interfaces and lines to connect various parts of the entire electronic device 110, and executes various functions and processes data of the electronic device 110 by running or executing instructions, programs, code sets or instruction sets stored in the memory 112, and calling data stored in the memory 112. Optionally, the processor 111 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 111 can integrate one or a combination of a central processing unit, an image processor, and a modem. Among them, the CPU mainly processes the operating system, the user interface, and the computer program; the GPU is responsible for rendering and drawing the 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 111, and it may be implemented separately through a communication chip. Specifically, the method described in the above embodiment can be executed by one or more processors 111.
[0230] For some embodiments, the memory 112 may include a random access memory (RAM) or a read-only memory (ROM). The memory 112 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 112 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, instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 110 during use, etc.
[0231] See also Fig.16 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1600 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0232] The computer readable storage medium 1600 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 storage medium 1600 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1600 has storage space for program code 1610 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 1610 can be compressed, for example, in an appropriate form.
[0233] 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: Determine a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among a plurality of processors; Acquire first information of each of the first processors, the first information including at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupation information; Based on the load information and the first information, determining a processor that needs to be frequency adjusted as a second processor through an adjustment model, and determining a target adjustment strategy for frequency adjustment of the second processor, wherein the second processor is at least part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; The frequency of the second processor is adjusted based on the target adjustment policy.
2. The method according to claim 1, characterized in that Before determining, based on the load information and the first information, through the adjustment model, a processor that needs to be frequency adjusted as the second processor, and determining a target adjustment strategy for the frequency adjustment of the second processor, the method further includes: Acquire sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information; Inputting the sample data into the model to be trained, determining a processor that needs to be frequency adjusted as a third processor based on an output of the model to be trained, and determining an initial strategy for frequency adjustment of the third processor; Adjusting the frequency of the third processor based on the initial strategy to obtain an intermediate frequency of the third processor; When the frequency of the third processor runs at the intermediate frequency, obtaining fluency information and power consumption information of executing the sample task load through a fourth processor, wherein the fourth processor is a processor set in an electronic device for executing the sample task load; Obtain an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the electronic device or the cloud server.
3. The method according to claim 2, characterized in that The step of obtaining an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the electronic device or the cloud server, comprises: In a case where the fluency information satisfies a fluency threshold, determining an initial reward value based on the power consumption information, wherein the initial reward value is inversely correlated with the power consumption information; When the fluency information does not meet the fluency threshold, determining the initial reward value based on the fluency information, wherein the initial reward value is positively correlated with the fluency information; Reinforcement training is performed on the model to be trained to increase the initial reward value, and the model to be trained after the reinforcement training is used as the adjustment model.
4. The method according to claim 3, characterized in that The step of determining the initial reward value based on the power consumption information when the fluency information satisfies the fluency threshold includes: When the fluency information satisfies the fluency threshold, obtaining maximum power consumption information of the electronic device; Obtaining a ratio of the power consumption information to the maximum power consumption information; The initial reward value is determined based on the ratio, the initial reward value being negatively correlated with the ratio.
5. The method according to claim 2, characterized in that: The first information includes upper and lower frequency limit information, the operating frequency of each of the first processors when executing the task load, and occupation information, and the acquiring of sample data includes: Determine a sample processor set of the electronic device for executing a sample task load, wherein the sample processor set includes at least one fourth processor among the plurality of processors; Obtaining an operating temperature of each of the fourth processors; When each of the operating temperatures is less than or equal to a temperature threshold, obtaining sample load information of the sample task load; The upper and lower limit frequency information of each of the fourth processors, the sample running frequency of each of the fourth processors when executing the sample task load, and the sample occupied information are obtained, and the sample load information, the upper and lower limit frequency information of the fourth processors, the sample running frequency of the fourth processors when executing the sample task load, and the sample occupied information are used as the sample data.
6. The method according to claim 5, characterized in that The acquiring of sample load information of the sample task load when each of the operating temperatures is less than or equal to a temperature threshold comprises: When each of the operating temperatures is less than or equal to a temperature threshold, detecting whether the electronic device is being charged; When the electronic device is being charged, controlling the electronic device to stop charging and acquiring sample load information of the sample task load; When it is detected that the electronic device is not charged, sample load information of the sample task load is obtained.
7. The method according to claim 1, characterized in that The step of determining, based on the load information and the first information, a processor that needs to be frequency adjusted as a second processor through an adjustment model, and determining a target adjustment strategy for the frequency adjustment of the second processor includes: Inputting the load information and the first information into an adjustment model to obtain an adjustment parameter output by the adjustment model; Based on a pre-acquired mapping table corresponding to the electronic device, a processor matching the adjustment parameter is determined as the second processor, and a target adjustment strategy matching the adjustment parameter is determined, wherein the mapping table includes multiple reference adjustment intervals, at least one processor corresponding to each of the reference adjustment intervals, and a reference adjustment strategy corresponding to each of the reference adjustment intervals.
8. The method according to claim 1, characterized in that The adjusting the frequency of the second processor based on the target adjustment strategy includes: Determine the target adjustment range for frequency adjustment; Based on the target adjustment strategy and the target adjustment range, the frequency of the second processor is adjusted.
9. The method according to claim 8, characterized in that The step of determining a target adjustment amplitude for frequency adjustment includes: A target adjustment amplitude for frequency adjustment is determined based on the load information and the operating frequency.
10. A frequency adjustment method, characterized in that: Applied to a cloud server, the method includes: Acquire sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information, the first information including at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information; Inputting the sample data into the model to be trained, determining a processor that needs to be frequency adjusted as a third processor based on an output of the model to be trained, and determining an initial strategy for frequency adjustment of the third processor; Adjusting the frequency of the third processor based on the initial strategy to obtain an intermediate frequency of the third processor; When the frequency of the third processor runs at the intermediate frequency, obtaining fluency information and power consumption information of executing the sample task load through a fourth processor, wherein the fourth processor is a processor set in an electronic device for executing the sample task load; Obtaining an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the cloud server; The adjustment model is arranged in the electronic device, so that the electronic device executes the method according to any one of claims 1 to 9 based on the adjustment model.
11. A frequency adjustment method, characterized in that: Applied to a frequency adjustment system, the frequency adjustment system includes an electronic device and a cloud server, the electronic device is connected to the cloud server, and the method includes: The electronic device is used to determine a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among a plurality of processors; The electronic device is used to obtain first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupation information; The cloud server is used to obtain sample data, wherein the sample data includes sample load information of a sample task load and sample information of the same type as the first information; The cloud server is used to input the sample data into the model to be trained, determine the processor that needs to be frequency adjusted as the third processor based on the output of the model to be trained, and determine the initial strategy for frequency adjustment of the third processor; The cloud server is used to adjust the frequency of the third processor based on the initial strategy to obtain the intermediate frequency of the third processor; The cloud server is used to obtain the fluency information and power consumption information of executing the sample task load through the fourth processor when the frequency of the third processor runs at the intermediate frequency, wherein the fourth processor is a processor set in the electronic device for executing the sample task load; The cloud server is used to obtain an adjustment model for performing intensive training on the model to be trained, wherein the intensive training is performed on the cloud server; The cloud server is used to arrange the adjustment model on the electronic device, so that the electronic device performs the method according to any one of claims 1 to 9 based on the adjustment model; The electronic device determines, based on the load information and the first information, a processor that needs to be frequency adjusted as a second processor through the adjustment model, and determines a target adjustment strategy for frequency adjustment of the second processor, wherein the second processor is at least a part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; The electronic device adjusts the frequency of the second processor based on the target adjustment strategy.
12. A frequency adjustment device, characterized in that: Applied to an electronic device, the electronic device includes a plurality of processors, and the device includes: A first acquisition unit, configured to determine a target processor set used by the electronic device to execute a task load and load information of the task load, wherein the target processor set includes at least one first processor among the plurality of processors; A second acquisition unit is used to acquire first information of each of the first processors, where the first information includes at least one of upper and lower frequency limit information, an operating frequency of each of the first processors when executing the task load, and occupied information; an adjustment information determining unit, configured to determine, based on the load information and the first information, a processor that needs to be frequency adjusted as a second processor through an adjustment model, and determine a target adjustment strategy for frequency adjustment of the second processor, wherein the second processor is at least part of the first processor, and the target adjustment strategy is used to increase or decrease the frequency; An adjustment unit is used to adjust the frequency of the second processor based on the target adjustment strategy.
13. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1 to 9.
Citation Information
Cited By
Frequency adjustment method and device, storage medium and computer equipment
CN120122800A