WO2015106563A1 - 缓存的清理方法、装置及客户端 - Google Patents

缓存的清理方法、装置及客户端 Download PDF

Info

Publication number
WO2015106563A1
WO2015106563A1 PCT/CN2014/084328 CN2014084328W WO2015106563A1 WO 2015106563 A1 WO2015106563 A1 WO 2015106563A1 CN 2014084328 W CN2014084328 W CN 2014084328W WO 2015106563 A1 WO2015106563 A1 WO 2015106563A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
operating system
request
mobile terminal
release
Prior art date
Application number
PCT/CN2014/084328
Other languages
English (en)
French (fr)
Inventor
董熠
韦航
李丁盼
马健
Original Assignee
贝壳网际(北京)安全技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 贝壳网际(北京)安全技术有限公司 filed Critical 贝壳网际(北京)安全技术有限公司
Priority to US15/111,764 priority Critical patent/US10275359B2/en
Publication of WO2015106563A1 publication Critical patent/WO2015106563A1/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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/81Threshold
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/885Monitoring specific for caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/1016Performance improvement
    • G06F2212/1021Hit rate improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/17Embedded application
    • G06F2212/171Portable consumer electronics, e.g. mobile phone
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/604Details relating to cache allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/608Details relating to cache mapping

Definitions

  • the present invention relates to the field of mobile terminal technologies, and in particular, to a cache cleaning method, device, and client. Background technique
  • the object of the present invention is to at least solve one of the above technical problems.
  • the object of the present invention is to propose a method of cleaning a cache.
  • the method can clean up too much buffer space, improve the smooth running of the mobile terminal, and effectively improve the user experience.
  • a second object of the present invention is to provide a buffer cleaning apparatus.
  • a third object of the present invention is to propose a client.
  • a fourth object of the present invention is to propose an application.
  • a fifth object of the present invention is to provide a storage medium.
  • the method for cleaning a cache includes: detecting a current cache usage of the mobile terminal; and when the cache usage of the mobile terminal is greater than a preset threshold, to the mobile terminal
  • the operating system sends a cache request request to trigger a cache release rule preset in the operating system; and after the operating system releases the corresponding cache according to the preset cache release rule, sending a cache release to the operating system Requesting, to cause the operating system to release the cache request according to the cache release request Request the allocated cache.
  • the cache cleaning method of the embodiment of the present invention when the cache usage exceeds a preset threshold, the cache is released by applying a cache space to trigger a cache release rule, and then requesting to release the cache space allocated according to the cache application request, and rationally utilizing the mobile terminal operating system.
  • the caching mechanism uses the interface provided by the operating system to clean up too much buffer space, which is easy to operate, improves the running smoothness of the mobile terminal, and improves the user experience.
  • the cache cleaning apparatus of the second aspect of the present invention includes: a detecting module, configured to detect a current cache usage of the mobile terminal; and a cache application module, configured to be used as a buffer usage of the mobile terminal.
  • a detecting module configured to detect a current cache usage of the mobile terminal
  • a cache application module configured to be used as a buffer usage of the mobile terminal.
  • the cache clearing device of the embodiment of the present invention applies a cache space to trigger a cache release rule to release the cache, and then requests to release the cache space allocated according to the cache request request, and reasonably utilizes the mobile terminal operating system.
  • the caching mechanism using the interface provided by the operating system, is safe and easy, and the cleaning uses too much buffer space, which improves the running smoothness of the mobile terminal and improves the user experience.
  • a client includes: a housing, a display, a circuit board, and a processor, wherein the circuit board is disposed inside a space enclosed by the outer casing, and the display is The processor is externally connected to the circuit board, and the processor is disposed on the circuit board; the processor is configured to process data, and is specifically configured to perform the following steps: detecting a current cache usage of the mobile terminal; When the cache usage of the mobile terminal is greater than a preset threshold, sending a cache request request to the operating system of the mobile terminal to trigger a preset cache release rule in the operating system; and in the operating system according to the operating system After the preset cache release rule releases the corresponding cache, the cache release request is sent to the operating system, so that the operating system releases the cache allocated for the cache request according to the cache release request.
  • the client in the embodiment of the present invention releases the cache by applying the cache space to trigger the cache release rule when the cache usage exceeds the preset threshold, and then requests to release the cache space allocated according to the cache application request, and reasonably utilize the cache of the mobile terminal operating system.
  • the mechanism uses the interface provided by the operating system to clean up excessive buffer space, prevent jamming, and is easy to operate. It improves the smooth running of the mobile terminal and improves the user experience.
  • an application of the fourth aspect of the present invention is configured to perform a cache cleaning method according to the first aspect of the present invention at runtime.
  • the application program of the embodiment of the present invention releases the cache by applying a cache space to trigger a cache release rule when the cache usage exceeds a preset threshold, and then requests to release the cache space allocated according to the cache application request, and reasonably utilize the cache of the mobile terminal operating system.
  • Mechanism using the interface provided by the operating system, cleaning up too much cache
  • the space is simple and easy to operate, which improves the smooth running of the mobile terminal and improves the user experience.
  • a storage medium configured to store an application, and the application is configured to execute a cache cleaning method according to the first aspect of the present invention at runtime.
  • the storage medium of the embodiment of the present invention releases the cache by applying a cache space to trigger a cache release rule when the cache usage exceeds a preset threshold, and then requests to release the cache space allocated according to the cache request request, and reasonably utilize the cache of the mobile terminal operating system.
  • the mechanism uses the interface provided by the operating system to clean up too much buffer space, which is easy to operate, improves the running smoothness of the mobile terminal, and improves the user experience.
  • FIG. 1 is a flow chart of a method for cleaning a cache according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a cache usage detection result interface according to an embodiment of the present invention.
  • FIG. 3 is a flow chart of a method for cleaning a cache according to another embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a cache cleaning apparatus according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a cache cleaning apparatus according to another embodiment of the present invention. detailed description
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first”, “second” may explicitly or implicitly include one or more of the features.
  • the meaning of “plurality” is two or more, unless specifically defined otherwise.
  • the present invention proposes a cache cleaning method.
  • FIG. 1 is a flow chart of a method of cleaning a cache in accordance with one embodiment of the present invention. As shown in Figure 1, the cache cleaning method includes:
  • the mobile terminal application can detect the current cache usage by using a programming interface provided by the operating system or a specific detection module, as shown in FIG. 2, which is a schematic diagram of the detection result of the cache usage, and the detection result includes available memory (cache). ), used memory (cache) and the current cache usage as a percentage of the total cache.
  • the mobile terminal application is an application that can be used for cache detection and cleaning, such as a mobile terminal cache cleaner, a mobile phone housekeeper, etc., and may also be other applications with cache detection and cleaning functions.
  • the preset threshold is a preset ratio of the total cache occupied by the application available cache, and can be set according to the specific running condition of the mobile terminal.
  • the application request may be sent to the operating system of the mobile terminal by the application.
  • the cache request request includes the required cache space, which can be sent to the operating system through the cache request interface provided by the operating system.
  • the operating system allocates a cache according to the cache request request, resulting in a decrease in available cache space, thereby triggering a cache release rule preset in the operating system.
  • the cache release rule is preset by the developer at the beginning of development according to the operating system.
  • the cache release rule is triggered, for example, the idle cache is insufficient to support the normal operation of the mobile terminal, the preset cache release behavior is automatically implemented, and a certain number of corresponding delays are released according to the preset priority. Save.
  • IOS is a handheld operating system developed by Apple
  • Android is a Linux-based free and open source operating system
  • Windows Phone is a mobile operating system released by Microsoft
  • any data object applied in the application will use the cache space, and the operating system allocates the cache space according to the cache request request, and sends the address of the allocated cache space to The application, this segment of the cache space will be occupied by the application until the application is manually released or forced release.
  • the IOS operating system is a completely object-oriented system. Any form of presentation visible to the user is based on an object, where the object is a basic entity in the process of implementing the program, such as a view, a list, A picture, etc.
  • the IOS operating system provides several programming interfaces for the application to request the cache space: For the standard NSObject (the basic class of the IOS operating system, all classes in the system are based on the characteristics of this class) objects, you need to use the alloc interface, malloc interface, etc.
  • the application space if an image is used in the application, the imageNamed interface is used to apply space for the image in the cache to accommodate the image data; for network-related operations, such as opening a web page, requesting data, etc., the operating system provides the NSURLCache class ( The network request data cache class), through the setMemoryCapacity interface (used to set the cache size) to apply for cache space to store network data.
  • Alloc, malloc, imageNamed, and setMemoryCapacity are the programming interface names provided by the IOS operating system for the application.
  • the alloc interface and malloc interface are common interfaces for allocating memory, and NSObject and NSURLCache are common class names in the IOS operating system.
  • the interface provided by the operating system may be used to send a cache release request to the operating system, requesting the operating system to release the cache space allocated for the cache request.
  • the cache cleaning method of the embodiment of the present invention when the cache usage exceeds a preset threshold, the cache is released by applying a cache space to trigger a cache release rule, and then requesting to release the cache space allocated according to the cache application request, and rationally utilizing the mobile terminal operating system.
  • the caching mechanism uses the interface provided by the operating system to clean up too much buffer space, which is easy to operate, improves the running smoothness of the mobile terminal, and improves the user experience.
  • FIG. 3 is a flow chart of a method of cleaning a cache in accordance with another embodiment of the present invention.
  • a preset amount of cache space occupied by the background application may be preferentially released according to the cache release rule, and then the cache allocated by the operating system according to the cache request request is requested to be released. Space.
  • the method for cleaning the cache includes:
  • the preset cache release rule includes that the operating system releases a preset number of caches occupied by the background running program. In the operation of the mobile terminal, whenever the cache release rule is satisfied, the operating system releases a preset amount of cache occupied by the application running in the background. For example, when the cache usage is greater than a predetermined threshold (such as 90%), a memory alarm is generated in the mobile terminal and a certain amount of cache is automatically released. It should be understood that the mobile terminal prioritizes the cache occupied by applications running in the background, where each segment of the cache is marked by a cached address.
  • a predetermined threshold such as 90%
  • the size of the cache space requested in the cache request request needs to be set according to the currently available cache to ensure that the preset in the cache release rule is reached. Threshold, which triggers the operating system to clear the cache.
  • the cache release request includes the number of caches that need to be released, and the cache address that needs to be released.
  • the operating system allocates a cache address according to the cache request request, and returns a starting address of a continuous cache space, and the available cache space is reduced, which triggers a cache release rule, thereby causing the operating system to release the background application. Cache space.
  • the cache release request may be sent to the operating system by using an interface provided by the operating system, and the operating system releases all cache space allocated for the cache request request, and The corresponding cache address and cache space are made available.
  • the cache space released according to the cache release rule and the cache space allocated by the operating system according to the cache request request belong to the cache released in the current cleanup, but the amount of the cache released to the user in the mobile terminal may include two.
  • the common release amount may also include only the amount of buffer released according to the cache release rule.
  • the cache request request is sent again. Specifically, after the cleaning is performed, the current cache usage of the mobile terminal may be detected again. If the current cache usage in the detection result is still greater than the preset threshold, the cache request request is sent again to trigger the cache release. Rules, start the second cleaning process, the specific steps can refer to S202 ⁇ S205.
  • the cache cleaning method of the embodiment of the present invention when the cache usage exceeds a preset threshold, triggers a cache release rule by applying for a cache space, preferentially releases the cache space occupied by the background application, and then requests to release the cache allocated according to the cache application request. Space, and repeatedly clear the cache until the cache usage does not exceed the preset threshold, clean up the background application occupies too much cache space, easy to operate, improve the smoothness of the mobile terminal, and improve the user experience.
  • the present invention also proposes a buffer cleaning device.
  • the apparatus includes a detection module 100, a cache application module 200, and a cache release module 300.
  • the detecting module 100 is configured to detect a current cache usage of the mobile terminal. More specifically, the detecting module 100 can detect the current cache usage by using a programming interface provided by the operating system, as shown in FIG. 2 is a schematic diagram of the detection result of the cache usage, and the detection result includes available memory (cache), used The ratio of memory (cache) and current cache usage to the total cache.
  • the cache requesting module 200 is configured to send a cache request request to the operating system of the mobile terminal to trigger a cache release rule preset in the operating system when the cache usage of the mobile terminal is greater than a preset threshold. More specifically, based on the detection result of the current cache usage, it is determined whether the current cache usage is greater than a preset threshold.
  • the preset threshold is a preset ratio of the total cache occupied by the application available cache, and can be set according to the specific running condition of the mobile terminal.
  • the cache requesting module 200 may send a cache request request to the operating system of the mobile terminal.
  • the cache request request includes the required cache space, which can be sent to the operating system through the cache request interface provided by the operating system.
  • the operating system allocates a cache according to the cache request request, resulting in a decrease in available cache space, thereby triggering a preset cache release rule in the operating system.
  • the preset cache release rule includes a cache that the operating system releases a preset number and is occupied by the background running program.
  • the operating system releases a preset amount of cache occupied by the application running in the background. For example, when the cache usage is greater than a predetermined threshold (such as 90%), a memory alarm is generated in the mobile terminal and a certain amount of cache is automatically released.
  • a predetermined threshold such as 90%
  • IOS operating system IOS is a handheld operating system developed by Apple
  • Android operating system Android system is a Linux-based free and open source operating system
  • Windows Phone operating system Windows Phone is a mobile operating system released by Microsoft.
  • IOS operating system any The data object applied in the application will use the cache space.
  • the operating system allocates the cache space according to the cache request request, and sends the address of the allocated cache space to the application.
  • the cache space will be occupied by the application until the application is manually released. Or forcibly released.
  • the IOS operating system is a completely object-oriented system.
  • Any form of presentation visible to the user is based on an object, where the object is a basic entity in the process of implementing the program, such as a view, a list, A picture, etc.
  • the IOS operating system provides several programming interfaces for the application to request the cache space: For the standard NSObject (the basic class of the IOS operating system, all classes in the system are based on the characteristics of this class) objects, you need to use the alloc interface, malloc interface, etc.
  • the application space if an image is used in the application, the imageNamed interface is used to request space for the image in the cache to accommodate the image data; for network-related operations, such as opening a web page, requesting data, etc., the operating system provides the NSURLCache class ( The network request data cache class), through the setMemoryCapacity interface (used to set the cache size) to apply for cache space to store network data.
  • Alloc, malloc, imageNamed, and setMemoryCapacity are the programming interface names provided by the IOS operating system for the application.
  • the alloc interface and malloc interface are common interfaces for allocating memory, and NSObject and NSURLCache are common class names in the IOS operating system.
  • the cache release module 300 is configured to send a cache release request to the operating system after the operating system releases the corresponding cache according to the preset cache release rule, so that the operating system releases the cache allocated for the cache request according to the cache release request. More specifically, after the operating system releases a certain amount of cache according to the preset cache release rule, the cache release module 300 may send a cache release request to the operating system through an interface provided by the operating system, requesting the operating system to release the allocation for the cache request request. Cache space.
  • the cache clearing device of the embodiment of the present invention applies a cache space to trigger a cache release rule to release the cache, and then requests to release the cache space allocated according to the cache request request, and reasonably utilizes the mobile terminal operating system.
  • the caching mechanism using the interface provided by the operating system, cleans up the excessive cache space, is safe and simple, improves the running smoothness of the mobile terminal, and improves the user experience.
  • FIG. 5 is a structural block diagram of a cache cleaning apparatus according to another embodiment of the present invention. As shown in FIG. 5, the apparatus includes a detection module 100, a cache application module 200, a cache release module 300, a receiving module 400, an adding module 500, an obtaining module 600, and a display module 700.
  • the receiving module 400 is configured to receive and record a cache address allocated by the operating system according to the cache request. More specifically, when the cache space is applied, the operating system allocates a cache address according to the cache request, and the receiving module 400 receives and records the start address of the cache space returned by the operating system, and the available cache space is reduced, thereby triggering the cache release rule. Causes the operating system to free up the cache space used by the background application.
  • the add module 500 adds the allocated cache address in the cache release request.
  • the cache release request includes the number of caches that need to be released, and the cache address that needs to be released. More specifically, the module 500 is added.
  • the operating system for receiving and recording the receiving module 400 adds the cache address allocated according to the cache request request to the cache release request.
  • the obtaining module 600 is configured to obtain the buffer amount released this time according to the cache release rule and the cache address allocated by the operating system according to the cache request request.
  • the display module 700 is configured to display the amount of buffers released this time to the user in the mobile terminal.
  • the cache space released according to the cache release rule and the cache space allocated by the operating system according to the cache request request belong to the cache released in the current cleanup, but the amount of the cache released to the user in the mobile terminal may include two.
  • the common release amount may also include only the amount of buffer released according to the cache release rule.
  • the detecting module 100 is further configured to detect the current cache usage of the mobile terminal again.
  • the cache requesting module 200 is further configured to: when it is determined that the current cache usage of the mobile terminal that is detected again is still greater than the preset threshold, send the cache request request again.
  • the detecting module 100 may detect whether the current cache usage of the mobile terminal exceeds a preset threshold. If the current cache usage in the detection result is still greater than a preset threshold, the cache request module 200 again. Send a cache request request and start the second cleanup process.
  • the cache cleaning device of the embodiment of the present invention when the cache usage exceeds a preset threshold, triggers a cache release rule by applying for a cache space, preferentially releases the cache space occupied by the background application, and then requests to release the cache allocated according to the cache application request. Space, and repeatedly clear the cache until the cache usage does not exceed the preset threshold, clean up the background application occupies too much cache space, easy to operate, improve the smoothness of the mobile terminal, and improve the user experience.
  • the present invention also proposes a client.
  • a client includes: a casing, a display, a circuit board, and a processor, wherein the circuit board is disposed inside a space enclosed by the casing, the display is outside the casing, and is connected to the circuit board, and the processor is disposed in the circuit
  • the processor is used to process data and is specifically used to perform the following steps:
  • Sior detecting the current cache usage of the mobile terminal.
  • the processor may detect the current cache usage by using a programming interface provided by the operating system or a specific detection module, as shown in FIG. 2, which is a schematic diagram of a detection result of the cache usage, where the detection result includes available memory (cache), The ratio of used memory (cache) and current cache usage to the total cache.
  • FIG. 2 is a schematic diagram of a detection result of the cache usage, where the detection result includes available memory (cache), The ratio of used memory (cache) and current cache usage to the total cache.
  • the processor determines, according to the detection result of the current cache usage, whether the current cache usage is greater than a preset threshold.
  • the preset threshold is a preset ratio of the total cache occupied by the application available cache, and can be set according to the specific running condition of the mobile terminal.
  • the processor may send a cache request request to the operating system of the mobile terminal through the application.
  • the cache request request includes the required cache space, and can be sent to the operating system through a cache application interface provided by the operating system.
  • the operating system allocates a cache according to the cache request request, which causes the available cache space of the operating system to be reduced, thereby triggering a preset cache release rule in the operating system.
  • the cache release rule is preset by the developer at the beginning of development according to the operating system.
  • the cache release rule is satisfied, for example, when the available cache size is insufficient to support the normal operation of the mobile terminal, the preset cache release behavior is automatically implemented, and a certain number of corresponding ones are released according to the preset priority. Cache.
  • IOS operating system IOS is a handheld operating system developed by Apple
  • Android operating system Android system is a Linux-based free and open source operating system
  • Windows Phone operating system Windows Phone is a mobile operating system released by Microsoft.
  • IOS operating system any data object applied in the application will use the cache space, and the operating system allocates the cache space according to the cache request request, and sends the address of the allocated cache space to The application, this segment of the cache space will be occupied by the application until the application is manually released or forced release.
  • the IOS operating system is a completely object-oriented system.
  • Any form of presentation visible to the user is based on an object, where the object is a basic entity in the process of implementing the program, such as a view, a list, A picture, etc.
  • the IOS operating system provides several programming interfaces for the application to request the cache space: For the standard NSObject (the basic class of the IOS operating system, all classes in the system are based on the characteristics of this class) objects, you need to use the alloc interface, malloc interface, etc.
  • the application space if an image is used in the application, the imageNamed interface is used to request space for the image in the cache to accommodate the image data; for network-related operations, such as opening a web page, requesting data, etc., the operating system provides the NSURLCache class ( The network request data cache class), through the setMemoryCapacity interface (used to set the cache size) to apply for cache space to store network data.
  • Alloc, malloc, imageNamed, and setMemoryCapacity are the programming interface names provided by the IOS operating system for the application.
  • the alloc interface and malloc interface are common interfaces for allocating memory, and NSObject and NSURLCache are common class names in the IOS operating system.
  • the interface provided by the operating system may be used to send a cache release request to the operating system, requesting the operating system to release the cache space allocated for the cache request.
  • the client of the embodiment of the present invention touches by applying for a cache space when the cache usage exceeds a preset threshold.
  • the cache release rule releases the cache, and then requests to release the cache space allocated according to the cache request request, reasonably utilizes the cache mechanism of the mobile terminal operating system, uses the interface provided by the operating system, cleans up excessive cache space, prevents jamming, and is easy to operate. Improves the smoothness of mobile terminal operation and improves user experience.
  • the processor is further configured to perform the following steps:
  • the preset cache release rule includes that the operating system releases a preset number of caches occupied by the background running program. In the mobile terminal operation, whenever the cache release rule is satisfied, the operating system releases a preset amount of cache occupied by the application running in the background. For example, when the cache usage is greater than a predetermined threshold (such as 90%), the mobile terminal generates a memory alarm and automatically releases a certain amount of cache. It should be understood that the operating system will preferentially handle the cache occupied by applications running in the background, where each segment of the cache is marked by the cache address.
  • the size of the cache space requested in the cache request request needs to be set according to the currently available cache to ensure that the preset in the cache release rule is reached. Threshold, which triggers the operating system to clear the cache.
  • the cache release request includes the number of caches that need to be released, and the cache address that needs to be released.
  • the operating system allocates a cache address according to the cache request request, and returns a starting address of a continuous cache space, and the available cache space is reduced, which triggers a cache release rule, thereby causing the operating system to release the background application. Cache space.
  • the processor may send a cache release request to the operating system by using an interface provided by the operating system, and the operating system releases all cache space allocated for the cache request request.
  • the corresponding cache address and cache space are made available.
  • the cache amount released this time is displayed, and displayed to the user in the mobile terminal.
  • the cache space released according to the cache release rule and the cache space allocated by the operating system according to the cache request request belong to the cache released in the current cleanup, but the amount of the cache released to the user in the mobile terminal may include two.
  • the common release amount may also include only the amount of buffer released according to the cache release rule.
  • the current cache usage of the mobile terminal may be detected again whether the current cache usage exceeds a preset threshold. If the current cache usage in the detection result is still greater than a preset threshold, the cache request request is sent again, and the second request is started.
  • the cleaning process refer to S202' -S205 ' for specific steps.
  • the client of the embodiment of the present invention when the cache usage exceeds a preset threshold, triggers a cache release rule by applying for a cache space, preferentially releases the cache space occupied by the background application, and then requests to release the cache space allocated according to the cache application request.
  • the cache is repeatedly cleaned up until the cache usage does not exceed the preset threshold.
  • the background application occupies too much cache space, which is easy to operate, improves the smoothness of the mobile terminal, and improves the user experience.
  • the present invention also proposes an application.
  • the application is operative to perform a cache cleanup method as described in the embodiment of the present invention at runtime.
  • the application program according to the embodiment of the present invention releases the cache by applying a cache space to trigger a cache release rule when the cache usage exceeds a preset threshold, and then requests to release the cache space allocated according to the cache request request, and reasonably utilizes the mobile terminal operating system.
  • the caching mechanism uses the interface provided by the operating system to clean up too much cache space, which is easy to operate, improves the smooth running of the mobile terminal, and improves the user experience.
  • the present invention further provides a storage medium for storing an application for executing a cache cleaning method according to an embodiment of the present invention at runtime.
  • the storage medium releases the cache by applying a cache space to trigger a cache release rule when the cache usage exceeds a preset threshold, and then requests to release the cache space allocated according to the cache application request, and reasonably utilizes the mobile terminal operating system.
  • the caching mechanism uses the interface provided by the operating system to clean up too much cache space, which is easy to operate, improves the smooth running of the mobile terminal, and improves the user experience.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by the instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read-only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method proceeds to obtain the program electronically and then store it in computer memory.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented with any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated part can be implemented either in the form of hardware or in the form of a software function.
  • the integrated portion can also be stored in a computer readable storage medium if it is implemented in the form of a software function and sold or used as a standalone product.
  • the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种缓存的清理方法、装置和客户端,提高客户端缓存清理效率,提升用户体验。方法包括以下步骤:检测移动终端当前的缓存使用量;当移动终端的缓存使用量大于预设阈值时,向移动终端的操作系统发送缓存申请请求,以触发操作系统中预设的缓存释放规则;以及在操作系统根据预设的缓存释放规则释放对应缓存之后,向操作系统发送缓存释放请求,以使操作系统根据缓存释放请求释放为缓存申请请求所分配的缓存。可用于移动终端设备缓存管理技术中。

