CN110647401B - Frequency modulation method, frequency modulation device, storage medium and electronic equipment - Google Patents

Frequency modulation method, frequency modulation device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110647401B
CN110647401B CN201910939771.XA CN201910939771A CN110647401B CN 110647401 B CN110647401 B CN 110647401B CN 201910939771 A CN201910939771 A CN 201910939771A CN 110647401 B CN110647401 B CN 110647401B
Authority
CN
China
Prior art keywords
frequency modulation
task
time
state
operated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910939771.XA
Other languages
Chinese (zh)
Other versions
CN110647401A (en
Inventor
黄志根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201910939771.XA priority Critical patent/CN110647401B/en
Publication of CN110647401A publication Critical patent/CN110647401A/en
Application granted granted Critical
Publication of CN110647401B publication Critical patent/CN110647401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a frequency modulation method, a frequency modulation device, a storage medium and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: responding to the start of operation of a target task in a task group to be operated, and detecting the state of a delayed frequency modulation mode; when the delay frequency modulation mode is in a closed state, calling a native scheduler to perform frequency modulation; when the delay frequency modulation mode is in an on state, detecting the state of the target task after preset delay time; and if the target task is in the running state after the preset delay time, calling a preset real-time frequency modulation thread to modulate frequency. The method can rapidly judge whether frequency modulation is needed or not in the task operation process, immediately modulate the frequency through the real-time frequency modulation thread, solve the problem that the frequency modulation is not matched with the task operation process in the related technology, improve the pertinence and the timeliness of the frequency modulation, and improve the actual acceleration effect on the task operation.

Description

Frequency modulation method, frequency modulation device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a frequency modulation method, a frequency modulation apparatus, a computer-readable storage medium, and an electronic device.
Background
The frequency modulation refers to adjusting the operating frequency of a processor on an electronic device, and includes frequency modulation for a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and the like, so as to improve performance or reduce power consumption.
In the related art, the frequency modulation method mainly includes two methods: the first method is to carry out unified frequency modulation from a system level, and tasks running on a CPU are accelerated (when frequency is increased) or decelerated (when frequency is decreased), obviously, the method has poor pertinence, so that part of tasks which do not need frequency modulation can be also subjected to frequency modulation, and resource waste is caused; the second method is to perform frequency modulation from a task level, and only perform frequency modulation on a task needing frequency modulation, but the related technology has the problem of mismatching between the frequency modulation time and the task operation, so that the task cannot be effectively optimized in frequency modulation.
Therefore, a new frequency modulation method is needed to solve the above technical problems.
It is noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a frequency modulation method, a frequency modulation apparatus, a computer-readable storage medium, and an electronic device, thereby improving the pertinence and timeliness of frequency modulation at least to some extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a frequency modulation method comprising: responding to the start of operation of a target task in a task group to be operated, and detecting the state of a delayed frequency modulation mode; when the delay frequency modulation mode is in a closed state, calling a native scheduler to perform frequency modulation; when the delay frequency modulation mode is in an on state, detecting the state of the target task after preset delay time; and if the target task is in the running state after the preset delay time, calling a preset real-time frequency modulation thread to modulate frequency.
According to a second aspect of the present disclosure, there is provided a frequency modulation apparatus comprising: the mode detection module is used for responding to the starting of the target task in the task group to be operated and detecting the state of the delayed frequency modulation mode; the native frequency modulation module is used for calling a native scheduler to perform frequency modulation when the delay frequency modulation mode is in a closed state; the delay detection module is used for detecting the state of the target task after preset delay time when the delay frequency modulation mode is in an on state; and the real-time frequency modulation module is used for calling a preset real-time frequency modulation thread to modulate frequency if the target task is in the running state after the preset delay time.
According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the frequency modulation method as described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the frequency modulation method described above via execution of the executable instructions.
The technical scheme of the disclosure has the following beneficial effects:
according to the frequency modulation method, the frequency modulation device, the computer readable storage medium and the electronic equipment, the target task in the task group to be operated starts to operate, when the delay frequency modulation mode is in the closed state, the native scheduler is called to carry out frequency modulation, when the delay frequency modulation mode is in the open state, the state of the target task is detected after the preset delay time, and if the delay frequency modulation mode is in the operating state, the preset real-time frequency modulation thread is called to carry out frequency modulation. On the one hand, through setting up delay frequency modulation mode and real-time frequency modulation thread, when the higher task of running performance demand, can be under delay frequency modulation mode, call real-time frequency modulation thread, carry out quick real-time frequency modulation according to the task condition in the operation queue, the time interval that makes frequency modulation and the time interval of task operation coincide basically, thereby solve the unmatched problem of frequency modulation and task operation among the correlation technique, improve the pertinence and the ageing of frequency modulation, improve the actual acceleration effect to the task operation behind the frequency modulation. On the other hand, the preset delay time is set, and whether the target task is finished after the preset delay time for starting to run is detected, so that whether abnormal conditions such as blocking and the like occur or not is judged quickly to determine whether frequency modulation is needed or not. On the other hand, by controlling the on-off state of the delay frequency modulation mode, a frequency modulation mechanism can be switched between the real-time frequency modulation thread and the native scheduler, the real-time frequency modulation thread can realize task-level rapid frequency modulation, and the scheduler can realize resource allocation based on frequency modulation from the aspect of load, so that a proper frequency modulation mode can be selected according to actual requirements, and the flexibility is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is apparent that the drawings in the following description are only some embodiments of the present disclosure, and that other drawings can be obtained from those drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram showing an actual frequency modulation result in the related art;
FIG. 2 shows a flow diagram of a frequency modulation method in the present exemplary embodiment;
FIG. 3 illustrates a sub-flow diagram of a frequency modulation method in the present exemplary embodiment;
fig. 4 shows a schematic diagram of a frequency modulation flow in the present exemplary embodiment;
fig. 5 is a block diagram showing a structure of a frequency modulation apparatus in the present exemplary embodiment;
FIG. 6 illustrates a computer-readable storage medium for implementing the above-described method in the present exemplary embodiment;
fig. 7 shows an electronic device for implementing the above method in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the related art, taking schedule (process Scheduling) native mechanism in EAS (Energy Aware Scheduling, Energy Scheduling policy) as an example, as shown in fig. 1, when a game is running, a game screen needs to be rendered through a rendering thread (Render), and in order to accelerate a rendering process and reduce the pause of the screen, frequency modulation (mainly frequency boosting to improve CPU/GPU performance) needs to be performed. However, in the Schetune native mechanism, whether frequency modulation is performed or not is determined according to the system load condition, and after the rendering thread runs for a period of time, if the system performance cannot meet the requirements of the thread, the system load parameters are reflected, and then frequency modulation is performed. The response time of the process is long, and a more obvious lag problem generally exists, and the actual frequency raising interval in fig. 1 is always later than the interval in which the rendering thread runs, so that the actual acceleration effect of the rendering thread is influenced.
In view of one or more of the above problems, exemplary embodiments of the present disclosure first provide a frequency modulation method, which may be applied to various electronic devices such as a computer, a smart phone, a tablet computer, and the like. Fig. 2 shows a flow of the method, which may include the following steps S210 to S240:
and step S210, responding to the start of the target task, and detecting the state of the delayed frequency modulation mode.
The task Group to be operated is a task Group formed by a plurality of tasks to be operated, for example, in an Android system, the task Group to be operated may be a Boost Group; the target task may be any task in the group of tasks to be run (but typically not the last task in the group of tasks). The delay frequency modulation mode is a frequency modulation mode added in the present exemplary embodiment, and unlike the native frequency modulation mode, fast real-time frequency modulation can be realized. The system may be provided with a switch for turning On or Off the delay frequency modulation mode, or a state variable of the delay frequency modulation mode, for example, a delayed Boost variable is set, and when the delayed Boost value is On, it indicates that the delay frequency modulation mode is turned On, and when the delayed Boost value is Off, it indicates that the delay frequency modulation mode is turned Off.
Several embodiments are provided below as to how to control the state of the delayed chirp mode, but the following should not be construed as limiting the scope of the present disclosure:
(1) the status of the delay modulation mode can be manually controlled, for example, an option related to the delay modulation mode is added in the system setting, so that the user can customize the delay modulation mode to be switched on or switched off.
(2) The status of the delayed fm mode may be associated with a specific program, for example, when the system runs a program such as a large game or graphics processing software that requires high processing performance, the delayed fm mode may be automatically turned on, and when the program is turned off, the delayed fm mode may be automatically turned off. Based on this, in one embodiment, as shown with reference to fig. 3, the delayed chirp mode may be turned on through the following steps S310 and S320:
step S310, when generating a task group to be operated, acquiring a program to which tasks in the task group to be operated belong;
step S320, if the program to which the task in the task group to be executed belongs includes a preset program, the delay frequency modulation mode is started.
The preset program is a predetermined program that requires a delayed fm mode, such as the above-mentioned large game or graphics processing software. Therefore, when each task group to be operated is generated, if the tasks comprise the tasks under the preset program, the delay frequency modulation mode can be started if the preset program is currently operated or is about to be operated. Further, if the program to which the task in the task group to be executed belongs includes a preset program, the task group to be executed may be marked as a fast frequency modulation task group, and when all the fast frequency modulation task groups in the system are finished to run, that is, when the task group currently running in the system does not include a fast frequency modulation task group, the delayed frequency modulation mode may be closed. The switch of the delay frequency modulation mode is controlled by the task group, so that the pertinence can be improved.
Furthermore, the state of the delay frequency modulation mode may be associated with a specific event, for example, when an event such as Activity switching or touch screen clicking occurs, the delay frequency modulation mode may be automatically activated.
(3) The state of the delay frequency modulation mode can also be controlled according to the load condition of the system, for example, the delay frequency modulation mode is turned on when the system load is higher or the number of running processes or threads is larger, or the delay frequency modulation mode is turned off when the device temperature is higher.
It should be noted that any combination of the above manners may be adopted to control the on or off of the delay modulation mode.
In step S220, when the delay modulation mode is in the off state, the native scheduler is invoked to perform frequency modulation.
The native scheduler may perform frequency modulation through a native mechanism. Specifically, the scheduler may obtain a load parameter of the task group to be operated, perform uniform scheduling on the system resource according to the load parameter, determine a frequency modulation parameter, and perform frequency modulation.
In an optional implementation manner, step S220 may specifically include: and calling a native scheduler to update the global load parameter according to the load parameter of the task group to be operated, and carrying out frequency modulation according to the global load parameter. For example, the scheduler may obtain a Boost parameter of a task group to be run, update the global load parameter Utility by integrating the conditions of other tasks, and calculate the required CPU/GPU frequency according to the Utility, thereby performing frequency modulation. Therefore, the process needs certain processing and response time, and frequency modulation cannot be immediately realized.
In step S230, when the delay modulation mode is in the on state, the state of the target task is detected after a preset delay time.
The preset delay time is a time parameter set for detecting whether the operation of the target task is abnormal, and may be a time required for normal operation of the target task (a certain margin may be set). For example, the time when the target task starts to run is T0, the preset delay time is Tw, the state of the target task is detected at time T0+ Tw, whether the target task is finished running or not is mainly detected, the target task should be finished running at this time in a normal case, and if the target task is still in a running state, the running speed is slower than an expected level, and a stuck situation may exist.
In an optional implementation manner, a Timer may be set, the time of the Timer is set to a preset delay time, when the target task starts to run, the Timer is triggered to start timing, and when the preset delay time is reached, the state of the target task is detected.
And step S240, if the target task is in the running state after the delay time is preset, calling a preset real-time frequency modulation thread to modulate frequency.
From the above, the target task is still in the running state after the preset delay time. And (3) the abnormal conditions such as jamming and the like possibly occur during the running of the target task, frequency modulation is required to be immediately carried out, the running is improved, and a real-time frequency modulation thread can be called. In the present exemplary embodiment, the real-time frequency modulation thread is a thread for fast frequency modulation set based on the delayed frequency modulation mode, and the principle is to read the task conditions in the running queue, determine parameters such as the degree and time of frequency modulation according to the task conditions, and immediately perform frequency modulation. And when the delay frequency modulation mode is started, calling the real-time frequency modulation thread to perform frequency modulation. Specifically, because the target task runs in the running queue at this time, the real-time frequency modulation thread may read information of the task to perform frequency modulation, and if the running queue further includes other tasks requiring frequency modulation, the real-time frequency modulation thread may also read information of the tasks to perform frequency modulation. Taking the target task as the task a in the task group to be operated as an example, the real-time frequency modulation thread reads the information of the task a, and determines that the task a is allocated to the CPU #1 to operate, so that the frequency of the CPU #1 can be correspondingly increased.
Based on the above, in the exemplary embodiment, in response to the target task in the task group to be executed starting to run, when the delayed frequency modulation mode is in the off state, the native scheduler is called to perform frequency modulation, when the delayed frequency modulation mode is in the on state, the state of the target task is detected after the preset delay time, and if the delayed frequency modulation mode is in the running state, the preset real-time frequency modulation thread is called to perform frequency modulation. On the one hand, by setting the delay frequency modulation mode and the real-time frequency modulation thread, when a task with higher operation performance requirement is operated, the real-time frequency modulation thread can be called in the delay frequency modulation mode, and the quick real-time frequency modulation is carried out according to the task condition in the operation queue, so that the time interval of the frequency modulation is basically coincided with the time interval of the task operation, the problem that the frequency modulation is not matched with the task operation in the related technology is solved, the pertinence and the timeliness of the frequency modulation are improved, and the actual acceleration effect of the task operation after the frequency modulation is improved. On the other hand, the preset delay time is set, and whether the target task finishes running or not is detected after the preset delay time for starting running is reached, so that whether abnormal conditions such as jamming occur or not is judged quickly to determine whether frequency modulation is needed or not. On the other hand, by controlling the on-off state of the delay frequency modulation mode, a frequency modulation mechanism can be switched between the real-time frequency modulation thread and the native scheduler, the real-time frequency modulation thread can realize task-level fast frequency modulation, and the scheduler can realize resource allocation based on frequency modulation from the perspective of load, so that a proper frequency modulation mode can be selected according to actual requirements, and higher flexibility is achieved.
As can be seen from the above, the present exemplary embodiment actually performs control of frequency modulation in units of task groups. Considering that some task groups have higher requirements on processing performance and need frequency modulation, and some task groups have lower requirements on processing performance and do not need frequency modulation. In an alternative embodiment, before step S210, the following steps may be performed:
when a task group to be operated is generated, acquiring load parameters of the task group to be operated;
determining whether frequency modulation is needed according to the load parameters;
when it is determined that frequency modulation is required, step S210 is performed.
The load parameter is one or more index parameters reflecting how much system resources are occupied by the task group to be run, or the performance requirement is high or low, such as occupancy rate of CPU, data amount run in unit time, and the like. When generating the task group to be run, the load parameter can be estimated through historical running data because the tasks in the task group are not actually run, or calculated through distributed and determined parameters such as the number of threads and the like. According to the load parameters of the task group to be operated, whether frequency modulation is needed when the task group to be operated operates can be determined, specifically, frequency modulation is needed when the load parameters are high, or frequency modulation is needed when the residual resources of the current system are not enough to support the load of the task group to be operated, and the like. When the frequency modulation is determined to be needed, monitoring the state of a task group to be operated, and when a target task starts to operate, performing frequency modulation by adopting the method steps shown in FIG. 2; when it is determined that frequency modulation is not required, the tasks therein may be normally operated at the current processor frequency.
Further, determining whether frequency modulation is needed according to the load parameter may be specifically implemented by the following method:
calculating the maximum acceleration value of the task group to be operated according to the load parameters;
and when the maximum acceleration value is higher than a preset value, determining that frequency modulation is needed.
The maximum acceleration value is a measure of the maximum acceleration degree required during the running of the task group to be run, and may be, for example, a Boost Max value in an Android system, and the maximum acceleration value is calculated by calculating an average acceleration value through a load parameter and by adding an amplitude value to the average acceleration value through estimation of a peak value condition of the task group to be run on the basis of the average acceleration value. The maximum acceleration value has the property of estimation and prediction, and in order to smoothly run the task, a certain margin can be reserved when the maximum acceleration value is calculated, for example, an amplitude value is obtained by adding a certain margin to the peak value of the task group to be run, and the maximum acceleration value is calculated according to the margin, so that the performance requirement of the task can be met. The preset value is a measure of the normal operation capability of the system, can be set according to system hardware conditions, historical operation data, empirical values and the like, and can be regarded as a threshold value for measuring whether acceleration is needed or not. By calculating the maximum acceleration value and comparing the maximum acceleration value with the preset value, the running condition of the task group to be run can be accurately estimated to determine whether frequency modulation is needed or not, so that the condition of frequency modulation when frequency modulation is not needed is reduced, and the use efficiency of system resources is improved.
In an alternative embodiment, the target task may be a first task in the group of tasks to be run; starting to run a target task in the task group to be run may include: and the first task in the task group to be run enters the running queue. By the mode, whether the abnormality such as blockage exists or not is determined when the first task of the task group to be operated runs, so that real-time frequency modulation is carried out under the abnormal condition, and the normal running of the subsequent tasks can be ensured.
Further, after the preset real-time frequency modulation thread is called for frequency modulation, when the last task of the task group to be operated is finished, the real-time frequency modulation thread can be closed. Before the real-time frequency modulation thread is closed, the running frequency of the processor can be restored. And when the operation of the last task is finished, indicating that the operation of the task group to be operated is finished, and closing the real-time frequency modulation thread without performing frequency modulation. In other words, in the case that frequency modulation is not normally required, the real-time frequency modulation thread is in an off or sleep state, and subsequently, if other task groups requiring frequency modulation are generated and the delay frequency modulation mode is in an on state, the real-time frequency modulation thread may be started again.
In an alternative embodiment, the target task may be a thread running periodically, and the preset delay time may be a running time of the thread in each cycle. For example, under normal conditions, the target task runs for a time Tw in each period, when the target task runs in the first period, the preset delay time is set to Tw, whether the target task runs on the card pause or not is determined by detecting the running state of the target task after the time Tw, if the target task runs on the card pause, frequency modulation is immediately carried out, and the target task can be guaranteed to run normally in the subsequent period.
Further, the thread may be a rendering thread of consecutive frames, and the preset delay time may be a time of each frame. For example, when a game is executed, a game screen is rendered frame by frame, and assuming that the frame rate is 50fps, that is, the time per frame is 20ms, the preset delay time may be set to 20 ms. When each frame starts to be rendered, 20ms is delayed to detect whether the rendering of the frame is completed or not, if the frame is still being rendered, the operation of a rendering thread is blocked, and at the moment, optimization and acceleration are performed in a frequency modulation mode, so that the rendering speed of a subsequent frame can be ensured.
Fig. 4 shows a schematic diagram of a frequency modulation process. The Task Group to be operated comprises n tasks, namely Task1, Task2, … and Task. When the first Task1 starts to run, the system detects the value of the current transferred Boost variable, and the following processes are respectively carried out:
if the value of the delayed Boost variable is On when the Task1 starts to run, indicating that the delay frequency modulation mode is in an opening state, detecting whether the Task1 is still in a running state after a preset delay time Tw; if the Task1 is still in the running state after Tw, it indicates that a stuck occurs, and a real-time frequency modulation thread is called to modulate the frequency of the corresponding CPU according to the situation of the Boost Group, for example, if the Task runs on the CPU2, the real-time frequency modulation thread adjusts the frequency of the CPU2, usually increasing the running frequency to improve the performance; during the operation period of the Boost Group, if the value of the delayed Boost variable is not changed, namely the value is always kept to be On, the real-time frequency modulation thread can continuously perform frequency modulation, and dynamic frequency modulation can be performed according to the real-time load condition.
If the value of the delayed Boost variable is detected to be Off when the Task1 starts to run, the delayed frequency modulation mode is indicated to be in a closed state, or although the value of the delayed Boost variable is On, the Task1 is detected to be already run after Tw, which indicates that the real-time frequency modulation is not needed, and a native frequency modulation mechanism can be adopted in both cases. Specifically, the maximum acceleration value Boost Max of the Boost Group can be calculated, the scheduler is called to update the global load parameter Utility according to the Boost Max value, and then the frequency modulation is performed on the CPU.
When the operation of the last task is finished, the current value of the delayed Boost variable is detected, if the value of the delayed Boost variable is On, a real-time frequency modulation thread is called to restore the CPU to the normal frequency, and if the value of the delayed Boost variable is Off, a scheduler is called to restore the CPU to the normal frequency by calculating Utility.
It needs to be supplemented that, during the operation of the Boost Group, after the real-time frequency modulation thread is called to increase the CPU frequency, if the value of the delayed Boost variable is modified to Off, the delayed frequency modulation mode is closed, and when the operation of the Boost Group is finished, the CPU frequency can be recovered through the scheduler; the opposite situation is also established, after the CPU frequency is improved by calling the scheduler, if the value of the delayed Boost variable is modified to be On, the delayed frequency modulation mode is started, and when the operation of the Boost Group is finished, the CPU frequency can be recovered through the real-time frequency modulation thread; that is, in the primary frequency modulation, the frequency up and down may be realized by different frequency modulation mechanisms, which is not limited in this disclosure.
Exemplary embodiments of the present disclosure also provide a frequency modulation apparatus, as shown in fig. 5, the frequency modulation apparatus 500 may include: a mode detection module 510, configured to detect a state of a delayed frequency modulation mode in response to a start of operation of a target task in a task group to be operated; a native frequency modulation module 520, configured to call a native scheduler to perform frequency modulation when the delay frequency modulation mode is in an off state; a delay detection module 530, configured to detect a state of the target task after a preset delay time when the delay frequency modulation mode is in an on state; and the real-time frequency modulation module 540 is configured to, if the target task is in the running state after the preset delay time, invoke a preset real-time frequency modulation thread to perform frequency modulation.
In an alternative embodiment, the target task may be a first task in the group of tasks to be run; the mode detection module 510 may be further configured to detect a status of the delayed frequency modulation mode in response to a first task of the group of tasks to be executed entering the run queue.
Further, the real-time frequency modulation module 540 may be further configured to close the real-time frequency modulation thread when the operation of the last task of the task group to be operated is finished.
In an alternative embodiment, the target task may be a thread running periodically, and the preset delay time may be a running time of the thread in each cycle.
Further, the thread may include a rendering thread of consecutive frames, and the preset delay time may be a time of each frame.
In an alternative embodiment, the frequency modulation apparatus 500 may further include: and the mode control module is used for acquiring a program to which the tasks in the task group to be operated belong when the task group to be operated is generated, and starting the delayed frequency modulation mode if the program to which the tasks in the task group to be operated belong comprises a preset program.
In an optional implementation manner, the native frequency modulation module 520 may be further configured to invoke a native scheduler to update the global load parameter according to the load parameter of the task group to be executed, and perform frequency modulation according to the global load parameter.
The specific details of each module in the above apparatus have been described in detail in the method section, and details that are not disclosed may refer to the method section, and thus are not described again.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing an electronic device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the electronic device.
Referring to fig. 6, a program product 600 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The exemplary embodiment of the present disclosure also provides an electronic device capable of implementing the above method. An electronic device 700 according to this exemplary embodiment of the present disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may take the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, a bus 730 that couples various system components including the memory unit 720 and the processing unit 710, and a display unit 740.
The memory unit 720 stores program code that may be executed by the processing unit 710 to cause the processing unit 710 to perform steps according to various exemplary embodiments of the present disclosure as described in the "exemplary methods" section above in this specification. For example, the processing unit 710 may perform the method steps shown in fig. 2 or fig. 3.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)721 and/or a cache memory unit 722, and may further include a read only memory unit (ROM) 723.
The memory unit 720 may also include programs/utilities 724 having a set (at least one) of program modules 725, such program modules 725 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. As shown, the network adapter 760 communicates with the other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, according to exemplary embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (10)

