Dynamic voltage and frequency scaling system, related method and storage medium

By using the controller and sampler in the computer to adjust the frequency and voltage of the processing system, based directly on actual performance and frequency changes, the problem between accuracy and real-time performance of the existing DVFS technology is solved, and better energy efficiency control is achieved. .

WO2024174950A1PCT designated stage expired Publication Date: 2024-08-29HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/077495
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-22
Filing Date
2024-02-19
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Existing DVFS technology is difficult to balance between accuracy and real-time performance, which makes it difficult to achieve a balance between performance and energy consumption when adjusting the frequency and voltage of computer hardware, affecting the energy efficiency ratio.

Method used

By using the first controller to adjust the frequency of the processing system during computer operation, and using a sampler to sample and compare the performance in different states, the frequency scaling factor is determined, avoiding the use of complex prediction models or algorithms, and directly through actual Frequency and performance changes adjust the frequency and voltage of the processing system.

Benefits of technology

It achieves real-time stability of the processing system at the balance point between performance and energy consumption, improves the energy efficiency ratio, and ensures the accuracy and real-time performance of DVFS.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077495_29082024_PF_FP_ABST
    Figure CN2024077495_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a dynamic voltage and frequency scaling system, a related method and a storage medium. The system can comprise: a first controller, used for controlling a processing system to be at target frequencies, the target frequencies at least comprising a first frequency and a second frequency; a sampler, used for sampling the performance of the processing system at the first frequency and the performance of the processing system at the second frequency, so as to obtain a first performance parameter and a second performance parameter, and comparing the first performance parameter with the second performance parameter, so as to obtain a comparison result; and a second controller, used for determining, on the basis of the comparison result, a working frequency and a working voltage of the processing system, and respectively regulating a current frequency and a current voltage of the processing system to the working frequency and the working voltage. The present application can accurately stabilize in real time processing systems on a balance point of performance and energy consumption, thus achieving better energy efficiency control.
Need to check novelty before this filing date? Find Prior Art

Description

A dynamic voltage frequency adjustment system, related method and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on February 22, 2023, with application number 202310187361.0 and application name “A dynamic voltage frequency adjustment system, related methods and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a dynamic voltage and frequency adjustment system, related methods, and storage media. Background Art

[0003] With the continuous advancement of computer technology, the operating frequency and integration density of integrated circuits have continued to increase, resulting in a rapid increase in the power consumption of integrated circuits. This has made it difficult to improve the performance and integration of various computer hardware (such as processors), increasing cooling costs. To save power and control heat, dynamic voltage frequency scaling (DVFS) technology is often used to adjust the voltage and frequency of various computer hardware. This prevents these hardware from always running at the highest frequency. Instead, it can be instructed to operate at different frequencies and corresponding voltages based on the computer's load and configuration. By adjusting the voltage and frequency through DVFS technology, computers can maintain a relatively good energy efficiency while maintaining a certain performance, or improve performance while meeting certain energy consumption constraints.

[0004] Currently, DVFS technology is commonly implemented by collecting dynamic information from the processing system and then analyzing it using predictive models or algorithms to achieve performance predictions, providing a basis for decision-making regarding voltage and frequency adjustments. However, in actual computer operation, DVFS solutions based on predictive models or algorithms often require collecting and analyzing a large amount of dynamic information from the processing system to ensure DVFS accuracy. This increases the analysis time of the predictive models or algorithms, making real-time performance difficult to guarantee. Conversely, ensuring real-time performance can compromise accuracy. Therefore, achieving high accuracy and real-time performance for voltage and frequency adjustments using DVFS technologies that rely on predictive models or algorithms presents a significant challenge.

[0005] Therefore, how to provide a DVFS system and method with high accuracy and real-time performance is an urgent problem to be solved.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a dynamic voltage and frequency adjustment system, related methods, and storage media, which can accurately stabilize the processing system in real time at a balance point between performance and energy consumption, thereby achieving better energy efficiency control.

[0008] In a first aspect, an embodiment of the present application provides a dynamic voltage and frequency adjustment system, which may include:

[0009] a first controller configured to control the processing system to be at a target frequency, the target frequency including at least a first frequency and a second frequency;

[0010] a sampler, configured to sample the performance of the processing system at the first frequency and the performance of the processing system at the second frequency to obtain a first performance parameter and a second performance parameter; and compare the first performance parameter with the second performance parameter to obtain a comparison result;

[0011] The second controller is configured to determine an operating frequency and an operating voltage of the processing system based on the comparison result, and adjust a current frequency and a current voltage of the processing system to the operating frequency and the operating voltage, respectively.

[0012] In the prior art, the implementation of DVFS technology is usually to analyze the dynamic information of the processing system with the help of a prediction model or a prediction algorithm to obtain a performance prediction result (such as a frequency scaling factor), and then adjust the voltage and frequency according to the performance prediction result. However, it is difficult to balance the accuracy and real-time performance of the DVFS solution with the help of a prediction model or a prediction algorithm. In the embodiment of the present application, the frequency of the processing system can be adjusted by the first controller during the operation of the computer, so that the processing system can be in different states, and the performance of the processing system in different states can be sampled and compared by the sampler, and then the frequency scaling factor of the processing system can be determined, avoiding the use of complex prediction models or prediction algorithms to predict the frequency scaling factor. Instead, the relationship between the performance and frequency of the processing system is clarified through actual frequency changes and performance changes, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time by the second controller, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0013] In a possible implementation, the second controller is specifically configured to:

[0014] Obtaining constraint information; the constraint information includes one or more of frequency information of a memory connected to the processing system, frequency information of a level 3 cache connected to the processing system, and a configuration policy of software running on the processing system;

[0015] When the operating frequency and the operating voltage meet the requirements of the constraint information, the current frequency and voltage of the processing system are adjusted to the operating frequency and the operating voltage respectively.

[0016] In an embodiment of the present application, after the sampler compares the performance parameters of the processing system at different frequencies to obtain a comparison result, it can send the comparison result to the second controller. After the second controller determines the frequency and voltage based on the comparison result, it can also determine whether the frequency and voltage meet the requirements in combination with the constraint information. When the frequency and voltage determined by the second controller meet the requirements of the constraint information, the current frequency and voltage of the processing system can be adjusted to the determined frequency and voltage, respectively. In this embodiment of the present application, by combining more information to determine the frequency and voltage determined by the second controller, the accuracy of DVFS can be further improved.

[0017] In a possible implementation, the second controller is further configured to:

[0018] When the operating frequency and the operating voltage do not meet the requirements of the constraint information, the operating frequency and the operating voltage are updated according to the constraint information and the comparison result, and the current frequency and voltage of the processing system are adjusted to the updated operating frequency and the updated operating voltage respectively.

[0019] In this embodiment of the present application, when the frequency and voltage determined by the second controller do not meet the requirements of the constraint information, the frequency and voltage can be re-determined based on the constraint information and the comparison result, and the current frequency and voltage of the processing system can be adjusted to the re-determined frequency and voltage, respectively. This embodiment of the present application further improves the accuracy of DVFS by combining more information to judge the frequency and voltage determined by the second controller.

[0020] In a possible implementation, the sampler is specifically configured to:

[0021] Comparing the first performance parameter and the second performance parameter to obtain a performance difference or a performance ratio;

[0022] A frequency scaling factor of the processing system is determined based on the frequency difference or frequency ratio, and the performance difference or performance ratio; the frequency scaling factor represents the relationship between the performance change and the frequency change of the processing system; the comparison result includes the frequency scaling factor; the frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

[0023] In an embodiment of the present application, after sampling and obtaining the performance parameters of the processing system at different frequencies, the sampler can determine the frequency scaling factor of the processing system through the frequency difference or frequency ratio, and the performance difference or performance ratio. Unlike the prior art solutions that require the use of prediction models or prediction algorithms to determine the frequency scaling factor, the embodiment of the present application can actually adjust the frequency of the processing system, sample and compare the performance of the processing system at different frequencies, and then quickly determine the frequency scaling factor of the processing system through a relatively simple strategy, without relying on prediction models or prediction algorithms, further ensuring the accuracy and real-time performance of DVFS.

[0024] In a possible implementation, the first controller is specifically configured to:

[0025] The processing system is controlled to perform time-sharing switching between the first frequency and the second frequency based on pre-configuration information; the pre-configuration information includes a duration of the first frequency and a duration of the second frequency.

[0026] In an embodiment of the present application, the time during which the processing system is at the first frequency and the second frequency can be configured (i.e., corresponding to the first frequency duration and the second frequency duration), wherein the duration of the first frequency and the second frequency can be configured according to the needs of different services, which can further ensure the accuracy and real-time performance of DVFS, and also enable the DVFS solution provided in the embodiment of the present application to cover more application scenarios.

[0027] In one possible implementation, the processing system includes one or more of a processor core, a first-level cache, and a second-level cache.

[0028] In the embodiment of the present application, the processing system may include any combination of a processor core, a first-level cache, and a second-level cache, and DVFS can flexibly and accurately adjust the frequency and voltage of each hardware.

[0029] In a possible implementation, the first performance parameter includes a first operating speed, and the second performance parameter includes a second operating speed.

