WO2017206852A1 - 处理器计算资源的分配方法、装置及终端 - Google Patents

处理器计算资源的分配方法、装置及终端 Download PDF

Info

Publication number
WO2017206852A1
WO2017206852A1 PCT/CN2017/086447 CN2017086447W WO2017206852A1 WO 2017206852 A1 WO2017206852 A1 WO 2017206852A1 CN 2017086447 W CN2017086447 W CN 2017086447W WO 2017206852 A1 WO2017206852 A1 WO 2017206852A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
frequency
core
processor core
load
Prior art date
Application number
PCT/CN2017/086447
Other languages
English (en)
French (fr)
Inventor
曾元清
Original Assignee
广东欧珀移动通信有限公司
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 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Priority to EP17805797.2A priority Critical patent/EP3467651B1/en
Publication of WO2017206852A1 publication Critical patent/WO2017206852A1/zh
Priority to US16/110,319 priority patent/US10740154B2/en
Priority to US16/245,236 priority patent/US10664318B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • 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]
    • 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/5094Allocation of resources, e.g. of the central processing unit [CPU] where the allocation takes into account power or heat criteria
    • 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

Definitions

  • the present invention relates to the field of terminals, and in particular, to a method, an apparatus, and a terminal for allocating processor computing resources.
  • multi-core technology has become an important direction for the development of today's processors.
  • the multi-core processor technology can greatly improve the performance of the system by maintaining the same frequency by means of mutual assistance of multiple processing cores.
  • a first aspect of the embodiments of the present invention provides a method for allocating a computing resource of a processor, including:
  • Obtaining a power value of the a priori processor core at a specific frequency value determining a number of processor cores and a frequency value of each processor core according to a power value of the a priori processor core at a specific frequency value, such that each The sum of the frequency values of the processor cores conforms to the computing resources and minimizes the sum of the power values of each of the processor cores.
  • a second aspect of the embodiments of the present invention provides a processor computing resource allocation apparatus, including:
  • a processor load detection module for detecting a current processor load
  • a required computing resource calculation module configured to determine a required computing resource according to the processor load, where the computing resource includes a sum of frequency values of each processor core;
  • a processor core combination determining module for obtaining a work of a priori processor core at a specific frequency value Rate value, determining the number of processor cores and the frequency value of each processor core according to the power value of the a priori processor core at a specific frequency value, such that the sum of the frequency values of each processor core conforms to the calculation Resources and minimize the sum of the power values of each of the processor cores.
  • a third aspect of the embodiments of the present invention provides a terminal, including: a processor and a memory, where the processor is configured to store a computer program, where the processor is configured to execute a computer program stored in the memory to perform:
  • Obtaining a power value of the a priori processor core at a specific frequency value determining a number of processor cores and a frequency value of each processor core according to a power value of the a priori processor core at a specific frequency value, such that each The sum of the frequency values of the processor cores conforms to the computing resources and minimizes the sum of the power values of each of the processor cores.
  • the operating processor core is within the range of the processor resources allowed by the system.
  • the quantity and the frequency are optimized, that is, according to different combinations of the number of processors and the frequency, corresponding to different power consumption parameters, in order to satisfy the performance requirements, the power consumption optimal result is obtained, that is, the number of processors running and the number of processors are determined.
  • Frequency that is to say, after the above-mentioned processor computing resource allocation method and device, the power consumption of the terminal is reduced under the premise of ensuring the performance of the display thread.
  • FIG. 1 is a schematic flow chart of a method for allocating computing resources of a processor in an embodiment
  • FIG. 2 is a schematic structural diagram of a processor computing resource allocation apparatus in an embodiment
  • FIG. 3 is a schematic structural diagram of a computer device for operating a method for allocating a computing resource of the foregoing processor in an embodiment.
  • a method for allocating a computing resource of a processor is proposed, and the implementation of the method may depend on a computer program, which may run on a computer system based on a von Neumann system, the computer program It can be a processor control application for the terminal of a multi-core processor.
  • the computer system may be a terminal device such as a smart phone, a tablet computer, a personal computer or the like that runs the above computer program.
  • the terminal mentioned in the embodiment of the present invention may be a smart phone, a tablet personal computer, a vehicle terminal, a computer, or the like.
  • the load difference corresponding to different foreground applications will be very large, such as very lightweight playing music, moderate load.
  • the number of CPUs or GPUs and frequency resources required for large photos, web pages, and heavy-duty games are quite different.
  • a large number of background applications are also running in the terminal, which also requires a certain amount of background applications. Processor resources.
  • the frequency regulator is responsible for the frequency hopping voltage regulation operation of the core
  • the hot swap control module is responsible for
  • the processing method is mainly to periodically preset the load according to the current processing and the running frequency and the changing direction, or to determine the switching of each processing core according to the number of tasks running per unit time;
  • the frequency regulator and the hot-swap control module are difficult to distinguish the different load requirements of the anterior-posterior application, and the processor resource allocation cannot be accurately controlled according to the load.
  • the processor cannot distinguish the different load requirements of the application of the front-rear path, and cannot accurately control the allocation of the processor resources according to the load, which makes the processor
  • the load may be overloaded.
  • the processor's processing power is insufficient and the card may be stuck. Or the processor's load may be too light.
  • Some of the processor's cores may be in an "idle" state and cause unnecessary. The power is wasted.
  • the method for allocating the computing resources of the processor includes the following steps S102-S108, specifically:
  • Step S102 Detect the current processor load.
  • the processor mentioned may be a central processing unit (CPU), a graphics processing unit (GPU), and a micro controller unit (Micro Controller Unit, A combination of one or more of MCUs.
  • the processor in this embodiment may be a Symmetrical Multi-Processing (SMP) or an Asymmetric Multi-Processing (AMP).
  • SMP Symmetrical Multi-Processing
  • AMP Asymmetric Multi-Processing
  • the load of the processor depends on the number of processes that the current processor is processing and waiting for the processor to process. Generally speaking, the larger the load, the more processing resources are occupied in the processor, that is, the remaining processing power is smaller.
  • the processor load of each processor core in the current state is respectively acquired.
  • Step S104 Determine required computing resources according to the processor load, where the computing resources include a sum of frequency values of each processor core.
  • the computing resource refers to the operating frequency corresponding to the processor core, and the limit computing resource of the processor core is the maximum operating frequency value of the processor core running.
  • the limit computing resource of the processor core is the maximum operating frequency value of the processor core running.
  • the operating frequency corresponding to each processor load is determined, and then the sum of the operating frequencies corresponding to the processor loads of all the processors is calculated, and the sum of the operating frequencies is all
  • the computing resources required by the processor load that is, the computing resources allocated by the processor core to the terminal required by the current process or task of the processing terminal.
  • Step S106 Acquire a power value of the a priori processor core at a specific frequency value, and determine the number of processor cores and the frequency value of each processor core according to the power value of the a priori processor core at a specific frequency value. The sum of the frequency values of each processor core is made to conform to the computing resources and the sum of the power values of each of the processor cores is minimized.
  • the power value of the processor at different operating frequency values is obtained in advance, that is, the correspondence between the operating frequency and the power value of the processor is determined.
  • the corresponding relationship may be The experimental values provided by the manufacturer can also be obtained in advance by the terminal.
  • the operating frequency of the processor is not proportional to the power value, but is closer to the exponential relationship, that is, the power value increases exponentially with the increase of the operating frequency.
  • the number of processor cores and the frequency value of each processor core can be determined according to the correspondence. For example, when the computing resource corresponding to the processor load is 4G, and the number of available processor cores is 4, and the maximum calculation amount of each processor core is 4G, the following 4 processes can be given for the above 4G requirements.
  • the two processors operate at a running frequency of 2G;
  • the three processors operate at a running frequency of 4/3G;
  • the fourth, four processors run at a running frequency of 1G.
  • the running quantity and running frequency of the above four kinds of processors can satisfy the current load of the terminal, that is, the overall processing capability of the processor is sufficient, but for the above various combinations, which one is selected depends on the combination mode.
  • the specific power consumption size. The last chosen combination is that the sum of the power values of each processor core is the smallest in this combination, that is, the number of processor runs and the operating frequency that minimizes processor power consumption are selected.
  • the operating frequencies of each processor may be consistent or different from each other.
  • the minimum number of processors corresponding to the load can be calculated according to the following formula:
  • Nc_min [(Lc+100)/100].
  • the maximum frequency value of the processor core, Fx represents the frequency value assigned to the processor core, and the combination of different processors and operating frequencies can be determined by the values of Nc_x and Fx.
  • determining the power value of the processor core at a specific frequency value according to the a priori may be based on the power value of the a priori processor core at a specific frequency value, that is, according to the correspondence between the specific frequency value of the processor and the power value. Determining a frequency allocation policy that satisfies the above computing resources, that is, the sum of the operating frequencies allocated by all the processors satisfies the specific value of the computing resource calculated in the foregoing step S104, and on this basis, selects the frequency with the smallest sum of the power values. Assignment strategy.
  • the sum of the power values under each frequency allocation strategy may be calculated, and the minimum value thereof is determined according to the sum of the calculated power values, and the frequency allocation strategy corresponding to the minimum value is selected.
  • the number of processors running and the operating frequency under the frequency allocation strategy thus obtained can obtain the frequency allocation strategy of the lowest power consumption level while satisfying the current load demand of the system.
  • the method further includes: if the minimum number of required processor cores determined by the current processor load is 1, if there is no foreground user operation, The load is then set to a single processor core.
  • the single-core processor mode has less standby current than the dual-core, multi-core processor mode, so the terminal's load can be set to a single processor core, if circumstances permit.
  • the requirement is that all current processor loads can be carried out by a single processor, that is, into a single processor core mode, for example, when the processor is a CPU, entering a single CPU mode.
  • the current of the terminal in the standby state can be significantly reduced.
  • the number and frequency of processor cores running in the processor are determined according to the foregoing steps, and then the terminal needs to determine the number of processor cores running in the processor and the frequency pair.
  • the processor of the terminal performs related settings.
  • the frequency governor is responsible for the frequency hopping voltage regulation operation of the kernel
  • the hot swap control module (CPU/GPU hotplug) is responsible for the switching of the plurality of processing cores. That is to say, the switching of the processor core and the adjustment of the frequency need to be completed by the frequency regulator and the hot plug control module.
  • the a priori processor core further includes: calling the frequency regulator and the hot plug module The interface applies the number of processor cores and the configuration of the frequency values of each processor core to the processor core.
  • a processor computing resource allocation apparatus including a processor load detection module 102, a required computing resource calculation module 104, and a processor core combination determination module 106, wherein :
  • the processor load detection module 102 is configured to detect a current processor load.
  • the processor mentioned may be a central processing unit (CPU), a graphics processing unit (GPU), and a micro controller unit (Micro Controller Unit, A combination of one or more of MCUs.
  • the processor in this embodiment may be a Symmetrical Multi-Processing (SMP) or an Asymmetric Multi-Processing (AMP).
  • SMP Symmetrical Multi-Processing
  • AMP Asymmetric Multi-Processing
  • the load of the processor depends on the number of processes that the current processor is processing and waiting for the processor to process. Generally speaking, the larger the load, the more processing resources are occupied in the processor, that is, the remaining processing power is smaller.
  • the processor load detection module 102 respectively acquires the processor load of each processor core in the current state.
  • the required computing resource calculation module 104 is configured to determine a required computing resource according to the processor load, where the computing resource includes a sum of frequency values of each processor core.
  • the computing resource refers to the operating frequency corresponding to the processor core, and the limit computing resource of the processor core is the maximum operating frequency value of the processor core running.
  • the limit computing resource of the processor core is the maximum operating frequency value of the processor core running.
  • the required computing resource calculation module 104 determines the operating frequency corresponding thereto according to each processor load, and then calculates the sum of the operating frequencies corresponding to the processor loads of all the processors, and the sum of the operating frequencies is The computing resources required for all processor loads, that is, the computing resources allocated to the terminal by the processor core required to process the current process or task of the terminal.
  • the processor core combination determining module 106 is configured to obtain a power value of the a priori processor core at a specific frequency value, determine the number of the processor cores according to the power value of the a priori processor core at the specific frequency value, and each The frequency values of the processor cores are such that the sum of the frequency values of each processor core conforms to the computing resources and minimizes the sum of the power values of each of the processor cores.
  • the processor core combination determining module 106 needs to acquire the processor in advance.
  • the power value on the operating frequency value that is, the processor core combination determining module 106 determines the correspondence between the operating frequency and the power value of the processor.
  • the corresponding relationship may be provided by the processor manufacturer.
  • the operating frequency of the processor is not proportional to the power value, but is closer to the exponential relationship, that is, the power value increases exponentially with the increase of the operating frequency.
  • the processor core combination determining module 106 After the processor core combination determining module 106 obtains the correspondence between the operating frequency and the power value of the processor, the number of processor cores and the frequency value of each processor core may be determined according to the correspondence. For example, when the computing resource corresponding to the processor load is 4G, and the number of available processor cores is 4, and the maximum calculation amount of each processor core is 4G, the following 4 processes can be given for the above 4G requirements. Combination of devices:
  • the two processors operate at a running frequency of 2G;
  • the three processors operate at a running frequency of 4/3G;
  • the fourth, four processors run at a running frequency of 1G.
  • the running quantity and running frequency of the above four kinds of processors can satisfy the current load of the terminal, that is, the overall processing capability of the processor is sufficient, but for the above various combinations, which one is selected depends on the combination mode.
  • the specific power consumption size. The last chosen combination is that the sum of the power values of each processor core is the smallest in this combination, that is, the number of processor runs and the operating frequency that minimizes processor power consumption are selected.
  • the operating frequencies of each processor may be consistent or different from each other.
  • the foregoing apparatus further includes a frequency allocation policy determining module 108, configured to determine a minimum number of required processor cores according to the current processor load;
  • the frequency allocation policy is determined according to the power value of the a priori processor core at a specific frequency value such that the sum of the power values of each processor core corresponding to the frequency allocation strategy is minimized.
  • the minimum number of processors corresponding to the load can be calculated according to the following formula:
  • Nc_min [(Lc+100)/100].
  • the frequency allocation policy determining module 108 may perform a priori according to the a priori
  • the processor core determines the frequency allocation policy that satisfies the above computing resources according to the power value of the specific frequency value, that is, according to the correspondence between the specific frequency value and the power value of the processor, that is, the sum of the operating frequencies allocated by all the processors satisfies
  • the specific value of the computing resource obtained above is calculated, and on this basis, the frequency allocation strategy with the smallest sum of power values is selected.
  • the frequency allocation policy determining module 108 calculates the sum of the power values under each of the frequency allocation policies, and determines the minimum value according to the sum of the calculated power values, and selects a frequency allocation policy corresponding to the minimum value.
  • the number of processors running under the frequency allocation strategy thus obtained and the operating frequency can satisfy the current negative of the system. Under the premise of the demand, the frequency allocation strategy with the lowest power consumption level is obtained.
  • the apparatus further includes a single processor core setting module 110, and the minimum number of required processor cores determined by the current processor load is At 1 o'clock, if there is no foreground user operation, the load is set to a single processor core.
  • the single core processor mode is smaller than the standby current in the dual core, multicore processor mode, so the single processor core setting module 110 can set the terminal load to a single case, if circumstances permit.
  • the single processor core setting module 110 can perform all current processor loads with a single processor, that is, into a single processor core mode, for example, when the processor is a CPU, enters a single CPU mode. With this embodiment, the current of the terminal in the standby state can be significantly reduced.
  • the apparatus further includes a processor configuration application module 112, where the number of the processor cores is used by calling an interface of a frequency regulator and a hot plug module. And the configuration of the frequency value of each processor core is applied to the processor core.
  • the processor configuration application module 112 is then required to determine the number of processor cores running in the processor and The frequency is related to the processor of the terminal.
  • the frequency governor is responsible for the frequency hopping voltage regulation operation of the kernel
  • the hot swap control module (CPU/GPU hotplug) is responsible for the switching of the plurality of processing cores. That is to say, the switching of the processor core and the adjustment of the frequency need to be completed by the frequency regulator and the hot plug control module.
  • the number of running processor cores within the range of processor resources allowed by the system and The frequency is optimized, that is, according to the combination of different processor numbers and frequencies, different power consumption parameters are corresponding, so as to obtain the optimal power consumption under the premise of satisfying the performance requirements.
  • the result is to determine the number of processors and the frequency of the operation; that is, after using the above-mentioned processor computing resource allocation method and device, the power consumption of the terminal is reduced under the premise of ensuring the performance of the display thread.
  • FIG. 3 illustrates a terminal of a von Neumann system-based computer system that operates the above-described processor computing resource allocation method.
  • the computer system can be a terminal device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer or a personal computer.
  • an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included.
  • the external input interface 1001 can optionally include at least a network interface 10012.
  • the memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034.
  • the output interface 1004 can include at least a device such as a display 10042.
  • the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned von Neumann system-based computer system, loaded into the internal memory 10034 at runtime, and then After being compiled into machine code, it is passed to the processor 1002 for execution, so that the logical processor load detection module 102, the required computing resource calculation module 104, and the processor core combination are determined in the von Neumann system-based computer system.
  • Module 106 the logical processor load detection module 102, the required computing resource calculation module 104, and the processor core combination are determined in the von Neumann system-based computer system.
  • the input parameters are all received through the external input interface 1001, and transferred to the memory in the memory 1003, and then input to the processor 1002 for processing, and the processed result data or cached in Subsequent processing is performed in the memory 1003 or passed to the output interface 1004 for output.

Abstract

一种处理器计算资源的分配方法,包括:检测当前的处理器负载(S102);根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和(S104);获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小(S106)。采用该方法,可降低终端的功耗。

Description

处理器计算资源的分配方法、装置及终端
本发明要求2016年5月31日递交的发明名称为“处理器计算资源的分配方法及装置”的申请号为201610380703.0的在先申请优先权,上述在先申请的内容以引入的方式并入本文本中。
技术领域
本发明涉及终端领域,尤其涉及处理器计算资源的分配方法、装置及终端。
背景技术
随着处理器技术的不断发展,多核技术成为当今处理器发展的重要方向。相比传统的单核芯片,多核处理器技术通过多个处理核互相协助的方式实现了保持频率不变的情况下,大幅度地提升系统的性能。
发明内容
本发明实施例第一方面提供了一种处理器计算资源的分配方法,包括:
检测当前的处理器负载;
根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和;
获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
本发明实施例第二方面提供了一种处理器计算资源的分配装置,包括:
处理器负载检测模块,用于检测当前的处理器负载;
所需计算资源计算模块,用于根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和;
处理器核心组合确定模块,用于获取先验的处理器核心在特定频率值的功 率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
本发明实施例第三方面提供了一种终端包括:处理器和存储器,所述处理器用于存储计算机程序,所述处理器用于执行所述存储器中存储的计算机程序来执行:
检测当前的处理器负载;
根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和;
获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
采用了上述处理器计算资源的分配方法、装置、终端之后,根据终端当前的处理器负载情况以及当前需要的最小计算资源,在系统允许的处理器资源的范围内,对运行的处理器核心的数量以及频率进行优化,即按照不同的处理器数量和频率的组合对应不同的功耗参数,以求在满足性能要求的前提下,得到功耗最优的结果,即确定运行的处理器数量以及频率;也就是说,采用上述处理器计算资源的分配方法及装置之后,在保证了显示线程的性能的前提下,降低了终端的功耗。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
其中:
图1为一个实施例中一种处理器计算资源的分配方法的流程示意图;
图2为一个实施例中一种处理器计算资源的分配装置的结构示意图;
图3为一个实施例中运行前述处理器计算资源的分配方法的计算机设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
在本实施例中,特提出了一种处理器计算资源的分配方法,该方法的实现可依赖于计算机程序,该计算机程序可运行于基于冯诺依曼体系的计算机系统之上,该计算机程序可以是多核处理器的终端的处理器控制应用程序。该计算机系统可以是运行上述计算机程序的例如智能手机、平板电脑、个人电脑等终端设备。
本发明实施例中提及的终端可以是智能手机(smart phone)、平板电脑(Tablet Personal Computer)、车载终端、台式电脑(computer)等等。
在实践过程技术人员发现,不同的应用场景下,处理器的实际负载其实并不相同,例如,不同的前景应用所对应的负载差异会非常大,比如非常轻量级的播放音乐、中度负载的拍照、浏览网页,以及重度负载的大型游戏,其所需要的CPU或者GPU的数量以及频率资源都存在较大的差异;另外,在终端中还运行了大量的后台应用,同样也需要占用一定的处理器资源。而在操作系统中处理核控制中,频率调节器负责内核的跳频调压操作,热插拔控制模块负责 多个处理核的开关,处理方法主要是周期性的根据当前处理和的运行频率和变化方向来预设负载,或者根据单位时间内运行的任务数来确定每一个处理核的开关;也就是说,频率调节器以及热插拔控制模块难以区分前后径的应用的不同负载需求,不能精确的根据负载来控制处理器资源的分配。
也就是说,在现有技术中多核处理器的控制方案中,处理器并不能区分前后径的应用的不同负载需求,不能精确的根据负载来控制处理器资源的分配,这就使得处理器的负载可能出现负载过重的问题,处理器的处理能力不足而导致出现卡顿等现象,或者,处理器的负载可能过轻,处理器的一些内核可能会处于“空转”状态而导致出现不必要的电量浪费。
为了减少处理器不必要的功耗,如图1所示,上述处理器计算资源的分配方法包括如下步骤S102-S108,具体的:
步骤S102:检测当前的处理器负载。
需要说明的是,在本发明实施例中,所提及的处理器可以是中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、微控制单元(Micro Controller Unit,MCU)中的一种或者多种的组合。而且,本实施例中的处理器可以是对称多核处理器(Symmetrical Multi-Processing,SMP),也可以是非对称多核处理器(Asymmetric Multi-Processing,AMP)。
处理器的负载取决于当前处理器正在处理以及等待处理器处理的进程数,一般来讲,负载越大,处理器中被占用的处理资源越多,也就是说,剩余的处理能力越小。在本实施例中,针对终端中的多个处理器核心,分别获取每一个处理器核心在当前状态下的处理器负载。
步骤S104:根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和。
计算资源指的是处理器核心对应的运行频率,处理器核心的极限计算资源即为该处理器核心运行的最大运行频率值。为了支持处理器当前的负载,即正在处理以及等在处理器处理的进程数和任务量,就需要保证处理器核心的运行频率。
在本实施例中,根据每一个处理器负载确定与之对应的运行频率,然后计算所有的处理器的处理器负载对应的运行频率之和,该运行频率之和即为所有 处理器负载所需要的计算资源,即处理终端当前的进程或任务所需要处理器核心分配给终端的计算资源。
步骤S106:获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
在本实施例中,需要预先获取处理器在不同的运行频率值上的功率值,即确定处理器的运行频率与功率值之间的对应关系,在本实施例中,该对应关系可以是处理器厂家提供的,也可以终端预先获取的实验值。一般来讲,处理器的运行频率与功率值之间并不是成正比例关系的,而比较接近于指数关系,即功率值随着运行频率的增加成指数倍增长。
在获取到处理器的运行频率与功率值之间的对应关系之后,就可以根据该对应关系确定处理器核心的数量以及每个处理器核心的频率值。例如,在于处理器负载对应的计算资源为4G、且可用的处理器核心的数量为4、每个处理器核心的最大计算量为4G时,针对上述4G的需求,可以给出以下4中处理器的组合方式:
第一种,单个处理器以4G的运行频率运行;
第二种,2个处理器分别以2G的运行频率运行;
第三种,3个处理器分别以4/3G的运行频率运行;
第四种,4个处理器分别以1G的运行频率运行。
上述4种处理器的运行数量以及运行频率都可以满足终端当前的负载,即处理器的总体处理能力是足够的,但是对于上述多种组合方式,选择哪一种取决于该种组合方式下的具体的功耗大小。最后选择的组合方式是在该组合方式下每个处理器核心的功率值的总和最小,也就是说,选择的是使得处理器功耗最小的处理器运行数量以及运行频率。
需要说明的是,在本实施例中,每个处理器的运行频率可以是一致的,也可以互相之间是不同的。
在一个具体的实施例中,上述根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值的过程可以是:所 述检测当前的处理器负载之后还包括:根据所述当前的处理器负载确定所需处理器核心的最小数目;获取系统中处理器核心的最大数目,根据所述处理器核心的最小数目和最大数目确定处理器核心数量的可选范围;根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Nc_x取值为[Nc_min,Nc_max],所述Nc_min表示所述所需处理器核心的最小数目,所述Nc_max表示所述系统中处理器核心的最大数目,Fmax为单个处理器核心的最大频率值,所述Fx表示所述给处理器核心分配的频率值;所述根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值还包括:根据所述先验的处理器核心在特定频率值的功率值确定频率分配策略,使得所述频率分配策略对应的每个处理器核心的功率值之和最小。
用Lc表示处理器的负载,则与该负载对应的最少的处理器个数可以根据如下公式进行计算:
Nc_min=[(Lc+100)/100]。
例如,Lc=20%,则需要的最少处理器数量为1,若Lc=120%,则需要的最少的处理器数量为2。
在终端中的处理器核心的数量总和即为终端中允许的或者可用的最大处理器核心的数量,在本实施例中,用Nc_max表示,例如,对于4核心CPU来讲,Nc_max=4,对于8核心的CPU来讲,Nc_max=8。
根据上述所需处理器核心的最小数目Nc_min以及系统中处理器核心的最大数目Nc_max,可以确定在本方法中可以选择的运行的处理器核心的数量。例如,Nc_min=1,Nc_max=8,则对应的可选的运行的处理器核心的数量Nc_x的取值可以是1,2,3,4,5,6,7,8,即[1,8]中的整数值,即Nc_x取值范围为[Nc_min,Nc_max]。
根据步骤S104中计算出来的计算资源的具体值,以及每个处理器对应的最大的频率值,就可以确定Nc_min,根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Fmax为单个处理器核心的最大频率值,Fx表示所述给处理器核心分配的频率值,由Nc_x和Fx的取值就可以确定不同处理器与运行频率之间的组合。
进一步的,在上述根据所述先验的处理器核心在特定频率值的功率值确定 处理器核心的数量以及每个处理器核心的频率值的过程中,可以根据先验的处理器核心在特定频率值的功率值,即根据处理器的特定频率值与功率值之间的对应关系,确定满足上述计算资源的频率分配策略,即所有处理器分配的运行频率之和满足上述步骤S104中计算得到的计算资源的具体值,且,在此基础上,选择功率值之和最小的频率分配策略。例如,可以计算每一种频率分配策略下的功率值之和,并根据计算得到的功率值之和确定其中的最小值,选择与该最小值对应的频率分配策略。这样得到的频率分配策略下的处理器运行数量以及运行频率,可以在满足系统当前的负载需求的前提下,得到最低功耗水平的频率分配策略。
在另一可选的实施例中,所述检测当前的处理器负载之后还包括:在所述当前的处理器负载确定的所需处理器核心的最小数目为1时,若没有前景用户操作,则将所述负载设置到单一的处理器核心上。
一般来讲,单核的处理器模式比双核、多核的处理器模式下的待机的电流要小,因此,在情况允许的情况下,可以将终端的负载设置到单一的处理器核心上。具体的,若确定的Nc_min=1,则说明单一的处理器核心已经足够承载当前的负载,并且,若用户当前并没有进行任何的前景操作,则说明用户对于终端也不会有较大的负载需求,即可以将当前的所有的处理器负载有单一的处理器进行,即进入到单一处理器核心模式,例如,在处理器为CPU时,进入到单一CPU模式。采用本实施例,可以显著的降低终端在待机状态下的电流。
需要说明的是,在本实施例中,根据上述的步骤确定了处理器中运行的处理器核心的数量以及频率,然后需要终端根据确定好的处理器中运行的处理器核心的数量以及频率对终端的处理器进行相关的设置。在本实施例中,在操作系统中处理核控制中,频率调节器(Frequency Governor)负责内核的跳频调压操作,热插拔控制模块(CPU/GPU hotplug)负责多个处理核的开关,也就是说,处理器核心的开关以及频率的调节需要通过频率调节器以及热插拔控制模块完成。具体的,所述根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值之后还包括:通过调用频率调节器和热拔插模块的接口将所述处理器核心的数量以及每个处理器核心的频率值的配置应用到处理器核心上。
在一个实施例中,如图2所示,还提出了一种处理器计算资源的分配装置,包括处理器负载检测模块102、所需计算资源计算模块104以及处理器核心组合确定模块106,其中:
处理器负载检测模块102,用于检测当前的处理器负载。
需要说明的是,在本发明实施例中,所提及的处理器可以是中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、微控制单元(Micro Controller Unit,MCU)中的一种或者多种的组合。而且,本实施例中的处理器可以是对称多核处理器(Symmetrical Multi-Processing,SMP),也可以是非对称多核处理器(Asymmetric Multi-Processing,AMP)。
处理器的负载取决于当前处理器正在处理以及等待处理器处理的进程数,一般来讲,负载越大,处理器中被占用的处理资源越多,也就是说,剩余的处理能力越小。在本实施例中,针对终端中的多个处理器核心,处理器负载检测模块102分别获取每一个处理器核心在当前状态下的处理器负载。
所需计算资源计算模块104,用于根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和。
计算资源指的是处理器核心对应的运行频率,处理器核心的极限计算资源即为该处理器核心运行的最大运行频率值。为了支持处理器当前的负载,即正在处理以及等在处理器处理的进程数和任务量,就需要保证处理器核心的运行频率。
在本实施例中,所需计算资源计算模块104根据每一个处理器负载确定与之对应的运行频率,然后计算所有的处理器的处理器负载对应的运行频率之和,该运行频率之和即为所有处理器负载所需要的计算资源,即处理终端当前的进程或任务所需要处理器核心分配给终端的计算资源。
处理器核心组合确定模块106,用于获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
在本实施例中,处理器核心组合确定模块106需要预先获取处理器在不同 的运行频率值上的功率值,即处理器核心组合确定模块106确定处理器的运行频率与功率值之间的对应关系,在本实施例中,该对应关系可以是处理器厂家提供的,也可以终端预先获取的实验值。一般来讲,处理器的运行频率与功率值之间并不是成正比例关系的,而比较接近于指数关系,即功率值随着运行频率的增加成指数倍增长。
在处理器核心组合确定模块106获取到处理器的运行频率与功率值之间的对应关系之后,就可以根据该对应关系确定处理器核心的数量以及每个处理器核心的频率值。例如,在于处理器负载对应的计算资源为4G、且可用的处理器核心的数量为4、每个处理器核心的最大计算量为4G时,针对上述4G的需求,可以给出以下4中处理器的组合方式:
第一种,单个处理器以4G的运行频率运行;
第二种,2个处理器分别以2G的运行频率运行;
第三种,3个处理器分别以4/3G的运行频率运行;
第四种,4个处理器分别以1G的运行频率运行。
上述4种处理器的运行数量以及运行频率都可以满足终端当前的负载,即处理器的总体处理能力是足够的,但是对于上述多种组合方式,选择哪一种取决于该种组合方式下的具体的功耗大小。最后选择的组合方式是在该组合方式下每个处理器核心的功率值的总和最小,也就是说,选择的是使得处理器功耗最小的处理器运行数量以及运行频率。
需要说明的是,在本实施例中,每个处理器的运行频率可以是一致的,也可以互相之间是不同的。
可选的,在其中一个实施例中,如图2所示,上述装置还包括频率分配策略确定模块108,用于根据所述当前的处理器负载确定所需处理器核心的最小数目;获取系统中处理器核心的最大数目,根据所述处理器核心的最小数目和最大数目确定处理器核心数量的可选范围;根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Nc_x取值为[Nc_min,Nc_max],所述Nc_min表示所述所需处理器核心的最小数目,所述Nc_max表示所述系统中处理器核心的最大数目,Fmax为单个处理器核心的最大频率值,所述Fx表示所述给处理器核心分配的频率值;所述处理器核心组合确定模块106还用于根 据所述先验的处理器核心在特定频率值的功率值确定频率分配策略,使得所述频率分配策略对应的每个处理器核心的功率值之和最小。
用Lc表示处理器的负载,则与该负载对应的最少的处理器个数可以根据如下公式进行计算:
Nc_min=[(Lc+100)/100]。
例如,Lc=20%,则需要的最少处理器数量为1,若Lc=120%,则需要的最少的处理器数量为2。
在终端中的处理器核心的数量总和即为终端中允许的或者可用的最大处理器核心的数量,在本实施例中,用Nc_max表示,例如,对于4核心CPU来讲,Nc_max=4,对于8核心的CPU来讲,Nc_max=8。
根据上述所需处理器核心的最小数目Nc_min以及系统中处理器核心的最大数目Nc_max,频率分配策略确定模块108可以确定在本方法中可以选择的运行的处理器核心的数量。例如,Nc_min=1,Nc_max=8,则对应的可选的运行的处理器核心的数量Nc_x的取值可以是1,2,3,4,5,6,7,8,即[1,8]中的整数值,即Nc_x取值范围为[Nc_min,Nc_max]。
根据所需计算资源计算模块104计算出来的计算资源的具体值,以及每个处理器对应的最大的频率值,频率分配策略确定模块108可以确定Nc_min,根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Fmax为单个处理器核心的最大频率值,Fx表示所述给处理器核心分配的频率值,由Nc_x和Fx的取值就可以确定不同处理器与运行频率之间的组合。
进一步的,在上述频率分配策略确定模块108根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值的过程中,可以根据先验的处理器核心在特定频率值的功率值,即根据处理器的特定频率值与功率值之间的对应关系,确定满足上述计算资源的频率分配策略,即所有处理器分配的运行频率之和满足上述计算得到的计算资源的具体值,且,在此基础上,选择功率值之和最小的频率分配策略。例如,频率分配策略确定模块108计算每一种频率分配策略下的功率值之和,并根据计算得到的功率值之和确定其中的最小值,选择与该最小值对应的频率分配策略。这样得到的频率分配策略下的处理器运行数量以及运行频率,可以在满足系统当前的负 载需求的前提下,得到最低功耗水平的频率分配策略。
可选的,在其中一个实施例中,如图2所示,上述装置还包括单一处理器核心设置模块110,用于在所述当前的处理器负载确定的所需处理器核心的最小数目为1时,若没有前景用户操作,则将所述负载设置到单一的处理器核心上。
一般来讲,单核的处理器模式比双核、多核的处理器模式下的待机的电流要小,因此,在情况允许的情况下,单一处理器核心设置模块110可以将终端的负载设置到单一的处理器核心上。具体的,若确定的Nc_min=1,则说明单一的处理器核心已经足够承载当前的负载,并且,若用户当前并没有进行任何的前景操作,则说明用户对于终端也不会有较大的负载需求,即单一处理器核心设置模块110可以将当前的所有的处理器负载有单一的处理器进行,即进入到单一处理器核心模式,例如,在处理器为CPU时,进入到单一CPU模式。采用本实施例,可以显著的降低终端在待机状态下的电流。
可选的,在其中一个实施例中,如图2所示,上述装置还包括处理器配置应用模块112,用于通过调用频率调节器和热拔插模块的接口将所述处理器核心的数量以及每个处理器核心的频率值的配置应用到处理器核心上。
需要说明的是,在本实施例中,根据确定了处理器中运行的处理器核心的数量以及频率,然后需要处理器配置应用模块112根据确定好的处理器中运行的处理器核心的数量以及频率对终端的处理器进行相关的设置。在本实施例中,在操作系统中处理核控制中,频率调节器(Frequency Governor)负责内核的跳频调压操作,热插拔控制模块(CPU/GPU hotplug)负责多个处理核的开关,也就是说,处理器核心的开关以及频率的调节需要通过频率调节器以及热插拔控制模块完成。
实施本发明实施例,将具有如下有益效果:
采用了上述处理器计算资源的分配方法和装置之后,根据终端当前的处理器负载情况以及当前需要的最小计算资源,在系统允许的处理器资源的范围内,对运行的处理器核心的数量以及频率进行优化,即按照不同的处理器数量和频率的组合对应不同的功耗参数,以求在满足性能要求的前提下,得到功耗最优 的结果,即确定运行的处理器数量以及频率;也就是说,采用上述处理器计算资源的分配方法及装置之后,在保证了显示线程的性能的前提下,降低了终端的功耗。
在一个实施例中,如图3所示,图3展示了一种运行上述处理器计算资源的分配方法的基于冯诺依曼体系的计算机系统的终端。该计算机系统可以是智能手机、平板电脑、掌上电脑,笔记本电脑或个人电脑等终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述基于冯诺依曼体系的计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的处理器负载检测模块102、所需计算资源计算模块104以及处理器核心组合确定模块106。且在上述处理器计算资源的分配方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (19)

  1. 一种处理器计算资源的分配方法,其特征在于,包括:
    检测当前的处理器负载;
    根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和;
    获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
  2. 根据权利要求1所述的处理器计算资源的分配方法,其特征在于,所述检测当前的处理器负载还包括:
    获取每个处理器核心在当前状态下的处理器负载,根据所述每个处理器核心在当前状态下的处理器负载确定所述当前的处理器负载。
  3. 根据权利要求1所述的处理器计算资源的分配方法,其特征在于,所述获取先验的处理器核心在特定频率值的功率值还包括:
    确定处理器的运行频率与之间的对应关系,所述功率值与处理器的运行频率之间成指数关系;
    根据所述对应关系确定所述处理器核心在特定频率上的功率值。
  4. 根据权利要求1所述的处理器计算资源的分配方法,其特征在于,所述检测当前的处理器负载之后还包括:
    根据所述当前的处理器负载确定所需处理器核心的最小数目;
    获取系统中处理器核心的最大数目,根据所述处理器核心的最小数目和最大数目确定处理器核心数量的可选范围;
    根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Nc_x取值为[Nc_min,Nc_max],所述Nc_min表示所述所需处理器核心的最小数 目,所述Nc_max表示所述系统中处理器核心的最大数目,Fmax为单个处理器核心的最大频率值,所述Fx表示所述给处理器核心分配的频率值;
    所述根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值还包括:
    根据所述先验的处理器核心在特定频率值的功率值确定频率分配策略,使得所述频率分配策略对应的每个处理器核心的功率值之和最小。
  5. 根据权利要求4所述的处理器计算资源的分配方法,其特征在于,所述根据所述当前的处理器负载确定所需处理器核心的最小数目的步骤还包括:
    根据公式
    Nc_min=[(Lc+100)/100]
    计算所述所需处理器核心的最小数目,其中,所述Lc表示所述当前的处理器负载。
  6. 根据权利要求4所述的处理器计算资源的分配方法,其特征在于,所述检测当前的处理器负载之后还包括:
    在所述当前的处理器负载确定的所需处理器核心的最小数目为1时,若没有前景用户操作,则将所述负载设置到单一的处理器核心上。
  7. 根据权利要求4所述的处理器计算资源的分配方法,其特征在于,所述根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值之后还包括:
    通过调用频率调节器和热拔插模块的接口将所述处理器核心的数量以及每个处理器核心的频率值的配置应用到处理器核心上。
  8. 根据权利要求1至7任一所述的处理器计算资源的分配方法,其特征在于,所述处理器核心包括CPU核心和GPU核心。
  9. 一种处理器计算资源的分配装置,其特征在于,包括:
    处理器负载检测模块,用于检测当前的处理器负载;
    所需计算资源计算模块,用于根据所述处理器负载确定所需的计算资源,所述计算资源包括每个处理器核心的频率值之和;
    处理器核心组合确定模块,用于获取先验的处理器核心在特定频率值的功率值,根据所述先验的处理器核心在特定频率值的功率值确定处理器核心的数量以及每个处理器核心的频率值,使得每个处理器核心的频率值之和符合所述计算资源,且使得所述每个处理器核心的功率值之和最小。
  10. 根据权利要求9所述的处理器计算资源的分配装置,其特征在于,所述处理器负载检测模块还用于获取每个处理器核心在当前状态下的处理器负载,根据所述每个处理器核心在当前状态下的处理器负载确定所述当前的处理器负载。
  11. 根据权利要求9所述的处理器计算资源的分配装置,其特征在于,所述处理器核心组合确定模块还用于确定处理器的运行频率与之间的对应关系,所述功率值与处理器的运行频率之间成指数关系;根据所述对应关系确定所述处理器核心在特定频率上的功率值。
  12. 根据权利要求9所述的处理器计算资源的分配装置,其特征在于,所述装置还包括频率分配策略确定模块,用于根据所述当前的处理器负载确定所需处理器核心的最小数目;获取系统中处理器核心的最大数目,根据所述处理器核心的最小数目和最大数目确定处理器核心数量的可选范围;根据公式Nc_x*Fx=Nc_min*Fmax获取多种频率分配策略,其中Nc_x取值为[Nc_min,Nc_max],所述Nc_min表示所述所需处理器核心的最小数目,所述Nc_max表示所述系统中处理器核心的最大数目,Fmax为单个处理器核心的最大频率值,所述Fx表示所述给处理器核心分配的频率值;
    所述处理器核心组合确定模块还用于根据所述先验的处理器核心在特定频率值的功率值确定频率分配策略,使得所述频率分配策略对应的每个处理器核心的功率值之和最小。
  13. 根据权利要求12所述的处理器计算资源的分配装置,其特征在于,所述频率分配策略确定模块还用于根据公式
    Nc_min=[(Lc+100)/100]
    计算所述所需处理器核心的最小数目,其中,所述Lc表示所述当前的处理器负载。
  14. 根据权利要求12所述的处理器计算资源的分配装置,其特征在于,所述装置还包括单一处理器核心设置模块,用于在所述当前的处理器负载确定的所需处理器核心的最小数目为1时,若没有前景用户操作,则将所述负载设置到单一的处理器核心上。
  15. 根据权利要求12所述的处理器计算资源的分配装置,其特征在于,所述装置还包括处理器配置应用模块,用于通过调用频率调节器和热拔插模块的接口将所述处理器核心的数量以及每个处理器核心的频率值的配置应用到处理器核心上。
  16. 根据权利要求9至15任一所述的处理器计算资源的分配装置,其特征在于,所述处理器核心包括CPU核心和GPU核心。
  17. 一种终端,包括:处理器和存储器,其特征在于,所述处理器用于存储计算机程序,所述处理器用于执行所述存储器中存储的计算机程序来执行如权利要求1-8任一项所述的方法。
  18. 一种计算机可读存储介质,其特征在于,其存储用于电子数据交换的计算机程序,其中,所述计算机程序被执行的情况下实现如权利要求1-8任一项所述的方法。
  19. 一种程序产品,其特征在于,所述计算机程序被执行的情况下实现如 权利要求1-8任一项所述的方法。
PCT/CN2017/086447 2016-05-31 2017-05-27 处理器计算资源的分配方法、装置及终端 WO2017206852A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP17805797.2A EP3467651B1 (en) 2016-05-31 2017-05-27 Method, device and terminal for allocating computational resources of processor
US16/110,319 US10740154B2 (en) 2016-05-31 2018-08-23 Method and apparatus for allocating computing resources of processor based on processor load, and terminal
US16/245,236 US10664318B2 (en) 2016-05-31 2019-01-10 Method and apparatus for allocating computing resources of processor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610380703.0A CN105955827B (zh) 2016-05-31 2016-05-31 处理器计算资源的分配方法及装置
CN201610380703.0 2016-05-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/110,319 Continuation US10740154B2 (en) 2016-05-31 2018-08-23 Method and apparatus for allocating computing resources of processor based on processor load, and terminal

Publications (1)

Publication Number Publication Date
WO2017206852A1 true WO2017206852A1 (zh) 2017-12-07

Family

ID=56907307

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086447 WO2017206852A1 (zh) 2016-05-31 2017-05-27 处理器计算资源的分配方法、装置及终端

Country Status (4)

Country Link
US (2) US10740154B2 (zh)
EP (1) EP3467651B1 (zh)
CN (1) CN105955827B (zh)
WO (1) WO2017206852A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112068690A (zh) * 2020-09-04 2020-12-11 龙芯中科技术有限公司 处理器调频方法及装置

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10445850B2 (en) * 2015-08-26 2019-10-15 Intel Corporation Technologies for offloading network packet processing to a GPU
CN105955827B (zh) * 2016-05-31 2017-11-24 广东欧珀移动通信有限公司 处理器计算资源的分配方法及装置
CN106341231A (zh) * 2016-08-22 2017-01-18 北京信安世纪科技有限公司 一种信息处理方法及电子设备
CN106776004A (zh) * 2016-11-18 2017-05-31 努比亚技术有限公司 Cpu资源分配装置及方法
CN109101073B (zh) * 2017-06-20 2023-01-10 深圳市中兴微电子技术有限公司 一种总线动态调频方法和总线动态调频装置
CN109117262B (zh) * 2017-06-22 2022-01-11 深圳市中兴微电子技术有限公司 一种基带处理芯片cpu动态调频方法及无线终端
CN107729145A (zh) * 2017-10-11 2018-02-23 广东欧珀移动通信有限公司 应用程序运行控制方法及装置
CN112912820A (zh) * 2018-10-26 2021-06-04 华为技术有限公司 Cpu调节器的能效调整
CN112799838A (zh) * 2021-01-27 2021-05-14 Oppo广东移动通信有限公司 任务处理方法、多核处理器及计算机设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289365A1 (en) * 2004-06-29 2005-12-29 Bhandarkar Dileep P Multiprocessing power & performance optimization
CN103838353A (zh) * 2014-01-02 2014-06-04 深圳市金立通信设备有限公司 一种控制处理器运行的方法及终端
CN104820618A (zh) * 2015-04-24 2015-08-05 华为技术有限公司 一种任务调度方法、任务调度装置及多核系统
CN105955827A (zh) * 2016-05-31 2016-09-21 广东欧珀移动通信有限公司 处理器计算资源的分配方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8032772B2 (en) * 2007-11-15 2011-10-04 Intel Corporation Method, apparatus, and system for optimizing frequency and performance in a multi-die microprocessor
US7992015B2 (en) * 2008-02-05 2011-08-02 Dell Products L.P. Processor performance state optimization
EP2362297B1 (en) 2010-02-25 2014-05-14 Telefonaktiebolaget L M Ericsson (publ) Technique for selecting a frequency of operation in a processor system
US9137848B2 (en) * 2012-01-31 2015-09-15 Lg Electronics Inc. Mobile terminal, controlling method thereof and recording medium thereof
US9075556B2 (en) 2012-12-21 2015-07-07 Intel Corporation Controlling configurable peak performance limits of a processor
US10642652B2 (en) 2016-01-29 2020-05-05 Peter P. Nghiem Best trade-off point on an elbow curve for optimal resource provisioning and performance efficiency

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289365A1 (en) * 2004-06-29 2005-12-29 Bhandarkar Dileep P Multiprocessing power & performance optimization
CN103838353A (zh) * 2014-01-02 2014-06-04 深圳市金立通信设备有限公司 一种控制处理器运行的方法及终端
CN104820618A (zh) * 2015-04-24 2015-08-05 华为技术有限公司 一种任务调度方法、任务调度装置及多核系统
CN105955827A (zh) * 2016-05-31 2016-09-21 广东欧珀移动通信有限公司 处理器计算资源的分配方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3467651A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112068690A (zh) * 2020-09-04 2020-12-11 龙芯中科技术有限公司 处理器调频方法及装置
CN112068690B (zh) * 2020-09-04 2022-09-20 龙芯中科技术股份有限公司 处理器调频方法及装置

Also Published As

Publication number Publication date
EP3467651A1 (en) 2019-04-10
US20180365066A1 (en) 2018-12-20
US20190146842A1 (en) 2019-05-16
CN105955827A (zh) 2016-09-21
US10664318B2 (en) 2020-05-26
EP3467651A4 (en) 2019-05-22
US10740154B2 (en) 2020-08-11
CN105955827B (zh) 2017-11-24
EP3467651B1 (en) 2021-12-15

Similar Documents

Publication Publication Date Title
WO2017206852A1 (zh) 处理器计算资源的分配方法、装置及终端
GB2544609B (en) Granular quality of service for computing resources
US9507632B2 (en) Preemptive context switching of processes on ac accelerated processing device (APD) based on time quanta
JP5673672B2 (ja) マルチコアプロセッサシステム、制御プログラム、および制御方法
US20140022263A1 (en) Method for urgency-based preemption of a process
JP2014504416A (ja) 組み合わせたcpu/gpuアーキテクチャシステムにおけるデバイスの発見およびトポロジーのレポーティング
US11243795B2 (en) CPU overcommit with guest idle polling
CN110300959B (zh) 用于动态运行时任务管理的方法、系统、设备、装置和介质
WO2015123840A1 (en) Workload batch submission mechanism for graphics processing unit
US10216530B2 (en) Method for mapping between virtual CPU and physical CPU and electronic device
CN116382880B (zh) 任务执行方法、装置、处理器、电子设备及存储介质
WO2016182683A1 (en) System and method for dynamic granularity control of parallelized work in a portable computing device (pcd)
US9342477B2 (en) Multi-core processor, controlling method thereof and computer system with such processor
CN115617494B (zh) 多cpu环境下的进程调度方法、装置、电子设备和介质
CN111338803A (zh) 一种线程处理方法和装置
US20140053162A1 (en) Thread processing method and thread processing system
CN112114967B (zh) 一种基于服务优先级的gpu资源预留方法
CN114116220A (zh) 一种gpu共享控制方法、gpu共享控制装置及存储介质
CN115269131A (zh) 一种任务调度方法及装置
CN113032154B (zh) 一种虚拟cpu的调度方法、装置、电子设备及存储介质
JP5858947B2 (ja) 情報処理装置及び動作周波数/動作電圧制御方法
US20240143394A1 (en) Heterogeneous computing terminal for task scheduling
CN115686803B (zh) 一种调度策略动态加载的计算任务管理系统、方法和装置
CN114443255A (zh) 一种线程调用方法和装置
CN115599554A (zh) 一种gpgpu资源分配方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17805797

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017805797

Country of ref document: EP

Effective date: 20190102