1. A method of frequency modulation, comprising:
responding to the start of operation of a target task in a task group to be operated, and detecting the state of a delayed frequency modulation mode;
when the delay frequency modulation mode is in a closed state, calling a native scheduler to update a global load parameter according to the load parameter of the task group to be operated, and carrying out frequency modulation according to the global load parameter;
when the delay frequency modulation mode is in an on state, detecting the state of the target task after preset delay time; the preset delay time is greater than or equal to the time required by the normal operation of the target task;
and if the target task is in the running state after the preset delay time, calling a preset real-time frequency modulation thread to modulate frequency.
2. The method of claim 1, wherein the target task is a first task in the group of tasks to be run;
the method for starting to run the target task in the task group to be run comprises the following steps:
and the first task in the task group to be run enters a running queue.
3. The method of claim 2, wherein after invoking the preset real-time frequency modulation thread for frequency modulation, the method further comprises:
and when the operation of the last task in the task group to be operated is finished, closing the real-time frequency modulation thread.
4. The method of claim 1, wherein the target task comprises a periodically running thread; the preset delay time is the running time of the thread in each period.
5. The method of claim 4, wherein the thread comprises a rendering thread of consecutive frames, and wherein the preset delay time is a time of each frame.
6. The method of claim 1, further comprising:
when the task group to be operated is generated, acquiring a program to which tasks in the task group to be operated belong;
and if the program to which the tasks in the task group to be operated belong comprises a preset program, starting the delay frequency modulation mode.
7. The method of claim 1, further comprising:
when the task group to be operated is generated, acquiring load parameters of the task group to be operated;
and determining whether frequency modulation is needed or not according to the load parameters, and when the frequency modulation is determined to be needed, executing the operation of starting responding to the target task in the task group to be operated, and detecting the state of a delayed frequency modulation mode.
8. A frequency modulation apparatus, comprising:
the mode detection module is used for responding to the starting of the target tasks in the task group to be operated and detecting the state of the delay frequency modulation mode;
the native frequency modulation module is used for calling a native scheduler to update a global load parameter according to the load parameter of the task group to be operated and carrying out frequency modulation according to the global load parameter when the delay frequency modulation mode is in a closed state;
the delay detection module is used for detecting the state of the target task after preset delay time when the delay frequency modulation mode is in an on state; the preset delay time is greater than or equal to the time required by the normal operation of the target task;
and the real-time frequency modulation module is used for calling a preset real-time frequency modulation thread to modulate frequency if the target task is in the running state after the preset delay time.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1 to 7 via execution of the executable instructions.
CN201910939771.XA 2019-09-30 2019-09-30 Frequency modulation method, frequency modulation device, storage medium and electronic equipment Active CN110647401B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910939771.XA CN110647401B (en) 2019-09-30 2019-09-30 Frequency modulation method, frequency modulation device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910939771.XA CN110647401B (en) 2019-09-30 2019-09-30 Frequency modulation method, frequency modulation device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110647401A CN110647401A (en) 2020-01-03
CN110647401B true CN110647401B (en) 2022-07-08