[0030] In the embodiment of the present application, the performance parameter of the processing system may be a computing speed, such as MIPS. The sampler can quickly and accurately determine the number of instructions processed by the processing system during sampling statistics, further ensuring the accuracy and real-time performance of DVFS.

[0031] In a second aspect, an embodiment of the present application provides a dynamic voltage and frequency adjustment method, which may include:

[0032] controlling the processing system to be at a target frequency by a first controller, the target frequency including at least a first frequency and a second frequency;

[0033] sampling, by a sampler, the performance of the processing system at the first frequency and the performance of the processing system at the second frequency to obtain a first performance parameter and a second performance parameter; and comparing the first performance parameter with the second performance parameter to obtain a comparison result;

[0034] The second controller determines the operating frequency and the operating voltage of the processing system based on the comparison result, and adjusts the current frequency and voltage of the processing system to the operating frequency and the operating voltage respectively.

[0035] In the prior art, the implementation of DVFS technology is usually to analyze the dynamic information of the processing system with the help of a prediction model or a prediction algorithm to obtain a performance prediction result (such as a frequency scaling factor), and then adjust the voltage and frequency according to the performance prediction result. However, it is difficult to balance the accuracy and real-time performance of the DVFS solution with the help of a prediction model or a prediction algorithm. In the embodiment of the present application, the frequency of the processing system can be adjusted by the first controller during the operation of the computer, so that the processing system can be in different states, and the performance of the processing system in different states can be sampled and compared by the sampler, and then the frequency scaling factor of the processing system can be determined, avoiding the use of complex prediction models or prediction algorithms to predict the frequency scaling factor. Instead, the relationship between the performance and frequency of the processing system is clarified through actual frequency changes and performance changes, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time by the second controller, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0036] In one possible implementation, determining the operating frequency and the operating voltage of the processing system based on the comparison result, and adjusting the current frequency and voltage of the processing system to the operating frequency and the operating voltage, respectively, includes:

[0037] Obtaining constraint information; the constraint information includes one or more of frequency information of a memory connected to the processing system, frequency information of a level 3 cache connected to the processing system, and a configuration policy of software running on the processing system;

[0038] When the operating frequency and the operating voltage meet the requirements of the constraint information, the current frequency and voltage of the processing system are adjusted to the operating frequency and the operating voltage respectively.

[0039] In a possible implementation, the method further includes:

[0040] When the operating frequency and the operating voltage do not meet the requirements of the constraint information, the operating frequency and the operating voltage are updated according to the constraint information and the comparison result, and the current frequency and voltage of the processing system are adjusted to the updated operating frequency and the updated operating voltage respectively.

[0041] In a possible implementation, comparing the first performance parameter and the second performance parameter to obtain a comparison result includes:

[0042] Comparing the first performance parameter and the second performance parameter to obtain a performance difference or a performance ratio;

[0043] A frequency scaling factor of the processing system is determined based on the frequency difference or frequency ratio, and the performance difference or performance ratio; the frequency scaling factor represents the relationship between the performance change and the frequency change of the processing system; the comparison result includes the frequency scaling factor; the frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

[0044] In a possible implementation, controlling the processing system to operate at a target frequency includes:

[0045] The processing system is controlled to perform time-sharing switching between the first frequency and the second frequency based on pre-configuration information; the pre-configuration information includes a duration of the first frequency and a duration of the second frequency.

[0046] In one possible implementation, the processing system includes one or more of a processor core, a first-level cache, and a second-level cache.

[0047] In a possible implementation, the first performance parameter includes a first operating speed; and the second performance parameter includes a second operating speed.

[0048] In a third aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer software instructions used by a system for implementing a dynamic voltage and frequency adjustment method provided by one or more of the first aspects above, which includes a program designed for executing the above aspects.

[0049] In a fourth aspect, an embodiment of the present application provides a computer program comprising instructions, which, when executed by a computer, enables the computer to execute a process executed by a system for implementing a dynamic voltage and frequency adjustment method provided by one or more of the first aspects above.

[0050] In a fifth aspect, an embodiment of the present application provides a terminal device, comprising a processor configured to support the terminal device in implementing the corresponding functions of the dynamic voltage and frequency adjustment method provided in the second aspect. The terminal device may also include a memory coupled to the processor and storing program instructions and data necessary for the terminal device. The terminal device may also include a communication interface for communicating with other devices or a communication network.

[0051] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a processor for supporting a device to implement the functions involved in the second aspect above, for example, generating or processing the information involved in the above-mentioned dynamic voltage and frequency adjustment method. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0053] FIG1a is a schematic structural diagram of a terminal device provided in an embodiment of the present application.

[0054] FIG1 b is a schematic structural diagram of another terminal device provided in an embodiment of the present application.

[0055] FIG2 a is a schematic structural diagram of a dynamic voltage and frequency adjustment system provided in an embodiment of the present application.

[0056] FIG2 b is a schematic diagram of frequency control provided in an embodiment of the present application.

[0057] FIG2c is another frequency control schematic diagram provided in an embodiment of the present application.

[0058] FIG2 d is another frequency control schematic diagram provided in an embodiment of the present application.

[0059] FIG2e is a waveform diagram of a frequency control provided in an embodiment of the present application.

[0060] FIG3 is a schematic structural diagram of another dynamic voltage and frequency adjustment system provided in an embodiment of the present application.

[0061] FIG4 is a schematic structural diagram of another dynamic voltage and frequency adjustment system provided in an embodiment of the present application.

[0062] FIG5 is a flow chart of a dynamic voltage-frequency adjustment method provided in an embodiment of the present application.

[0063] FIG6 is a schematic diagram of a flow chart of a dynamic voltage-frequency adjustment process provided in an embodiment of the present application.

[0064] FIG7 is a timing diagram of a dynamic voltage-frequency adjustment provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0066] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0067] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in one or more embodiments of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0068] As used in this specification, the terms "component," "module," "system," and the like are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and a computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).

[0069] First, some terms in this application are explained to facilitate understanding by those skilled in the art.

[0070] (1) Dynamic voltage frequency scaling (DVFS) can generally dynamically adjust the operating frequency and voltage of the chip according to the different computing power requirements of the application program running on the chip (for the same chip, the higher the frequency, the higher the required voltage), thereby achieving the purpose of energy saving. In the embodiment of the present application, during the operation of the computer, by adjusting the frequency of the processing system (including one or more of the processor core, the first-level cache and the second-level cache), the processing system can be in different states, and the performance of the processing system in different states can be sampled and compared, thereby determining the frequency scaling factor of the processing system, clarifying the relationship between the performance and frequency of the processing system, and thus being able to adjust the frequency and voltage of the processing system to the operating voltage and operating frequency in real time and accurately, stabilizing the processing system in real time at the balance point between performance and energy consumption, and improving energy efficiency.

[0071] (2) Frequency scaling factors. Generally, when the frequency of the processing system is increased (or decreased), the performance of the processing system (for example, the number of instructions executed per second) will be increased (or decreased) accordingly. The ratio of the performance improvement (or decrease) of the processing system to the increase (or decrease) of the frequency of the processing system is the relationship between the performance and frequency of the processing system, which is called the frequency scaling factor. In the embodiment of the present application, the frequency scaling factor of the processing system can be obtained based on the comparison between the different performances of the processing system at different frequencies.

[0072] (3) DVFS process. When the processing system encounters certain performance bottlenecks, DVFS can reduce the frequency and voltage of non-performance-critical components (such as components with low utilization) to reduce their energy consumption. After the performance bottleneck is resolved, the voltage and frequency of performance-critical components (such as components with high utilization) are increased to maintain performance. When adjusting frequency and voltage, the following principles can generally be used as a reference: when adjusting frequency from high to low, the frequency can be reduced first, then the voltage; conversely, when adjusting frequency from low to high, the voltage should be increased first, then the frequency.

[0073] (4) Phase-locked loop (PLL) is a technology that uses feedback control principles to achieve frequency and phase synchronization. Its function is to synchronize the clock output by the circuit with its external reference clock. When the frequency or phase of the reference clock changes, the PLL detects this change and adjusts the output frequency through its internal feedback system until the two are synchronized again. This synchronization is called "phase lock". In the embodiment of the present application, the PLL can generate and output multiple frequencies.

[0074] (5) In this application, "plurality" means two or more. "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0075] First, we analyze and propose the technical problems that this application aims to solve. Common DVFS solutions include the following: Solution 1, Solution 2, and Solution 3:

[0076] Solution 1: Collect information such as the program's preset classification, I / O characteristics, processor utilization, scheduling delay, and processor cluster allocation. This information is controlled through independent proportional-integral-derivative (PID) controllers. The outputs of each independent PID controller loop are combined according to certain weights to calculate the minimum performance requirement. A preconfigured table is then looked up based on the minimum performance requirement to determine the frequency, voltage, and core type. Finally, the frequency, voltage, and core scheduling information are output for DVFS control operations.

[0077] This solution has the following disadvantages:

[0078] Poor real-time performance. The PID controller needs to perform DVFS control based on the long-term average of the above information. This has poor real-time performance and cannot adapt to the demand for high-speed response DVFS control capabilities in complex environments, affecting the energy efficiency benefits brought by DVFS control.

[0079] The algorithm is complex. Each of the above information needs to be processed separately by the corresponding PID controller, and the results need to be synthesized according to the weights. This makes the algorithm complex, the processing process slow, and the possibility of hardware implementation is low. This limits the feasibility of hardware implementation of this solution and further restricts its real-time performance.

[0080] DVFS control has low accuracy. The information is coarse-grained, meaning the PID controller processes it based on coarse-grained information. This results in low DVFS control accuracy, impacting DVFS's energy efficiency. For example, in some application scenarios, reducing the frequency by a certain amount can result in minimal performance loss but significant energy efficiency improvements. However, Solution 1, which relies on coarse-grained DVFS processing, cannot detect and identify such scenarios.

[0081] Solution 2: The system-on-chip (SOC) load is collected through a system-on-chip (SOC) information collection unit. The SOC load is then used to determine the processor's performance requirements. The DVFS table selection unit then converts the processor's performance requirements into frequency and voltage information for DVFS control. Finally, the DVFS operation control unit controls the SOC's supply voltage based on this frequency and voltage information.

[0082] This second solution has the following disadvantages:

[0083] DVFS control suffers from poor accuracy and real-time performance. Using only the system load (SOC-load) as the basis for DVFS adjustment fails to accurately reflect processor performance requirements, thus failing to guarantee DVFS accuracy and, consequently, achieving optimal energy efficiency. Furthermore, load changes are generally slow, so DVFS based solely on load will also be slow to respond, failing to meet the needs of scenarios requiring high real-time performance.

[0084] Solution 3: First, use the first counter to count the active time of the processor core; then use the second counter to count the time when the processor core is idle due to the third-level cache miss; and predict the frequency scaling factor of the processor core based on these two factors: the active time of the processor core and the time when the processor core is idle.

[0085] This solution has the following disadvantages:

[0086] DVFS control has poor accuracy and is applicable in limited scenarios. Considering only L3 cache misses doesn't guarantee DVFS's accuracy. For example, in complex scenarios, DVFS accuracy is affected by various factors. This solution, which only considers L3 cache misses, is unable to guarantee DVFS accuracy.

[0087] To this end, the present application proposes a dynamic voltage and frequency adjustment system, which can adjust the frequency of the processing system during the operation of the computer so that the processing system can be in different states, and sample and compare the performance of the processing system in different states, so as to determine the frequency scaling factor of the processing system, avoid using complex prediction models or prediction algorithms to predict the frequency scaling factor, and instead clarify the relationship between the performance and frequency changes of the processing system through actual frequency changes and performance changes, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time and accurately, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0088] To better understand the dynamic voltage and frequency adjustment system provided in the embodiments of the present application, the system architecture and / or application scenarios of the dynamic voltage and frequency adjustment system provided in the embodiments of the present application are described below. It is understood that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.

[0089] Please refer to Figure 1a, which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device 01 provided in the present application may include one or more processors 11, one or more power management units (PMUs) 12, and other hardware 13. The terminal device 01 can be a subscriber unit, a cellular phone, a smart phone, a personal computer (PC), a personal digital assistant (PDA), a tablet computer, a handheld device (Handset), a laptop computer, a machine type communication (MTC) terminal, a smart wearable device, etc. It can be understood that in the embodiment of the present application, a terminal device can correspond to a computer, or a terminal device can also be called a computer.

[0090] The processor 11 may be a central processing unit (CPU), a graphics processing unit (GPU), or a chip with other functions (such as a SOC or a programmable system-on-chip (PSOC)). The processor 11 may include one or more processor cores and one or more memories. The CPU may be used to process instructions, execute operations, control time, and process data. In other words, the CPU is mainly responsible for interpreting computer instructions and processing data in computer software. The CPU is responsible for reading instructions, decoding instructions, and executing instructions in the computer. The GPU is a microprocessor that performs image operations on the computer and mainly performs complex mathematical and geometric calculations to complete graphics rendering. In an embodiment of the present application, the processor 11 may include a dynamic voltage and frequency adjustment system, so that the frequency of the processing system can be adjusted by the dynamic voltage and frequency adjustment system, so that the processing system can be in different states, and the performance of the processing system in different states can be sampled and compared, thereby determining the frequency scaling factor of the processing system, clarifying the relationship between the performance and frequency of the processing system, and thus adjusting the frequency and voltage of the processing system to the operating voltage and operating frequency in real time and accurately, and stabilizing the processing system in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0091] The memory is used to store the preparation data required by the processor 11 to execute tasks, the intermediate data generated during the execution of tasks, and the result data after the tasks are completed. The memory may include one or more local memories, one or more registers, one or more level 1 caches (L1 caches), one or more level 2 caches (L2 caches), and various buffers, etc. It may also include other external memories (not shown in the figure).

[0092] The power management unit 12 may include a power input and a power management chip. The power management unit 12 is connected to the processor 11 and other hardware 13 respectively. The power management unit 12 can be used to power the processor 11 and other hardware 13. The power management unit 12 can also receive control information sent by the dynamic voltage and frequency adjustment system in the processor 11 and adjust the voltage provided to the processing system based on the control information. The control information is determined by the dynamic voltage and frequency adjustment system by adjusting the frequency of the processing system so that the processing system can be in different states, sampling and comparing the performance of the processing system in different states, and then determining the frequency scaling factor of the processing system, clarifying the relationship between the performance of the processing system and the frequency change.

[0093] Other hardware 13 may include a linear regulator, a phase-locked loop (PLL), a display screen, a camera, various I / O interfaces, and various sensors. The PLL can generate and output multiple frequencies, while the linear regulator can transform the output of the power management unit 12 to output multiple voltages.

[0094] In one possible implementation, the processor in the terminal device provided by the present application may not include a dynamic voltage and frequency adjustment system, that is, the dynamic voltage and frequency adjustment system may be implemented by a separate chip rather than being integrated on the processor chip. Referring to FIG1b , FIG1b is a schematic structural diagram of another terminal device provided by an embodiment of the present application. The terminal device 02 provided by the present application may include one or more processors 21, one or more dynamic voltage and frequency adjustment systems 22, one or more power management units 23, and other hardware 24. The functions and connection relationships of the various units in the terminal device 02 can refer to the relevant description of the terminal device 01 above and will not be repeated here.

[0095] It should be noted that the embodiments of the present application can be applied to the system architecture of various computer devices. The architecture of the computer device in the above figure is only an exemplary implementation in the embodiments of the present application. The architecture applicable to the embodiments of the present application includes but is not limited to the above architecture. It should be understood that the architecture of the computer device may have more or fewer units / modules than shown in the figure, may combine two or more units / modules, or may have different unit / module configurations. The various units / modules shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application-specific integrated circuits.

[0096] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. For ease of understanding, first, the structure of the dynamic voltage and frequency adjustment system provided by the present application is described by taking the scenario in which the terminal device includes a single processor core as an example. Please refer to Figure 2a, which is a structural diagram of a dynamic voltage and frequency adjustment system provided by the embodiment of the present application. The dynamic voltage and frequency adjustment system may include a first controller 2100, a sampler 2200, and a second controller 2300. The dynamic voltage and frequency adjustment system can adjust the frequency of the processing system of the terminal device (including one or more of the processor core, the first-level cache, and the second-level cache) so that the processing system can be in different states, and sample and compare the performance of the processing system in different states, and then determine the frequency scaling factor of the processing system, clarify the relationship between the performance and frequency of the processing system, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time and accurately, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency. Among them,

[0097] The first controller 2100 may control the processing system to be at a target frequency, where the target frequency includes at least a first frequency and a second frequency.

[0098] Optionally, the first controller 2100 can control the processing system to switch between the first frequency and the second frequency through pre-configuration information. The pre-configuration information may include the duration of the first frequency and the duration of the second frequency, so that the sampler 2200 can sample the performance of the processing system at a certain time interval. Among them, the duration of the first frequency and the second frequency can be configured by the processor (or operating system) according to the needs of different services (such as games, videos, music, and social interaction software). For example, for services with higher real-time requirements (such as games, social interaction software, etc.), the duration of the first frequency and the second frequency can be configured to be shorter; and for services with lower real-time requirements (such as videos, music, etc.), the duration of the first frequency and the second frequency can be configured to be longer, which is not specifically limited here. It is understandable that the duration of the first frequency and the duration of the second frequency can be equal or different.

[0099] Optionally, the processing system may include one or more of a processor core, a first-level cache, and a second-level cache. For ease of understanding, taking the processing system including a processor core, a first-level cache, and a second-level cache as an example, the processor core, the first-level cache, and the second-level cache may be in the same clock domain and the same power domain, or in different clock domains and different power domains. In other words, the processor core, the first-level cache, and the second-level cache may operate at the same frequency and voltage, and the frequency and voltage may be adjusted uniformly; the processor core, the first-level cache, and the second-level cache may also operate at different frequencies and voltages, and their respective frequencies and voltages may be adjusted separately without affecting each other.

