WO2014161374A1 - 对移动通信设备进行加速的方法及装置 - Google Patents

对移动通信设备进行加速的方法及装置 Download PDF

Info

Publication number
WO2014161374A1
WO2014161374A1 PCT/CN2014/070687 CN2014070687W WO2014161374A1 WO 2014161374 A1 WO2014161374 A1 WO 2014161374A1 CN 2014070687 W CN2014070687 W CN 2014070687W WO 2014161374 A1 WO2014161374 A1 WO 2014161374A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
mobile communication
communication device
size
idle state
Prior art date
Application number
PCT/CN2014/070687
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 北京奇虎科技有限公司
Publication of WO2014161374A1 publication Critical patent/WO2014161374A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present invention relates to the field of mobile communication terminal technologies, and in particular, to a method and apparatus for accelerating a mobile communication device. Background technique
  • the i OS system is an operating system for handheld devices such as mobile phones. Since the iOS system is relatively closed, each application can only read files in the file system created for the program, and can not be accessed elsewhere. This area is called a sandbox, and all non-code files are saved here. Such as images, icons, sounds, images, property lists, text files, and more.
  • the iOS platform There are three common installation packages on the iOS platform: deb, ipa, and pxl, where the ipa format is a proprietary software installation package that is available on the iOS platform.
  • the ipa file is essentially a z ip archive (not a rar or 7z package). Since the z ip package cannot record permissions and owner information, the iOS system developer specifies the installation method of ipa, that is, all ipa will be unpacked and installed.
  • the above characteristics of the iOS operating system ensure the security and stability of the entire system, and there are obvious defects in other aspects. For example, when a user has enabled many applications, more and more memory is being used, causing the system to process data slower. If an open operating system such as Android can obtain the super-privilege of the mobile communication device by the program to batchly close the application that does not need to run, the resource is released, and the mobile communication device is accelerated. However, due to the closed nature of the iOS system, the program cannot obtain the super-rights of the mobile communication device, and thus the operation of closing other applications cannot be performed. Therefore, the letter device is accelerated.
  • an open operating system such as Android can obtain the super-privilege of the mobile communication device by the program to batchly close the application that does not need to run, the resource is released, and the mobile communication device is accelerated.
  • the program cannot obtain the super-rights of the mobile communication device, and thus the operation of closing other applications cannot be performed. Therefore, the letter device is accelerated.
  • the screen ⁇ bottom ⁇ shows the application that is already open and is currently in the background; nextly, the user needs to press and hold any one of the application icons, after about 1.5 seconds, the icon automatically shakes, and A red delete mark appears in the upper right corner of each icon; the user clicks on the red delete In addition to marking, the app is closed. If you want to close other apps, click the red delete tag in the top left corner of the other app. In addition to the cumbersome method of closing, more than 4 users do not know the function of closing the application. These users think that as long as the home button is pressed, the desktop of the mobile communication device is displayed, and the running application is closed. This leads to more and more memory usage and slower and slower operation. Summary of the invention
  • the present invention has been made in order to provide a method and apparatus for accelerating a mobile communication device that overcomes the above problems or at least partially solves the above problems, and is capable of cleaning system memory and accelerating the mobile communication device.
  • a method for accelerating a mobile communication device comprising: acquiring the mobile communication device in an idle state The size of the memory of the state; requesting the virtual memory system to allocate memory for the application currently being used, wherein the size of the requested memory is greater than the size of the memory in the idle state; so that the virtual memory system is responding to the allocation
  • the memory request is made, the memory in the idle state is converted into active memory, and after the memory in the idle state is found to be insufficient for allocation, the memory that is partially or completely inactive is also converted into an active state;
  • the virtual memory system is requested to release the memory that is converted into an active state, so that the virtual memory system converts the memory into an active state in response to the request to release the memory. Is idle, thus leaving the original idle Memory converted back to an idle state, and the portion or all of the original memory is also inactive state into an idle state.
  • an apparatus for accelerating a mobile communication device wherein the mobile communication device runs an operating system that does not have user rights, the device comprising: a first memory size acquisition unit, Obtaining a size of the memory in the idle state in the mobile communication device; a memory allocation requesting unit, configured to request the virtual memory system to allocate memory for an application currently being used, where the requested memory is larger than the idle The size of the memory of the state; so that the virtual memory system converts the memory in the idle state into active memory in response to the request to allocate the memory, and after discovering that the memory in the idle state is insufficient for allocation, the portion is The memory that is in the inactive state is also converted into an active state; the memory release request unit is configured to request the virtual memory system to release the memory that is converted into an active state after the requested memory is converted into an active state, so as to be The virtual memory system responds to the release of memory When requested, the memory converted into an active state is converted into an idle state, thereby re-converting the originally idle memory
  • the method and apparatus for accelerating a mobile communication device can request a certain size of a memory space from a virtual memory system through an application for performing acceleration, and ensure that the specified large The size is larger than the current free memory, so that the original free memory is converted into active memory together with the original inactive memory; after that, the virtual memory system is requested to release the memory space of the request, and re-convert it into free space.
  • the free memory is increased, that is, the memory is cleaned, and the mobile is realized. Acceleration of communication equipment.
  • Figure 1 shows a flow chart of a method in accordance with one embodiment of the present invention
  • FIG. 2 shows a schematic diagram of a memory state in accordance with one embodiment of the present invention
  • FIG. 3 shows another memory state diagram according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram showing still another memory state according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram showing an apparatus according to an embodiment of the present invention.
  • Figure 6 shows a block diagram of an intelligent electronic device for performing the method according to the invention
  • Figure 7 shows a schematic diagram of a storage unit for holding or carrying program code implementing the method according to the invention.
  • an operating system that does not have user rights, such as iOS
  • uses a virtual memory system to manage the use of memory, and maps the logical address of the application to the physical memory address.
  • a program is told by the system that the available memory segments are 0 to 100 pages.
  • the memory segments it occupies may be scattered. It is possible that the actual physical range it occupies is 70-120 pages, 201 pages to 240 pages. There are also 10 pages on the disk, and so on.
  • the virtual memory system can be triggered to automatically release the occupied memory by some means to accelerate the mobile phone.
  • Active list (act ive l i s t ) - Manages active memory, pages that have recently been mapped to physical memory, and are being used by the program.
  • Inactive ive l i s t - A page that manages inactive memory, currently in physical memory, but has not been used recently. These pages contain data that has long been used by applications that are in the background, allowing them to be purged from physical memory at any time.
  • Linked memory and active memory cannot be released, so only the released objects can be targeted to inactive memory. As mentioned earlier, "If there is not enough free memory in physical memory, the virtual memory system will release some occupied memory.” This "occupied memory” refers to inactive memory.
  • the size of the memory in the idle state may be first obtained by using the system function, and then the virtual memory system is requested to allocate a memory area of a specified size to the currently used program, and the size of the memory area is greater than The size of the memory that is currently idle.
  • the virtual memory system will forcibly release some inactive memory and redistribute the memory as active memory for use.
  • the allocated memory can be directly released. In this way, the inactive memory allocated as active memory is released, which is equivalent to cleaning up the memory and increasing the free memory. Maintain energy consumption due to inactive memory. The method is described in detail below.
  • an embodiment of the present invention first provides a method for accelerating a mobile communication device.
  • the mobile communication device runs an operating system that does not have user rights, such as an iOS system.
  • the method may include the following steps:
  • S101 Obtain a size of a memory in an idle state in the mobile communication device
  • the size of the memory in the idle state can be obtained through the system function provided by the iOS system.
  • the user can be provided with an acceleration of the mobile communication terminal in an application manner.
  • the application can be a stand-alone program or a function module in a program.
  • the user can install the application in his mobile communication terminal, and then the user can launch the application and enter the interface of the application when the mobile communication terminal needs to be accelerated.
  • the user can be provided with a button such as "immediate acceleration" in the interface, and then when the user enters by clicking the button, the step of obtaining the size of the free memory can be triggered. Or, in addition to the way that the user manually triggers, it can also be triggered in an automatic manner.
  • the size of the memory that is currently in an inactive state can be automatically obtained by calling a system function. And then compare it with a preset threshold (which can be set according to actual needs). If the threshold is exceeded, it proves that the memory that is currently inactive is relatively large, which may have affected the running speed of the system. The step of obtaining the size of the free memory is then automatically triggered, and so on.
  • S102 requesting a virtual memory system to allocate memory for an application currently being used, where a size of the requested memory is greater than a size of the memory in an idle state; so that the virtual memory system responds to the request for allocating memory Converting the idle memory into active memory, and converting some or all of the inactive memory into an active state after discovering that the idle memory is insufficient for allocation;
  • the virtual memory system may first be requested to allocate a specified size of memory for the application currently being used, the specified size. It is larger than the size of the memory in the idle state acquired in step S101. In this way, after the virtual memory system receives the request, it will find that the free memory is not enough, so it will release some inactive memory, and then the original idle memory and the partially released inactive memory. Assigned to the application that is currently being used, that is, the memory is converted to an active state.
  • S103 After the requested memory is converted into an active state, requesting the virtual memory system to release the memory converted into an active state, so that the virtual memory system converts the request into a response to the request to release the memory
  • the active state memory is converted to an idle state, thereby re-converting the originally idle memory to an idle state, and converting some or all of the previously inactive memory into an idle state.
  • the application for accelerating the mobile communication device in the embodiment of the present invention does not use the memory to perform operations such as storing or processing data, but directly releases the memory. In this way, the memory will be converted to an idle state.
  • the memory that is converted to the idle state at this time is the memory that is converted to the active state in step S102, and the size of the portion of the memory is larger than the size of the free memory acquired in step S101, and therefore, in step S103
  • the memory that is converted to the idle state is also larger than the free memory acquired in step S101. That is, after the processing of steps S102 and S103, the free memory in the mobile communication device is increased, which is equivalent to Converting the memory that was originally inactive to free memory is equivalent to cleaning up the memory and speeding up the mobile communication device.
  • an application program for performing acceleration may request a memory space of a specified size from the virtual memory system, and ensure that the specified size is larger than the current free memory size, so as to be The free memory is converted into active memory along with the original inactive memory. After that, the virtual memory system is requested to release the memory space of the request and re-convert it into free space, which is equivalent to re-converting the original free memory back. Free memory, at the same time, the original inactive memory is also converted into free memory, which is equivalent to the original inactive memory is released, free memory is increased, that is, the memory is cleaned, and the acceleration of the mobile communication device is realized.
  • the size of the memory currently in the inactive state may be acquired while acquiring the memory size currently in the idle state in step S101, and thus, the virtual memory system is requested in step S102.
  • the specified size can be equal to the sum of the size of the memory that is currently idle and inactive.
  • the virtual memory system is requested to allocate the memory area where the inactive memory size and the free memory size are summed, that is, the portion of the rightmost two boxes in Figure 2.
  • the inactive memory is forcibly released and reallocated, and becomes active together with the free memory.
  • the memory is used by the application for acceleration in the embodiment of the present invention. After redistribution, the memory state changes to Figure 3, that is, the original inactive memory and free memory in Figure 2 become active memory.
  • Free-count get _vm_f reecount (); ⁇ Get the number of free memory pages
  • Da ta ma l loc (freeS i ze) ; ⁇ allocate memory, at this time inactive memory will be forcibly allocated by the virtual memory system
  • Inactive memory is part of the kernel maintenance running in the linked memory, so the tasks managed by the kernel change, and the size of the linked memory changes.
  • the virtual memory system will re-update the state of the memory, and the size of the linked memory, active memory, and inactive memory may be reallocated. That is, although it seems that all of the "all" inactive memory can be converted into free memory, and from Figure 4, it seems that there is no inactive memory, but actually after converting the memory to the state of Figure 4.
  • the virtual memory system in the operating system automatically re-allocates the memory and allocates a portion of the inactive memory. Since some inactive memory occurs after the reallocation, there is still room for further acceleration, so that the acceleration processing can be continued, that is, the aforementioned steps S101 to S103 are re-executed. Of course, after releasing to a certain extent, there may be no memory to release. At this point, the system will only issue a memory warning. After receiving the warning, it is no longer necessary to continue the acceleration process. As long as it is before this warning, it can be cycled for acceleration.
  • the pre-set condition may be that the inactive memory is less than a certain threshold. Therefore, after performing an acceleration process, the size of the processed inactive memory may be acquired, and then compared with the threshold. If the threshold is less than the threshold, Then you can no longer continue the acceleration process. That is to say, it is possible to determine the degree of acceleration based on information such as prior experience and, after reaching this level, even if the system has not issued a warning message, it is not necessary to continue the acceleration.
  • information such as the ratio of acceleration can be calculated according to the size of the free memory before the acceleration and the size of the free memory after the acceleration, and then the information is displayed to the user.
  • the embodiment of the present invention further provides an apparatus for accelerating the mobile communication device, where the mobile communication device operates An operating system with no open user rights, see Figure 5, the device may include:
  • a first memory size obtaining unit 501 configured to acquire a size of a memory in the idle state of the mobile communication device
  • the memory allocation requesting unit 502 is configured to request the virtual memory system to allocate memory for the application currently being used, wherein the size of the requested memory is greater than the size of the memory in the idle state, and the requested memory conversion is performed after the allocation is successful. Active state
  • the memory release requesting unit 503 is configured to: after the requested memory is converted into an active state, request the virtual memory system to release the memory that is converted into an active state, so that the virtual memory system responds to the request for releasing the memory
  • the memory converted into an active state is converted into an idle state, thereby re-converting the memory that was originally in the idle state into an idle state, and converting some or all of the memory that was originally in an inactive state into an idle state.
  • the apparatus may further include: a second memory size acquiring unit, configured to acquire the mobile device when the size of the memory in the idle state is acquired, in order to obtain the acceleration gain to be maximized in an acceleration process. a size of a memory in an inactive state in the communication device; a sum of memory obtaining unit, configured to obtain a sum of sizes of the memory in the idle state and the inactive state in the mobile communication device;
  • the memory allocation requesting unit 502 may specifically be used to:
  • the device may further include:
  • a first triggering unit configured to receive, by using a preset portal, a request for accelerating a mobile communication device by using a preset entry, before the acquiring the size of the memory in the idle state in the mobile communication device, triggering, by the request, the request Obtaining an operation of the size of the memory in the idle state in the mobile communication device.
  • the apparatus may further include:
  • a second triggering unit configured to acquire, before the size of the memory in the idle state of the mobile communication device, a size of a memory that is in an inactive state in the mobile communication device, if the memory is in an inactive state
  • the size reaches a preset threshold, the operation of acquiring the size of the memory in the idle state in the mobile communication device is triggered.
  • the device may further comprise:
  • the acceleration unit for re-acquiring the size of the memory in the idle state of the mobile communication device after converting the memory that is partially inactive or inactive to the idle state, causing the virtual memory system to reallocate the memory.
  • the system may further comprise:
  • a first ending acceleration unit configured to stop the acceleration processing of the mobile communication device after receiving a warning message sent by the operating system that is free of memory available for release.
  • the apparatus may further include:
  • the second end acceleration unit is configured to determine the size of the memory in each state after the acceleration, and if the predetermined condition is satisfied, the acceleration processing on the mobile communication device is stopped.
  • the operating system that does not have open user rights includes an iOS operating system.
  • an application program for performing acceleration may request a memory space of a specified size from the virtual memory system, and ensure that the specified size is larger than the current free memory size, so as to be The free memory is converted into active memory along with the original inactive memory. After that, the virtual memory system is requested to release the memory space of the request and re-convert it into free space, which is equivalent to re-converting the original free memory back. Free memory, at the same time, the original inactive memory is also converted into free memory, which is equivalent to the original inactive memory is released, free memory is increased, that is, the memory is cleaned, and the acceleration of the mobile communication device is realized.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • All of the features disclosed in this specification, including the accompanying claims, the abstract and the drawings, and all processes or units of any of the methods or devices disclosed herein may be combined in any combination.
  • Each feature disclosed in the specification including the accompanying claims, the abstract, and the drawings) may be replaced by alternative features that provide the same, equivalent, or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of some or all of the components of the device for accelerating the mobile communication device in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the present invention may be stored on a computer readable medium or may have the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 6 illustrates a mobile communication device that can implement the method of the present invention for accelerating a mobile communication device.
  • the mobile communication device conventionally includes a processor 610 and a computer program product or computer readable medium in the form of a memory 620.
  • Memory 620 can be a storage space 630 of code 631 such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the storage space 630 for the program code may include reading into the one or more computer products, or writing to the one or more program products, respectively.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage section or a storage space or the like arranged similarly to the storage 620 in the mobile communication device of FIG.
  • the program code may, for example, be in a proper order, ie, code readable by a processor, such as 610, which when executed by the mobile communication device causes the mobile communication device to perform the method described above Each step.
  • the word “comprising” does not exclude the presence of the elements or steps that are not in the claims.
  • the word “a” or “an” preceding a component does not exclude the presence of a plurality of such elements.
  • the invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item.
  • the use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
  • the application can be applied to a computer system/server that can operate with numerous other general purpose or special purpose computing system environments or configurations.
  • Examples of well-known computing systems, environments, and/or configurations suitable for use with computer systems/servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, based on Microprocessor systems, set-top boxes, programmable consumer electronics, networked personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above, and the like.
  • the computer system/server can be described in the general context of computer system executable instructions (such as program modules) being executed by a computer system.
  • program modules may include routines, programs, target programs, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communication network.
  • program modules may be located on a local or remote computing system storage medium including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