Description

缓存的清理方法、 装置及客户端
技术领域
本发明涉及移动终端技术领域, 特别涉及一种缓存的清理方法、 装置及客户端。 背景技术
随着移动终端技术的发展, 适用于移动终端的操作系统和应用程序也在不断更新。 许多应用程序为了提升运行效率和流畅性, 大量使用缓存, 导致缓存空间不足使用户 正常使用的体验变差。
目前, 很多操作系统支持应用程序的后台挂起和运行等行为, 即使用户离开应用 程序操作界面, 该应用程序占用的缓存也并不释放, 用户必须在任务管理器中再次手 动操作使应用程序退出, 或重启设备以释放后台占用过多的缓存。
在实现本发明的过程中, 发明人发现现有技术至少存在以下问题: 在任务管理器 中手动操作使应用程序一一退出、 重启设备等方式操作步骤繁琐, 速度缓慢; 许多操 作系统不提供对缓存直接进行操作的接口, 导致应用程序本身无法直接实现对缓存的 清理; 而有些声称可以实现此功能的应用程序, 使用虚假数据展现给用户, 实际上完 全没有对缓存做出清理, 系统运行依旧缓慢, 用户体验差。 发明内容
本发明的目的旨在至少解决上述的技术问题之一。
为此, 本发明的目的在于提出一种缓存的清理方法。 该方法能够清理占用过多的 缓存空间, 改善了移动终端运行流畅度, 有效提升用户体验。
本发明的第二个目的在于提出一种缓存的清理装置。
本发明的第三个目的在于提出一种客户端。
本发明的第四个目的在于提出一种应用程序。
本发明的第五个目的在于提出一种存储介质。
为达到上述目的, 本发明第一方面实施例提出的缓存的清理方法, 包括: 检测移 动终端当前的缓存使用量; 当所述移动终端的缓存使用量大于预设阈值时, 向所述移 动终端的操作系统发送缓存申请请求, 以触发所述操作系统中预设的缓存释放规则; 以及在所述操作系统根据所述预设的缓存释放规则释放对应缓存之后, 向所述操作系 统发送缓存释放请求, 以使所述操作系统根据所述缓存释放请求释放为所述缓存申请 请求所分配的缓存。
本发明实施例的缓存的清理方法, 在缓存使用量超过预设阈值时, 通过申请缓存 空间以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的 缓存空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
为达到上述目的, 本发明第二方面实施例提出的缓存的清理装置, 包括: 检测模 块, 用于检测移动终端当前的缓存使用量; 缓存申请模块, 用于当所述移动终端的缓 存使用量大于预设阈值时, 向所述移动终端的操作系统发送缓存申请请求, 以触发所 述操作系统中预设的缓存释放规则; 以及缓存释放模块, 用于在所述操作系统根据所 述预设的缓存释放规则释放对应缓存之后, 向所述操作系统发送缓存释放请求, 以使 所述操作系统根据所述缓存释放请求释放为所述缓存申请请求所分配的缓存。
本发明实施例的缓存的清理装置, 在缓存使用量超过预设阈值时, 申请缓存空间 以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合 理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 安全简便, 清理占 用过多的缓存空间, 改善了移动终端的运行流畅度, 提升了用户体验。
为达到上述目的, 本发明第三方面实施例提出的客户端, 包括: 外壳, 显示器、 电路板和处理器, 其中, 所述电路板安置在所述外壳围成的空间内部, 所述显示器在 所述外壳外部, 并与所述电路板相连接, 所述处理器设置在所述电路板上; 处理器用 于处理数据, 并具体用于执行以下步骤: 检测移动终端当前的缓存使用量; 当所述移 动终端的缓存使用量大于预设阈值时, 向所述移动终端的操作系统发送缓存申请请求, 以触发所述操作系统中预设的缓存释放规则; 以及在所述操作系统根据所述预设的缓 存释放规则释放对应缓存之后, 向所述操作系统发送缓存释放请求, 以使所述操作系 统根据所述缓存释放请求释放为所述缓存申请请求所分配的缓存。
本发明实施例的客户端, 在缓存使用量超过预设阈值时, 通过申请缓存空间以触 发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利 用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的缓存空 间, 预防卡死, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
为了实现上述目的, 本发明第四方面实施例的应用程序, 用于在运行时执行本发 明第一方面实施例所述的缓存的清理方法。
本发明实施例的应用程序, 在缓存使用量超过预设阈值时, 通过申请缓存空间以 触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理 利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的缓存 空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
为了实现上述目的, 本发明第五方面实施例的存储介质, 用于存储应用程序, 所 述应用程序用于在运行时执行本发明第一方面实施例所述的缓存的清理方法。
本发明实施例的存储介质, 在缓存使用量超过预设阈值时, 通过申请缓存空间以 触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理 利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的缓存 空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
本发明附加的方面和优点将在下面的描述中部分给出, 部分将从下面的描述中变 得明显, 或通过本发明的实践了解到。 附图说明
本发明上述的和 /或附加的方面和优点从下面结合附图对实施例的描述中将变得明 显和容易理解, 其中:
图 1是根据本发明一个实施例的缓存的清理方法的流程图;
图 2是根据本发明一个实施例的缓存使用量检测结果界面的示意图;
图 3是根据本发明另一个实施例的缓存的清理方法的流程图;
图 4是根据本发明一个实施例的缓存的清理装置的结构框图;
图 5是根据本发明另一个实施例的缓存的清理装置的结构框图。 具体实施方式
下面详细描述本发明的实施例, 所述实施例的示例在附图中示出, 其中自始至终 相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。 下面通过参 考附图描述的实施例是示例性的, 仅用于解释本发明, 而不能解释为对本发明的限制。
此外, 术语 "第一"、 "第二"仅用于描述目的, 而不能理解为指示或暗示相对重要性 或者隐含指明所指示的技术特征的数量。 由此, 限定有 "第一"、 "第二" 的特征可以明示 或者隐含地包括一个或者更多个该特征。在本发明的描述中, "多个"的含义是两个或两个 以上, 除非另有明确具体的限定。
在本发明的描述中, 需要说明的是, 除非另有规定和限定, 术语 "安装" 、 "相 连" 、 "连接" 应做广义理解, 例如, 可以是机械连接或电连接, 也可以是两个元件 内部的连通, 可以是直接相连, 也可以通过中间媒介间接相连, 对于本领域的普通技 术人员而言, 可以根据具体情况理解上述术语的具体含义。
参照下面的描述和附图, 将清楚本发明的实施例的这些和其他方面。 在这些描述 和附图中, 具体公开了本发明的实施例中的一些特定实施方式, 来表示实施本发明的 实施例的原理的一些方式, 但是应当理解, 本发明的实施例的范围不受此限制。 相反, 本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、 修改和 等同物。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为, 表示包括 一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、 片段 或部分, 并且本发明的优选实施方式的范围包括另外的实现, 其中可以不按所示出或 讨论的顺序, 包括根据所涉及的功能按基本同时的方式或按相反的顺序, 来执行功能, 这应被本发明的实施例所属技术领域的技术人员所理解。
下面参考附图描述根据本发明实施例的缓存的清理方法、 装置和客户端。
为了解决移动终端缓存清理效率低导致移动终端运行缓慢的问题, 本发明提出一 种缓存的清理方法。
图 1是根据本发明一个实施例的缓存的清理方法的流程图。 如图 1所示, 该缓存 的清理方法包括:
S 101 , 检测移动终端当前的缓存使用量。
具体地, 移动终端应用程序可通过操作系统提供的编程接口或特定检测模块检测 当前缓存使用量, 如图 2所示为一种缓存使用量的检测结果示意图, 检测结果中包含 了可用内存 (缓存) 、 已用内存 (缓存) 和当前缓存使用量所占总缓存的比例。 其中, 移动终端应用程序为可用于缓存检测和清理的应用程序, 例如移动终端缓存清理器、 手机管家等, 也可为其他具有缓存检测和清理功能的应用程序。
S 102, 当移动终端的缓存使用量大于预设阈值时, 向移动终端的操作系统发送缓 存申请请求, 以触发操作系统中预设的缓存释放规则。
具体地, 根据当前缓存使用量的检测结果, 判定当前缓存使用量是否大于预设阈 值。 其中, 预设阈值为应用程序可用缓存所占总缓存的预设比例, 可以根据移动终端 具体的运行情况设定。
当移动终端的缓存使用量大于预设阈值时, 可通过应用程序向移动终端的操作系 统发送缓存申请请求。 其中, 缓存申请请求中包括所需缓存空间大小, 可通过操作系 统提供的缓存申请接口发送至操作系统。 操作系统根据缓存申请请求分配缓存, 导致 可用缓存空间减少, 从而触发操作系统中预设的缓存释放规则。
其中, 缓存释放规则由开发者在开发之初根据操作系统的不同预先设定。 在移动 终端运行中, 每当缓存释放规则被触发, 例如空闲缓存不足以支持移动终端正常运行 时, 就会自动实施预设的缓存释放行为, 按照预设的优先级释放一定数量的相应的缓 存。
目前, 移动终端的操作系统有多种, 例如 IOS操作系统 (IOS是由苹果公司开发的 手持设备操作系统)、 安卓操作系统 (Android系统是一种基于 Linux的自由及开放源代 码的操作系统)、 Windows Phone 操作系统 (Windows Phone 是微软公司发布的一款手 机操作系统) 等。
具体地, 以 IOS操作系统为例, 根据 IOS操作系统的原理, 任何在应用程序中申 请的数据对象都会使用缓存空间, 操作系统根据缓存申请请求分配缓存空间, 将分配 的缓存空间的地址发送至应用程序, 该段缓存空间将被应用程序占用直到应用程序被 手动释放或强行释放为止。 以 IOS操作系统为例, IOS操作系统属于完全地面向对象 的系统, 用户可见的任何形式的展现都以对象为基础, 其中, 对象即程序实现过程中 的基本实体, 如一个视图, 一个列表, 一张图片等。 IOS 操作系统为应用程序提供了 若干编程接口以申请缓存空间: 对于标准的 NSObject ( IOS操作系统的基本类, 系统 中所有类都基于此类的特性)对象, 需要使用 alloc接口、 malloc接口等为其申请空间; 若应用程序中使用了图片,需使用 imageNamed接口在缓存中为图片申请空间以容纳图 片数据; 对于与网络相关的操作, 如打开网页、 请求数据等, 操作系统提供了 NSURLCache类 (网络请求数据缓存类) , 通过 setMemoryCapacity接口 (用于设置缓 存大小) 申请缓存空间以存储网络数据。 其中, alloc、 malloc、 imageNamed、 setMemoryCapacity均为 IOS 操作系统为应用程序提供的编程接口名称, alloc接口、 malloc接口为分配内存的通用接口, NSObject、 NSURLCache为 IOS操作系统中的常 用类名。
S 103 , 在操作系统根据预设的缓存释放规则释放对应缓存之后, 向操作系统发送 缓存释放请求, 以使操作系统根据缓存释放请求释放为缓存申请请求所分配的缓存。
具体地, 在操作系统根据预设的缓存释放规则释放一定量的缓存之后, 可使用操 作系统提供的接口向操作系统发送缓存释放请求, 请求操作系统释放为缓存申请请求 所分配的缓存空间。
本发明实施例的缓存的清理方法, 在缓存使用量超过预设阈值时, 通过申请缓存 空间以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的 缓存空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
图 3 是根据本发明另一个实施例的缓存的清理方法的流程图。 为了优化移动终端 对缓存的清理, 在本发明的实施例中, 可根据缓存释放规则优先释放预设数量的由后 台应用程序所占用的缓存空间, 然后请求释放操作系统根据缓存申请请求分配的缓存 空间。 如图 3所示, 该缓存的清理方法包括:
5201 , 检测移动终端当前的缓存使用量。
5202, 当移动终端的缓存使用量大于预设阈值时, 向移动终端的操作系统发送缓 存申请请求, 以触发操作系统中预设的缓存释放规则。
其中, 预设的缓存释放规则包括操作系统释放预设数量的, 且由后台运行程序所 占用的缓存。 在移动终端的运行中, 每当满足缓存释放规则, 操作系统就会释放预设 数量的, 且由后台运行的应用程序所占用的缓存。 例如缓存使用量大于某一预设阈值 (如 90% ) 时, 移动终端中产生内存告警并自动释放一定量的缓存。 应当理解, 移动 终端会优先处理后台运行的应用程序所占用的缓存, 其中, 每一段缓存都是由缓存地 址来标记的。
需要注意的是, 为了触发操作系统中预设的缓存释放规则, 需要根据检测到的当 前可用缓存, 来设定缓存申请请求中所申请的缓存空间大小, 以保证达到缓存释放规 则中的预设阈值, 从而触发操作系统清理缓存。
5203 , 接收并记录操作系统根据缓存申请请求分配的缓存地址, 并在缓存释放请 求中添加分配的缓存地址。
其中, 缓存释放请求中包含需要释放的缓存数量, 也可以指定需要释放的缓存地 址。 申请缓存空间时, 操作系统会根据缓存申请请求分配缓存地址, 并返回一段连续 的缓存空间的起始地址, 同时可用缓存空间减少, 触发了缓存释放规则, 从而使操作 系统释放后台应用程序所占用的缓存空间。
S204 , 在操作系统根据预设的缓存释放规则释放对应缓存之后, 向操作系统发送 缓存释放请求, 以使操作系统根据缓存释放请求释放为缓存申请请求所分配的缓存。
具体地, 在操作系统根据预设的缓存释放规则释放对应缓存之后, 可使用操作系 统提供的接口向操作系统发送缓存释放请求, 操作系统会释放所有为缓存申请请求所 分配的缓存空间, 并将相对应的缓存地址和缓存空间置为可用。
S205 , 根据缓存释放规则和操作系统根据缓存申请请求分配的缓存地址获取本次 释放的缓存量, 并在移动终端中显示给用户。
应当理解, 根据缓存释放规则释放的缓存空间和操作系统根据缓存申请请求分配 的缓存空间都属于本次清理中释放的缓存, 但在移动终端中显示给用户的本次释放的 缓存量可以包括两者共同的释放量, 也可以只包括根据缓存释放规则释放的缓存量。
S206, 再次检测移动终端当前的缓存使用量。
S207 , 如果判断再次检测的移动终端当前的缓存使用量依然大于预设阈值, 则再 次发送缓存申请请求。 具体地, 在完成一次清理后, 可再次检测移动终端当前的缓存使用量是否超过预 设阈值, 如果检测结果中当前的缓存使用量依然大于预设阈值, 则再次发送缓存申请 请求以触发缓存释放规则, 开始第二次清理流程, 具体步骤可参考 S202~S205。
本发明实施例的缓存的清理方法, 在缓存使用量超过预设阈值时, 通过申请缓存 空间触发缓存释放规则, 优先释放后台应用程序所占用的缓存空间, 然后请求释放根 据缓存申请请求分配的缓存空间, 并重复清理缓存直到缓存使用量不超过预设阈值, 清理了后台应用程序占用过多的缓存空间, 操作简便, 改善了移动终端运行流畅度, 提升了用户体验。
为了实现上述实施例, 本发明还提出一种缓存的清理装置。
图 4是根据本发明一个实施例的缓存的清理装置的结构框图。 如图 4所示, 该装 置包括检测模块 100、 缓存申请模块 200和缓存释放模块 300。
具体地, 检测模块 100用于检测移动终端当前的缓存使用量。 更具体地, 检测模 块 100可通过操作系统提供的编程接口检测当前缓存使用量, 如图 2所示为一种缓存 使用量的检测结果示意图, 检测结果中包含了可用内存 (缓存) 、 已用内存 (缓存) 和当前缓存使用量所占总缓存的比例。
缓存申请模块 200用于当移动终端的缓存使用量大于预设阈值时, 向移动终端的 操作系统发送缓存申请请求, 以触发操作系统中预设的缓存释放规则。 更具体地, 根 据当前缓存使用量的检测结果, 判定当前缓存使用量是否大于预设阈值。 其中, 预设 阈值为应用程序可用缓存所占总缓存的预设比例, 可以根据移动终端具体的运行情况 设定。 当移动终端的缓存使用量大于预设阈值时, 缓存申请模块 200可向移动终端的 操作系统发送缓存申请请求。 其中, 缓存申请请求中包括所需缓存空间大小, 可通过 操作系统提供的缓存申请接口发送至操作系统。操作系统根据缓存申请请求分配缓存, 导致可用缓存空间减少, 从而触发操作系统中预设的缓存释放规则。 其中, 预设的缓 存释放规则包括操作系统释放预设数量的, 且由后台运行程序所占用的缓存。 在移动 终端运行中, 每当满足缓存释放规则, 操作系统就会释放预设数量的, 且由后台运行 的应用程序所占用的缓存。 例如缓存使用量大于某一预设阈值 (如 90% ) 时, 移动终 端中产生内存告警并自动释放一定量的缓存。 应当理解, 操作系统会优先处理后台运 行的应用程序所占用的缓存, 其中, 每一段缓存都是由缓存地址来标记的。
目前, 移动终端的操作系统有多种, 例如 IOS操作系统 (IOS是由苹果公司开发的 手持设备操作系统)、 安卓操作系统 (Android系统是一种基于 Linux的自由及开放源代 码的操作系统)、 Windows Phone 操作系统 (Windows Phone 是微软公司发布的一款手 机操作系统) 等。 更具体地, 以 IOS操作系统为例, 根据 IOS操作系统的原理, 任何 在应用程序中申请的数据对象都会使用缓存空间, 操作系统根据缓存申请请求分配缓 存空间, 将分配的缓存空间的地址发送至应用程序, 该段缓存空间将被应用程序占用 直到应用程序被手动释放或强行释放为止。 以 IOS操作系统为例, IOS操作系统属于 完全地面向对象的系统, 用户可见的任何形式的展现都以对象为基础, 其中, 对象即 程序实现过程中的基本实体, 如一个视图, 一个列表, 一张图片等。 IOS 操作系统为 应用程序提供了若干编程接口以申请缓存空间: 对于标准的 NSObject ( IOS操作系统 的基本类, 系统中所有类都基于此类的特性) 对象, 需要使用 alloc接口、 malloc接口 等为其申请空间; 若应用程序中使用了图片, 需使用 imageNamed接口在缓存中为图片 申请空间以容纳图片数据; 对于与网络相关的操作, 如打开网页、 请求数据等, 操作 系统提供了 NSURLCache类 (网络请求数据缓存类) , 通过 setMemoryCapacity接口 (用于设置缓存大小)申请缓存空间以存储网络数据。其中, alloc、 malloc、 imageNamed, setMemoryCapacity均为 IOS 操作系统为应用程序提供的编程接口名称, alloc接口、 malloc接口为分配内存的通用接口, NSObject、 NSURLCache为 IOS操作系统中的常 用类名。
缓存释放模块 300用于在操作系统根据预设的缓存释放规则释放对应缓存之后, 向操作系统发送缓存释放请求, 以使操作系统根据缓存释放请求释放为缓存申请请求 所分配的缓存。 更具体地, 在操作系统根据预设的缓存释放规则释放一定量的缓存之 后, 缓存释放模块 300可通过操作系统提供的接口向操作系统发送缓存释放请求, 请 求操作系统释放为缓存申请请求所分配的缓存空间。
本发明实施例的缓存的清理装置, 在缓存使用量超过预设阈值时, 申请缓存空间 以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合 理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的缓 存空间, 安全简便, 改善了移动终端的运行流畅度, 提升了用户体验。
图 5是根据本发明另一个实施例的缓存的清理装置的结构框图。 如图 5所示, 该 装置包括检测模块 100、 缓存申请模块 200、 缓存释放模块 300、 接收模块 400、 添加 模块 500、 获取模块 600和显示模块 700。
具体地, 接收模块 400用于接收并记录操作系统根据缓存申请请求分配的缓存地 址。 更具体地, 申请缓存空间时, 操作系统会根据缓存申请请求分配缓存地址, 接收 模块 400接收并记录操作系统返回的缓存空间的起始地址, 同时可用缓存空间减少, 触发了缓存释放规则, 从而使操作系统释放后台应用程序所占用的缓存空间。
添加模块 500在缓存释放请求中添加分配的缓存地址。 其中, 缓存释放请求中包 含需要释放的缓存数量, 也可以指定需要释放的缓存地址。 更具体地, 添加模块 500 用于将接收模块 400接收并记录的操作系统根据缓存申请请求分配的缓存地址添加到 缓存释放请求中。
获取模块 600用于根据缓存释放规则和操作系统根据缓存申请请求分配的缓存地 址获取本次释放的缓存量。
显示模块 700用于将本次释放的缓存量在移动终端中显示给用户。
应当理解, 根据缓存释放规则释放的缓存空间和操作系统根据缓存申请请求分配 的缓存空间都属于本次清理中释放的缓存, 但在移动终端中显示给用户的本次释放的 缓存量可以包括两者共同的释放量, 也可以只包括根据缓存释放规则释放的缓存量。
检测模块 100还用于再次检测移动终端当前的缓存使用量。
缓存申请模块 200还用于当判断再次检测的所述移动终端当前的缓存使用量依然 大于所述预设阈值时, 再次发送所述缓存申请请求。
更具体地, 在完成一次清理后, 检测模块 100可再次检测移动终端当前的缓存使 用量是否超过预设阈值, 如果检测结果中当前的缓存使用量依然大于预设阈值, 则缓 存申请模块 200再次发送缓存申请请求, 开始第二次清理流程。
本发明实施例的缓存的清理装置, 在缓存使用量超过预设阈值时, 通过申请缓存 空间触发缓存释放规则, 优先释放后台应用程序所占用的缓存空间, 然后请求释放根 据缓存申请请求分配的缓存空间, 并重复清理缓存直到缓存使用量不超过预设阈值, 清理了后台应用程序占用过多的缓存空间, 操作简便, 改善了移动终端运行流畅度, 提升了用户体验。
为了实现上述实施例, 本发明还提出一种客户端。
根据本发明实施例的客户端包括: 外壳, 显示器、 电路板和处理器, 其中, 电路 板安置在外壳围成的空间内部, 显示器在外壳外部, 并与电路板相连接, 处理器设置 在电路板上; 处理器用于处理数据, 并具体用于执行以下步骤:
sior , 检测移动终端当前的缓存使用量。
具体地, 处理器可通过操作系统提供的编程接口或特定检测模块检测当前缓存使 用量, 如图 2所示为一种缓存使用量的检测结果示意图, 检测结果中包含了可用内存 (缓存) 、 已用内存 (缓存) 和当前缓存使用量所占总缓存的比例。
S 102 ' , 当移动终端的缓存使用量大于预设阈值时, 向移动终端的操作系统发送 缓存申请请求, 以触发操作系统中预设的缓存释放规则。
具体地, 处理器根据当前缓存使用量的检测结果, 判定当前缓存使用量是否大于 预设阈值。 其中, 预设阈值为应用程序可用缓存所占总缓存的预设比例, 可以根据移 动终端具体的运行情况设定。 当移动终端的缓存使用量大于预设阈值时, 处理器可通过应用程序向移动终端的 操作系统发送缓存申请请求。 其中, 缓存申请请求中包括所需缓存空间大小, 可通过 操作系统提供的缓存申请接口发送至操作系统。操作系统根据缓存申请请求分配缓存, 导致操作系统可用缓存空间减少, 从而触发操作系统中预设的缓存释放规则。
其中, 缓存释放规则由开发者在开发之初根据操作系统的不同预先设定。 在移动 终端运行中, 每当满足缓存释放规则, 例如当可用缓存大小不足以支持移动终端正常 运行时, 就会自动实施预设的缓存释放行为, 按照预设的优先级释放一定数量的相应 的缓存。
目前, 移动终端的操作系统有多种, 例如 IOS操作系统 (IOS是由苹果公司开发的 手持设备操作系统)、 安卓操作系统 (Android系统是一种基于 Linux的自由及开放源代 码的操作系统)、 Windows Phone 操作系统 (Windows Phone 是微软公司发布的一款手 机操作系统) 等。 具体地, 以 IOS操作系统为例, 根据 IOS操作系统的原理, 任何在 应用程序中申请的数据对象都会使用缓存空间, 操作系统根据缓存申请请求分配缓存 空间, 将分配的缓存空间的地址发送至应用程序, 该段缓存空间将被应用程序占用直 到应用程序被手动释放或强行释放为止。 以 IOS操作系统为例, IOS操作系统属于完 全地面向对象的系统, 用户可见的任何形式的展现都以对象为基础, 其中, 对象即程 序实现过程中的基本实体, 如一个视图, 一个列表, 一张图片等。 IOS 操作系统为应 用程序提供了若干编程接口以申请缓存空间: 对于标准的 NSObject ( IOS操作系统的 基本类, 系统中所有类都基于此类的特性) 对象 , 需要使用 alloc接口、 malloc接口 等为其申请空间; 若应用程序中使用了图片, 需使用 imageNamed接口在缓存中为图片 申请空间以容纳图片数据; 对于与网络相关的操作, 如打开网页、 请求数据等, 操作 系统提供了 NSURLCache类 (网络请求数据缓存类) , 通过 setMemoryCapacity接口 (用于设置缓存大小)申请缓存空间以存储网络数据。其中, alloc、 malloc、 imageNamed, setMemoryCapacity均为 IOS 操作系统为应用程序提供的编程接口名称, alloc接口、 malloc接口为分配内存的通用接口, NSObject、 NSURLCache为 IOS操作系统中的常 用类名。
S 103 ' , 在操作系统根据预设的缓存释放规则释放对应缓存之后, 向操作系统发 送缓存释放请求, 以使操作系统根据缓存释放请求释放为缓存申请请求所分配的缓存。
具体地, 在操作系统根据预设的缓存释放规则释放一定量的缓存之后, 可使用操 作系统提供的接口向操作系统发送缓存释放请求, 请求操作系统释放为缓存申请请求 所分配的缓存空间。
本发明实施例的客户端, 在缓存使用量超过预设阈值时, 通过申请缓存空间以触 发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利 用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的缓存空 间, 预防卡死, 操作简便, 改善了移动终端运行流畅度, 提升了用户体验。
在本发明的一个实施例中, 处理器还用于执行以下步骤:
S201 ' , 检测移动终端当前的缓存使用量。
S202 ' , 当移动终端的缓存使用量大于预设阈值时, 向移动终端的操作系统发送 缓存申请请求, 以触发操作系统中预设的缓存释放规则。
其中, 预设的缓存释放规则包括操作系统释放预设数量的, 且由后台运行程序所 占用的缓存。 在移动终端运行中, 每当满足缓存释放规则, 操作系统就会释放预设数 量的, 且由后台运行的应用程序所占用的缓存。例如缓存使用量大于某一预设阈值(如 90% ) 时, 移动终端产生内存告警并自动释放一定量的缓存。 应当理解, 操作系统会优 先处理后台运行的应用程序所占用的缓存, 其中, 每一段缓存都是由缓存地址来标记 的。
需要注意的是, 为了触发操作系统中预设的缓存释放规则, 需要根据检测到的当 前可用缓存, 来设定缓存申请请求中所申请的缓存空间大小, 以保证达到缓存释放规 则中的预设阈值, 从而触发操作系统清理缓存。
S203 ' , 接收并记录操作系统根据缓存申请请求分配的缓存地址, 并在缓存释放 请求中添加分配的缓存地址。
其中, 缓存释放请求中包含需要释放的缓存数量, 也可以指定需要释放的缓存地 址。 申请缓存空间时, 操作系统会根据缓存申请请求分配缓存地址, 并返回一段连续 的缓存空间的起始地址, 同时可用缓存空间减少, 触发了缓存释放规则, 从而使操作 系统释放后台应用程序所占用的缓存空间。
S204 ' , 在操作系统根据预设的缓存释放规则释放对应缓存之后, 向操作系统发 送缓存释放请求, 以使操作系统根据缓存释放请求释放为缓存申请请求所分配的缓存。
具体地, 在操作系统根据预设的缓存释放规则释放对应缓存之后, 处理器可使用 操作系统提供的接口向操作系统发送缓存释放请求, 操作系统会释放所有为缓存申请 请求所分配的缓存空间, 并将相对应的缓存地址和缓存空间置为可用。
S205 ' , 根据缓存释放规则和操作系统根据缓存申请请求分配的缓存地址获取本 次释放的缓存量, 并在移动终端中显示给用户。
应当理解, 根据缓存释放规则释放的缓存空间和操作系统根据缓存申请请求分配 的缓存空间都属于本次清理中释放的缓存, 但在移动终端中显示给用户的本次释放的 缓存量可以包括两者共同的释放量, 也可以只包括根据缓存释放规则释放的缓存量。 S206 ' , 再次检测移动终端当前的缓存使用量。
S207 ' , 如果判断再次检测的移动终端当前的缓存使用量依然大于预设阈值, 则 再次发送缓存申请请求。
具体地, 在完成一次清理后, 可再次检测移动终端当前的缓存使用量是否超过预 设阈值, 如果检测结果中当前的缓存使用量依然大于预设阈值, 则再次发送缓存申请 请求, 开始第二次清理流程, 具体步骤可参考 S202' -S205 ' 。
本发明实施例的客户端, 在缓存使用量超过预设阈值时, 通过申请缓存空间触发 缓存释放规则, 优先释放后台应用程序所占用的缓存空间, 然后请求释放根据缓存申 请请求分配的缓存空间, 并重复清理缓存直到缓存使用量不超过预设阈值, 清理了后 台应用程序占用过多的缓存空间, 操作简便, 改善了移动终端运行流畅度, 提升了用 户体验。
为了实现上述实施例, 本发明还提出一种应用程序。 该应用程序用于在运行时执 行如本发明实施例所述的缓存的清理方法。
根据本发明实施例的应用程序, 在缓存使用量超过预设阈值时, 通过申请缓存空 间以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的 缓存空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
为了实现上述实施例, 本发明还提出一种存储介质, 用于存储应用程序, 该应用 程序用于在运行时执行如本发明实施例所述的缓存的清理方法。
根据本发明实施例的存储介质, 在缓存使用量超过预设阈值时, 通过申请缓存空 间以触发缓存释放规则释放缓存, 然后请求释放根据缓存申请请求分配的缓存空间, 合理利用移动终端操作系统的缓存机制, 使用操作系统提供的接口, 清理占用过多的 缓存空间, 操作简便, 改善了移动终端的运行流畅度, 提升了用户体验。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为, 表示包括 一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的部、 片段或 部分, 并且本发明的优选实施方式的范围包括另外的实现, 其中可以不按所示出或讨 论的顺序, 包括根据所涉及的功能按基本同时的方式或按相反的顺序, 来执行功能, 这应被本发明的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和 /或步骤, 例如, 可以被认为是用 于实现逻辑功能的可执行指令的定序列表, 可以具体实现在任何计算机可读介质中, 以供指令执行系统、 装置或设备 (如基于计算机的系统、 包括处理器的系统或其他可 以从指令执行系统、 装置或设备取指令并执行指令的系统) 使用, 或结合这些指令执 行系统、装置或设备而使用。就本说明书而言, "计算机可读介质"可以是任何可以包含、 存储、 通信、 传播或传输程序以供指令执行系统、 装置或设备或结合这些指令执行系 统、 装置或设备而使用的装置。 计算机可读介质的更具体的示例 (非穷尽性列表) 包 括以下: 具有一个或多个布线的电连接部(电子装置), 便携式计算机盘盒(磁装置), 随机存取存储器 (RAM) , 只读存储器 (ROM) , 可擦除可编辑只读存储器 (EPROM 或闪速存储器) , 光纤装置, 以及便携式光盘只读存储器 (CDROM) 。 另外, 计算机 可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质, 因为可以例如通 过对纸或其他介质进行光学扫描, 接着进行编辑、 解译或必要时以其他合适方式进行 处理来以电子方式获得所述程序, 然后将其存储在计算机存储器中。
应当理解, 本发明的各部分可以用硬件、 软件、 固件或它们的组合来实现。 在上 述实施方式中, 多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行 的软件或固件来实现。 例如, 如果用硬件来实现, 和在另一实施方式中一样, 可用本 领域公知的下列技术中的任一项或他们的组合来实现: 具有用于对数据信号实现逻辑 功能的逻辑门电路的离散逻辑电路, 具有合适的组合逻辑门电路的专用集成电路, 可 编程门阵列 (PGA) , 现场可编程门阵列 (FPGA) 等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤 是可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读存储 介质中, 该程序在执行时, 包括方法实施例的步骤之一或其组合。
此外, 在本发明各个实施例中的各功能单元可以集成在一个处理部中, 也可以是 各个单元单独物理存在, 也可以两个或两个以上单元集成在一个部中。 上述集成的部 既可以采用硬件的形式实现, 也可以采用软件功能部的形式实现。 所述集成的部如果 以软件功能部的形式实现并作为独立的产品销售或使用时, 也可以存储在一个计算机 可读取存储介质中。
上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
在本说明书的描述中, 参考术语 "一个实施例" 、 "一些实施例" 、 "示例" 、
"具体示例" 、 或 "一些示例" 等的描述意指结合该实施例或示例描述的具体特征、 结构、 材料或者特点包含于本发明的至少一个实施例或示例中。 在本说明书中, 对上 述术语的示意性表述不一定指的是相同的实施例或示例。 而且, 描述的具体特征、 结 构、 材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管已经示出和描述了本发明的实施例, 对于本领域的普通技术人员而言, 可以 理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、 修改、 替换和变型, 本发明的范围由所附权利要求及其等同限定。