Family

ID=69012009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910939771.XA Active CN110647401B (en) 2019-09-30 2019-09-30 Frequency modulation method, frequency modulation device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110647401B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342665B (en) * 2021-06-17 2023-10-20 北京百度网讯科技有限公司 Task allocation method and device, electronic equipment and computer readable medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0105241A2 (en) * 1982-09-30 1984-04-11 Kabushiki Kaisha Toshiba Computer system for preventing copying of program
CN101699368A (en) * 2009-11-02 2010-04-28 中兴通讯股份有限公司 Method and device for adaptive dynamic frequency or voltage adjustment of CPU
CN102866921A (en) * 2012-08-29 2013-01-09 惠州Tcl移动通信有限公司 Method and system for regulating and controlling multi-core central processing unit (CPU)
TW201403299A (en) * 2012-07-04 2014-01-16 Acer Inc Central processor control method
CN104731304A (en) * 2015-03-20 2015-06-24 广东欧珀移动通信有限公司 Adjusting method and device for CPU frequency adjustment mode in terminal
CN104768208A (en) * 2015-03-17 2015-07-08 广东欧珀移动通信有限公司 Frequency modulation mode switching method and mobile terminal
CN104991830A (en) * 2015-07-10 2015-10-21 山东大学 YARN resource allocation and energy-saving scheduling method and system based on service level agreement
CN105045369A (en) * 2015-06-19 2015-11-11 北京大学深圳研究生院 Dynamic CPU frequency adjustment method based on historical user-interaction information
CN105867582A (en) * 2015-12-31 2016-08-17 乐视移动智能信息技术(北京)有限公司 Frequency modulation parameter adjustment method and apparatus, frequency modulator, and mobile terminal
CN106598200A (en) * 2016-12-08 2017-04-26 武汉斗鱼网络科技有限公司 Temperature-based CPU dynamic frequency modulation apparatus and method
CN109960584A (en) * 2019-01-30 2019-07-02 努比亚技术有限公司 CPU frequency modulation control method, terminal and computer readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0105241A2 (en) * 1982-09-30 1984-04-11 Kabushiki Kaisha Toshiba Computer system for preventing copying of program
CN101699368A (en) * 2009-11-02 2010-04-28 中兴通讯股份有限公司 Method and device for adaptive dynamic frequency or voltage adjustment of CPU
TW201403299A (en) * 2012-07-04 2014-01-16 Acer Inc Central processor control method
CN102866921A (en) * 2012-08-29 2013-01-09 惠州Tcl移动通信有限公司 Method and system for regulating and controlling multi-core central processing unit (CPU)
CN104768208A (en) * 2015-03-17 2015-07-08 广东欧珀移动通信有限公司 Frequency modulation mode switching method and mobile terminal
CN104731304A (en) * 2015-03-20 2015-06-24 广东欧珀移动通信有限公司 Adjusting method and device for CPU frequency adjustment mode in terminal
CN105045369A (en) * 2015-06-19 2015-11-11 北京大学深圳研究生院 Dynamic CPU frequency adjustment method based on historical user-interaction information
CN104991830A (en) * 2015-07-10 2015-10-21 山东大学 YARN resource allocation and energy-saving scheduling method and system based on service level agreement
CN105867582A (en) * 2015-12-31 2016-08-17 乐视移动智能信息技术(北京)有限公司 Frequency modulation parameter adjustment method and apparatus, frequency modulator, and mobile terminal
CN106598200A (en) * 2016-12-08 2017-04-26 武汉斗鱼网络科技有限公司 Temperature-based CPU dynamic frequency modulation apparatus and method
CN109960584A (en) * 2019-01-30 2019-07-02 努比亚技术有限公司 CPU frequency modulation control method, terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN110647401A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
US10191772B2 (en) Dynamic resource configuration based on context
KR101864980B1 (en) Virtual machine power management
US8364997B2 (en) Virtual-CPU based frequency and voltage scaling
CN102789305B (en) Postponing suspend
KR102490908B1 (en) Resource scheduling method and terminal device
WO2017014913A1 (en) Systems and methods for scheduling tasks in a heterogeneous processor cluster architecture using cache demand monitoring
JP2004164643A (en) Execution level setting in data processing system
US20160077571A1 (en) Heuristic Processor Power Management in Operating Systems
US9817696B2 (en) Low latency scheduling on simultaneous multi-threading cores
CN110795238B (en) Load calculation method and device, storage medium and electronic equipment
EP2972826B1 (en) Multi-core binary translation task processing
US20120254822A1 (en) Processing optimization load adjustment
CN110673958B (en) Frequency modulation method, frequency modulation device, storage medium and electronic equipment
US20230127112A1 (en) Sub-idle thread priority class
US10025372B2 (en) Techniques for managing system power using deferred graphics rendering
US10275007B2 (en) Performance management for a multiple-CPU platform
CN110647401B (en) Frequency modulation method, frequency modulation device, storage medium and electronic equipment
CN108415765B (en) Task scheduling method and device and intelligent terminal
CN108241522B (en) Sleep state switching method and device in virtualization environment and electronic equipment
WO2016204876A1 (en) Virtual machine management method and apparatus including idling and scheduling of virtual processors
CN115080237A (en) Performance adjusting method, computer equipment and storage medium
WO2022039744A1 (en) Temperature control of computing device
CN114253683B (en) Task processing method and device, electronic equipment and storage medium
CN114003367B (en) Risk monitoring method, device, equipment and storage medium
CN116795538A (en) Compiling process management method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant