WO2017101324A1 - 一种用于分配动态内存资源的方法及装置 - Google Patents

一种用于分配动态内存资源的方法及装置 Download PDF

Info

Publication number
WO2017101324A1
WO2017101324A1 PCT/CN2016/088545 CN2016088545W WO2017101324A1 WO 2017101324 A1 WO2017101324 A1 WO 2017101324A1 CN 2016088545 W CN2016088545 W CN 2016088545W WO 2017101324 A1 WO2017101324 A1 WO 2017101324A1
Authority
WO
WIPO (PCT)
Prior art keywords
bandwidth
dynamic memory
met
determining whether
condition
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.)
Ceased
Application number
PCT/CN2016/088545
Other languages
English (en)
French (fr)
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.)
Le Holdings Beijing Co Ltd
Lemobile Information Technology (Beijing) Co Ltd
Original Assignee
Le Holdings Beijing Co Ltd
Lemobile Information Technology (Beijing) 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 Le Holdings Beijing Co Ltd, Lemobile Information Technology (Beijing) Co Ltd filed Critical Le Holdings Beijing Co Ltd
Priority to US15/242,720 priority Critical patent/US20170177255A1/en
Publication of WO2017101324A1 publication Critical patent/WO2017101324A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0625Power saving in storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • H04W52/028Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof switching on or off only a part of the equipment circuit blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1028Power efficiency
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/25Using a specific main memory architecture
    • G06F2212/253Centralized memory
    • 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
    • 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
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the field of intelligent mobile terminal technologies, and in particular, to a method and apparatus for allocating dynamic memory resources.
  • DRAM Dynamic Random Access Memory
  • DRAM Dynamic Random Access Memory
  • capacitor storage In order to maintain data, DRAM uses capacitor storage, so it must be refreshed once in a while. If the memory unit is not refreshed, the stored information will be lost.
  • the technical problem to be solved by the present invention is that the method for extending the endurance time by optimizing the system resources by the existing smart mobile terminal is not perfect and the effect is limited.
  • a method for allocating dynamic memory resources includes the following steps:
  • the application is allocated the full bandwidth of the dynamic memory.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the step of determining whether to meet the condition for limiting the bandwidth of the allocated dynamic memory to the partial bandwidth further includes:
  • the bandwidth of the dynamic memory for allocation is limited to one quarter.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth comprises:
  • the present invention also provides an apparatus for allocating dynamic memory resources, including:
  • a request obtaining unit configured to acquire a memory resource allocation request of the application
  • a determining unit configured to determine whether a condition for limiting the bandwidth of the dynamic memory for allocation to a partial bandwidth is met
  • the entire bandwidth allocation unit is configured to allocate the entire bandwidth of the dynamic memory to the application if the condition is not met.
  • the invention further discloses an apparatus for allocating dynamic memory resources, comprising: one or more processors; a memory; one or more programs, the one or more programs being stored in the memory, when When the one or more processors are executed, the following operations are performed: acquiring a memory resource allocation request of the application; determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth; if yes, according to the memory The resource allocation request allocates a portion of the bandwidth of the dynamic memory; otherwise, the application allocates the full bandwidth of the dynamic memory.
  • the method, wherein the determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth condition comprises: determining whether there is a memory resource allocation request requesting the entire bandwidth of the dynamic memory; Then, it is determined that the condition is not met; otherwise, the determination is met.
  • the method wherein the determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth condition comprises: determining whether the screen of the mobile device is in a screen-off state; if yes, determining the match The condition; if not, it is determined whether the number of CPUs is less than 2, and if the number of CPUs is less than 2, it is determined that the condition is not met.
  • determining whether the bandwidth of the dynamic memory for allocation is limited to a partial bandwidth condition is further included, if the number of CPUs is greater than 2, determining whether the dynamic memory is requested A memory resource allocation request for all bandwidths; if so, it is determined that the condition is not met; otherwise, the determination is met.
  • the method, wherein the determining whether the bandwidth of the dynamic memory for allocation is limited to a partial bandwidth condition comprises: determining whether a bright screen command exists when the screen of the mobile device is in a screen-off state If yes, it is determined that the condition is not met.
  • the method, wherein the determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth condition comprises: determining whether to start the operating system of the mobile device; if yes, determining that the content is not met The conditions.
  • the method, wherein the determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth condition comprises: determining whether the operating system of the mobile device is started up; if yes, determining whether the existence exists A memory resource allocation request requesting the full bandwidth of the dynamic memory; if so, determining that the condition is not met; otherwise, determining that the condition is met.
  • the method, wherein the determining whether the bandwidth of the dynamic memory for allocation is limited to a partial bandwidth condition comprises: determining whether the operating system of the mobile device is If yes, determine whether the screen of the mobile device is in the off state; if yes, determine that the condition is met; otherwise, determine whether the number of CPUs is less than 2; if the number of CPUs is less than 2, then Determining that the condition is not met; if the number of CPUs is greater than 2, determining whether there is a memory resource allocation request requesting the full bandwidth of the dynamic memory; if yes, determining that the condition is not met; otherwise, determining that the condition is met condition.
  • the method and device for allocating dynamic memory resources provided by the embodiments of the present invention allocate memory resources according to the needs of the terminal device. If the terminal device needs to allocate all the bandwidth, all the bandwidths are allocated. Otherwise, only a part of the bandwidth may be allocated, and the remaining Bandwidth resources are not occupied. That is, only when the system does not need all the memory resources, it can save, not only can guarantee the performance of the intelligent mobile terminal, but also can extend its battery life. Together with the optimized allocation method of other resources, the power saving effect can be greatly improved, and the life time of the smart mobile device terminal can be further extended.
  • FIG. 1 is a flowchart of a method for allocating dynamic memory resources according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for determining whether a bandwidth for limiting allocated dynamic memory is limited to a partial bandwidth according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic block diagram of an apparatus for allocating dynamic memory resources according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for allocating dynamic memory resources with a processor according to Embodiment 3 of the present invention
  • FIG. 5 is a schematic structural diagram of an apparatus for allocating dynamic memory resources with two processors according to Embodiment 3 of the present invention.
  • This embodiment provides a method for allocating dynamic memory resources. As shown in FIG. 1 , the method includes the following steps:
  • S1 Get the memory resource allocation request of the application. Each application needs memory resources after startup, whether it is running in the foreground or running in the background, so it is necessary to apply for allocating memory resources.
  • Memory bandwidth refers to the data transfer speed per second between the memory and the North Bridge. The bigger the better.
  • the dynamic random access memory (DRAM) resources of the smart phones have reached 3 GB or more.
  • DRAM dynamic random access memory
  • the occupation of memory resources is directly proportional to the consumption of power, so power can be saved by eliminating waste of resources.
  • the method for allocating dynamic memory resources provided in this embodiment, that is, allocating memory resources according to the needs of the terminal device, if the terminal device needs to allocate all the bandwidths, all of them are allocated, otherwise only one of them may be allocated. Part of the bandwidth, the remaining bandwidth resources are not occupied.
  • the system does not need all the memory resources, it can save, not only can guarantee the performance of the intelligent mobile terminal, but also can extend its battery life. Together with the optimized allocation method of other resources, the power saving effect can be greatly improved, and the life time of the smart mobile device terminal can be further extended.
  • the step S2 that is, the step of determining whether the bandwidth for the allocated dynamic memory is limited to the partial bandwidth, includes:
  • the limitation of limiting the bandwidth of the dynamic memory for allocation to the partial bandwidth in this embodiment is that the bandwidth of the dynamic memory for allocation is limited to a part of the bandwidth only when all the memory resource allocation requests request only part of the bandwidth, otherwise As long as there is a memory resource allocation request for the full bandwidth, the bandwidth used for allocation is not limited to ensure the performance of the intelligent mobile terminal and improve the user experience.
  • each application requesting allocation of memory resources is assigned a unique identifier, such as a unique corresponding number.
  • the handler inserts the number corresponding to the application into the linked list, and specifically inserts the linked list in order from the highest to the lowest according to the priority of each application. Then you can scan the linked list and allocate memory resources in order. However, if there is a memory resource allocation request requesting the full bandwidth, the corresponding number is inserted into the linked list header, and the handler first scans the linked list header, and the memory bandwidth for allocation is removed. After the resource allocation is completed, the corresponding number on the linked list is deleted, and the new request is received and the number corresponding to the new request is placed.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes:
  • the determination is that the condition is met. Specifically, at this time, all the memory resource allocation requests do not request the full bandwidth, and the application is not in the foreground running state, so the bandwidth of the dynamic memory for allocation can be limited to four.
  • One of the points in order to maximize the resources to reduce energy consumption, while ensuring the normal operation of the various applications of the mobile terminal in the off-screen state;
  • step S2 further includes:
  • the step S2 that is, the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth, includes:
  • the dynamic memory bandwidth for allocation is not limited.
  • the step S2 that is, the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth, includes:
  • the entire bandwidth of the dynamic memory is not originally required, but in order to speed up the startup speed of the operating system, therefore, the allocation is not limited.
  • the bandwidth of dynamic memory is not limited.
  • the step S2 that is, the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth, includes:
  • the time interval is greater than the preset threshold, if yes, the determination is complete, otherwise the time interval is determined to be greater than the preset threshold, and the preset threshold is calculated by counting the startup time of the mobile device. Determined, generally can be set to be greater than the normal startup time.
  • the above step S2 that is, the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes:
  • S21 Determine whether the operating system of the mobile device is started.
  • the bandwidth of the allocated dynamic memory cannot be limited to speed up the system startup speed. If the operating system startup is completed, it is judged according to whether the screen of the mobile device is bright, and if it is off, the bandwidth of the dynamic memory for allocation is limited. If it is bright, then it is necessary to judge the current number of CPUs. If it is less than 2, it does not limit the dynamic memory bandwidth used for allocation. If it is greater than 2, it is determined whether to limit the use of memory resources according to whether there is a request for the full bandwidth. The allocated dynamic memory bandwidth.
  • this embodiment provides an apparatus for allocating dynamic memory resources, including:
  • the request obtaining unit U1 is configured to obtain a memory resource allocation request of the application
  • the determining unit U2 is configured to determine whether a condition for limiting the bandwidth of the dynamic memory for allocation to a partial bandwidth is met;
  • Part of the bandwidth allocation unit U3, if the condition is met, is used to allocate a part of the bandwidth of the dynamic memory according to the memory resource allocation request;
  • All bandwidth allocation unit U4 if not met, is used to allocate the entire bandwidth of the dynamic memory to the application.
  • the foregoing device allocates memory resources according to the needs of the terminal device. If the terminal device needs to allocate all the bandwidths, all the resources are allocated. Otherwise, only a part of the bandwidth may be allocated, and the remaining bandwidth resources are not occupied. That is, only when the system does not need all the memory resources, it can save, not only can guarantee the performance of the intelligent mobile terminal, but also can extend its battery life.
  • the determining unit U2 includes:
  • a first determining subunit configured to determine whether there is memory for requesting full bandwidth of dynamic memory Resource allocation request
  • the second determining sub-unit if there is no memory resource allocation request requesting the full bandwidth of the dynamic memory, is used to determine the matching condition.
  • the determining unit U2 includes:
  • a second determining subunit configured to determine whether the screen of the mobile device is in a blanking state
  • the third determining subunit if the screen is in the off state, is used to determine that the condition is met when the screen is in the off state, and the bandwidth of the dynamic memory for allocation is limited to one quarter;
  • the fourth determining subunit determines whether the number of CPUs is less than 2, and if the number of CPUs is less than 2, it determines that the condition is not met.
  • the determining unit U2 further includes:
  • a third determining subunit if the number of CPUs is greater than 2, determining whether there is a memory resource allocation request for requesting all bandwidth of the dynamic memory
  • the fifth determining subunit if there is a memory resource allocation request for requesting the full bandwidth of the dynamic memory, is used to determine that the condition is not met;
  • the sixth determining subunit if there is no memory resource allocation request requesting the full bandwidth of the dynamic memory, is used to determine the matching condition.
  • the determining unit U2 includes:
  • a fourth determining sub-unit configured to determine whether a bright screen command exists when the screen of the mobile device is in a screen-off state
  • the seventh determining subunit if there is a bright screen command, is used to determine that the condition is not met.
  • the device provided in this embodiment can speed up the lighting of the screen.
  • the determining unit U2 comprises:
  • a fifth determining subunit configured to determine whether to start an operating system of the mobile device
  • the eighth determining subunit if starting to start the operating system of the mobile device, is used to determine that the condition is not met.
  • the above device utilizes the full bandwidth of the dynamic memory when the operating system is started, which speeds up the system startup speed and improves the user experience.
  • the determining unit U2 includes:
  • a sixth determining subunit configured to determine whether the operating system of the mobile device is started
  • a seventh determining subunit if the operating system is booted, determining whether there is a memory resource allocation request for requesting all bandwidth of the dynamic memory
  • the ninth determining subunit if there is a memory resource allocation request for requesting the full bandwidth of the dynamic memory, is used to determine that the condition is not met;
  • the tenth determining subunit if there is no memory resource allocation request requesting the full bandwidth of the dynamic memory, is used to determine the matching condition.
  • the determining unit U2 includes:
  • the startup completion determining subunit is configured to determine whether the operating system of the mobile device is started up;
  • the screen state determining subunit if the operating system startup is completed, determining whether the screen of the mobile device is in the off state
  • the first determination meets the conditional subunit, and if the screen is in the off state, it is used to determine that the condition is met;
  • the number of CPUs determines the subunit. If the screen is in the bright screen state, it is determined whether the number of CPUs is less than 2;
  • the first decision does not meet the conditional subunit. If the number of CPUs is less than 2, it is used to determine the discrepancy. Condition
  • the request determining subunit if the number of CPUs is greater than 2, is used to determine whether there is a memory resource allocation request for requesting all bandwidth of the dynamic memory;
  • the second determination does not meet the conditional subunit, and if there is a memory resource allocation request for requesting the full bandwidth of the dynamic memory, it is used to determine that the condition is not met;
  • the second determination meets the conditional subunit, and if there is no memory resource allocation request requesting the full bandwidth of the dynamic memory, it is used to determine the matching condition.
  • An embodiment of the present invention discloses an apparatus for allocating dynamic memory resources, including: one or more processors 200; a memory 100; one or more programs, and the one or more programs are stored in the memory 100.
  • the following operations are performed: obtaining a memory resource allocation request of the application; determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth; if And allocating a portion of the bandwidth of the dynamic memory according to the memory resource allocation request; otherwise, allocating the entire bandwidth of the dynamic memory to the application.
  • a processor 200 may be included, and as shown in FIG. 5, two processors 200 may be included.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes: determining whether there is a memory resource allocation requesting the entire bandwidth of the dynamic memory. The request; if yes, the decision does not meet the condition; otherwise, the determination meets the condition.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes: determining whether the screen of the mobile device is in a blanking state; Then, it is determined that the condition is met; if not, it is determined whether the number of CPUs is less than 2, and if the number of CPUs is less than 2, it is determined that the condition is not met.
  • the step of determining whether the bandwidth of the dynamic memory for allocation is limited to a partial bandwidth is further included, and if the number of CPUs is greater than 2, determining whether a request exists a memory resource allocation request for the entire bandwidth of the dynamic memory; if so, determining that the condition is not met; otherwise, determining that the condition is met.
  • the bandwidth of the dynamic memory for allocation is limited to one quarter.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes: when the screen of the mobile device is in a screen-off state, determining whether There is a bright screen command; if so, it is determined that the condition is not met.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a part of the bandwidth includes: determining whether to start the operating system of the mobile device; if yes, Then it is determined that the condition is not met.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes: determining whether the operating system of the mobile device is started up; if yes, Then, it is determined whether there is a memory resource allocation request for requesting the entire bandwidth of the dynamic memory; if so, it is determined that the condition is not met; otherwise, the condition is met.
  • the step of determining whether the bandwidth for limiting the allocated dynamic memory is limited to a partial bandwidth includes: determining whether the operating system of the mobile device is started up; if yes, Determining whether the screen of the mobile device is in a screen-off state; if yes, determining that the condition is met; otherwise, determining whether the number of CPUs is less than 2; if the number of CPUs is less than 2, determining that the condition is not met If the number of CPUs is greater than 2, it is determined whether there is a memory resource allocation request requesting the entire bandwidth of the dynamic memory; if so, it is determined that the condition is not met; otherwise, the condition is met.
  • embodiments of the present invention can be provided as a method, system, or computer program product.
  • the present invention can be implemented in an entirely hardware embodiment, fully software implemented For example, or in combination with an embodiment of software and hardware aspects.
  • the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Dram (AREA)