Claims

权利要求书
1、 一种缓存的清理方法, 其特征在于, 包括以下步骤:
检测移动终端当前的缓存使用量;
当所述移动终端的缓存使用量大于预设阈值时, 向所述移动终端的操作系统发送 缓存申请请求, 以触发所述操作系统中预设的缓存释放规则; 以及
在所述操作系统根据所述预设的缓存释放规则释放对应缓存之后, 向所述操作系 统发送缓存释放请求, 以使所述操作系统根据所述缓存释放请求释放为所述缓存申请 请求所分配的缓存。
2、 如权利要求 1所述的方法, 其特征在于, 在所述向移动终端的操作系统发送缓 存申请请求之后, 还包括:
接收并记录所述操作系统根据所述缓存申请请求分配的缓存地址, 并在所述缓存 释放请求中添加所述分配的缓存地址。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述预设的缓存释放规则包括所 述操作系统释放预设数量的, 且由后台运行程序所占用的缓存。
4、 如权利要求 1-3任一项所述的方法, 其特征在于, 在所述向所述操作系统发送 缓存释放请求之后, 还包括:
再次检测所述移动终端当前的缓存使用量; 以及
如果判断再次检测的所述移动终端当前的缓存使用量依然大于所述预设阈值, 则 再次发送所述缓存申请请求。
5、 如权利要求 2-4任一项所述的方法, 其特征在于, 在所述向所述操作系统发送 缓存释放请求之后, 还包括:
根据所述缓存释放规则和所述操作系统根据所述缓存申请请求分配的缓存地址获 取本次释放的缓存量, 并在所述移动终端中显示给用户。
6、 一种缓存的清理装置, 其特征在于, 包括:
检测模块, 用于检测移动终端当前的缓存使用量;
缓存申请模块, 用于当所述移动终端的缓存使用量大于预设阈值时, 向所述移动 终端的操作系统发送缓存申请请求, 以触发所述操作系统中预设的缓存释放规则; 以 及
缓存释放模块, 用于在所述操作系统根据所述预设的缓存释放规则释放对应缓存 之后, 向所述操作系统发送缓存释放请求, 以使所述操作系统根据所述缓存释放请求 释放为所述缓存申请请求所分配的缓存。
7、 如权利要求 6所述的装置, 其特征在于, 还包括:
接收模块, 用于接收并记录所述操作系统根据所述缓存申请请求分配的缓存地址; 以及
添加模块, 在所述缓存释放请求中添加所述分配的缓存地址。
8、 如权利要求 6或 7所述的装置, 其特征在于, 所述预设的缓存释放规则包括所 述操作系统释放预设数量的, 且由后台运行程序所占用的缓存。
9、 如权利要求 6-8任一项所述的装置, 其特征在于,
所述检测模块, 还用于再次检测所述移动终端当前的缓存使用量; 以及
所述缓存申请模块, 还用于当判断再次检测的所述移动终端当前的缓存使用量依 然大于所述预设阈值时, 再次发送所述缓存申请请求。
10、 如权利要求 7-9任一项所述的装置, 其特征在于, 还包括:
获取模块, 用于根据所述缓存释放规则和所述操作系统根据所述缓存申请请求分 配的缓存地址获取本次释放的缓存量, 以及
显示模块, 用于将本次释放的缓存量在所述移动终端中显示给用户。
1 1、 一种客户端, 其特征在于, 包括: 外壳, 显示器、 电路板和处理器, 其中, 所述电路板安置在所述外壳围成的空间内部, 所述显示器在所述外壳外部, 并与所述 电路板相连接, 所述处理器设置在所述电路板上; 处理器用于处理数据, 并具体用于 执行以下步骤:
检测移动终端当前的缓存使用量;
当所述移动终端的缓存使用量大于预设阈值时, 向所述移动终端的操作系统发送 缓存申请请求, 以触发所述操作系统中预设的缓存释放规则; 以及
在所述操作系统根据所述预设的缓存释放规则释放对应缓存之后, 向所述操作系 统发送缓存释放请求, 以使所述操作系统根据所述缓存释放请求释放为所述缓存申请 请求所分配的缓存。
12、 一种应用程序, 其特征在于, 用于在运行时执行如权利要求 1-5任一项所述的 缓存的清理方法。
13、 一种存储介质, 其特征在于, 用于存储应用程序, 所述应用程序用于在运行 时执行如权利要求 1-5任一项所述的缓存的清理方法。
PCT/CN2014/084328 2014-01-14 2014-08-13 缓存的清理方法、装置及客户端 WO2015106563A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/111,764 US10275359B2 (en) 2014-01-14 2014-08-13 Cache cleaning method and apparatus, client

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410016945.2A CN103714016B (zh) 2014-01-14 2014-01-14 缓存的清理方法、装置及客户端
CN201410016945.2 2014-01-14