本发明公开了对移动通信设备进行加速的方法及装置,移动通信设备中运行有未开放用户权限的操作系统,所述方法包括:获取所述移动通信设备中处于空闲状态的内存的大小;请求虚拟内存系统为当前正在被使用的应用分配内存,其中,所请求的内存的大小大于所述处于空闲状态的内存的大小;以便将所述处于空闲状态的内存转化为活跃内存,并将部分或全部处于非活跃状态的内存也转化为活跃状态;请求虚拟内存系统为将所述转化为活跃状态的内存释放,以便将所述转化为活跃状态的内存转化为空闲状态,从而将原处于空闲状态的内存重新转化为空闲状态,并将原处于非活跃状态的内存也转化为空闲状态,通过本发明,能够清理系统内存,实现对移动通信设备的加速。

Description

对移动通信设备进行加速的方法及装置
技术领域
本发明涉及移动通信终端技术领域,具体涉及对移动通信设备进行加速的 方法及装置。 背景技术
i OS系统是一种手持设备(如手机等 )的操作系统。由于 iOS系统比较封闭, 每个应用程序只能在为该程序创建的文件系统中读取文件,不可以去其它地方 访问,此区域被成为沙盒,所有的非代码文件都要保存在此,例如图像、 图标、 声音、 映像、 属性列表、 文本文件等。
iOS 平台上常见的安装包有三种: deb、 ipa 和 pxl , 其中, ipa 格式是 在 iOS 平台上推出的专属软件安装包。 ipa 文件实质是一个 z ip压缩包(不 是 rar 或 7z 包), 由于 z ip 包不能记录权限和所有者等信息, 所以 iOS系统 开发商规定了 ipa 的安装方式, 即全部 ipa 都会解包安装在 /var/mob i le/Appl icat ions 目录下, 全部文件和目录的所有者及用户组均设 为 mobi le (ID 为 501) , 主程序(可执行文件)的权限设为 0755 (所有人都可 以执行, 但只有所有者可以修改), 可执行文件在 pl i s t 中定义。 全部目录权 限设为 0755 , 而其它所有文件都设为 0644 (仅所有者可以修改, 其余人只允 许读取,全部人都不允许执行)。 ipa 解包后并非直接放置于 Appl i cat ions 目 录下, 而是放在一串由随机码构成的目录下, 其作用在于, 只允许这个软件运 行在一个特定的沙盒(Sandbox)中, 不能干扰其他软件。 由于这个软件只能在 这个特定的目录下运行(当然了,部分程序会调用系统的通讯录、相机等组件, 但仍然是受限制的) , 从而保证了整个系统的安全性和稳定性。
iOS操作系统的上述特点在保证整个系统的安全性和稳定性的同时, 也在 其他方面存在着明显的缺陷。 例如, 当用户启用了很多应用之后, 内存使用越 来越多, 导致系统处理数据变慢。 如果 Android等开放式的操作系统, 则可以 通过程序获取移动通信设备的超级权限来批量地关闭不需要运行的应用的办 法来释放资源, 起到移动通信设备加速目的。 但由于 iOS系统的封闭性, 程序 无法获得移动通信设备的超级权限,也就无法进行关闭其他应用的操作,因此, 信设备加速。 例如、, 双击 hom键, 屏 ^底^显示处于已经打开的、 目前处于后 台的应用; 接下来需要用户长按住其中任意一个应用图标, 约过 1. 5秒后, 图 标自动晃动, 并在各个图标右上角出现一个红色删除的标记; 用户点击红色删 除标记, 该应用被关闭。 如果要关闭其他的应用, 就点击其他应用左上角的红 色删除标记。这种关闭方法除了繁瑣之外, 4艮多用户还不知道有这个关闭应用 的功能, 这些用户以为只要按了 home键, 显示出移动通信设备的桌面, 运行中 的应用就关闭了, 这进一步导致内存占用越来越多, 运行效率越来越慢。 发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地 解决上述问题的对移动通信设备进行加速的方法及装置, 能够清理系统内存, 实现对移动通信设备的加速。
依据本发明的一个方面,提供了一种对移动通信设备进行加速的方法, 所 述移动通信设备中运行有未开放用户权限的操作系统, 所述方法包括: 获取所 述移动通信设备中处于空闲状态的内存的大小;请求虚拟内存系统为当前正在 被使用的应用分配内存, 其中, 所请求的内存的大小大于所述处于空闲状态的 内存的大小; 以便所述虚拟内存系统在响应所述分配内存的请求时,将所述处 于空闲状态的内存转化为活跃内存,并在发现处于空闲状态的内存不足以分配 之后,将部分或全部处于非活跃状态的内存也转化为活跃状态; 在所请求的内 存转化为活跃状态之后,请求虚拟内存系统为将所述转化为活跃状态的内存释 放, 以便所述虚拟内存系统在响应所述释放内存的请求时,将所述转化为活跃 状态的内存转化为空闲状态,从而将原处于空闲状态的内存重新转化为空闲状 态, 并将所述部分或全部原处于非活跃状态的内存也转化为空闲状态。
根据本发明的另一方面,提供了一种对移动通信设备进行加速的装置, 所 述移动通信设备中运行有未开放用户权限的操作系统, 所述装置包括: 第一内 存大小获取单元, 用于获取所述移动通信设备中处于空闲状态的内存的大小; 内存分配请求单元, 用于请求虚拟内存系统为当前正在被使用的应用分配内 存, 其中, 所请求的内存的大小大于所述处于空闲状态的内存的大小; 以便所 述虚拟内存系统在响应所述分配内存的请求时,将所述处于空闲状态的内存转 化为活跃内存, 并在发现处于空闲状态的内存不足以分配之后,将部分或全部 处于非活跃状态的内存也转化为活跃状态; 内存释放请求单元, 用于在所请求 的内存转化为活跃状态之后,请求虚拟内存系统为将所述转化为活跃状态的内 存释放, 以便所述虚拟内存系统在响应所述释放内存的请求时,将所述转化为 活跃状态的内存转化为空闲状态,从而将原处于空闲状态的内存重新转化为空 闲状态, 并将所述部分或全部原处于非活跃状态的内存也转化为空闲状态。
根据本发明的对移动通信设备进行加速的方法及装置,可以通过用于进行 加速的应用程序向虚拟内存系统请求某指定大小的内存空间,并保证该指定大 小大于当前的空闲内存的大小,以便将原空闲内存连同原非活跃内存一并转化 为活跃内存; 之后, 再请求虚拟内存系统将这些请求到的内存空间释放, 使其 重新转化为空闲空间, 这样, 就相当于将原空闲内存重新转化回空闲内存, 同 时将原非活跃内存也转化为空闲内存,相当于原非活跃内存被释放, 空闲内存 增加, 也即清理了内存, 实现了对移动通信设备的加速。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术 手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、 特征和优点能够更明显易懂, 以下特举本发明的具体实施方式。 附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领 域普通技术人员将变得清楚明了。 附图仅用于示出优选实施方式的目的, 而并 不认为是对本发明的限制。 而且在整个附图中, 用相同的参考符号表示相同的 部件。 在附图中:
图 1示出了根据本发明一个实施例的方法的流程图;
图 2示出了根据本发明一个实施例的内存状态示意图;
图 3示出了根据本发明一个实施例的另一内存状态示意图;
图 4示出了根据本发明一个实施例的再一内存状态示意图; 以及, 图 5示出了根据本发明一个实施例的装置的示意图;
图 6示出了用于执行根据本发明的方法的智能电子设备的框图; 以及 图 7示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单 元示意图。 具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了 本公开的示例性实施例, 然而应当理解, 可以以各种形式实现本公开而不应被 这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本 公开, 并且能够将本公开的范围完整的传达给本领域的技术人员。
首先需要说明的是, 本发明人在实现本发明的过程中发现, iOS等未开放 用户权限的操作系统是采用虚拟内存系统来管理内存的使用,将应用程序的逻 辑地址映射到物理内存地址, 使得进程认为自己拥有连续的、 大量的内存, 提 高内存利用率, 降低程序编写难度。 比如一个程序被系统告知其可用的内存片 段是 0到 100页, 而实际上其占用的内存片段可能是分散的,有可能其占用的真 正物理范围是 70-120页, 201页到 240页, 还有 10页在磁盘上面, 等等。 如果一 个应用程序执行时所要访问的内存在物理内存中不存在,则会在物理内存中分 配一块新的区域,将磁盘上的对应的地址区域的内容加载进来。如果物理内存 中空间不够,虚拟内存系统则会释放一些已占用的内存, 来腾出内存空间给需 要运行的应用程序。所以, 可以通过一些手段来触发虚拟内存系统自动去释放 已占用的内存, 起到手机加速的效果。
另外需要说明的是, iOS操作系统启动后, 在物理内存空间有一块联动内 存(wi red memory ) , 存储内核以及其有关的数据结构, 联动内存受到保护, 无法被应用和其他用户级别的程序所分配或者释放。运行在联动内存的内核维 护着三个物理内存页列表:
活跃列表(act ive l i s t ) -管理着活跃内存, 最近被映射到物理内存的 页, 并且正在被程序使用中。
非活跃列表( inact ive l i s t ) -管理着非活跃内存, 当前在物理内存的 页, 但是最近未被使用。 这些页载有长期为使用处于后台的应用程序的数据, 允许被随时从物理内存中清除。
空闲列表(free l i s t ) -管理着空闲内存, 物理内存中空闲的页, 随时 可以被程序分配使用。
联动内存、活跃内存都无法被释放,所以只能将释放的对象瞄准非活跃内 存。 如前面所述, "如果物理内存中空闲的内存空间不够, 虚拟内存系统则会 释放一些已占用的内存" , 这个 "已占用的内存" 就是指非活跃内存。
因此, 为了对移动通信终端进行加速, 可以首先利用系统函数得到处于空 闲状态的内存的大小,然后请求虚拟内存系统为当前正在使用的程序分配一块 指定大小的内存区域,该内存区域的大小要大于当前处于空闲状态的内存的大 小。 这样, 由于联动内存与活跃内存无法释放, 而又无更多的空闲内存, 所以 虚拟内存系统会去强行释放一些非活跃内存,并将这些内存重新分配作为活跃 内存以供使用。在这些内存被分配为活跃内存之后, 就可以直接释放这些分配 到的内存, 这样, 便将刚才的分配为活跃内存的非活跃内存释放出来, 相当于 清理了内存, 增加空闲内存, 减轻了为了维护非活跃内存而带来的能耗。 下面 就对该方法进行详细地介绍。
参见图 1 ,本发明实施例首先提供了一种对移动通信设备进行加速的方法, 该移动通信设备中运行有未开放用户权限的操作系统, 例如 iOS系统等, 该方 法可以包括以下步骤:
S101 : 获取所述移动通信设备中处于空闲状态的内存的大小;
可以通过 iOS系统提供的系统函数, 来获取处于空闲状态的内存的大小。 在实际应用中,可以以应用程序的方式为用户提供对移动通信终端进行加速的 功能,该应用程序可以是一个独立的程序,也可以是某程序中的一个功能模块。 用户可以在其移动通信终端中安装该应用程序,然后用户就可以在需要对移动 通信终端进行加速时, 启动该应用程序, 进入该应用程序的界面。 可以在界面 中为用户提供 "立即加速"等按钮, 然后当用户通过点击该按钮的方式进入之 后, 就可以触发该获取空闲内存的大小的步骤。 或者, 除了这种用户手动触发 的方式之外, 也可以通过自动的方式来触发, 例如, 该应用程序被启动之后, 可以自动通过调用系统函数的方式来获取当前处于非活跃状态的内存的大小, 然后将其与某预置的阈值(可以根据实际的需要来设定)进行比较, 如果超过 了该阈值, 则证明当前处于非活跃状态的内存比较大, 可能已经影响了系统的 运行速度, 于是自动触发该获取空闲内存的大小的步骤, 等等。
S102 : 请求虚拟内存系统为当前正在被使用的应用分配内存, 其中, 所请 求的内存的大小大于所述处于空闲状态的内存的大小;以便所述虚拟内存系统 在响应所述分配内存的请求时, 将所述处于空闲状态的内存转化为活跃内存, 并在发现处于空闲状态的内存不足以分配之后,将部分或全部处于非活跃状态 的内存也转化为活跃状态;
在确定需要对移动通信设备进行加速之后,由于还获取到了当前处于空闲 状态的内存的大小, 因此, 就可以首先请求虚拟内存系统为当前正在被使用的 应用分配一块指定大小的内存,该指定大小大于在步骤 S101中获取到的处于空 闲状态的内存的大小。 这样, 在虚拟内存系统接收到该请求之后, 就会发现空 闲内存不够, 于是就会释放一些处于非活跃状态的内存, 然后将原处于空闲状 态的内存以及这部分释放出来的非活跃内存一并分配给当前正在被使用的应 用, 也即将这些内存转化为活跃状态。
S103: 在所请求的内存转化为活跃状态之后,请求虚拟内存系统为将所述 转化为活跃状态的内存释放,以便所述虚拟内存系统在响应所述释放内存的请 求时,将所述转化为活跃状态的内存转化为空闲状态,从而将原处于空闲状态 的内存重新转化为空闲状态,并将所述部分或全部原处于非活跃状态的内存也 转化为空闲状态。
在将指定大小的内存转换为活跃内存之后,本发明实施例中用于对移动通 信设备进行加速的应用程序并不是利用这些内存进行数据的存储或处理等操 作, 而是直接将这些内存释放, 这样, 这些内存会被转化为空闲状态。 此时被 转化为空闲状态的内存就是在步骤 S 1 02中被转换为活跃状态的内存,而这部分 内存的大小大于步骤 S 101中获取到的空闲内存的大小, 因此, 该步骤 S 103中被 转化为空闲状态的内存也大于步骤 S 101中获取到的空闲内存。也就是说,在经 过步骤 S102及 S103的处理之后,使得移动通信设备中的空闲内存增加,相当于 将原来处于非活跃状态的内存转化为空闲内存, 这就相当于清理了内存, 实现 了对移动通信设备的加速。
总之,在本发明实施例提供的上述装置中,可以通过用于进行加速的应用 程序向虚拟内存系统请求某指定大小的内存空间,并保证该指定大小大于当前 的空闲内存的大小, 以便将原空闲内存连同原非活跃内存一并转化为活跃内 存; 之后, 再请求虚拟内存系统将这些请求到的内存空间释放, 使其重新转化 为空闲空间, 这样, 就相当于将原空闲内存重新转化回空闲内存, 同时将原非 活跃内存也转化为空闲内存, 相当于原非活跃内存被释放, 空闲内存增加, 也 即清理了内存, 实现了对移动通信设备的加速。
其中, 在实际应用中, 为了获得最大的加速增益, 可以在步骤 S101获取当 前处于空闲状态的内存大小的同时, 获取当前处于非活跃状态的内存的大小, 这样,在步骤 S102向虚拟内存系统请求指定大小的内存时, 该指定大小可以等 于当前处于空闲状态以及非活跃状态的内存的大小之和。
也即, 参见图 2 , 请求虚拟内存系统分配非活跃内存大小与空闲内存大小 总和的内存区域, 即图 2中最右侧的两个方框所在部分。 此时, 由于当前的空 闲内存(也即图 2中最右侧的一个方框所在部分) 小于该请求分配的内存, 因 此, 非活跃内存便被强行释放并重新分配, 与空闲内存一起成为活跃内存以供 本发明实施例中的用于进行加速的应用程序使用。 重新分配之后,会使得内存 状态变为图 3所示,也即, 图 2中原来的非活跃内存和空闲内存都变成了活跃内 存。
在本发明实施例中的用于进行加速的应用程序获得内存之后,就可以再次 释放已成为活跃内存的图 3中最右侧的两块区域, 使得这两块区域又成为了空 闲内存, 参见图 4。 也即, 使得图 1中的非活跃内存也被转化为空闲内存, 从而 起到了清理内存的作用。
以上实现过程可以通过以下伪代码来描述:
#def ine IOS_VM_PAGE_SIZE (4 * 1024)
int f ree_count, inact ive_count;
uint64_ t f reeS ize;
f reeS i ze = 0;
free-count = get _vm_f reecount (); 〃获取空闲内存的页数
inact ive— count = get _vm_ inact ivecount (); //获取非活跃内存的页数 free— count = free— count + inact ive— count; //空闲内存与非活跃内存 的页数总和, 作为进行分配释放的内存页数
f reeS i ze = free— count * I0S_VM_PAGE_SIZE; 〃得到要分配释放的内存 大小
if (f reeS ize) {
void *data;
da ta = ma l loc (freeS i ze) ; 〃分配内存, 此时非活跃的内存会被虚 拟内存系统强行分配过来
memset (data, 0, f reeS ize);
free (data) ; 〃再释放内存, 其中非活跃部分的内存就变成了空闲内存
在实际应用中,在进行了一次前述从步骤 S101到步骤 S103的加速处理过程 之后, 由于非活跃内存的大小发生了变化(因为已经向部分或者全部的非活跃 内存转化成了空闲内存), 而非活跃内存属于运行于联动内存的内核维护的一 部分, 所以导致内核管理的任务变化, 联动内存大小发生变化。 这个时候, 虚 拟内存系统会重新更新内存的状态,联动内存、活跃内存和非活跃内存的大小 可能会重新分配。 也即, 虽然看似能够将 "全部" 的非活跃内存都转化为空闲 内存, 并且从图 4来看, 似乎是已经不存在非活跃内存, 但是实际上在将内存 转化为图 4的状态之后, 操作系统中的虚拟内存系统会自动重新对内存进行分 配, 再分配出一部分非活跃内存。 由于重新分配之后, 又出现了一些非活跃内 存, 因此相当于还存在进一步加速的空间, 这样, 就可以继续进行加速处理, 也即重新实行前述步骤 S101到 S103。 当然, 在释放到一定程度之后, 可能会出 现没有内存可以释放的情况, 此时, 系统会才艮出内存警告(memory warning ) , 收到该警告之后, 就可以不必再继续进行加速处理, 换言之, 只要是在此警告 之前, 都可以循环进行加速处理。
或者, 也可以是根据一些预先设定的条件等来确定何时停止加速。 例如, 预先设定的条件可以是非活跃状态的内存小于某阈值, 因此,在执行完一次加 速处理之后, 就可以获取处理后非活跃内存的大小, 然后与该阈值进行比较, 如果小于该阈值, 则可以不再继续进行加速处理。 也就是说, 可以根据预先的 经验等信息, 来确定加速到什么程度, 在达到该程度之后, 即使系统尚未发出 警告消息, 也不必再继续进行加速。
另外, 在实际应用中, 在每完成一次加速处理之后, 都可以根据加速前空 闲内存的大小以及加速后空闲内存的大小计算出加速的比例等信息,然后将该 信息显示给用户。
与本发明实施例提供的对移动通信设备进行加速的方法相对应,本发明实 施例还提供了一种对移动通信设备进行加速的装置,所述移动通信设备中运行 有未开放用户权限的操作系统, 参见图 5 , 该装置可以包括:
第一内存大小获取单元 501 , 用于获取所述移动通信设备中处于空闲状态 的内存的大小;
内存分配请求单元 502 , 用于请求虚拟内存系统为当前正在被使用的应用 分配内存, 其中, 所请求的内存的大小大于所述处于空闲状态的内存的大小, 分配成功后, 所请求的内存转化为活跃状态;
内存释放请求单元 503 , 用于在所请求的内存转化为活跃状态之后, 请求 虚拟内存系统为将所述转化为活跃状态的内存释放,以便所述虚拟内存系统在 响应所述释放内存的请求时, 将所述转化为活跃状态的内存转化为空闲状态, 从而将原处于空闲状态的内存重新转化为空闲状态,并将所述部分或全部原处 于非活跃状态的内存也转化为空闲状态。
为了在一次加速过程中最大程度的获得加速增益, 该装置还可以包括: 第二内存大小获取单元,用于所述获取所述移动通信设备中处于空闲状态 的内存的大小时, 获取所述移动通信设备中处于非活跃状态的内存的大小; 内存之和获得单元,用于获得所述移动通信设备中处于空闲状态以及非活 跃状态的内存的大小之和;
此时, 所述内存分配请求单元 502具体可以用于:
请求虚拟内存系统为当前正在被使用的应用分配内存, 其中, 所请求的内 存的大小等于所述处于空闲状态以及非活跃状态的内存的大小之和,分配成功 后, 所请求的内存转化为活跃状态。
在实际应用中, 该装置还可以包括:
第一触发单元,用于所述获取所述移动通信设备中处于空闲状态的内存的 大小之前, 通过预置的入口接收用户发出的对移动通信设备进行加速的请求, 通过所述请求触发所述获取所述移动通信设备中处于空闲状态的内存的大小 的操作。
或者, 在另一种实现方式下, 该装置还可以包括:
第二触发单元,用于所述获取所述移动通信设备中处于空闲状态的内存的 大小之前, 获取所述移动通信设备中处于非活跃状态的内存的大小,如果所述 处于非活跃状态的内存的大小达到预置的阈值,则触发所述获取所述移动通信 设备中处于空闲状态的内存的大小的操作。
为了进一步进行加速, 该装置还可以包括:
继续加速单元,用于在所述将部分或全部原处于非活跃状态的内存转化为 空闲状态导致虚拟内存系统重新分配内存的状态之后,重新获取所述移动通信 设备中处于空闲状态的内存的大小, 以便继续对所述移动通信设备进行加速。 其中, 该系统还可以包括:
第一结束加速单元,用于接收到操作系统发出的没有可用于释放的内存的 警告消息之后, 停止对所述移动通信设备的加速处理。
或者, 在另一种实现方式下, 该装置还可以包括:
第二结束加速单元, 用于判断加速后的各状态的内存的大小,如果满足预 置的条件, 则停止对所述移动通信设备的加速处理。
在实际应用中, 所述未开放用户权限的操作系统包括 iOS操作系统。
总之,在本发明实施例提供的上述装置中,可以通过用于进行加速的应用 程序向虚拟内存系统请求某指定大小的内存空间,并保证该指定大小大于当前 的空闲内存的大小, 以便将原空闲内存连同原非活跃内存一并转化为活跃内 存; 之后, 再请求虚拟内存系统将这些请求到的内存空间释放, 使其重新转化 为空闲空间, 这样, 就相当于将原空闲内存重新转化回空闲内存, 同时将原非 活跃内存也转化为空闲内存, 相当于原非活跃内存被释放, 空闲内存增加, 也 即清理了内存, 实现了对移动通信设备的加速。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有 相关。 各种通用系统也可以与基于在此的示教一起使用。 根据上面的描述, 构 造这类系统所要求的结构是显而易见的。此外, 本发明也不针对任何特定编程 语言。 应当明白, 可以利用各种编程语言实现在此描述的本发明的内容, 并且 上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中, 说明了大量具体细节。 然而, 能够理解, 本发 明的实施例可以在没有这些具体细节的情况下实践。在一些实例中, 并未详细 示出公知的方法、 结构和技术, 以便不模糊对本说明书的理解。
类似地,应当理解, 为了精筒本公开并帮助理解各个发明方面中的一个或 多个,在上面对本发明的示例性实施例的描述中, 本发明的各个特征有时被一 起分组到单个实施例、 图、 或者对其的描述中。 然而, 并不应将该公开的方法 解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确 记载的特征更多的特征。 更确切地说, 如下面的权利要求书所反映的那样, 发 明方面在于少于前面公开的单个实施例的所有特征。 因此, 遵循具体实施方式 的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为 本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适 应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实 施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它 们分成多个子模块或子单元或子组件。 除了这样的特征和 /或过程或者单元中 的至少一些是相互排斥之外, 可以采用任何组合对本说明书(包括伴随的权利 要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所 有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、 摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征 来代替。
此外, 本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它 实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意 味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求 书中, 所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器 上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解, 可以在实践中使用微处理器或者数字信号处理器(DSP )来实现根据本发明实 施例的对移动通信设备进行加速的设备中的一些或者全部部件的一些或者全 部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的 设备或者装置程序(例如, 计算机程序和计算机程序产品)。 这样的实现本发 明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形 式。 这样的信号可以从因特网网站上下载得到, 或者在载体信号上提供, 或者 以任何其他形式提供。
例如, 图 6示出了可以实现本发明的对移动通信设备进行加速的方法的 移动通信设备。 该移动通信设备传统上包括处理器 610和以存储器 620形式 的计算机程序产品或者计算机可读介质。 存储器 620可以是诸如闪存、 EEPROM (电可擦除可编程只读存储器)、 EPROM、 硬盘或者 ROM之类的 码 631的存储空间 630。 例如, 用于程序代码的存储空间 ^630可以包括分别用 一 ^或者多个计算机程 产品中读^!或者写入到这一个或者多个计^ 程 序产品中。 这些计算机程序产品包括诸如硬盘, 紧致盘(CD ) 、 存储卡或 者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图 7所述 的便携式或者固定存储单元。该存储单元可以具有与图 6的移动通信设备中 的存储器 620类似布置的存储段或者存储空间等。程序代码可以例如以适当 序^ 1,Γ即可以由例如诸如 610之类的处理器读取的代码, 这些代码当由移 动通信设备运行时, 导致该移动通信设备执行上面所描述的方法中的各个 步骤。 应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并 且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施 例。在权利要求中, 不应将位于括号之间的任何参考符号构造成对权利要求的 限制。 单词 "包含" 不排除存在未列在权利要求中的元件或步骤。 位于元件之 前的单词 "一" 或 "一个" 不排除存在多个这样的元件。 本发明可以借助于包 括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干 装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体 体现。 单词第一、 第二、 以及第三等的使用不表示任何顺序。 可将这些单词解 释为名称。
本申请可以应用于计算机系统 /服务器, 其可与众多其它通用或专用计算 系统环境或配置一起操作。 适于与计算机系统 /服务器一起使用的众所周知的 计算系统、 环境和 /或配置的例子包括但不限于: 个人计算机系统、 服务器计 算机系统、 瘦客户机、 厚客户机、 手持或膝上设备、 基于微处理器的系统、 机 顶盒、 可编程消费电子产品、 网络个人电脑、 小型计算机系统、 大型计算机系 统和包括上述任何系统的分布式云计算技术环境, 等等。
计算机系统 /服务器可以在由计算机系统执行的计算机系统可执行指令 (诸如程序模块) 的一般语境下描述。 通常, 程序模块可以包括例程、 程序、 目标程序、 组件、 逻辑、 数据结构等等, 它们执行特定的任务或者实现特定的 抽象数据类型。 计算机系统 /服务器可以在分布式云计算环境中实施, 分布式 云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式 云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介 质上。

Claims

权 利 要 求
1、 一种对移动通信设备进行加速的方法, 所述移动通信设备中运行有未 开放用户权限的操作系统, 所述方法包括:
获取所述移动通信设备中处于空闲状态的内存的大小;
请求虚拟内存系统为当前正在被使用的应用分配内存, 其中, 所请求的内 存的大小大于所述处于空闲状态的内存的大小;以便所述虚拟内存系统在响应 所述分配内存的请求时,将所述处于空闲状态的内存转化为活跃内存, 并在发 现处于空闲状态的内存不足以分配之后,将部分或全部处于非活跃状态的内存 也转化为活跃状态;
在所请求的内存转化为活跃状态之后,请求虚拟内存系统将所述转化为活 跃状态的内存释放, 以便所述虚拟内存系统在响应所述释放内存的请求时, 将 所述转化为活跃状态的内存转化为空闲状态,从而将原处于空闲状态的内存重 新转化为空闲状态,并将所述部分或全部原处于非活跃状态的内存也转化为空 闲状态。
2、如权利要求 1所述的方法, 所述获取所述移动通信设备中处于空闲状态 的内存的大小时, 还包括:
获取所述移动通信设备中处于非活跃状态的内存的大小;
获得所述移动通信设备中处于空闲状态以及非活跃状态的内存的大小之 和;
所述请求虚拟内存系统为当前正在被使用的应用分配内存包括: 请求虚拟内存系统为当前正在被使用的应用分配内存, 其中, 所请求的内 存的大小等于所述处于空闲状态以及非活跃状态的内存的大小之和,分配成功 后, 所请求的内存转化为活跃状态。
3、如权利要求 1所述的方法, 所述获取所述移动通信设备中处于空闲状态 的内存的大小之前还包括:
通过预置的入口接收用户发出的对移动通信设备进行加速的请求,通过所 述请求触发所述获取所述移动通信设备中处于空闲状态的内存的大小的操作。
4、如权利要求 1所述的方法, 所述获取所述移动通信设备中处于空闲状态 的内存的大小之前还包括:
获取所述移动通信设备中处于非活跃状态的内存的大小,如果所述处于非 活跃状态的内存的大小达到预置的阈值,则触发所述获取所述移动通信设备中 处于空闲状态的内存的大小的操作。
5、 如权利要求 1所述的方法, 还包括:
在所述将部分或全部原处于非活跃状态的内存转化为空闲状态导致虚拟 内存系统重新分配内存的状态之后,重新获取所述移动通信设备中处于空闲状 态的内存的大小, 以便继续对所述移动通信设备进行加速。
6、 如权利要求 5所述的方法, 还包括:
接收到操作系统发出的没有可用于释放的内存的警告消息之后,停止对所 述移动通信设备的加速处理。
7、 如权利要求 5所述的方法, 还包括:
判断加速后的各状态的内存的大小,如果满足预置的条件, 则停止对所述 移动通信设备的加速处理。
8、 如权利要求 1至 7任一项所述的方法, 所述未开放用户权限的操作系统 包括 i OS操作系统。
9、 一种对移动通信设备进行加速的装置, 所述移动通信设备中运行有未 开放用户权限的操作系统, 所述装置包括:
第一内存大小获取单元,用于获取所述移动通信设备中处于空闲状态的内 存的大小;
内存分配请求单元,用于请求虚拟内存系统为当前正在被使用的应用分配 内存, 其中, 所请求的内存的大小大于所述处于空闲状态的内存的大小; 以便 所述虚拟内存系统在响应所述分配内存的请求时,将所述处于空闲状态的内存 转化为活跃内存, 并在发现处于空闲状态的内存不足以分配之后,将部分或全 部处于非活跃状态的内存也转化为活跃状态;
内存释放请求单元, 用于在所请求的内存转化为活跃状态之后,请求虚拟 内存系统为将所述转化为活跃状态的内存释放,以便所述虚拟内存系统在响应 所述释放内存的请求时,将所述转化为活跃状态的内存转化为空闲状态,从而 将原处于空闲状态的内存重新转化为空闲状态,并将所述部分或全部原处于非 活跃状态的内存也转化为空闲状态。
10、 如权利要求 9所述的装置, 还包括:
第二内存大小获取单元,用于所述获取所述移动通信设备中处于空闲状态 的内存的大小时, 获取所述移动通信设备中处于非活跃状态的内存的大小; 内存之和获得单元,用于获得所述移动通信设备中处于空闲状态以及非活 跃状态的内存的大小之和;
所述内存分配请求单元具体用于:
请求虚拟内存系统为当前正在被使用的应用分配内存, 其中, 所请求的内 存的大小等于所述处于空闲状态以及非活跃状态的内存的大小之和,分配成功 后, 所请求的内存转化为活跃状态。
11、 如权利要求 9所述的装置, 还包括: 第一触发单元 ,用于所述获取所述移动通信设备中处于空闲状态的内存的 大小之前, 通过预置的入口接收用户发出的对移动通信设备进行加速的请求, 通过所述请求触发所述获取所述移动通信设备中处于空闲状态的内存的大小 的操作。
12、 如权利要求 9所述的装置, 还包括:
第二触发单元,用于所述获取所述移动通信设备中处于空闲状态的内存的 大小之前, 获取所述移动通信设备中处于非活跃状态的内存的大小,如果所述 处于非活跃状态的内存的大小达到预置的阈值,则触发所述获取所述移动通信 设备中处于空闲状态的内存的大小的操作。
1 3、 如权利要求 9所述的装置, 还包括:
继续加速单元,用于在所述将部分或全部原处于非活跃状态的内存转化为 空闲状态导致虚拟内存系统重新分配内存的状态之后,重新获取所述移动通信 设备中处于空闲状态的内存的大小, 以便继续对所述移动通信设备进行加速。
14、 如权利要求 1 3所述的装置, 还包括:
第一结束加速单元,用于接收到操作系统发出的没有可用于释放的内存的 警告消息之后, 停止对所述移动通信设备的加速处理。
15、 如权利要求 1 3所述的装置, 还包括:
第二结束加速单元, 用于判断加速后的各状态的内存的大小,如果满足预 置的条件, 则停止对所述移动通信设备的加速处理。
16、 如权利要求 9至 15任一项所述的装置, 所述未开放用户权限的操作系 统包括 i OS操作系统。
17、 一种计算机程序, 包括计算机可读代码, 当移动通信设备运行所述计 算机可读代码运行时, 导致权利要求 1-8中的任一项权利要求所述的方法被执 行。
18、 一种计算机可读介质, 其中存储了如权利要求 17所述的计算机程序。
PCT/CN2014/070687 2013-01-22 2014-01-15 对移动通信设备进行加速的方法及装置 WO2014161374A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310022852.6A CN103092769B (zh) 2013-01-22 2013-01-22 对移动通信设备进行加速的方法及装置
CN201310022852.6 2013-01-22

Publications (1)

Publication Number Publication Date
WO2014161374A1 true WO2014161374A1 (zh) 2014-10-09

Family

ID=48205369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/070687 WO2014161374A1 (zh) 2013-01-22 2014-01-15 对移动通信设备进行加速的方法及装置

Country Status (2)

Country Link
CN (1) CN103092769B (zh)
WO (1) WO2014161374A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092769B (zh) * 2013-01-22 2015-10-14 北京奇虎科技有限公司 对移动通信设备进行加速的方法及装置
CN104021085A (zh) * 2014-04-24 2014-09-03 北京掌阔移动传媒科技有限公司 一种移动终端内存清理方法和装置
CN104408209A (zh) * 2014-12-25 2015-03-11 中科创达软件股份有限公司 移动操作系统启动过程中文件处理方法、装置及电子设备
CN105808442A (zh) * 2014-12-27 2016-07-27 北京奇虎科技有限公司 一种移动终端内存的清理方法和装置
CN107247674B (zh) * 2017-06-16 2020-07-31 深圳市万普拉斯科技有限公司 内存块类型处理方法、装置、电子设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4282400B2 (ja) * 2003-07-23 2009-06-17 日本電気通信システム株式会社 移動通信システム及びそれに用いる動的リソース制御方法
CN101908022A (zh) * 2010-08-13 2010-12-08 优视科技有限公司 一种用于移动通讯设备终端的内存管理方法及其装置
US20110271074A1 (en) * 2010-04-30 2011-11-03 Youngki Lyu Method for memory management to reduce memory fragments
CN102279762A (zh) * 2011-06-23 2011-12-14 杭州斯凯网络科技有限公司 在手机平台提高内存使用效率的方法
CN103092769A (zh) * 2013-01-22 2013-05-08 北京奇虎科技有限公司 对移动通信设备进行加速的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4282400B2 (ja) * 2003-07-23 2009-06-17 日本電気通信システム株式会社 移動通信システム及びそれに用いる動的リソース制御方法
US20110271074A1 (en) * 2010-04-30 2011-11-03 Youngki Lyu Method for memory management to reduce memory fragments
CN101908022A (zh) * 2010-08-13 2010-12-08 优视科技有限公司 一种用于移动通讯设备终端的内存管理方法及其装置
CN102279762A (zh) * 2011-06-23 2011-12-14 杭州斯凯网络科技有限公司 在手机平台提高内存使用效率的方法
CN103092769A (zh) * 2013-01-22 2013-05-08 北京奇虎科技有限公司 对移动通信设备进行加速的方法及装置

Also Published As

Publication number Publication date
CN103092769B (zh) 2015-10-14
CN103092769A (zh) 2013-05-08

Similar Documents

Publication Publication Date Title
US20200409798A1 (en) Tiered cloud storage for different availability and performance requirements
CN108712454B (zh) 一种文件处理方法、装置及设备
WO2015062389A1 (zh) 一种终端设备卸载系统应用的方法和装置
WO2014161374A1 (zh) 对移动通信设备进行加速的方法及装置
US8683484B2 (en) Intelligently pre-placing data for local consumption by workloads in a virtual computing environment
CN111930473B (zh) 在容器云上部署图像识别服务的方法与设备
US10394580B2 (en) Dynamic addition and removal of operating system components
TW201229905A (en) Policy-based access to virtualized applications
JP2017512340A (ja) 修正されたメモリー圧縮
US11360884B2 (en) Reserved memory in memory management system
CN105138376A (zh) 混合模式应用、其网页资源升级方法、移动终端以及系统
US8918776B2 (en) Self-adapting software system
CN115378735B (zh) 一种数据处理方法、装置、存储介质及电子设备
US20170052979A1 (en) Input/Output (IO) Request Processing Method and File Server
WO2017095820A1 (en) Methods and devices for acquiring data using virtual machine and host machine
CN106657182B (zh) 云端文件处理方法和装置
CN113760543A (zh) 资源管理方法、装置、电子设备及计算机可读存储介质
US20150149615A1 (en) Process cage providing attraction to distributed storage
CN113961520A (zh) 动态文件挂载方法、系统、计算机设备及可读存储介质
CN113010265A (zh) Pod的调度方法、调度器、存储插件及系统
CN112219202A (zh) 用于客户操作系统的存储器分配
CN110764930B (zh) 基于消息模式的请求或应答处理方法及装置
KR101535792B1 (ko) 운영체제 구성 장치 및 방법
US10474512B1 (en) Inter-process intra-application communications
CN110120963B (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: 14778319

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

Country of ref document: EP

Kind code of ref document: A1