[0100] For example, when the first controller 2100 needs to control the processing system to operate at a first frequency, the first controller 2100 can control the frequency provided by the PLL 2400 to be the first frequency and transmit it to the processor core 2000, the first level cache 2001, and the second level cache 2002 in the clock domain 200. At this time, the processor core 2000, the first level cache 2001, and the second level cache 2002 operate at the first frequency and are in a first state. The frequency of the PLL 2400 can be one of multiple frequency outputs generated by multiplying the external frequency input by the crystal oscillator 2600. Each of the multiple frequency outputs generated by the PLL 2400 can be output to an independent clock domain.

[0101] For example, when the first controller 2100 needs to control the processing system to operate at the second frequency, the first controller 2100 can control the frequency provided by the PLL 2400 to be the second frequency, thereby adjusting the frequency of the processing system to the second frequency. In other words, the first controller 2100 can adjust the frequency of the processor core 2000, the first level cache 2001, and the second level cache 2002 in the clock domain 200 from the first frequency to the second frequency, so that the processor core 2000, the first level cache 2001, and the second level cache 2002 operate at the second frequency and are in the second state.

[0102] It should be noted that the relationship between the first frequency and the second frequency includes the first frequency being greater than the second frequency, or the first frequency being less than the second frequency. If the first frequency is greater than the second frequency, the first controller 2100 reduces the frequency of the processing system from the first frequency to the second frequency, and the performance of the processing system will be partially lost. The voltage of the processing system can remain unchanged or can be reduced along with the frequency. It is understandable that when reducing the frequency, the voltage can be kept constant to further improve the real-time performance of DVFS, because the voltage adjustment is usually slow. If the first frequency is less than the second frequency, the first controller 2100 can first increase the voltage of the processing system and then increase the frequency in order to increase the frequency of the processing system from the first frequency to the second frequency.

[0103] Optionally, the target frequency may also include other frequencies (e.g., a third frequency, a fourth frequency, etc.). Understandably, the third frequency, the fourth frequency, etc. may also be pre-configured with a certain duration. When the first controller 2100 adjusts the frequency of the processing system from the first frequency to the second frequency, a larger frequency adjustment may be performed, such as directly adjusting from the first frequency to the second frequency; a smaller frequency adjustment may also be performed, such as first adjusting from the first frequency to the third frequency, then adjusting to the fourth frequency, and finally adjusting to the second frequency (at this time, the values ​​of the third frequency and the fourth frequency are between the first frequency and the second frequency). Exemplarily, the first controller 2100 may determine whether to make a larger frequency adjustment or a smaller frequency adjustment based on the needs of the computer. For example, when the computer needs to protect the voltage, the first controller 2100 may use a smaller frequency adjustment, i.e., continuously adjust the frequency at a certain interval to protect the voltage; for example, when the computer hardware temperature is too high and needs to be cooled, it may also be directly reduced from the first frequency to the second frequency (at this time, the first frequency is greater than the second frequency) to achieve a significant and rapid reduction in frequency, thereby reducing the hardware temperature.

[0104] The sampler 2200 can be used to sample the performance of the processing system at the first frequency and the performance at the second frequency to obtain a first performance parameter and a second performance parameter; and compare the first performance parameter and the second performance parameter to obtain a comparison result.

[0105] Optionally, the above-mentioned performance parameters (i.e., the first performance parameter and the second performance parameter) may include an operating speed (i.e., a first operating speed and a second operating speed). The operating speed may be the number of instructions processed per second by the processing system, such as million instructions per second (MIPS), or may be the number of instructions executed per cycle (IPC) by the processing system. Understandably, the above-mentioned performance parameters may also be other parameters that can be used to describe the performance of the processing system, such as a running score. Running score refers to testing a computer through relevant software to obtain a running score value, thereby evaluating the performance of the computer. The higher the running score value, the better the computer performance.

[0106] For example, when the first controller 2100 controls the frequency of the processing system to a first frequency, the processor core 2000, the level 1 cache 2001, and the level 2 cache 2002 operate at the first frequency, i.e., the processing system is in a first state. The sampler 2200 can sample the performance parameters of the processing system in the first state to obtain the first performance parameters.

[0107] When the first controller 2100 adjusts the frequency of the processing system (e.g., the processor core 2000, the L1 cache 2001, and the L2 cache 2002 in the clock domain 200) from the first frequency to the second frequency, the processor core 2000, the L1 cache 2001, and the L2 cache 2002 operate at the second frequency. The processing system is then in a second state. The sampler 2200 can sample performance parameters of the processing system in the second state to obtain second performance parameters.

[0108] Optionally, the design of the frequency control implemented by the first controller 2100 may refer to any one of the following solutions:

[0109] Solution 1: See Figure 2b, which is a frequency control schematic diagram provided in an embodiment of the present application, wherein PLL2400 can be implemented based on a fractional divider, so that multiple clocks (such as frequency channel 1, frequency channel 2, frequency channel 3 and frequency channel 4) can be generated, and the first controller 2100 can select the frequency of one of the frequency channels to provide to the processing system. Exemplarily, the frequency of frequency channel 1 is the first frequency, and the frequency of frequency channel 2 is the second frequency. When the first controller 2100 wants to control the frequency of the processing system at the first frequency, it can select the frequency of frequency channel 1 to provide to the processing system. After a period of time (the duration of the first frequency), when the first controller 2100 wants to adjust the frequency of the processing system to the second frequency, it can select the frequency of frequency channel 2 to provide to the processing system.

[0110] Solution 2: See Figure 2c, which is another frequency control schematic diagram provided in an embodiment of the present application, wherein PLL2400 can output dual frequencies (for example, a first frequency and a second frequency), and the first controller can select one of the frequencies through a clock selector to complete the rapid switching of the processing system between different frequencies. For example, when the first controller 2100 wants to control the frequency of the processing system to the first frequency, the clock selector can select the first frequency and provide it to the processing system. After a period of time (the duration of the first frequency), when the first controller 2100 wants to adjust the frequency of the processing system to the second frequency, the clock selector can select the second frequency and provide it to the processing system.

[0111] Solution three: Please refer to Figure 2d, which is another frequency control schematic diagram provided by an embodiment of the present application. PLL2400 can generate multiple clocks, and the first controller 2100 can perform frequency control through clock gating. For example, the first controller 2100 can periodically (or randomly) discard part of the pulses of the clock output by the frequency channel in proportion through clock gating, thereby forming an equivalent low-frequency clock, which is equivalent to reducing the frequency. Please refer to Figure 2e, which is a waveform diagram of a frequency control provided by an embodiment of the present application, wherein the output of the frequency channel of PLL2400 can be a waveform with 12 pulses (waveform 1), and the throttling signal output by the first controller 2100 can be a waveform with two pulses (waveform 2). The signal finally output through clock gating is a waveform with 10 pulses (waveform 3), which has lost 2 pulses, which is equivalent to reducing the frequency.

[0112] After the sampler 2200 samples and obtains the first performance parameter and the second performance parameter, it can compare the two to obtain a comparison result. The comparison result may include a frequency scaling factor. The frequency scaling factor can be used to represent the relationship between the performance change and the frequency change of the processing system, for example, indicating how much the frequency of the processing system is reduced (or increased) and how much the performance is reduced (or improved); or, how much the frequency is reduced (or increased) and how much the performance is reduced (or improved).

[0113] In one possible implementation, the sampler 2200 compares the first performance parameter and the second performance parameter to obtain a performance difference or a performance ratio. The sampler 2200 can then determine a frequency scaling factor based on the frequency difference or the frequency ratio and the performance difference or the performance ratio. The frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

[0114] Optionally, the frequency scaling factor may be determined based on the frequency difference and the performance difference. For example, the frequency scaling factor may satisfy the following formula 1.1:

[0115] The performance parameters of the processing system can be expressed in MIPS; Frequency represents the frequency at which the processing system operates; Normal can indicate that the processing system operates at a first frequency, and Sample can indicate that the processing system operates at a second frequency; S represents the frequency scaling factor. For ease of understanding, this example assumes that the first frequency is greater than the second frequency. Because increasing frequency also increases MIPS, the frequency scaling factor in the above equation is generally a positive number. Optionally, the frequency scaling factor S can be expressed in MIPS / MHz or MIPS / GHz.

[0116] Optionally, the frequency scaling factor may be determined based on the frequency ratio and the performance ratio. For example, the frequency scaling factor may satisfy the following formula 1.2:

[0117] The performance parameter of the processing system can be expressed in MIPS; Frequency represents the frequency at which the processing system operates; Normal indicates that the processing system operates at a first frequency, and Sample indicates that the processing system operates at a second frequency; S represents the frequency scaling factor. The above formula uses a relative rate of change to describe the frequency scaling factor, and the final output frequency scaling factor S is dimensionless.

[0118] Optionally, the frequency scaling factor may be determined based on the frequency ratio and the performance difference. For example, the frequency scaling factor may satisfy the following formula 1.3:

[0119] The performance parameters of the processing system can be expressed in MIPS; Frequency represents the frequency at which the processing system operates; Normal indicates that the processing system operates at a first frequency, and Sample indicates that the processing system operates at a second frequency; and S represents the frequency scaling factor. In the right-hand side of the above equation, the numerator is an absolute value and the denominator is a relative value. The final output frequency scaling factor S can be expressed in MIPS.

[0120] Optionally, the frequency scaling factor may be determined based on the frequency difference and the performance ratio. For example, the frequency scaling factor may satisfy the following formula 1.4:

[0121] The performance parameter of the processing system can be expressed in MIPS; Frequency represents the frequency at which the processing system operates; Normal indicates that the processing system operates at a first frequency, and Sample indicates that the processing system operates at a second frequency; and S represents the frequency scaling factor. On the right side of the above equation, the numerator is a relative value and the denominator is an absolute value. The final output frequency scaling factor S can be in units of 1 / MHz or 1 / GHz.

[0122] In one possible implementation, the first performance parameter and the second performance parameter may also be the number of instructions executed per cycle (IPC) or a running score value of the processing system. Taking the performance parameter (including the first performance parameter and the second performance parameter) as an example, the IPC. The frequency scaling factor may be determined based on the frequency difference and the performance difference. For example, the frequency scaling factor may satisfy the following formula 2.1:

[0123] The performance parameter of the processing system can be expressed as IPC; Frequency represents the frequency at which the processing system operates; Normal can indicate that the processing system operates at a first frequency, and Sample can indicate that the processing system operates at a second frequency; S represents the frequency scaling factor. For ease of understanding, this example assumes that the first frequency is greater than the second frequency. Because IPC generally decreases or remains unchanged when the frequency increases, the frequency scaling factor in the above equation can be a negative number. Optionally, the frequency scaling factor S can be expressed in units of 1 / MHz or 1 / GHz.

[0124] It can be understood that the MIPS parameters in the above formulas 1.2, 1.3 and 1.4 can also be adjusted to IPC accordingly, so that the following formulas 2.2, 2.3 and 2.4 can be obtained respectively.

[0125] Optionally, the frequency scaling factor may satisfy the following formula 2.2:

[0126] Optionally, the frequency scaling factor may satisfy the following formula 2.3:

[0127] Optionally, the frequency scaling factor may satisfy the following formula 2.4:

[0128] Among them, the relevant descriptions of the above formulas 2.2, 2.3 and 2.4 can be referenced by the relevant descriptions of the above formulas 1.1, 1.2, 1.3, 1.4 and 2.1, which will not be repeated here.

[0129] Optionally, when the target frequency also includes other frequencies (such as a third frequency, a fourth frequency, etc.), the first controller 2100 adjusts the frequency of the processing system from the first frequency to the second frequency by adjusting the frequency by a smaller amplitude, for example, first adjusting from the first frequency to the third frequency, then adjusting to the fourth frequency, and finally adjusting to the second frequency (at this time, the values ​​of the third frequency and the fourth frequency are between the first frequency and the second frequency). The sampler 2200 can also sample the performance parameters of the processing system when it is at the third frequency and the fourth frequency, and then obtain the third performance parameter and the fourth performance parameter. Then, the sampler 2200 can also compare the third performance parameter and the fourth performance parameter with the first performance parameter respectively to obtain comparison results at different frequencies.

[0130] After the sampler 2200 samples and compares the first and second performance parameters of the processing system to obtain a comparison result, the second controller 2300 may determine the operating frequency and operating voltage of the processing system based on the comparison result and adjust the current frequency and voltage of the processing system to the determined operating frequency and operating voltage, respectively. Optionally, the second controller 2300 may obtain constraint information and then determine the operating frequency and operating voltage of the processing system based on the constraint information and the comparison result. The constraint information may include one or more of frequency information of memory connected to the processing system, frequency information of the third-level cache connected to the processing system, and configuration policies of software running on the processing system. Optionally, the constraint information may be obtained by the second controller 2300 interacting with the operating system. After obtaining the constraint information and the comparison result from the sampler 2200, the second controller 2300 may first determine whether the operating frequency and operating voltage corresponding to the comparison result meet the requirements of the constraint information. If the operating frequency and operating voltage meet the requirements of the constraint information, the second controller 2300 may adjust the current frequency and operating voltage of the processing system to the specified operating frequency and operating voltage, respectively. When the operating frequency and the operating voltage do not meet the requirements of the above constraint information, the second controller 2300 can update the operating frequency and the operating voltage according to the constraint information and the comparison result, and adjust the current frequency and voltage of the processing system to the updated operating frequency and the updated operating voltage respectively.

[0131] For example, when adjusting the frequency, the second controller 2300 can control the PLL 2400 through control information to precisely adjust the frequency output to the clock domain 200. When adjusting the voltage, the second controller 2300 can control the linear regulator 2500 through control information to precisely adjust the voltage output to the power domain 201. It should be noted that if a significant voltage adjustment is required, the second controller 2300 may also output a signal to the power management unit 2700 to control the power management chip to generate the required voltage.

[0132] Optionally, after obtaining the frequency scaling factor, the second controller 2300 may make a collaborative decision based on the constraint information of the terminal device's firmware or operating system, and ultimately determine whether to increase the frequency and voltage; or to reduce the frequency and voltage; or to maintain the frequency and voltage. The constraint information of the terminal device's firmware or operating system may include:

[0133] (1) The current working mode of the processing system. For example, power saving mode, or high performance mode. In power saving mode, the processing system can tolerate a certain performance degradation in exchange for an improvement in energy efficiency; while in high performance mode, the processing system can only tolerate a slight performance degradation. Exemplarily, the second controller 2300 can estimate the performance loss caused by the frequency reduction based on the frequency scaling factor. If the processing system can tolerate the performance loss, the second controller 2300 can decide to reduce the frequency and voltage. The performance degradation threshold that the processing system can tolerate is determined by the current working mode of the processing system. For example, the performance degradation threshold that the processing system can tolerate in power saving mode is 5%, and the performance degradation threshold that the processing system can tolerate in high performance mode is 2%. It is understandable that the above-mentioned performance degradation threshold can also take other values, which are not specifically limited here.

[0134] (2) The current thermal management state of the processing system. For example, if the chip is close to overheating, the processing system needs to reduce the thermal load by reducing the frequency and voltage. Optionally, in the scenario described below where the terminal device includes multiple processor cores, the second controller 2300 can refer to the frequency scaling factors of different processor cores and select the processor core whose frequency has less impact on performance to perform the frequency reduction operation, thereby minimizing the overall performance loss of the terminal device and reducing the thermal load of the processing system.

[0135] (3) When the processing system is overclocking to gain performance, it is necessary to check the frequency scaling factor of the processor core under the current business load. For businesses that are not sensitive to frequency, the performance improvement brought by overclocking is relatively small. In this case, the overclocking process is stopped.

[0136] (4) The priority of the service being processed by the processing system. The second controller 2300 makes a decision based on the frequency scaling factor of the service when it is running on the processor core. For example, for a service with a lower priority, the processing system running the service may prioritize frequency reduction; for a service with a higher priority but performance that is not frequency-sensitive, the processing system running the service may prioritize frequency reduction; for a service with a higher priority and performance that is frequency-sensitive, the processing system running the service may prioritize frequency increase.

[0137] (5) For multiple processor cores in the same processor cluster, whether to perform overall frequency reduction and voltage reduction, frequency increase and voltage increase, or frequency and voltage maintenance. Optionally, the second controller 2300 may first calculate the frequency scaling factors of the multiple processor cores in the same processor cluster, and then make a comprehensive decision based on the priority of the services running on each processor core or the occupancy rate of each processor core to determine whether to perform overall frequency reduction and voltage reduction, frequency increase and voltage increase, or frequency and voltage maintenance.

[0138] (6) Other influencing factors. After the second controller 2300 calculates the frequency scaling factor for each processor core, it can make decisions based on the bandwidth and command queue occupancy of the L3 cache, and the bandwidth and command queue occupancy of the memory. For example, it can determine the frequency adjustment strategy for the processor core, the frequency adjustment strategy for the L3 cache, and the frequency adjustment strategy for the memory, and then perform coordinated control.

[0139] Exemplarily, the processing system is in a normal operating state, and the frequency at this time is a normal operating frequency (such as the first frequency). For example, the first frequency (such as 5.6GHz) is greater than the second frequency (such as 5.2GHz), the performance of the processing system at the first frequency is normal performance (such as 9000MIPS), and the performance of the processing system at the second frequency is reduced frequency performance (such as 8800MIPS). After comparing the normal performance and the reduced frequency performance, the second controller 2300 can determine the second frequency as the operating frequency, and at the same time, can obtain the voltage corresponding to the second frequency by looking up the table, and determine the voltage corresponding to the second frequency as the operating voltage. It can be seen that when the frequency of the processing system is reduced from the first frequency to the second frequency, the frequency is reduced by 0.4GHz, and the performance of the processing system is reduced by 200MIPS, that is, the performance is reduced by 2.22%. Taking the method of determining the frequency scaling factor based on the frequency difference and the performance difference as an example, it can be determined that the frequency scaling factor S is 500MIPS / GHz, indicating that under the current load, the frequency of the processing system is reduced by 1GHz and the performance is reduced by 500MIPS. If the constraint information includes a configuration policy for the software, the performance degradation threshold that the processing system can tolerate in power saving mode is 5%, and the performance degradation threshold that the processing system can tolerate in high-performance mode is 2%. Assume that the terminal device is in power saving mode at this time. As in the above example, when the frequency drops from the first frequency (5.6GHz) to the second frequency (5.2GHz), the performance drops by 2.22%. It can be seen that the performance degradation ratio after the frequency adjustment is less than the performance degradation threshold of 5%, and the processing system can tolerate it. Then the second controller 2300 can adjust the frequency of the processing system to the second frequency (5.2GHz), and adjust the voltage of the processing system to the voltage corresponding to the second frequency (the voltage corresponding to the second frequency can be obtained by looking up the table).