Abstract

一种用于分配动态内存资源的方法及装置,该方法包括如下步骤:获取应用程序的内存资源分配请求(S1);判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件(S2);如果符合,则根据内存资源分配请求分配动态内存的部分带宽(S3);否则,为应用程序分配动态内存的全部带宽(S4)。该方法根据终端设备的需要来分配内存资源,保证智能移动终端的性能的同时,通过省去资源的浪费来节省电能,延长智能移动终端的续航时间。

Description

一种用于分配动态内存资源的方法及装置
本申请要求在2015年12月17日提交中国专利局、申请号为201510954679.2、发明名称为“一种用于分配动态内存资源的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及智能移动终端技术领域,具体涉及一种用于分配动态内存资源的方法及装置。
背景技术
现在的智能手机的性能越来越强大,但是手机的续航一直是用户体验的痛点,用户对智能机的诟病大部分都在此。在电池技术没有革命性提高之前,优化系统资源,减少系统对资源的占用,间接中就延长了电池的续航周期。其中,按需分配资源,即通过节省一些不必要的资源消耗可以节省电能,比如CPC,可以通过系统负载来动态的调节CPU的频率和个数。GPU(图形处理器)等资源也可以按需分配。
但是,现有的系统资源优化方法,并没有很全面地优化所有的资源,因此对续航时间的提升也很有限。
DRAM(Dynamic Random Access Memory),即动态随机存取存储器,最为常见的系统内存。DRAM只能将数据保持很短的时间。为了保持数据,DRAM使用电容存储,所以必须隔一段时间刷新(refresh)一次,如果存储单元没有被刷新,存储的信息就会丢失。
发明内容
因此,本发明要解决的技术问题在于现有智能移动终端通过优化系统资源来延长续航时间的方法不够完善,效果有限。
为此,本发明实施例提供了如下技术方案:
一种用于分配动态内存资源的方法,包括如下步骤:
获取应用程序的内存资源分配请求;
判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
如果符合,则根据所述内存资源分配请求分配所述动态内存的部分带宽;
否则,为所述应用程序分配所述动态内存的全部带宽。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合所述条件;
否则,判定符合所述条件。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断所述移动设备的屏幕是否处于灭屏状态;
如果是,则判定符合所述条件;
如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合所述条件。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤,还包括:
如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合所述条件;
否则,判定符合所述条件。
优选地,当所述屏幕处于灭屏状态,则将用于分配的所述动态内存的带宽限制为四分之一。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
当所述移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令;
如果是,则判定不符合所述条件。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断是否开始启动所述移动设备的操作系统;
如果是,则判定不符合所述条件。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断所述移动设备的操作系统是否启动完成;
如果是,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合所述条件;
否则,判定符合所述条件。
优选地,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断所述移动设备的操作系统是否启动完成;
如果是,则判断所述移动设备的屏幕是否处于灭屏状态;
如果是,则判定符合所述条件;
否则,则判断CPU的个数是否小于2;
如果CPU的个数小于2,则判定不符合所述条件;
如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合所述条件;
否则,判定符合所述条件。
本发明还提供一种用于分配动态内存资源的装置,包括:
请求获取单元,用于获取应用程序的内存资源分配请求;
判断单元,用于判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
部分带宽分配单元,如果符合所述条件,则用于根据所述内存资源分配请求分配所述动态内存的部分带宽;
全部带宽分配单元,如果不符合所述条件,则用于为所述应用程序分配所述动态内存的全部带宽。
本发明又公开了一种用于分配动态内存资源的装置,包括:一个或者多个处理器;存储器;一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时,进行如下操作:获取应用程序的内存资源分配请求;判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;如果符合,则根据所述内存资源分配请求分配所述动态内存的部分带宽;否则,为所述应用程序分配所述动态内存的全部带宽。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的屏幕是否处于灭屏状态;如果是,则判定符合所述条件;如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合所述条件。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤,还包括:如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
所述的方法,其中,当所述屏幕处于灭屏状态,则将用于分配的所述动态内存的带宽限制为四分之一。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:当所述移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令;如果是,则判定不符合所述条件。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断是否开始启动所述移动设备的操作系统;如果是,则判定不符合所述条件。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的操作系统是否启动完成;如果是,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
所述的方法,其中,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的操作系统是否启 动完成;如果是,则判断所述移动设备的屏幕是否处于灭屏状态;如果是,判定符合所述条件;否则,则判断CPU的个数是否小于2;如果CPU的个数小于2,则判定不符合所述条件;如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
本发明技术方案,具有如下优点:
本发明实施例提供的用于分配动态内存资源的方法及装置,根据终端设备的需要来分配内存资源,如果终端设备需要分配全部的带宽就全部分配,否则可以只分配其中的一部分带宽,剩余的带宽资源不占用。即只有系统并不需要全部内存资源的时候才节省,从而不仅可以保证智能移动终端的性能,同时也可以延长其续航时间。与其他资源的优化分配方法一起可以大大提升省电效果,进一步延长智能移动设备终端的续航时间。
附图说明
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例1中一种用于分配动态内存资源的方法流程图;
图2为本发明实施例1中一种判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的方法流程图;
图3为本发明实施例2中一种用于分配动态内存资源的装置的原理框图。
图4为本发明实施例3中具有一个处理器的用于分配动态内存资源的装置的结构示意图;
图5为本发明实施例3中具有二个处理器的用于分配动态内存资源的装置的结构示意图;
具体实施方式
下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。
实施例1
本实施例提供一种用于分配动态内存资源的方法,如图1所示,包括如下步骤:
S1:获取应用程序的内存资源分配请求,每个应用程序启动后都需要内存资源,不管是前台运行还是后台运行,因此就需要申请分配内存资源。
S2:判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件。内存带宽是指内存与北桥之间的每秒数据传输速度,越大越好。
S3:如果符合,则根据内存资源分配请求分配动态内存的部分带宽,具体可以一半带宽、四分之一带宽或者其他数量的带宽。
S4:否则,为应用程序分配动态内存的全部带宽。
由于现有的智能移动终端的内存资源已经很强大了,比如智能手机的动态随机存取存储器(DRAM)资源已经达到3GB甚至以上了。在移动终端的很多使用场景下并不需要全部的内存资源,而内存资源的占用与电量的消耗成正比,因此可以通过省去资源的浪费来节省电能。本实施例提供的用于分配动态内存资源的方法,即根据终端设备的需要来分配内存资源,如果终端设备需要分配全部的带宽就全部分配,否则可以只分配其中的一 部分带宽,剩余的带宽资源不占用。即只有系统并不需要全部内存资源的时候才节省,从而不仅可以保证智能移动终端的性能,同时也可以延长其续航时间。与其他资源的优化分配方法一起可以大大提升省电效果,进一步延长智能移动设备终端的续航时间。
具体地,步骤S2,即判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断是否存在请求动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合条件;
否则,判定符合条件。
本实施例中将用于分配的动态内存的带宽限制为部分带宽的条件是只有所有的内存资源分配请求都只请求部分带宽的时候才将用于分配的动态内存的带宽限制为部分带宽,否则只要有一个内存资源分配请求申请的是全部带宽就不限制用于分配的带宽,以保证智能移动终端的性能,提升用户体验。
具体地,请求分配内存资源的每个应用程序都分配有一个唯一的标识,例如可以是唯一对应的编号。各个应用程序发送内存资源分配请求后,处理程序就将应用程序对应的编号插入到链表中,具体也可以根据各个应用程序的优先级从高到低按顺序插入链表中。然后就可以扫描链表并按照顺序依次分配内存资源。但是,如果有请求全部带宽的内存资源分配请求就会将其对应的编号插入到链表头,处理程序优先扫描链表头,就会取消对用于分配的内存带宽的限制。在完成资源分配后,就会删除链表上对应的编号,并接收新的请求并放入新请求对应的编号。
作为本实施方式的第一种变形,上述步骤S2,判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断移动设备的屏幕是否处于灭屏状态;
如果是,则判定符合条件,具体地,此时默认所有的内存资源分配请求都不请求全部带宽,且应用程序没有处于前台运行状态的,因此可以将用于分配的动态内存的带宽限制为四分之一,以最大限度地节省资源降低能耗,同时可以保证灭屏状态下的移动终端的各个应用的正常运行;
如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合条件,即此时不能限制用于分配的动态内存带宽。
并且上述步骤S2,还包括:
如果CPU的个数大于2,则判断是否存在请求动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合条件;
否则,判定符合条件。
作为本实施方式的第二种变形,上述步骤S2,即判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
当移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令,即是否按下亮屏按键;
如果是,则判定不符合条件。
本实施例中,在屏幕点亮过程中,为了加快屏幕点亮的速度,因此不限制用于分配的动态内存带宽。
作为本实施方式的第三种变形,上述步骤S2,即判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断是否开始启动移动设备的操作系统;
如果是,则判定不符合条件。
本实施例中,在启动移动设备的操作系统时,本来并不需要动态内存的全部带宽,但是为了加快操作系统的启动速度,因此,不限制用于分配 的动态内存的带宽。
作为本实施方式的第四种变形,上述步骤S2,即判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
判断移动设备的操作系统是否启动完成;
如果是,则判断是否存在请求动态内存的全部带宽的内存资源分配请求;
如果是,则判定不符合条件;
否则,判定符合条件。
本实施例中,判断移动设备的操作系统是否启动完成的方法有两个:一个是,获取移动设备的操作系统启动完成指令;另一个是,判断当前时间与移动设备的操作系统的开始启动时间之间的时间间隔是否大于预设阈值,如果是则判定启动完成,否则延时预设的时间后再次判断时间间隔是否大于预设阈值,该预设阈值是通过统计该移动设备的启动时间来确定的,一般可设置为大于一般的启动时间。
作为本实施方式的第五种变形,如图2所示,上述步骤S2,即判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
S21:判断移动设备的操作系统是否启动完成;
S22:如果是,则判断移动设备的屏幕是否处于灭屏状态;
S23:如果是,则判定符合条件;
S24:否则,则判断CPU的个数是否小于2;
S25:如果CPU的个数小于2,则判定不符合条件;
S26:如果CPU的个数大于2,则判断是否存在请求动态内存的全部带宽的内存资源分配请求;
S27:如果是,则判定不符合条件;
S28:否则,判定符合条件。
本实施例中,首先如果移动设备的操作系统尚未启动完成,则不能限制用于分配的动态内存的带宽,以加快系统启动速度。如果操作系统启动完成了,就要根据移动设备的屏幕是否是亮的来判断,如果是灭的,那么就限制用于分配的动态内存的带宽。而如果是亮的,那么就要判断当前的CPU个数,小于2就不限制用于分配的动态内存带宽,大于2就要根据是否存在请求全部带宽的内存资源分配请求来确定是否限制用于分配的动态内存带宽。
实施例2
如图3所示,本施例提供了一种用于分配动态内存资源的装置,包括:
请求获取单元U1,用于获取应用程序的内存资源分配请求;
判断单元U2,用于判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
部分带宽分配单元U3,如果符合条件,则用于根据内存资源分配请求分配动态内存的部分带宽;
全部带宽分配单元U4,如果不符合条件,则用于为应用程序分配动态内存的全部带宽。
上述装置,根据终端设备的需要来分配内存资源,如果终端设备需要分配全部的带宽就全部分配,否则可以只分配其中的一部分带宽,剩余的带宽资源不占用。即只有系统并不需要全部内存资源的时候才节省,从而不仅可以保证智能移动终端的性能,同时也可以延长其续航时间。
具体地,判断单元U2包括:
第一判断子单元,用于判断是否存在请求动态内存的全部带宽的内存 资源分配请求;
第一判定子单元,如果存在请求动态内存的全部带宽的内存资源分配请求,则用于判定不符合条件;
第二判定子单元,如果不存在请求动态内存的全部带宽的内存资源分配请求,则用于判定符合条件。
作为本实施例的第一种变形方式,判断单元U2包括:
第二判断子单元,用于判断移动设备的屏幕是否处于灭屏状态;
第三判定子单元,如果屏幕处于灭屏状态,则用于判定符合条件当屏幕处于灭屏状态,此时将用于分配的动态内存的带宽限制为四分之一;
第四判定子单元,如果屏幕是亮的,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合条件。
另外,判断单元U2还包括:
第三判断子单元,如果CPU的个数大于2,则用于判断是否存在请求动态内存的全部带宽的内存资源分配请求;
第五判定子单元,如果存在请求动态内存的全部带宽的内存资源分配请求,则用于判定不符合条件;
第六判定子单元,如果不存在请求动态内存的全部带宽的内存资源分配请求,则用于判定符合条件。
作为本实施例的第二种变形方式,判断单元U2包括:
第四判断子单元,当移动设备的屏幕处于灭屏状态时,用于判断是否存在亮屏指令;
第七判定子单元,如果存在亮屏指令,则用于判定不符合条件。
本实施例提供的装置,可以加快屏幕点亮的速度。
作为本实施例的第三种变形方式,判断单元U2包括:
第五判断子单元,用于判断是否开始启动移动设备的操作系统;
第八判定子单元,如果开始启动移动设备的操作系统,则用于判定不符合条件。
上述装置,在操作系统启动时利用动态内存的全部带宽,加快了系统启动速度,提升用户体验。
作为本实施例的第四种变形方式,判断单元U2包括:
第六判断子单元,用于判断移动设备的操作系统是否启动完成;
第七判断子单元,如果操作系统启动完成,则用于判断是否存在请求动态内存的全部带宽的内存资源分配请求;
第九判定子单元,如果存在请求动态内存的全部带宽的内存资源分配请求,则用于判定不符合条件;
第十判定子单元,如果不存在请求动态内存的全部带宽的内存资源分配请求,则用于判定符合条件。
作为本实施例的第五种变形方式,判断单元U2包括:
启动完成判断子单元,用于判断移动设备的操作系统是否启动完成;
屏幕状态判断子单元,如果操作系统启动完成,则判断移动设备的屏幕是否处于灭屏状态;
第一判定符合条件子单元,如果屏幕处于灭屏状态,则用于判定符合条件;
CPU个数判断子单元,如果屏幕处于亮屏屏状态,则判断CPU的个数是否小于2;
第一判定不符合条件子单元,如果CPU的个数小于2,则用于判定不符 合条件;
请求判断子单元,如果CPU的个数大于2,则用于判断是否存在请求动态内存的全部带宽的内存资源分配请求;
第二判定不符合条件子单元,如果存在请求动态内存的全部带宽的内存资源分配请求,则用于判定不符合条件;
第二判定符合条件子单元,如果不存在请求动态内存的全部带宽的内存资源分配请求,则用于判定符合条件。
实施例3
本发明实施例公开了一种用于分配动态内存资源的装置,包括:一个或者多个处理器200;存储器100;一个或者多个程序,所述一个或者多个程序存储在所述存储器100中,当被所述一个或者多个处理器200执行时,进行如下操作:获取应用程序的内存资源分配请求;判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;如果符合,则根据所述内存资源分配请求分配所述动态内存的部分带宽;否则,为所述应用程序分配所述动态内存的全部带宽。具体为如图4所示可以包括一个处理器200,如图5所示可以包括二个处理器200。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的屏幕是否处于灭屏状态;如果是,则判定符合所述条件;如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合所述条件。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤,还包括:如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
本实施例的所述方法,优选为,当所述屏幕处于灭屏状态,则将用于分配的所述动态内存的带宽限制为四分之一。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:当所述移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令;如果是,则判定不符合所述条件。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断是否开始启动所述移动设备的操作系统;如果是,则判定不符合所述条件。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的操作系统是否启动完成;如果是,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
本实施例的所述方法,优选为,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:判断所述移动设备的操作系统是否启动完成;如果是,则判断所述移动设备的屏幕是否处于灭屏状态;如果是,判定符合所述条件;否则,则判断CPU的个数是否小于2;如果CPU的个数小于2,则判定不符合所述条件;如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;如果是,则判定不符合所述条件;否则,判定符合所述条件。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施 例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保 护范围之中。