Publications (1)

Publication Number Publication Date
WO2015106563A1 true WO2015106563A1 (zh) 2015-07-23

Family

ID=50407012

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084328 WO2015106563A1 (zh) 2014-01-14 2014-08-13 缓存的清理方法、装置及客户端

Country Status (3)

Country Link
US (1) US10275359B2 (zh)
CN (1) CN103714016B (zh)
WO (1) WO2015106563A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732371A (zh) * 2021-01-14 2021-04-30 厦门雷霆互动网络有限公司 一种基于iOS系统的解决应用程序死机的方法及装置

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714016B (zh) 2014-01-14 2017-10-27 北京猎豹移动科技有限公司 缓存的清理方法、装置及客户端
CN104268093A (zh) * 2014-09-22 2015-01-07 可牛网络技术(北京)有限公司 内存分配方法及装置
CN107209623B (zh) * 2015-04-16 2020-09-08 华为技术有限公司 一种显示应用存储空间的方法和终端
CN105224259A (zh) * 2015-10-22 2016-01-06 深圳市创想天空科技股份有限公司 一种移动终端内存释放方法、装置及移动终端
CN105426126B (zh) * 2015-11-11 2018-06-05 浪潮(北京)电子信息产业有限公司 云存储客户端多路恒定速率io缓存的构建方法及装置
CN106095587B (zh) * 2016-06-24 2019-12-24 北京金山安全软件有限公司 应用程序的缓存扫描方法、装置及电子设备
CN106657274A (zh) * 2016-11-16 2017-05-10 武汉斗鱼网络科技有限公司 对应用文件进行处理的方法及装置
CN106844032A (zh) * 2017-01-23 2017-06-13 努比亚技术有限公司 一种终端应用的存储处理方法和装置
CN110651253A (zh) * 2017-05-17 2020-01-03 三菱电机株式会社 内存管理系统、信息处理装置及内存管理方法
US10691729B2 (en) * 2017-07-07 2020-06-23 Palantir Technologies Inc. Systems and methods for providing an object platform for a relational database
KR102222133B1 (ko) * 2018-01-12 2021-03-03 엔에이치엔 주식회사 모바일 단말기 및 그의 어플리케이션 관리 방법과 이를 활용한 타겟 광고 제공 시스템
CN109189739B (zh) * 2018-09-20 2020-11-03 北京京东尚科信息技术有限公司 缓存空间回收方法和装置
CN111142803B (zh) * 2019-12-29 2022-07-08 北京浪潮数据技术有限公司 一种元数据刷盘方法、装置、设备及介质
CN111246297A (zh) * 2020-01-10 2020-06-05 湖南快乐阳光互动娱乐传媒有限公司 一种缓存清理方法、装置及电子设备
CN111666153B (zh) * 2020-05-25 2024-07-05 深圳Tcl新技术有限公司 缓存任务管理方法、终端设备及存储介质
CN115033306B (zh) * 2022-06-29 2024-05-24 维沃移动通信有限公司 应用退出方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130173862A1 (en) * 2011-12-28 2013-07-04 Realtek Semiconductor Corp. Method for cleaning cache of processor and associated processor
CN103220427A (zh) * 2013-04-16 2013-07-24 广东欧珀移动通信有限公司 手机后台程序清理方法及手机
CN103324575A (zh) * 2012-03-23 2013-09-25 腾讯科技(深圳)有限公司 清理内存的方法和移动终端
CN103714016A (zh) * 2014-01-14 2014-04-09 贝壳网际(北京)安全技术有限公司 缓存的清理方法、装置及客户端

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5893920A (en) * 1996-09-30 1999-04-13 International Business Machines Corporation System and method for cache management in mobile user file systems
CN101833512A (zh) * 2010-04-22 2010-09-15 中兴通讯股份有限公司 一种内存回收方法及其装置
CN102650959B (zh) * 2012-03-31 2014-06-04 华为技术有限公司 一种检测内存单元的方法及设备
US9292448B2 (en) * 2013-09-19 2016-03-22 Google Inc. Dynamic sizing of memory caches
CN103559299B (zh) * 2013-11-14 2017-02-15 贝壳网际(北京)安全技术有限公司 清理文件的方法、装置及移动终端
CN103677977B (zh) * 2013-12-19 2017-05-17 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130173862A1 (en) * 2011-12-28 2013-07-04 Realtek Semiconductor Corp. Method for cleaning cache of processor and associated processor
CN103324575A (zh) * 2012-03-23 2013-09-25 腾讯科技(深圳)有限公司 清理内存的方法和移动终端
CN103220427A (zh) * 2013-04-16 2013-07-24 广东欧珀移动通信有限公司 手机后台程序清理方法及手机
CN103714016A (zh) * 2014-01-14 2014-04-09 贝壳网际(北京)安全技术有限公司 缓存的清理方法、装置及客户端

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732371A (zh) * 2021-01-14 2021-04-30 厦门雷霆互动网络有限公司 一种基于iOS系统的解决应用程序死机的方法及装置