[0140] Taking the scenario where the terminal device includes multiple processor cores and each processor core can be independently controlled as an example, the structure of the dynamic voltage and frequency adjustment system provided by the present application is explained. Please refer to Figure 3, which is a structural diagram of another dynamic voltage and frequency adjustment system provided by an embodiment of the present application. The dynamic voltage and frequency adjustment system may include multiple first controllers (such as first controller 3100, first controller 3101), multiple samplers (such as sampler 3200 and sampler 3201) and a second controller 3300. The dynamic voltage and frequency adjustment system can adjust the frequency of different processing systems (including one or more of the processor core, the first level cache and the second level cache) of the terminal device so that different processing systems can be in different states respectively, and the performance of different processing systems in different states can be sampled and compared, and then the frequency scaling factors of different processing systems can be determined, and the relationship between the performance and frequency of each processing system can be clarified, so that the frequency and voltage of different processing systems can be adjusted to the operating voltage and operating frequency respectively in real time and accurately, and each processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency. Among them,

[0141] The terminal device may include at least two processing systems (e.g., processing system 1 and processing system 2) capable of independently adjusting voltage and frequency. The processing systems may include one or more of a processor core, a level 1 cache, and a level 2 cache. For example, the processing system may include a processor core, a level 1 cache, and a level 2 cache. For example, processing system 1 includes a processor core 3000, a level 1 cache 3001, and a level 2 cache 3002. Processing system 2 includes a processor core 3010, a level 1 cache 3011, and a level 2 cache 3012.

[0142] Optionally, processor core 3000, L1 cache 3001, and L2 cache 3002 may be located in an independent power domain 301 and clock domain 300. Processor core 3010, L1 cache 3011, and L2 cache 3012 may be located in another independent power domain 311 and clock domain 310. Voltage regulation in different power domains (such as power domain 301 and power domain 311) may be independent, and the voltage regulation methods of different power domains may be similar; frequency regulation in different clock domains (such as clock domain 300 and clock domain 310) may be independent, and the frequency regulation methods of different clock domains may be similar.

[0143] For example, the first controller 3100 can control the frequency generated by the PLL 3400 to a first frequency and send it to the clock domain 300. At this time, the processor core 3000, the first level cache 3001, and the second level cache 3002 of the processing system 1 operate at the first frequency and are in a first state. The sampler 3200 can collect performance data (e.g., MIPS, IPC, or running score) of the processing system 1 in the first state. The frequency control scheme implemented by the first controller 3100 can refer to the relevant description of the first controller 2100 above and will not be repeated here.

[0144] After processing system 1 operates at the first frequency for a period of time (i.e., the duration of the first frequency), first controller 3100 can down-clock the clock output by PLL 3400 to a second frequency (assuming the first frequency is greater than the second frequency) and then provide it to clock domain 300. At this point, processor core 3000, L1 cache 3001, and L2 cache 3002 of processing system 1 operate at the second frequency and are in the second state. Sampler 3200 can collect performance data (e.g., MIPS, IPC, or benchmark scores) of processing system 1 in the second state. It is understood that after processing system 1 operates at the second frequency for a period of time (i.e., the duration of the second frequency), first controller 3100 can restore the frequency from the second frequency to the first frequency, allowing processing system 1 to resume operation in the first state. Alternatively, first controller 3100 can further increase the frequency, allowing processing system 1 to operate at a frequency greater than the first frequency to achieve higher performance. Alternatively, first controller 3100 can continue to reduce the frequency from the second frequency to another frequency, and sampler 3200 can collect performance data of processing system 1 operating at the other frequency.

[0145] After obtaining performance data for processing system 1 in different states, sampler 3200 can compare the data and thereby infer a frequency scaling factor for processing system 1 under the current workload. The description of determining the frequency scaling factor can be found in the description of the single processor core scenario (e.g., Formulas 1.1-2.4) above and will not be repeated here.

[0146] It is understood that the process of the first controller 3101 adjusting the frequency of the processing system 2, and the process of the sampler 3201 sampling the performance of the processing system in different states and determining the frequency scaling factor, can be referred to the description of the first controller 3100 and the sampler 3200. It should be noted that the frequencies of the processing system 1 and the processing system 2 can be adjusted independently without affecting each other. In other words, when the first controller 3101 adjusts the frequency of the processing system 2, it can control the frequency of the processing system 2 to the first frequency or the second frequency, or to other frequencies, which are not specifically limited here.

[0147] Samplers 3200 and 3201 send the frequency scaling factors determined for processing system 1 and processing system 2 to the second controller 3300. Based on the frequency scaling factors of processing system 1 and processing system 2, combined with constraint information (e.g., memory frequency information, L3 cache frequency information, or software configuration policy), the second controller 3300 can make decisions to determine how to adjust the frequency and voltage of processing system 1 and processing system 2, such as increasing the voltage and frequency; or decreasing the voltage and frequency; or maintaining the voltage and frequency unchanged. For example, when adjusting the frequency, the second controller 3300 can control the PLL 3400 through control information to accurately adjust the frequency output to clock domain 300 and clock domain 310; when adjusting the voltage, the second controller 3300 can control the linear regulator 3500 through control information to accurately adjust the voltage output to power domain 301 and power domain 311.

[0148] Taking the scenario where the terminal device includes multiple processor cores and the multiple processor cores are in the same processor cluster and uniformly controlled as an example, the structure of the dynamic voltage and frequency adjustment system provided by the present application is explained. Please refer to Figure 4, which is a structural diagram of another dynamic voltage and frequency adjustment system provided by an embodiment of the present application. The dynamic voltage and frequency adjustment system may include a first controller 4100, a sampler 4200, and a second controller 4300. The dynamic voltage and frequency adjustment system can adjust the frequency of the processing system of the terminal device (including one or more of multiple processor cores, multiple first-level caches, and second-level caches) so that the processing system can be in different states respectively, and the performance of the processing system in different states can be sampled and compared, and then the frequency scaling factor of the processing system can be determined, and the relationship between the performance and frequency of the processing system can be clarified, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency respectively in real time and accurately, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency. Among them,

[0149] Processor cluster 402 may include multiple processor cores, such as processor core 4000, processor core 4010, and processor core 4020. Processor cluster 402 may also include a level 1 cache 4001 (which may correspond to processor core 4000), a level 1 cache 4011 (which may correspond to processor core 4010), and a level 1 cache 4021 (which may correspond to processor core 4020). Processor cluster 402 may also include a level 2 cache 4002 shared by the processor cores 4000, 4010, and 4020. It is understood that each of the processor cores may use its own corresponding level 2 cache, i.e., the level 2 cache may not be shared. This processor cluster 402 may be in the power domain 401 and the clock domain 400.

[0150] Optionally, when adjusting the voltage and frequency of a processor cluster, the voltage and frequency of the multiple processor cores included in the processor cluster can be adjusted uniformly. When the processor cluster also includes a level 1 cache corresponding to each processor core and a shared (or individually corresponding) level 2 cache, the voltage and frequency of the level 1 cache and the level 2 cache can also be adjusted uniformly.

[0151] Exemplarily, the first controller 4100 can control the frequency generated by the PLL 4400 to a first frequency and send it to the clock domain 400. Taking the processor cluster including multiple processor cores, their corresponding first-level caches, and their shared second-level caches as an example, at this time, the processor cores 4000, 4010, and 4020, and their corresponding first-level caches (including first-level cache 4001, first-level cache 4011, and first-level cache 4021), and their shared second-level cache 4002 operate at a first frequency and are in a first state. The sampler 4200 can collect performance data (e.g., MIPS, IPC, or running score, etc.) of the processor cores 4000, 4010, and 4020 in the first state respectively. It is understandable that since the types of services and the amount of services processed by each processor core may be different, their performance at the same frequency may also be different. Among them, the scheme for implementing frequency control by the first controller 4100 can refer to the relevant description of the first controller 2100 above, and will not be repeated here.

[0152] After the first frequency persists for a period of time, the first controller 4100 can reduce the clock output by the PLL 4400 to a second frequency (for example, the first frequency is greater than the second frequency) and then provide it to the clock domain 300. At this time, the processor core 4000, the processor core 4010, and the processor core 4020, and their corresponding first-level caches (including the first-level cache 4001, the first-level cache 4011, and the first-level cache 4021), and their shared second-level cache 4002 operate at the second frequency and are in the second state. The sampler 4200 can respectively collect performance data (for example, MIPS, IPC, or running score values) of the processor core 4000, the processor core 4010, and the processor core 4020 in the first state, wherein the performance of each processor core at the second frequency can be the same or different. Understandably, after the second frequency persists for a period of time, the first controller 4100 can restore the frequency of the processor cluster 402 from the second frequency to the first frequency, allowing the multiple processor cores to resume operation in the first state. Of course, the first controller 4100 can also further increase the frequency, allowing the multiple processor cores to operate at a frequency greater than the first frequency to achieve higher performance. Alternatively, the first controller 4100 can continue to reduce the frequency from the second frequency to another frequency, and the sampler 3200 can collect performance data of the processing system 1 operating at the other frequency.

[0153] After obtaining performance data for multiple processor cores in different states, sampler 4200 can compare the different performance data for the same processor core and further infer frequency scaling factors for each of the multiple processor cores (including processor core 4000, processor core 4010, and processor core 4020) under the current workload. The description of determining the frequency scaling factors for each processor core can be found in the description of the single processor core scenario (e.g., Formulas 1.1-2.4) above and will not be repeated here.

[0154] The sampler 4200 sends the frequency scaling factors determined for each processor core to the second controller 4300. The second controller 4300 can make frequency and voltage adjustment decisions based on the frequency scaling factors of each processor core, combined with constraint information (such as memory frequency information, L3 cache frequency information, or software configuration policies). For example, the decision can be to increase the voltage and frequency; or to reduce the voltage and frequency; or to keep the voltage and frequency unchanged. It is understandable that when the above-mentioned multiple processor cores, the L1 caches corresponding to the multiple processor cores, and the L2 caches corresponding to the multiple processor cores (shared) are in the same clock domain and the same power domain, their frequency and voltage adjustments can be adjusted uniformly. Because the types and number of services processed by each processor core and its L1 and L2 caches may be different, the frequency scaling factors of the multiple processor cores may also be different. Therefore, when uniformly adjusting their frequencies and voltages, the frequency and voltage adjustment strategies of the multiple processor cores can be comprehensively considered in combination with factors such as service priority, performance priority, or energy efficiency priority. For example, the frequency and voltage adjustment decision of the processor core with the highest service priority and its L1 and L2 caches can be selected, and the frequencies and voltages of other processor cores, other L1 caches and L2 caches can be uniformly adjusted accordingly.

[0155] In summary, the embodiments of the present application can adjust the frequency of the processing system during computer operation so that the processing system can be in different states, and sample and compare the performance of the processing system in different states, so as to determine the frequency scaling factor of the processing system, avoid using complex prediction models or prediction algorithms to predict the frequency scaling factor, and instead clarify the relationship between the performance and frequency changes of the processing system through actual frequency changes and performance changes, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time and accurately, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0156] The above describes the dynamic voltage and frequency adjustment system according to the embodiment of the present application. The following describes the related methods according to the embodiment of the present application.

[0157] Please refer to Figure 5, which is a schematic flow chart of a dynamic voltage-frequency adjustment method provided in an embodiment of the present application. This method can be applied to a terminal device, which can be the terminal device shown in Figure 1a or Figure 1b above. In other words, the terminal device shown in Figure 1a or Figure 1b above can be used to support and execute steps S500 to S502 of the method shown in Figure 5, wherein steps S500 to S502 include the following:

[0158] Step S500: controlling the processing system to be at a target frequency through a first controller, where the target frequency includes at least a first frequency and a second frequency.

[0159] Step S501: sampling the performance of the processing system at the first frequency and the performance at the second frequency through a sampler to obtain a first performance parameter and a second performance parameter; and comparing the first performance parameter and the second performance parameter to obtain a comparison result.

[0160] Step S502: determining the operating frequency and the operating voltage of the processing system based on the comparison result by a second controller, and adjusting the current frequency and voltage of the processing system to the operating frequency and the operating voltage respectively.

[0161] In one possible implementation, determining the operating frequency and the operating voltage of the processing system based on the comparison result, and adjusting the current frequency and voltage of the processing system to the operating frequency and the operating voltage, respectively, includes:

[0162] Obtaining constraint information; the constraint information includes one or more of frequency information of a memory connected to the processing system, frequency information of a level 3 cache connected to the processing system, and a configuration policy of software running on the processing system;

[0163] When the operating frequency and the operating voltage meet the requirements of the constraint information, the current frequency and voltage of the processing system are adjusted to the operating frequency and the operating voltage respectively.

[0164] In a possible implementation, the method further includes:

[0165] When the operating frequency and the operating voltage do not meet the requirements of the constraint information, the operating frequency and the operating voltage are updated according to the constraint information and the comparison result, and the current frequency and voltage of the processing system are adjusted to the updated operating frequency and the updated operating voltage respectively.

[0166] In a possible implementation, the method further includes: comparing the first performance parameter and the second performance parameter to obtain a comparison result, including:

[0167] Comparing the first performance parameter and the second performance parameter to obtain a performance difference or a performance ratio;

[0168] A frequency scaling factor of the processing system is determined based on the frequency difference or frequency ratio, and the performance difference or performance ratio; the frequency scaling factor represents the relationship between the performance change and the frequency change of the processing system; the comparison result includes the frequency scaling factor; the frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

[0169] In a possible implementation, controlling the processing system to operate at a target frequency includes:

[0170] The processing system is controlled to perform time-sharing switching between the first frequency and the second frequency based on pre-configuration information; the pre-configuration information includes a duration of the first frequency and a duration of the second frequency.

[0171] In one possible implementation, the processing system includes one or more of a processor core, a first-level cache, and a second-level cache.

[0172] In a possible implementation, the first performance parameter includes a first operating speed; and the second performance parameter includes a second operating speed.

[0173] For ease of understanding, the process of the dynamic voltage and frequency adjustment method according to the embodiment of the present application is further detailed below. Please refer to FIG6 , which is a schematic diagram of a process of dynamic voltage and frequency adjustment according to the embodiment of the present application, including the following steps:

[0174] S601: The processing system begins to be in a normal operating state (corresponding to a first state, the processing system operates at a first frequency).

[0175] S602: The terminal device determines whether to enter the performance statistics process of the normal operating state (ie, whether to sample the first performance parameter at the first frequency). If yes, then the process goes to S603; if not, then the processing system continues to operate normally.

[0176] S603: The sampler performs performance statistics on the processing system. For example, the sampler accumulates the number of instructions executed by the processing system and the time spent executing the instructions.

[0177] S604: The sampler determines whether the performance statistics time has arrived. If yes, it proceeds to S605; if not, it continues to collect statistics.

[0178] S605: The sampler records the performance data of the processing system in normal operation.

[0179] S606: The terminal device determines whether to enter the performance statistics process of the sampling perception state (corresponding to the second state). If yes, it proceeds to S607; if not, it continues to operate normally.

[0180] S607: The first controller reduces the frequency of the processing system (for example, reduces it to the second frequency. Here, it is taken as an example that the first frequency is greater than the second frequency).

[0181] S608: The sampler performs performance statistics on the processing system. For example, the sampler accumulates the number of instructions executed by the processing system and the time spent executing the instructions.

[0182] S609: The sampler determines whether the performance statistics time has arrived. If yes, it proceeds to S610; if not, it continues to collect statistics.

[0183] S610: The sampling controller records performance data of the processing system in a sampling sensing state.

[0184] S611: The first controller controls the processing system's frequency to return to the first frequency. At this point, the processing system exits the sampling and sensing state and returns to normal operation. Optionally, S611 may be skipped, and the process may proceed directly from S610 to S612. In other words, the processing system may not exit the sampling and sensing state.

[0185] S612: The sampler compares the performance data of the processing system in a normal operating state and in a sampling perception state to obtain a frequency scaling factor.

[0186] S613: The second controller performs voltage and frequency control based on the frequency scaling factor reported by the sampler. For example, the second controller may make a decision based on the frequency scaling factor and various constraints to determine whether to increase the voltage and frequency, decrease the voltage and frequency, or maintain the voltage and frequency.

[0187] The following further describes the timing of the voltage-frequency adjustment process in FIG6. Referring to FIG7, FIG7 is a timing diagram of a dynamic voltage-frequency adjustment provided by an embodiment of the present application, wherein:

[0188] The T001 stage corresponds to steps S601-S606 of FIG6 above, and the processing system is in normal operating state (corresponding to the first state, the processing system operates at the first frequency). The sampler can count and record the performance data of the processing system in normal operating state during this stage.

[0189] The T002 stage corresponds to steps S607-S610 of FIG6 above. The processing system is in a sampling sensing state (corresponding to the second state, the processing system operates at a second frequency). The sampler can count and record the performance data of the processing system in the sampling sensing state during this stage. Optionally, the fast frequency first controller can discard a portion of the clock pulses of the PLL frequency channel output signal through clock gating, which is equivalent to reducing the frequency (taking the first frequency as an example, which is greater than the second frequency), so that the processing system switches from the normal operating state to the sampling sensing state. In the T002 stage, the voltage of the processing system does not need to be adjusted. In other words, when the processing system is in the sampling sensing state, it can maintain a voltage consistent with the normal operating state.

[0190] Phase T003 corresponds to steps S611-S612 of FIG. 6 . The sampling and sensing state ends, and the processing system returns to normal operation. The sampler compares the performance data of the processing system in the normal operation state and the sampling and sensing state to obtain a frequency scaling factor. Optionally, when controlling the processing system to exit the sampling and sensing state, the first controller temporarily disables clock gating and stops discarding clock pulses, causing the frequency to return from the second frequency to the first frequency, and the processing system returns to normal operation from the sampling and sensing state.

[0191] Stage T004 corresponds to step S613 of FIG6 , where the second controller performs voltage-frequency control based on the frequency scaling factor reported by the sampler, for example, reducing the frequency and voltage.

[0192] In summary, in the embodiments of the present application, the frequency of the processing system can be adjusted during the operation of the computer so that the processing system can be in different states, and the performance of the processing system in different states can be sampled and compared, so as to determine the frequency scaling factor of the processing system, avoid using complex prediction models or prediction algorithms to predict the frequency scaling factor, and instead clarify the relationship between the performance and frequency changes of the processing system through actual frequency changes and performance changes, so that the frequency and voltage of the processing system can be adjusted to the operating voltage and operating frequency in real time and accurately, and the processing system can be stabilized in real time at the balance point between performance and energy consumption, thereby improving energy efficiency.

[0193] It should be noted that the relevant description of the dynamic voltage and frequency adjustment method process described in the embodiments of the present application can be found in the relevant description in the above-mentioned device embodiment, and will not be repeated here.

[0194] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the processor executes the computer program code, the computer executes the method in any of the aforementioned embodiments.

[0195] The present application also provides a terminal device, which may be in the form of a chip product. The terminal device includes a processor configured to support the terminal device in implementing the corresponding functions of the method in any of the aforementioned embodiments. The terminal device may also include a memory coupled to the processor and storing program instructions and data necessary for the terminal device. The terminal device may also include a communication interface for communicating with other devices or a communication network.

[0196] An embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the method in any of the aforementioned embodiments.

[0197] An embodiment of the present application provides a chip system, which includes a processor for supporting a device in implementing the functions described in the first aspect, such as generating or processing information used in the dynamic voltage and frequency adjustment method. In one possible design, the chip system also includes a memory for storing program instructions and data necessary for the device. The chip system may consist of a chip or may include a chip and other discrete components.

[0198] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0199] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0200] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0201] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0202] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0203] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to execute all or part of the steps of the above-mentioned methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (ROM) or random access memory (RAM) and other media that can store program codes.

[0204] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A dynamic voltage and frequency adjustment system, It is characterized in that The system comprises: A first controller, configured to control the processing system to be at a target frequency, wherein the target frequency includes at least a first frequency and a second frequency; a sampler, configured to sample the performance of the processing system at the first frequency and the performance of the processing system at the second frequency to obtain a first performance parameter and a second performance parameter; and compare the first performance parameter with the second performance parameter to obtain a comparison result; The second controller is used to determine the operating frequency and the operating voltage of the processing system based on the comparison result, and adjust the current frequency and voltage of the processing system to the operating frequency and the operating voltage respectively.

2. The system according to claim 1, It is characterized in that The second controller is specifically used for: Obtain constraint information; the constraint information includes one or more of frequency information of a memory connected to the processing system, frequency information of a third-level cache connected to the processing system, and a configuration strategy of software running on the processing system; When the operating frequency and the operating voltage meet the requirements of the constraint information, the current frequency and voltage of the processing system are adjusted to the operating frequency and the operating voltage respectively.

3. The system according to claim 2, It is characterized in that The second controller is further configured to: When the operating frequency and the operating voltage do not meet the requirements of the constraint information, the operating frequency and the operating voltage are updated according to the constraint information and the comparison result, and the current frequency and voltage of the processing system are adjusted to the updated operating frequency and the updated operating voltage respectively.

4. The system according to any one of claims 1 to 3, It is characterized in that The sampler is specifically used for: Comparing the first performance parameter with the second performance parameter to obtain a performance difference or a performance ratio; determining a frequency scaling factor for the processing system based on the frequency difference or the frequency ratio and the performance difference or the performance ratio; The frequency scaling factor represents the relationship between the performance change and the frequency change of the processing system; the comparison result includes the frequency scaling factor; The frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

5. The system according to any one of claims 1 to 4, It is characterized in that The first controller is specifically used for: The processing system is controlled to perform time-sharing switching between the first frequency and the second frequency based on pre-configuration information; the pre-configuration information includes a duration of the first frequency and a duration of the second frequency.

6. The system according to any one of claims 1 to 5, It is characterized in that The processing system includes one or more of a processor core, a first-level cache, and a second-level cache.

7. A system as claimed in claims 1 to 6, It is characterized in that The first performance parameter includes a first operating speed, and the second performance parameter includes a second operating speed.

8. A dynamic voltage frequency adjustment method, It is characterized in that The method comprises: Controlling the processing system to be at a target frequency by a first controller, the target frequency comprising at least a first frequency and a second frequency; Sampling the performance of the processing system at the first frequency and the performance of the processing system at the second frequency by a sampler to obtain a first performance parameter and a second performance parameter; and comparing the first performance parameter with the second performance parameter to obtain a comparison result; The operating frequency and the operating voltage of the processing system are determined by the second controller based on the comparison result, and the current frequency and voltage of the processing system are adjusted to the operating frequency and the operating voltage respectively.

9. The method according to claim 8, It is characterized in that The determining the operating frequency and the operating voltage of the processing system based on the comparison result, and adjusting the current frequency and the voltage of the processing system to the operating frequency and the operating voltage respectively, comprises: Obtain constraint information; the constraint information includes one or more of frequency information of a memory connected to the processing system, frequency information of a third-level cache connected to the processing system, and a configuration strategy of software running on the processing system; When the operating frequency and the operating voltage meet the requirements of the constraint information, the current frequency and voltage of the processing system are respectively Adjust to the operating frequency and the operating voltage.

10. The method according to claim 9, It is characterized in that The method further comprises: When the operating frequency and the operating voltage do not meet the requirements of the constraint information, the operating frequency and the operating voltage are updated according to the constraint information and the comparison result, and the current frequency and voltage of the processing system are adjusted to the updated operating frequency and the updated operating voltage respectively.

11. The method according to any one of claims 8 to 10, It is characterized in that The comparing the first performance parameter and the second performance parameter to obtain a comparison result includes: Comparing the first performance parameter with the second performance parameter to obtain a performance difference or a performance ratio; A frequency scaling factor of the processing system is determined based on the frequency difference or the frequency ratio, and the performance difference or the performance ratio; the frequency scaling factor represents the relationship between the performance change and the frequency change of the processing system; the comparison result includes the frequency scaling factor; the frequency difference is the difference between the first frequency and the second frequency, and the frequency ratio is the ratio of the first frequency to the second frequency.

12. The method according to any one of claims 8 to 11, It is characterized in that The controlling the processing system to be at a target frequency includes: The processing system is controlled to perform time-sharing switching between the first frequency and the second frequency based on pre-configuration information; the pre-configuration information includes a duration of the first frequency and a duration of the second frequency.

13. The method according to any one of claims 8 to 12, It is characterized in that The processing system includes one or more of a processor core, a first-level cache, and a second-level cache.

14. The method according to any one of claims 8 to 13, It is characterized in that The first performance parameter includes a first operating speed; the second performance parameter includes a second operating speed.

15. A computer-readable storage medium, It is characterized in that The method comprises instructions which, when executed on a computer, cause the computer to execute the method according to any one of claims 8 to 14.

16. A computer program, It is characterized in that The computer program comprises instructions, and when the computer program is executed by a computer, the computer is caused to perform the method according to any one of claims 8 to 14.

17. A terminal device, It is characterized in that The terminal device comprises a processor and a memory, wherein the memory is used to store program code, and when the program code is executed by the processor, the terminal device implements the method as described in any one of claims 8 to 14.

18. A chip system, It is characterized in that The chip system includes at least one processor, a memory and an interface circuit. The memory, the interface circuit and the at least one processor are interconnected by lines. Instructions are stored in the at least one memory. When the instructions are executed by the processor, the method described in any one of claims 8 to 14 is implemented.

Citation Information

Patent Citations

  • Dynamic voltage frequency adjustment system, related method and storage medium

    CN118534990A

  • Control method and control system for running frequency of terminal device

    CN106527654A

  • GPU dynamic frequency modulation method, device and system

    CN111429333A

  • Dynamic voltage frequency scaling system and method

    CN112292652A

  • Central processing unit (CPU) frequency modulation method and related device

    CN115525439A

Cited By

  • Kernel control method and device and electronic equipment

    CN120179413A

  • Dynamic underclocking protection method and device during overheating of set top box chip

    CN120455749A

  • Dynamic frequency reduction protection method and device for set-top box chip overheating

    CN120455749B

  • Self-adaptive energy consumption control method, system and equipment based on computing power chip and medium

    CN120872128A