Claims (19)

  1. 一种用于分配动态内存资源的方法,其特征在于,包括如下步骤:
    获取应用程序的内存资源分配请求;
    判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
    如果符合,则根据所述内存资源分配请求分配所述动态内存的部分带宽;
    否则,为所述应用程序分配所述动态内存的全部带宽。
  2. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  3. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的屏幕是否处于灭屏状态;
    如果是,则判定符合所述条件;
    如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合所述条件。
  4. 根据权利要求3所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤,还包括:
    如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  5. 根据权利要求3或4所述的方法,其特征在于,当所述屏幕处于灭屏状态,则将用于分配的所述动态内存的带宽限制为四分之一。
  6. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    当所述移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令;
    如果是,则判定不符合所述条件。
  7. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断是否开始启动所述移动设备的操作系统;
    如果是,则判定不符合所述条件。
  8. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的操作系统是否启动完成;
    如果是,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  9. 根据权利要求1所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的操作系统是否启动完成;
    如果是,则判断所述移动设备的屏幕是否处于灭屏状态;
    如果是,则判定符合所述条件;
    否则,则判断CPU的个数是否小于2;
    如果CPU的个数小于2,则判定不符合所述条件;
    如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  10. 一种用于分配动态内存资源的装置,其特征在于,包括:
    请求获取单元,用于获取应用程序的内存资源分配请求;
    判断单元,用于判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
    部分带宽分配单元,如果符合所述条件,则用于根据所述内存资源分配请求分配所述动态内存的部分带宽;
    全部带宽分配单元,如果不符合所述条件,则用于为所述应用程序分配所述动态内存的全部带宽。
  11. 一种用于分配动态内存资源的装置,其特征在于,包括:
    一个或者多个处理器;
    存储器;
    一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时,进行如下操作:
    获取应用程序的内存资源分配请求;
    判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件;
    如果符合,则根据所述内存资源分配请求分配所述动态内存的部分带 宽;
    否则,为所述应用程序分配所述动态内存的全部带宽。
  12. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  13. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的屏幕是否处于灭屏状态;
    如果是,则判定符合所述条件;
    如果否,则判断CPU的个数是否小于2,如果CPU的个数小于2,则判定不符合所述条件。
  14. 根据权利要求13所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤,还包括:
    如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  15. 根据权利要求13或14所述的方法,其特征在于,当所述屏幕处于灭屏状态,则将用于分配的所述动态内存的带宽限制为四分之一。
  16. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    当所述移动设备的屏幕处于灭屏状态时,判断是否存在亮屏指令;
    如果是,则判定不符合所述条件。
  17. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断是否开始启动所述移动设备的操作系统;
    如果是,则判定不符合所述条件。
  18. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的操作系统是否启动完成;
    如果是,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
  19. 根据权利要求11所述的方法,其特征在于,所述判断是否符合将用于分配的动态内存的带宽限制为部分带宽的条件的步骤包括:
    判断所述移动设备的操作系统是否启动完成;
    如果是,则判断所述移动设备的屏幕是否处于灭屏状态;
    如果是,则判定符合所述条件;
    否则,则判断CPU的个数是否小于2;
    如果CPU的个数小于2,则判定不符合所述条件;
    如果CPU的个数大于2,则判断是否存在请求所述动态内存的全部带宽的内存资源分配请求;
    如果是,则判定不符合所述条件;
    否则,判定符合所述条件。
