WO2015106563A1 - 缓存的清理方法、装置及客户端 - Google Patents
缓存的清理方法、装置及客户端 Download PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000004140 cleaning Methods 0.000 title claims abstract description 43
- 238000001514 detection method Methods 0.000 claims description 19
- 230000008569 process Effects 0.000 claims description 14
- 239000000872 buffer Substances 0.000 description 15
- 230000006870 function Effects 0.000 description 13
- 230000007246 mechanism Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 230000006399 behavior Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000011895 specific detection Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0891—Addressing 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3409—Recording 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/81—Threshold
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/885—Monitoring specific for caches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
- G06F2212/1021—Hit rate improvement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
- G06F2212/1024—Latency reduction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/17—Embedded application
- G06F2212/171—Portable consumer electronics, e.g. mobile phone
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/60—Details of cache memory
- G06F2212/604—Details relating to cache allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/60—Details of cache memory
- G06F2212/608—Details 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
Claims
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112732371A (zh) * | 2021-01-14 | 2021-04-30 | 厦门雷霆互动网络有限公司 | 一种基于iOS系统的解决应用程序死机的方法及装置 |
Families Citing this family (16)
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)
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)
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 | 贝壳网际(北京)安全技术有限公司 | 清理移动终端中临时文件的方法、装置和移动终端 |
-
2014
- 2014-01-14 CN CN201410016945.2A patent/CN103714016B/zh active Active
- 2014-08-13 US US15/111,764 patent/US10275359B2/en not_active Expired - Fee Related
- 2014-08-13 WO PCT/CN2014/084328 patent/WO2015106563A1/zh active Application Filing
Patent Citations (4)
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)
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 |