Also Published As

Publication number Publication date
CN103714016B (zh) 2017-10-27
CN103714016A (zh) 2014-04-09
US10275359B2 (en) 2019-04-30
US20160335191A1 (en) 2016-11-17

Similar Documents

Publication Publication Date Title
WO2015106563A1 (zh) 缓存的清理方法、装置及客户端
KR101357397B1 (ko) 데이터 프로세싱 시스템의 메모리 사용을 추적하는 방법
CN109213696B (zh) 用于缓存管理的方法和设备
KR101183424B1 (ko) 관리되지 않는 메모리에 대한 콜렉션을 수행하기 위한 방법및 시스템
US11366758B2 (en) Method and devices for managing cache
US10417137B2 (en) Flushing pages from solid-state storage device
JP2013509658A (ja) 将来の使用推量に基づく記憶メモリの割り当て
JP2005353070A5 (zh)
CN112068765A (zh) 管理存储系统的方法、设备和计算机程序产品
CN105893266B (zh) 用于重新使用文件系统的存储块的方法和装置
US9870400B2 (en) Managed runtime cache analysis
US10552318B2 (en) Working set adjustment in a managed environment
US20140258631A1 (en) Allocating Enclosure Cache In A Computing System
US20130173862A1 (en) Method for cleaning cache of processor and associated processor
CN115840635A (zh) 计算资源管理方法、电子设备和程序产品
CN109992217B (zh) 一种服务质量控制方法、装置、电子设备和存储介质
CN109840217B (zh) 一种缓存资源分配和装置
JP2008225669A (ja) メモリ管理装置、メモリ管理方法およびプログラム
TWI548989B (zh) 行動電子裝置與清理記憶區塊的方法
CN117742593A (zh) Ssd缓存回刷处理方法、系统、设备及储存介质
JP2012155502A (ja) 外部記録媒体に常駐されたキャッシュメモリプログラム
US9176854B2 (en) Presenting enclosure cache as local cache in an enclosure attached server
JP2009217589A (ja) 実行用メモリ領域割当装置及び実行用メモリ領域割当プログラム及び記録媒体
JP2009048258A (ja) 情報処理装置、情報処理方法、情報処理プログラム

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 15111764

Country of ref document: US

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 07-11-16

122 Ep: pct application non-entry in european phase

Ref document number: 14879049

Country of ref document: EP

Kind code of ref document: A1