PCT/CN2016/088545 2015-12-17 2016-07-05 一种用于分配动态内存资源的方法及装置 Ceased WO2017101324A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/242,720 US20170177255A1 (en) 2015-12-17 2016-08-22 Method and electronic device for allocating dynamic memory resources

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510954679.2A CN105893140A (zh) 2015-12-17 2015-12-17 一种用于分配动态内存资源的方法及装置
CN201510954679.2 2015-12-17

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/242,720 Continuation US20170177255A1 (en) 2015-12-17 2016-08-22 Method and electronic device for allocating dynamic memory resources

Publications (1)

Publication Number Publication Date
WO2017101324A1 true WO2017101324A1 (zh) 2017-06-22

Family

ID=57001992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/088545 Ceased WO2017101324A1 (zh) 2015-12-17 2016-07-05 一种用于分配动态内存资源的方法及装置

Country Status (3)

Country Link
US (1) US20170177255A1 (zh)
CN (1) CN105893140A (zh)
WO (1) WO2017101324A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107153576A (zh) 2017-04-10 2017-09-12 广东欧珀移动通信有限公司 一种内存资源的分配方法及终端设备
CN107438284B (zh) * 2017-09-12 2020-04-28 北京邮电大学 资源分配方法及装置
US10725819B2 (en) 2018-05-18 2020-07-28 Acronis International Gmbh System and method for scheduling and allocating data storage
CN109995862B (zh) * 2019-03-29 2021-10-15 北京百度网讯科技有限公司 一种资源调度方法及终端
CN110134655A (zh) * 2019-04-30 2019-08-16 华为技术有限公司 一种资源管理方法、装置和设备
CN112395080B (zh) * 2019-08-19 2025-09-05 阿里巴巴集团控股有限公司 基于fpga的资源分配方法、装置、存储介质及计算机设备
US12050937B2 (en) 2021-09-21 2024-07-30 International Business Machines Corporation Preventing resource exploitation in mobile devices
CN118140215A (zh) * 2021-09-30 2024-06-04 华为技术有限公司 一种内存控制器和带内存控制器的数据处理系统
CN114916017B (zh) * 2022-07-18 2022-10-04 荣耀终端有限公司 数据传输的方法、电子设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050086404A1 (en) * 2001-10-12 2005-04-21 Wolf-Dietrich Weber Method and apparatus for scheduling a resource to meet quality-of-service restrictions
CN102428450A (zh) * 2009-03-11 2012-04-25 新诺普系统公司 用于资源控制的系统和方法
CN103139099A (zh) * 2012-12-31 2013-06-05 北京北大众志微系统科技有限责任公司 自适应的带宽调节方法及装置
CN103200318A (zh) * 2013-03-07 2013-07-10 惠州Tcl移动通信有限公司 移动终端的节电方法及移动终端
CN105095146A (zh) * 2014-05-09 2015-11-25 华为技术有限公司 基于内存控制器的带宽分配方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050086404A1 (en) * 2001-10-12 2005-04-21 Wolf-Dietrich Weber Method and apparatus for scheduling a resource to meet quality-of-service restrictions
CN102428450A (zh) * 2009-03-11 2012-04-25 新诺普系统公司 用于资源控制的系统和方法
CN103139099A (zh) * 2012-12-31 2013-06-05 北京北大众志微系统科技有限责任公司 自适应的带宽调节方法及装置
CN103200318A (zh) * 2013-03-07 2013-07-10 惠州Tcl移动通信有限公司 移动终端的节电方法及移动终端
CN105095146A (zh) * 2014-05-09 2015-11-25 华为技术有限公司 基于内存控制器的带宽分配方法及装置

Also Published As

Publication number Publication date
CN105893140A (zh) 2016-08-24
US20170177255A1 (en) 2017-06-22

Similar Documents

Publication Publication Date Title
WO2017101324A1 (zh) 一种用于分配动态内存资源的方法及装置
WO2017113688A1 (zh) 一种资源分配方法及装置
JP6412162B2 (ja) グラフィックスフレーム処理において電力消費を低減させるためのcpu/gpu dcvs相互最適化
JP6178512B2 (ja) 選択的な電力または性能の最適化を伴うメモリチャネルインターリービングのためのシステムおよび方法
US9697124B2 (en) Systems and methods for providing dynamic cache extension in a multi-cluster heterogeneous processor architecture
JP5792351B2 (ja) マルチスレッドプロセッサ内で割り込みを割り当てるための方法及びシステム
US10713091B2 (en) Streaming program execution method of intelligent terminal
CN113419846B (zh) 资源配置方法和装置、电子设备及计算机可读存储介质
CN104239153B (zh) 多核cpu负载均衡的方法和装置
JP2017511940A (ja) デバイス固有又はユーザー固有のリソース使用プロファイルに基づくリソース管理
US9507641B1 (en) System and method for dynamic granularity control of parallelized work in a portable computing device (PCD)
CN103744736A (zh) 内存管理的方法及Linux终端
CN109685712B (zh) 图像缓存和使用方法及装置、终端
CN106797557B (zh) 数据传输的方法和终端
KR20140145748A (ko) 다중 코어 환경에서 프로세스의 할당 방법 및 장치
CN104364759A (zh) 用于控制计算机系统上硬件资源使用情况的方法、系统以及可执行代码段
CN111338803B (zh) 一种线程处理方法和装置
CN116578422A (zh) 资源分配方法和电子设备
CN103513956A (zh) 一种处理器处理数据的方法以及装置
CN107562520A (zh) 扩容虚拟机的内存的方法和装置
CN111352710B (zh) 进程管理方法及装置、计算设备、存储介质
WO2019056263A1 (zh) 计算机存储介质、嵌入式调度方法及系统
US20140053162A1 (en) Thread processing method and thread processing system
CN115712337A (zh) 处理器的调度方法、装置、电子设备及存储介质
CN119127417A (zh) 任务处理方法、任务分配方法及计算设备

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: 16874387

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16874387

Country of ref document: EP

Kind code of ref document: A1