WO2015090080A1 - 清理移动终端中临时文件的方法、装置和移动终端 - Google Patents

清理移动终端中临时文件的方法、装置和移动终端 Download PDF

Info

Publication number
WO2015090080A1
WO2015090080A1 PCT/CN2014/084322 CN2014084322W WO2015090080A1 WO 2015090080 A1 WO2015090080 A1 WO 2015090080A1 CN 2014084322 W CN2014084322 W CN 2014084322W WO 2015090080 A1 WO2015090080 A1 WO 2015090080A1
Authority
WO
WIPO (PCT)
Prior art keywords
preset
mobile terminal
storage space
cleaning
write
Prior art date
Application number
PCT/CN2014/084322
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/106,298 priority Critical patent/US10198453B2/en
Publication of WO2015090080A1 publication Critical patent/WO2015090080A1/zh

Links

Classifications

    • 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/174Redundancy elimination performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • 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

Definitions

  • the present invention relates to the field of mobile terminal technologies, and in particular, to a method, an apparatus, and a mobile terminal for cleaning temporary files in a mobile terminal. Background technique
  • the management of the application based on the sandbox the temporary file deletion of the storage space of the mobile terminal by the application is not allowed, and only the operating system of the mobile terminal has the clear permission. Only the operating system of the mobile terminal automatically clears temporary files in some application sandboxes to free up storage space when there is insufficient storage space. Therefore, it is very difficult to clear the temporary files of the installed application in the mobile terminal, and the longer the mobile terminal is used, the more temporary files are accumulated, which not only occupies the valuable storage resources of the mobile terminal, but also slows down the mobile terminal. Running speed. Summary of the invention
  • the present invention aims to solve at least one of the above technical problems.
  • a first object of the present invention is to provide a method of cleaning up temporary files in a mobile terminal. This method.
  • a second object of the present invention is to provide an apparatus for cleaning temporary files in a mobile terminal.
  • a third object of the present invention is to provide a mobile terminal.
  • a fourth object of the present invention is to provide a storage medium.
  • a method for cleaning a temporary file in a mobile terminal includes the steps of: receiving an input cleaning instruction; creating a write thread according to the cleaning instruction; and controlling the writing thread at the first
  • the data is written in the preset file directory to trigger the operating system of the mobile terminal to clean the temporary file in the at least one second preset file directory according to the preset cache release rule.
  • the method for cleaning a temporary file in a mobile terminal creates a write thread according to a cleanup instruction to write data in a temporary file, effectively utilizes an operating system cleanup mechanism, and cleans temporary files of other applications according to a preset cache release rule. To achieve the purpose of releasing more storage space, the user experience is good.
  • an apparatus for cleaning a temporary file in a mobile terminal includes: a cleanup instruction receiving module, configured to receive an input cleanup instruction; and a write thread creation module, configured to create according to the cleanup instruction a write thread; and a control module, configured to control the write thread to write data in the first preset file directory, to trigger the operating system of the mobile terminal to clean at least one second preset file according to a preset cache release rule Temporary files under the directory.
  • the device for cleaning the temporary file in the mobile terminal creates a write thread according to the cleanup instruction, and writes the data in the temporary file through the write thread, effectively utilizes the operating system cleanup mechanism, and cleans other applications according to the preset cache release rule.
  • the temporary file of the program in order to achieve the purpose of releasing more storage space, the user experience is good.
  • a mobile terminal includes: a housing, a screen, a processor, a memory, and a circuit board; the screen is disposed on the housing, and the circuit board is disposed in the housing Inside the space, the processor and the memory are disposed on the circuit board; the memory is configured to store executable program code; the processor reads the executable program code stored in the memory by Running a program corresponding to the executable program code, configured to: receive an input cleanup instruction; create a write thread according to the cleanup instruction; and control the write thread to write data in a first preset file directory, to The operating system that triggers the mobile terminal cleans up temporary files in the at least one second preset file directory according to a preset cache release rule.
  • the mobile terminal creates a write thread according to the cleanup instruction, and writes the data in the temporary file through the write thread, effectively utilizes the operating system cleanup mechanism, and cleans the temporary file of other application according to the preset cache release rule, thereby To achieve the purpose of releasing more storage space, the user experience is good.
  • a storage medium configured to store an application, where the application is used to execute a method for cleaning a temporary file in a mobile terminal according to the first aspect of the present invention.
  • FIG. 1 is a flow chart of a method of cleaning a temporary file in a mobile terminal according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for cleaning a temporary file in a mobile terminal according to still another embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for cleaning a temporary file in a mobile terminal according to an embodiment of the present invention
  • the present invention provides a method for cleaning up temporary files in the mobile terminal.
  • FIG. 1 is a flow chart of a method of cleaning a temporary file in a mobile terminal in accordance with one embodiment of the present invention. As shown in FIG. 1, the method for cleaning temporary files in a mobile terminal includes the following steps:
  • the cleanup command can be triggered by a preset method (for example, one-click cleaning, etc.), and there are various specific implementation forms, which are not enumerated here.
  • the mobile terminal may be a hardware device having various operating systems such as a smart phone, a tablet computer, a personal digital assistant, an electronic book, or the like.
  • a thread is a single sequential control process in a program that can be managed by a process, where a program being executed in a computer is called a "process.”
  • the write thread created in accordance with the cleanup instruction is a thread that is created to perform a write to disk operation.
  • the write thread can include one or more.
  • the data may be written in the target folder by using a single thread (ie, a single write process) or a multi-thread (ie, multiple write processes). Data padding will be described in detail in the subsequent embodiments.
  • the preset cache release rule includes releasing a preset amount of storage space occupied by the background running program.
  • the control write thread can continuously write the data occupation storage space to trigger the preset cache release rule in the operating system, thereby cleaning up the temporary file in the at least one second preset file directory in the storage space, at least one
  • the two preset files are file directories corresponding to other applications except the first preset file.
  • the cleaning process can be implemented by an application for cleaning temporary files, and the iOS operating system (iOS is a handheld operating system developed by Apple), for example, according to the iOS operating system.
  • iOS operating system iOS is a handheld operating system developed by Apple
  • any temporary files generated in the application will be stored in the library/caches or tmp folder of each application (used to store temporary files, which can be named differently in different operating systems).
  • the size of the data written in the library/caches or tmp folder allocates storage space that will be occupied by the application until the application is manually released or forcibly released.
  • an application for cleaning a temporary file corresponds to a first preset file directory
  • at least one second preset file directory that needs to be cleaned may be a file directory of another application by controlling an application for cleaning the temporary file.
  • the data is written in the first preset file directory to release the temporary file in the at least one second preset file directory.
  • the method for cleaning the temporary file in the mobile terminal creates a write thread according to the cleanup instruction, and writes the data in the temporary file through the write thread, effectively utilizes the operating system cleanup mechanism, and cleans other applications according to the preset cache release rule.
  • the temporary file of the program in order to achieve the purpose of releasing more storage space, the user experience is good.
  • FIG. 2 is a flow chart of a method of cleaning a temporary file in a mobile terminal according to still another embodiment of the present invention.
  • the method for cleaning up temporary files in the mobile terminal includes the following steps:
  • the cleanup command can be triggered by a preset method (for example, one-click cleaning, etc.), and there are various specific implementation forms, which are not enumerated here.
  • the mobile terminal may be a hardware device having various operating systems such as a smart phone, a tablet computer, a personal digital assistant, an electronic book, or the like.
  • the mobile terminal application is an application that can be used for storage space detection and cleaning, such as a mobile terminal temporary file cleaner, a mobile phone housekeeper, etc., and may also be other applications with storage space detection and cleaning functions. .
  • S203 Obtain a remaining amount of the storage space in the mobile terminal, and obtain a size of the cleaned storage space according to the size of the data written in the first preset file directory.
  • the mobile terminal application can acquire the remaining amount of the storage space in the current mobile terminal through an interface provided by the operating system or a specific detection module.
  • the difference between the size of the data written in the first preset file directory and the remaining amount of the storage space in the current mobile terminal should not be greater than the remaining amount of the minimum storage space preset by the operating system, thereby enabling After the preset size data is written in the first preset file directory, the cache release rule of the operating system is triggered to clear the temporary file corresponding to other applications.
  • the remaining storage space is divided into tasks according to the number of multi-threads, and the plurality of threads simultaneously write data to the temporary file corresponding to the task through the corresponding interface provided by the operating system.
  • the control write thread continuously writes a preset file or memory data in the first preset file directory until the storage space of the mobile terminal reaches a preset threshold, to trigger the operating system of the mobile terminal according to the preset.
  • the cache release rule cleans up temporary files under at least one second preset file directory.
  • the preset threshold may be a preset ratio of the total cache occupied by the application available cache, and is set according to the specific operation condition of the mobile terminal.
  • the preset cache release rule includes the operating system releasing a preset amount of storage space 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 storage space occupied by the application running by the background. For example, when the storage space usage is greater than a predetermined threshold (such as 90%), an alarm is generated in the mobile terminal and a certain amount of temporary files are automatically cleaned up. It should be understood that the mobile terminal will preferentially process temporary files corresponding to applications that are not currently being called.
  • the size of the preset file or the memory data written by the write thread in the first preset file directory needs to be set according to the currently available storage space.
  • the storage space of the mobile terminal is guaranteed to reach a preset threshold in the cache release rule, thereby triggering the operating system to clean the temporary file.
  • the data can be written in, but not limited to, the following two methods:
  • the first is to use the C language file system interface to directly write the data in the cache to the file system.
  • the size of the data written each time is 4KB is the best, the data written too large or too small will slow down the writing speed; the main use of C language
  • the interface is fopen (open a file), fwrite (write a block to a file), and fclose (close a stream) to minimize the cost of program runs that can occur during data writes.
  • the statistical results of several experiments show that the speed of writing data in this mode is about 36 MB/s, that is, it takes about 284 seconds to fill the remaining space of 10 GB.
  • the second is to copy the preset data files multiple times using the file system interface of the Objective-C language (expanding the C-oriented object-oriented programming language).
  • the preset data file size is 4MB, directly calling NSFileManager (which contains methods for querying the word library directory, creating, renaming, deleting directories, and getting/setting file attributes) in the copyItemAtPath:toPath:error: interface (iOS operation)
  • NSFileManager which contains methods for querying the word library directory, creating, renaming, deleting directories, and getting/setting file attributes
  • the application programming interface in the system is used to copy a file synchronously to a new path.
  • the data file is copied multiple times until the copy fails, that is, the task space is filled. Through experiments, the speed of writing data in this way is about 28MB/s, that is, it takes about 365 seconds to fill the remaining space of 10GB.
  • the C language file system interface is more likely to be used in practical applications, so that the cleaning task can be completed faster, and the performance can be improved by 22% compared with the second implementation.
  • the application deletes all the temporary files written by the write thread of the first preset directory file, and then calculates the new remaining storage space. Compared with the value before cleaning, the result of this cleaning is obtained.
  • the method for cleaning a temporary file in a mobile terminal increases a data writing speed by creating a plurality of write threads, and continuously writes data in a temporary file to trigger a cache release rule, thereby cleaning up temporary files corresponding to other applications, and then Delete the previously written data, clean up the application's own temporary files, further release the storage space, make reasonable use of the operating system rules, improve the cleaning efficiency of the application temporary files, easy to operate, improve the smoothness of the mobile terminal, and improve the user experience.
  • FIG. 3 is a schematic structural diagram of an apparatus for cleaning a temporary file in a mobile terminal according to an embodiment of the present invention.
  • the apparatus for cleaning temporary files in the mobile terminal includes: a cleanup instruction receiving module 100, a write thread creation module 200, and a control module 300.
  • the mobile terminal in the embodiment of the present invention may be a hardware device having various operating systems, such as a smart phone, a tablet computer, a personal digital assistant, and an e-book.
  • the cleaning instruction receiving module 100 is configured to receive the input cleaning instruction.
  • the cleanup command can be triggered by a preset method (for example, one-click cleaning, etc.), and there are various specific implementation forms, which are not enumerated here.
  • the write thread creation module 200 is for creating a write thread based on the cleanup instruction. Among them, the thread is a single sequential control process in the program, which can be managed by the process, wherein the program being executed in the computer is called "process".
  • the write thread created according to the cleanup instruction is the created thread that performs the write to disk operation. More specifically, the write thread may include one or more.
  • the write thread creation module 200 creates a write thread, and may adopt a single thread (ie, a single write process) or multiple threads (ie, multiple The way of writing the process is to write data under the target folder (ie, the first preset file directory mentioned in the subsequent embodiment), thereby performing data filling on the storage space.
  • the control module 300 is configured to control the write thread to write data in the first preset file directory, to trigger the operation system of the mobile terminal to clean the temporary file in the at least one second preset file directory according to the preset cache release rule.
  • the preset cache release rule includes releasing a preset amount of storage space occupied by the background running program. More specifically, the control module 300 can continuously write the data occupation storage space by controlling the write thread to trigger a preset cache release rule in the operating system, thereby cleaning the temporary file in the at least one second preset file directory in the storage space.
  • the at least one second preset file is a file directory corresponding to another application except the first preset file.
  • the cleaning process can be implemented by an application for cleaning temporary files, and the iOS operating system (iOS is a handheld operating system developed by Apple), for example, according to the iOS operating system.
  • iOS operating system iOS is a handheld operating system developed by Apple
  • any temporary files generated in the application will be stored in the library/caches or tmp folder of each application (used to store temporary files, which can be named differently in different operating systems).
  • the size of the data written in the library/caches or tmp folder allocates storage space that will be occupied by the application until the application is manually released or forcibly released.
  • an application for cleaning a temporary file corresponds to a first preset file directory
  • at least one second preset file directory that needs to be cleaned may be a file directory of another application by controlling an application for cleaning the temporary file.
  • the data is written in the first preset file directory to release the temporary file in the at least one second preset file directory.
  • the device for cleaning the temporary file in the mobile terminal creates a write thread according to the cleanup instruction, and writes the data in the temporary file through the write thread, effectively utilizes the operating system cleanup mechanism, and cleans other applications according to the preset cache release rule.
  • the temporary file of the program in order to achieve the purpose of releasing more storage space, the user experience is good.
  • FIG. 4 is a flow chart of a method of cleaning a temporary file in a mobile terminal in accordance with still another embodiment of the present invention.
  • the apparatus for cleaning the temporary files in the mobile terminal further includes: a cleaning module 400, a storage space obtaining module 500, and a task assigning module 600.
  • the cleaning module 400 is configured to clean the write of the first preset directory file when receiving the write failure message of the write thread Data. More specifically, the data written by the write thread in the first preset directory file continuously occupies the storage space of the operating system, and finally the operating system will return two results: one is to return the write when the cache release rule is not triggered. The signal that the data is successful; the other is that after the operating system storage space is insufficient, the cache release rule is triggered, the signal that fails to write data is returned, and the write thread that receives the failure signal stops running. In an embodiment of the present invention, after all the running write threads finish the task, the cleanup module 400 deletes all the temporary files that the write thread of the first preset directory file has written, and then calculates the new remaining storage space. , compared with the value before cleaning, the results of this cleanup.
  • the control module 300 is further configured to control the write thread to continuously write the preset file of the preset size in the first preset file directory until the storage space of the mobile terminal reaches a preset threshold; or control the write thread to continuously advance to the first pre-
  • the memory data of the preset size is written in the file directory until the storage space of the mobile terminal reaches a preset threshold. More specifically, the control module 300 controls the write thread to continuously write a preset size file or memory data in the first preset file directory until the storage space of the mobile terminal reaches a preset threshold to trigger the operation of the mobile terminal.
  • the system cleans the temporary files in the at least one second preset file directory according to a preset cache release rule.
  • the control module 300 may determine whether the current storage space remaining amount is smaller than a preset threshold according to the current storage space remaining amount.
  • the preset threshold may be a preset ratio of the total cache occupied by the application available cache, and is set according to the specific running condition of the mobile terminal.
  • the preset cache release rule includes the operating system releasing a preset amount of storage space 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 storage space occupied by the application running in the background. For example, when the storage space usage is greater than a preset threshold (such as 90%), an alarm is generated in the mobile terminal and a certain amount of temporary files are automatically cleaned up. It should be understood that the mobile terminal will preferentially process temporary files corresponding to applications that are not currently being called.
  • a preset threshold such as 90%
  • the size of the preset file or the memory data written by the write thread in the first preset file directory needs to be set according to the currently available storage space.
  • the storage space of the mobile terminal is guaranteed to reach a preset threshold in the cache release rule, thereby triggering the operating system to clean the temporary file.
  • the data can be written in, but not limited to, the following two methods:
  • the first is to use the C language file system interface to directly write the data in the cache to the file system.
  • the size of the data written each time is 4KB is the best, the data written too large or too small will slow down the writing speed;
  • the main use of the C language interface is fopen (open a file), fwrite (write to the file Incoming data blocks) and fclose (closing a stream) minimize the cost of program runs that can occur during the process of writing data.
  • the statistical results of many experiments show that the speed of writing data in this mode is about 36MB/s, that is, it takes about 284 seconds to fill the remaining space of 10GB.
  • the second is to copy the preset data file multiple times using the file system interface of the Objective-C language (expanding the C-oriented object-oriented programming language).
  • the preset data file size is 4MB, directly calling NSFileManager (which contains methods for querying the word library directory, creating, renaming, deleting directories, and getting/setting file attributes)
  • NSFileManager which contains methods for querying the word library directory, creating, renaming, deleting directories, and getting/setting file attributes
  • the copyItemAtPath:toPath:error method copies the data file multiple times until the copy fails, that is, the task space is filled.
  • the speed of writing data in this mode is about 28 MB/s, that is, it takes about 365 seconds to fill the remaining space of 10 GB.
  • the C language file system interface is more likely to be used in practical applications, so that the cleaning task can be completed faster, and the performance can be improved by 22% compared with the second implementation.
  • the storage space obtaining module 500 is configured to acquire a remaining amount of the storage space in the mobile terminal before the control module controls the write thread to continuously write data to the first preset file directory, and write according to the first preset file directory.
  • the size of the data gets the size of the cleaned storage space. More specifically, the storage space acquisition module 500 can acquire the remaining amount of storage space in the current mobile terminal.
  • the difference between the size of the data written in the first preset file directory and the remaining amount of the storage space in the current mobile terminal should not be greater than the remaining amount of the minimum storage space preset by the operating system, thereby enabling After the preset size data is written in the first preset file directory, the cache release rule of the operating system is triggered to clear the temporary file corresponding to other applications.
  • the task assignment module 600 is configured to allocate a write task to the plurality of write threads according to the remaining amount of the storage space before the control module controls the write thread to write data in the first preset file directory. More specifically, the task allocation module 600 divides the remaining storage space according to the remaining amount of the available storage space according to the number of multi-threads, and the plurality of threads simultaneously write to the temporary file corresponding to the task through the corresponding interface provided by the operating system. data.
  • the device for cleaning the temporary file in the mobile terminal in the embodiment of the present invention increases the data writing speed by creating a plurality of writing threads, and continuously writes the data in the temporary file to trigger a cache release rule, thereby cleaning up the temporary file corresponding to other applications, and then Delete the previously written data, clean up the application's own temporary files, further release the storage space, make reasonable use of the operating system rules, improve the cleaning efficiency of the application temporary files, easy to operate, improve the smoothness of the mobile terminal, and improve the user experience.
  • an embodiment of the present invention also proposes a mobile terminal.
  • the mobile terminal comprises: a casing, a screen, a processor, a memory and a circuit board; the screen is disposed on the casing, the circuit board is disposed inside the space enclosed by the casing, and the processor and the memory are disposed on the circuit board
  • the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for performing the following steps:
  • Sior receives the cleanup instructions for the input.
  • the cleanup command can be triggered by a preset method (for example, one-click cleaning, etc.), and there are various specific implementation forms, which are not enumerated here.
  • the mobile terminal may be a hardware device having various operating systems such as a smart phone, a tablet computer, a personal digital assistant, an electronic book, or the like.
  • S102' creates a write thread according to the cleanup instruction.
  • a thread is a single sequential control flow in a program that can be managed by a process, wherein a program being executed in a computer is called a "process.”
  • the write thread created according to the cleanup instruction is the created thread that performs the write to disk operation.
  • the write thread can include one or more.
  • the processor may adopt a single thread (ie, a single write process) or a multi-thread (ie, multiple write processes) in the target folder (ie, the first preset file mentioned in the subsequent embodiment).
  • the data is written under the directory, so that the data is filled in the storage space, which will be described in detail in the subsequent embodiments.
  • S103' controls the write thread to write data in the first preset file directory, to trigger the operating system of the mobile terminal to clean the temporary file in the at least one second preset file directory according to the preset cache release rule.
  • the preset cache release rule includes releasing a preset amount of storage space occupied by the background running program.
  • the processor can continuously write the data occupying the storage space by the write thread to trigger the preset cache release rule in the operating system, thereby cleaning the temporary file in the at least one second preset file directory in the storage space, at least A second preset file is a file directory corresponding to other applications than the first preset file.
  • the cleaning process can be implemented by an application for cleaning temporary files, and the iOS operating system (iOS is a handheld operating system developed by Apple), for example, according to the iOS operating system.
  • iOS operating system iOS is a handheld operating system developed by Apple
  • any temporary files generated in the application will be stored in the library/caches or tmp folder of each application (used to store temporary files, which can be named differently in different operating systems).
  • the size of the data written in the library/caches or tmp folder allocates storage space that will be occupied by the application until the application is manually released or forcibly released.
  • an application for cleaning a temporary file corresponds to a first preset file directory
  • at least one second preset file directory that needs to be cleaned may be a file directory of another application by controlling an application for cleaning the temporary file.
  • the data is written in the first preset file directory to release the temporary file in the at least one second preset file directory.
  • the mobile terminal in the embodiment of the present invention can create a write thread according to the cleanup instruction, write data in the temporary file through the write thread, effectively utilize the operating system cleanup mechanism, and clean the temporary files of other applications according to the preset cache release rule.
  • the purpose of releasing more storage space is achieved, and the user experience is good.
  • the processor is further configured to perform the following steps:
  • multiple write threads may be created according to the cleanup instruction to improve the application to the application.
  • the efficiency of writing data in temporary files may be improved according to the cleanup instruction to improve the application to the application.
  • the mobile terminal application is an application that can be used for storage space detection and cleaning, such as a mobile terminal temporary file cleaner, a mobile phone housekeeper, etc., and may also be other applications with storage space detection and cleaning functions. .
  • the processor can acquire the remaining amount of the storage space in the current mobile terminal.
  • the difference between the size of the data written in the first preset file directory and the remaining amount of the storage space in the current mobile terminal should not be greater than the remaining amount of the minimum storage space preset by the operating system, thereby enabling After the preset size data is written in the first preset file directory, the cache release rule of the operating system is triggered to clear the temporary file corresponding to other applications.
  • the write task is allocated for multiple write threads according to the remaining amount of the storage space.
  • the processor divides the remaining storage space according to the number of threads, and the plurality of threads simultaneously write data to the temporary file corresponding to the task through the corresponding interface provided by the operating system.
  • control write thread continuously writes a preset file or memory data in the first preset file directory until the storage space of the mobile terminal reaches a preset threshold, to trigger the operating system of the mobile terminal according to the preset
  • the cache release rule cleans up at least one temporary file under the second preset file directory.
  • the processor first determines whether the current storage space remaining amount is less than a preset threshold according to the current storage space remaining amount.
  • the preset threshold may be a preset ratio of the total cache occupied by the application available cache, and is set according to the specific running condition of the mobile terminal.
  • the preset cache release rule includes the operating system releasing a preset amount of storage space 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 storage space occupied by the application running in the background. For example, when the storage space usage is greater than a predetermined threshold (such as 90%), an alarm is generated in the mobile terminal and a certain amount of temporary files are automatically cleaned up. It should be understood that the processor will preferentially process temporary files corresponding to applications that are not currently being called.
  • a predetermined threshold such as 90%
  • the size of the preset file or the memory data written by the write thread in the first preset file directory needs to be set according to the currently available storage space.
  • the storage space of the mobile terminal is guaranteed to reach a preset threshold in the cache release rule, thereby triggering the operating system to clean the temporary file.
  • the processor will delete the first pre- Let the directory file write all the temporary files that have been written by the thread, and then calculate the new remaining storage space, and compare it with the value before cleaning, and get the result of this cleanup.
  • the mobile terminal in the embodiment of the present invention increases the data writing speed by creating a plurality of write threads, and continuously writes data in the temporary file to trigger a cache release rule, thereby cleaning up temporary files corresponding to other applications, and then deleting the previously written data. Clean up the application's own temporary files, further release the storage space, make reasonable use of the operating system rules, improve the cleaning efficiency of the application temporary files, and make the operation simple, improve the smoothness of the mobile terminal, and improve the user experience.
  • the present invention provides a storage medium for storing an application for executing a method for cleaning a temporary file in a mobile terminal according to any of the embodiments of the present invention.
  • 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 by 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.
  • the description of the terms “one embodiment”, “some embodiments”, “example”, “specific example”, or “some examples” and the like means a specific feature described in connection with the embodiment or example.
  • a structure, material or feature is included in at least one embodiment or example of the invention.
  • the schematic representation of the above terms does not necessarily mean the same embodiment or example.
  • the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Telephone Function (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本发明提出一种清理移动终端中临时文件的方法、装置、移动终端和存储介质,为提高移动终端中临时文件的清理效率,有效提升用户体验而发明。其中,清理移动终端中临时文件的方法包括:接收输入的清理指令;根据清理指令创建写线程;以及控制写线程在第一预设文件目录下写入数据,以触发移动终端的操作系统根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。本发明可用于移动终端设备存储空间管理技术中。

Description

清理移动终端中临时文件的方法、 装置和移动终端
技术领域
本发明涉及移动终端技术领域, 尤其涉及一种清理移动终端中临时文件的方法、 装置 和移动终端。 背景技术
随着电子技术的发展, 移动终端变得越来越普及, 移动终端中的应用程序数量也越来越 多。通常用户在移动终端中会安装多个应用程序, 使用不同的应用程序实现不同的目的。 因 此, 需要移动终端的操作系统对应用程序进行有效管理。 目前, 最重要的管理方式之一是基 于沙盘的管理方式, 即每个应用程序都有自己的沙盒, 该沙盒占用移动终端的部分存储空间 以存储应用程序的文件、 文档、 用户数据和临时文件等。 另外, 出于安全的考虑, 跨应用程 序之间的沙盘通常是不可相互访问的。
因此, 基于沙盘对应用程序进行管理, 通过应用程序对移动终端的存储空间进行临时文 件的清除是不允许的, 只有移动终端的操作系统具有清除权限。只有移动终端的操作系统在 存储空间不足时, 才会自动清除部分应用程序沙盘中的临时文件等以释放存储空间。 因此, 清除移动终端中已安装应用程序的临时文件非常困难, 造成了移动终端使用时间越长, 积累 的临时文件越多,不仅占用了移动终端宝贵的存储资源,而且也会拖慢移动终端的运行速度。 发明内容
本发明旨在至少解决上述技术问题之一。
为此, 本发明的第一个目的在于提出一种清理移动终端中临时文件的方法。 该方法。 本发明的第二个目的在于提出一种清理移动终端中临时文件的装置。
本发明的第三个目的在于提出一种移动终端。
本发明的第四个目的在于提出一种存储介质。
为了实现上述目的, 本发明第一方面实施例的清理移动终端中临时文件的方法, 包括以 下步骤: 接收输入的清理指令; 根据所述清理指令创建写线程; 以及控制所述写线程在第一 预设文件目录下写入数据, 以触发所述移动终端的操作系统根据预设的缓存释放规则清理至 少一个第二预设文件目录下的临时文件。
本发明实施例的清理移动终端中临时文件的方法,通过根据清理指令创建写线程在临时 文件中写入数据, 有效利用操作系统清理机制, 根据预设的缓存释放规则清理其他应用程序 的临时文件, 从而达到释放更多存储空间的目的, 用户体验好。 为了实现上述目的, 本发明第二方面实施例的清理移动终端中临时文件的装置, 包括: 清理指令接收模块, 用于接收输入的清理指令; 写线程创建模块, 用于根据所述清理指令创 建写线程; 以及控制模块, 用于控制所述写线程在第一预设文件目录下写入数据, 以触发所 述移动终端的操作系统根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时 文件。
本发明实施例的清理移动终端中临时文件的装置, 根据清理指令创建写线程, 并通过写 线程在临时文件中写入数据, 有效利用操作系统清理机制, 根据预设的缓存释放规则清理其 他应用程序的临时文件, 从而达到释放更多存储空间的目的, 用户体验好。
为了实现上述目的, 本发明第三方面实施例的移动终端, 包括: 外壳, 屏幕, 处理器, 存储器和电路板;所述屏幕安置在所述外壳上,所述电路板安置在所述外壳围成的空间内部, 所述处理器和所述存储器设置在所述电路板上; 所述存储器用于存储可执行程序代码; 所述 处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的 程序, 以用于: 接收输入的清理指令; 根据所述清理指令创建写线程; 以及控制所述写线程 在第一预设文件目录下写入数据, 以触发所述移动终端的操作系统根据预设的缓存释放规则 清理至少一个第二预设文件目录下的临时文件。
本发明实施例的移动终端, 根据清理指令创建写线程, 并通过写线程在临时文件中写入 数据,有效利用操作系统清理机制,根据预设的缓存释放规则清理其他应用程序的临时文件, 从而达到释放更多存储空间的目的, 用户体验好。
为了实现上述目的, 本发明第四方面实施例的存储介质, 用于存储应用程序, 所述应用 程序用于执行本发明第一方面实施例所述的清理移动终端中临时文件的方法。
本发明附加的方面和优点将在下面的描述中部分给出, 部分将从下面的描述中变得明 显, 或通过本发明的实践了解到。 附图说明
本发明上述的和 /或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和 容易理解, 其中,
图 1是根据本发明一个实施例的清理移动终端中临时文件的方法的流程图;
图 2是根据本发明又一个实施例的清理移动终端中临时文件的方法的流程图; 图 3是根据本发明一个实施例的清理移动终端中临时文件的装置的结构示意图; 图 4是根据本发明又一个实施例的清理移动终端中临时文件的装置的结构示意图。 具体实施方式 下面详细描述本发明的实施例, 所述实施例的示例在附图中示出, 其中自始至终相同或 类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的 实施例是示例性的, 仅用于解释本发明, 而不能理解为对本发明的限制。 相反, 本发明的实 施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、 修改和等同物。
在本发明的描述中, 需要理解的是, 术语"第一"、 "第二"等仅用于描述目的, 而不能理 解为指示或暗示相对重要性。 在本发明的描述中, 需要说明的是, 除非另有明确的规定和限 定, 术语 "相连"、 "连接 "应做广义理解, 例如, 可以是固定连接, 也可以是可拆卸连接, 或一体地连接; 可以是机械连接, 也可以是电连接; 可以是直接相连, 也可以通过中间媒介 间接相连。对于本领域的普通技术人员而言, 可以具体情况理解上述术语在本发明中的具体 含义。 此外, 在本发明的描述中, 除非另有说明, "多个"的含义是两个或两个以上。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或 更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分, 并且 本发明的优选实施方式的范围包括另外的实现, 其中可以不按所示出或讨论的顺序, 包括根 据所涉及的功能按基本同时的方式或按相反的顺序, 来执行功能, 这应被本发明的实施例所 属技术领域的技术人员所理解。
下面结合说明书附图详细说明本发明实施例的清理移动终端中临时文件的方法、装置和 移动终端。
为了解决移动终端中已安装应用程序的临时文件清理困难导致移动终端运行缓慢的问 题, 本发明提出一种清理移动终端中临时文件的方法。
图 1是根据本发明一个实施例的清理移动终端中临时文件的方法的流程图。如图 1所示, 清理移动终端中临时文件的方法包括以下步骤:
5101 , 接收输入的清理指令。
其中, 清理指令可以通过预设方式 (例如一键清理等)触发, 具体的可实现形式还有多 种, 在此不再一一列举。
在本发明的一个实施例中, 移动终端可以是智能手机、 平板电脑、 个人数字助理、 电子 书等具有各种操作系统的硬件设备。
5102, 根据清理指令创建写线程。
具体地, 线程是程序中一个单一的顺序控制流程, 可通过进程进行管理, 其中, 正在计 算机中执行的程序叫做 "进程"。 在本发明的实施例中, 根据清理指令创建的写线程是创建 的执行写入磁盘操作的线程。
其中, 写线程可以包括一个或多个。 具体地, 接收到清理指令后可采用单线程(即单个 写进程)或多线程(即多个写进程) 的方式在目标文件夹下写入数据, 从而对存储空间进行 数据填充, 具体将在后续实施例中详细叙述。
S103, 控制写线程在第一预设文件目录下写入数据, 以触发移动终端的操作系统根据预 设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。
其中,预设的缓存释放规则包括释放预设数量的、且由后台运行程序所占用的存储空间。 具体地, 可通过控制写线程不断写入数据占用存储空间, 以触发操作系统中的预设缓存释放 规则, 从而清理存储空间中的至少一个第二预设文件目录下的临时文件, 至少一个第二预设 文件为除第一预设文件之外的其他应用程序对应的文件目录。
在本发明的一个实施例中, 本清理过程可通过用于清理临时文件的应用程序来实现, 以 iOS操作系统 (iOS是由苹果公司开发的手持设备操作系统)为例, 根据 iOS操作系统的原理, 任何在应用程序中产生的临时文件都会存放在各应用程序自身的 library/caches或 tmp文件夹 (用于存放临时文件, 在不同的操作系统中可以有不同的命名) 下, 操作系统根据 library/caches或 tmp文件夹中写入数据的大小分配存储空间,该段存储空间将被应用程序占 用直到应用程序被手动释放或强行释放为止。当由于可用存储空间不足导致向应用程序对应 的 library/caches或 tmp文件夹中写入数据失败时, 根据 iOS操作系统的原理, 操作系统将 清理至少一个其他应用程序对应的 library/caches或 tmp文件夹中的数据,从而释放更多可用 存储空间。
例如, 用于清理临时文件的应用程序对应第一预设文件目录, 其他需要清理的至少一个 第二预设文件目录可以是其他应用程序的文件目录,通过控制用于清理临时文件的应用程序 向第一预设文件目录中写入数据, 以释放至少一个第二预设文件目录下的临时文件。
本发明实施例的清理移动终端中临时文件的方法, 根据清理指令创建写线程, 并通过写 线程在临时文件中写入数据, 有效利用操作系统清理机制, 根据预设的缓存释放规则清理其 他应用程序的临时文件, 从而达到释放更多存储空间的目的, 用户体验好。
图 2是根据本发明又一个实施例的清理移动终端中临时文件的方法的流程图。为了达到 更好的清理效果,可使用多线程多次在自身应用程序的临时文件夹下写入数据直到存储空间 不足, 以触发操作系统的缓存释放规则, 再释放写入的数据。 具体地, 如图 2所示, 清理移 动终端中临时文件的方法包括以下步骤:
5201 , 接收输入的清理指令。
其中, 清理指令可以通过预设方式 (例如一键清理等)触发, 具体的可实现形式还有多 种, 在此不再一一列举。
在本发明的一个实施例中, 移动终端可以是智能手机、 平板电脑、 个人数字助理、 电子 书等具有各种操作系统的硬件设备。
5202, 根据清理指令创建多个写线程。 具体地, 在接收到清理指令后, 可根据清理指令创建多个写线程, 以提高向应用程序的 临时文件中写入数据的效率。
在本发明的实施例中, 移动终端应用程序为可用于存储空间检测和清理的应用程序, 例 如移动终端临时文件清理器、手机管家等, 也可为其他具有存储空间检测和清理功能的应用 程序。
5203, 获取移动终端中存储空间的剩余量, 并根据在第一预设文件目录下写入的数据的 大小获取清理的存储空间大小。
具体地,移动终端应用程序可通过操作系统提供的接口或特定检测模块获取到当前移动 终端中存储空间的剩余量。在本发明的实施例中, 在第一预设文件目录下写入的数据的大小 与当前移动终端中存储空间的剩余量的差应不大于操作系统预设的最低存储空间剩余量,从 而能够在第一预设文件目录下写入预设大小的数据后, 触发操作系统的缓存释放规则, 达到 清理其他应用程序对应的临时文件的目的。
5204, 根据存储空间的剩余量分别为多个写线程分配写入任务。
具体地,根据可用存储空间的剩余量,将剩余存储空间按照多线程的数量进行任务划分, 通过操作系统提供的相应接口, 多个线程同时向任务对应的临时文件中写入数据。
5205,控制写线程持续地在第一预设文件目录下写入预设大小的预置文件或内存数据直 至移动终端的存储空间达到预设阈值为止, 以触发移动终端的操作系统根据预设的缓存释放 规则清理至少一个第二预设文件目录下的临时文件。
具体地,根据当前存储空间剩余量,判定当前存储空间剩余量是否小于预设阈值。其中, 预设阈值可以为应用程序可用缓存所占总缓存的预设比例,根据移动终端具体的运行情况设 定。预设的缓存释放规则包括操作系统释放预设数量的, 且由后台运行程序所占用的存储空 间。 在移动终端的运行中, 每当满足缓存释放规则, 操作系统就会释放预设数量的, 且由后 台运行的应用程序所占用的存储空间。例如存储空间使用量大于某一预设阈值(如 90% )时, 移动终端中产生告警并自动清理一定量的临时文件。应当理解, 移动终端会优先处理当前没 有被调用的应用程序对应的临时文件。
需要注意的是,为了触发操作系统中预设的缓存释放规则,需要根据当前可用存储空间, 来设定写线程在第一预设文件目录下写入的预置文件或内存数据的大小, 以保证移动终端的 存储空间达到缓存释放规则中的预设阈值, 从而触发操作系统清理临时文件。
在本发明的实施例中, 以 iOS系统为例, 写入数据方面, 可采用但不局限于以下两种方 式:
第一种是使用 C语言文件系统接口, 直接将缓存中的数据写入文件系统。通常, 每次写 入的数据大小是 4KB为最佳, 写入的数据过大或过小都会减缓写入速度; 主要利用的 C语 言接口为 fopen (打开一个文件)、 fwrite (向文件中写入数据块) 和 fclose (关闭一个流), 可最大限度地减少写入数据的过程中可能产生的程序运行代价。 多次实验的统计结果表明, 采用本方式写入数据的速度约为 36MB/s, 即填充 10GB大小的剩余空间约需 284秒。
第二种是使用 Objective-C语言(扩充 C语言的面向对象的编程语言)的文件系统接口, 将预置的数据文件多次拷贝。 预置数据文件大小为 4MB, 直接调用 NSFileManager (其中包 含了用来查询单词库目录、 创建、 重命名、 删除目录以及获取 /设置文件属性的方法) 中的 copyItemAtPath:toPath:error:接口 (iOS操作系统中的应用程序编程接口, 用于将一个文件同 步复制到一个新路径下), 将数据文件进行多次拷贝, 直到拷贝失败, 即已填充满任务空间。 经实验,采用本方式写入数据的速度约为 28MB/s, 即填充 10GB大小的剩余空间约需要 365 秒。
基于以上数据结果的对比, 实际应用中更倾向于使用 C语言文件系统接口的方式, 从而 更快地完成清理任务, 相对于第二种实现方式, 性能可提升 22%。
S206, 当接收到写线程的写入失败消息时, 清理第一预设目录文件下写入的数据。 具体地, 写线程在第一预设目录文件下写入的数据不断占用操作系统的存储空间, 最终 操作系统将会返回两种结果:一种是在缓存释放规则未被触发时,返回写入数据成功的信号; 另一种是在操作系统存储空间不足以致缓存释放规则被触发后, 返回写入数据失败的信号, 接收到失败信号的写线程即停止运行。
在本发明的一个实施例中, 当所有运行中的写线程都结束任务后, 应用程序将删除第一 预设目录文件下写线程已写入的所有临时文件, 再计算新的剩余存储空间, 与之清理前的数 值对比, 得出此次清理的结果。
本发明实施例的清理移动终端中临时文件的方法,通过创建多个写线程提高数据写入速 度,在临时文件中持续写入数据触发缓存释放规则,从而清理其他应用程序对应的临时文件, 然后删除之前写入的数据, 清理应用程序自身的临时文件, 进一步释放存储空间, 合理利用 了操作系统规则, 提高了应用程序临时文件的清理效率, 操作简便, 改善了移动终端运行流 畅度, 提升了用户体验。
为了实现上述实施例, 本发明的实施例还提出一种清理移动终端中临时文件的装置。 图 3是根据本发明一个实施例的清理移动终端中临时文件的装置的结构示意图。
如图 3所示, 清理移动终端中临时文件的装置包括: 清理指令接收模块 100、 写线程创 建模块 200和控制模块 300。 其中, 本发明实施例的移动终端可以是智能手机、 平板电脑、 个人数字助理、 电子书等具有各种操作系统的硬件设备。
具体地, 清理指令接收模块 100用于接收输入的清理指令。 其中, 清理指令可以通过预 设方式 (例如一键清理等) 触发, 具体的可实现形式还有多种, 在此不再一一列举。 写线程创建模块 200用于根据清理指令创建写线程。其中, 线程是程序中一个单一的顺 序控制流程, 可通过进程进行管理, 其中, 正在计算机中执行的程序叫做 "进程"。 在本发 明的实施例中, 根据清理指令创建的写线程是创建的执行写入磁盘操作的线程。 更具体地, 写线程可以包括一个或多个, 清理指令接收模块 100 接收到清理指令后, 写线程创建模块 200创建写线程, 并可采用单线程 (即单个写进程) 或多线程 (即多个写进程) 的方式在目 标文件夹(即后续实施例中提到的第一预设文件目录)下写入数据, 从而对存储空间进行数 据填充。
控制模块 300用于控制写线程在第一预设文件目录下写入数据, 以触发移动终端的操作 系统根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。其中, 预设的 缓存释放规则包括释放预设数量的、 且由后台运行程序所占用的存储空间。 更具体地, 控制 模块 300可通过控制写线程不断写入数据占用存储空间,以触发操作系统中的预设缓存释放 规则, 从而清理存储空间中的至少一个第二预设文件目录下的临时文件, 至少一个第二预设 文件为除第一预设文件之外的其他应用程序对应的文件目录。
在本发明的一个实施例中, 本清理过程可通过用于清理临时文件的应用程序来实现, 以 iOS操作系统 (iOS是由苹果公司开发的手持设备操作系统)为例, 根据 iOS操作系统的原理, 任何在应用程序中产生的临时文件都会存放在各应用程序自身的 library/caches或 tmp文件夹 (用于存放临时文件, 在不同的操作系统中可以有不同的命名) 下, 操作系统根据 library/caches或 tmp文件夹中写入数据的大小分配存储空间,该段存储空间将被应用程序占 用直到应用程序被手动释放或强行释放为止。当由于可用存储空间不足导致向应用程序对应 的 library/caches或 tmp文件夹中写入数据失败时, 根据 iOS操作系统的原理, 操作系统将 清理至少一个其他应用程序对应的 library/caches或 tmp文件夹中的数据,从而释放更多可用 存储空间。
例如, 用于清理临时文件的应用程序对应第一预设文件目录, 其他需要清理的至少一个 第二预设文件目录可以是其他应用程序的文件目录,通过控制用于清理临时文件的应用程序 向第一预设文件目录中写入数据, 以释放至少一个第二预设文件目录下的临时文件。
本发明实施例的清理移动终端中临时文件的装置, 根据清理指令创建写线程, 并通过写 线程在临时文件中写入数据, 有效利用操作系统清理机制, 根据预设的缓存释放规则清理其 他应用程序的临时文件, 从而达到释放更多存储空间的目的, 用户体验好。
图 4是根据本发明又一个实施例的清理移动终端中临时文件的方法的流程图。
如图 4所示, 在图 3的基础上, 清理移动终端中临时文件的装置还包括: 清理模块 400、 存储空间获取模块 500和任务分配模块 600。
清理模块 400用于当接收到写线程的写入失败消息时,清理第一预设目录文件下写入的 数据。 更具体地, 写线程在第一预设目录文件下写入的数据不断占用操作系统的存储空间, 最终操作系统将会返回两种结果: 一种是在缓存释放规则未被触发时, 返回写入数据成功的 信号; 另一种是在操作系统存储空间不足以致缓存释放规则被触发后, 返回写入数据失败的 信号, 接收到失败信号的写线程即停止运行。 在本发明的一个实施例中, 当所有运行中的写 线程都结束任务后, 清理模块 400将删除第一预设目录文件下写线程已写入的所有临时文 件, 再计算新的剩余存储空间, 与之清理前的数值对比, 得出此次清理的结果。
控制模块 300还用于控制写线程持续地在第一预设文件目录下写入预设大小的预置文件 直至移动终端的存储空间达到预设阈值为止;或控制写线程持续地向第一预设文件目录中写 入预设大小的内存数据直至移动终端的存储空间达到预设阈值为止。 更具体地, 控制模块 300控制写线程持续地在第一预设文件目录下写入预设大小的预置文件或内存数据直至移动 终端的存储空间达到预设阈值为止, 以触发移动终端的操作系统根据预设的缓存释放规则清 理至少一个第二预设文件目录下的临时文件。
更具体地, 控制模块 300可根据当前存储空间剩余量, 判定当前存储空间剩余量是否小 于预设阈值。其中, 预设阈值可以为应用程序可用缓存所占总缓存的预设比例, 根据移动终 端具体的运行情况设定。预设的缓存释放规则包括操作系统释放预设数量的, 且由后台运行 程序所占用的存储空间。 在移动终端的运行中, 每当满足缓存释放规则, 操作系统就会释放 预设数量的, 且由后台运行的应用程序所占用的存储空间。例如存储空间使用量大于某一预 设阈值(如 90% ) 时, 移动终端中产生告警并自动清理一定量的临时文件。 应当理解, 移动 终端会优先处理当前没有被调用的应用程序对应的临时文件。
需要注意的是,为了触发操作系统中预设的缓存释放规则,需要根据当前可用存储空间, 来设定写线程在第一预设文件目录下写入的预置文件或内存数据的大小, 以保证移动终端的 存储空间达到缓存释放规则中的预设阈值, 从而触发操作系统清理临时文件。
在本发明的实施例中, 以 iOS系统为例, 写入数据方面, 可采用但不局限于以下两种方 式:
第一种是使用 C语言文件系统接口, 直接将缓存中的数据写入文件系统。通常, 每次写 入的数据大小是 4KB为最佳, 写入的数据过大或过小都会减缓写入速度; 主要利用的 C语 言接口为 fopen (打开一个文件)、 fwrite (向文件中写入数据块) 和 fclose (关闭一个流), 可最大限度地减少写入数据的过程中可能产生的程序运行代价。 多次实验的统计结果表明, 采用本方式写入数据的速度约为 36MB/s, 即填充 10GB大小的剩余空间约需 284秒。
第二种是使用 Objective-C语言(扩充 C语言的面向对象的编程语言)的文件系统接口, 将预置的数据文件多次拷贝。 预置数据文件大小为 4MB, 直接调用 NSFileManager (其中包 含了用来查询单词库目录、 创建、 重命名、 删除目录以及获取 /设置文件属性的方法) 中的 copyItemAtPath:toPath:error:方法 , 将数据文件进行多次拷贝, 直到拷贝失败, 即已填充满 任务空间。 经实验, 采用本方式写入数据的速度约为 28MB/s, 即填充 10GB大小的剩余空 间约需要 365秒。
基于以上数据结果的对比, 实际应用中更倾向于使用 C语言文件系统接口的方式, 从而 更快地完成清理任务, 相对于第二种实现方式, 性能可提升 22%。
存储空间获取模块 500用于在控制模块控制写线程持续地向第一预设文件目录中写入数 据之前获取移动终端中存储空间的剩余量,并根据在第一预设文件目录下写入的数据的大小 获取清理的存储空间大小。更具体地, 存储空间获取模块 500可获取到当前移动终端中存储 空间的剩余量。在本发明的实施例中, 在第一预设文件目录下写入的数据的大小与当前移动 终端中存储空间的剩余量的差应不大于操作系统预设的最低存储空间剩余量,从而能够在第 一预设文件目录下写入预设大小的数据后, 触发操作系统的缓存释放规则, 达到清理其他应 用程序对应的临时文件的目的。
任务分配模块 600用于在控制模块控制写线程在第一预设文件目录下写入数据之前,根 据存储空间的剩余量分别为多个写线程分配写入任务。更具体地, 任务分配模块 600根据可 用存储空间的剩余量, 将剩余存储空间按照多线程的数量进行任务划分, 通过操作系统提供 的相应接口, 多个线程同时向任务对应的临时文件中写入数据。
本发明实施例的清理移动终端中临时文件的装置,通过创建多个写线程提高数据写入速 度,在临时文件中持续写入数据触发缓存释放规则,从而清理其他应用程序对应的临时文件, 然后删除之前写入的数据, 清理应用程序自身的临时文件, 进一步释放存储空间, 合理利用 了操作系统规则, 提高了应用程序临时文件的清理效率, 操作简便, 改善了移动终端运行流 畅度, 提升了用户体验。
为了实现上述实施例, 本发明的实施例还提出一种移动终端。
在本发明的一个实施例中, 移动终端包括: 外壳, 屏幕, 处理器, 存储器和电路板; 屏 幕安置在外壳上, 电路板安置在外壳围成的空间内部, 处理器和存储器设置在电路板上; 存 储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可 执行程序代码对应的程序, 以用于执行以下步骤:
sior , 接收输入的清理指令。
其中, 清理指令可以通过预设方式 (例如一键清理等)触发, 具体的可实现形式还有多 种, 在此不再一一列举。
在本发明的一个实施例中, 移动终端可以是智能手机、 平板电脑、 个人数字助理、 电子 书等具有各种操作系统的硬件设备。
S102' 根据清理指令创建写线程。 具体地, 线程是程序中一个单一的顺序控制流程, 可通过进程进行管理, 其中, 正在计 算机中执行的程序叫做 "进程"。 在本发明的实施例中, 根据清理指令创建的写线程是创建 的执行写入磁盘操作的线程。
其中,写线程可以包括一个或多个。具体地,处理器接收到清理指令后可采用单线程(即 单个写进程)或多线程(即多个写进程) 的方式在目标文件夹(即后续实施例中提到的第一 预设文件目录)下写入数据, 从而对存储空间进行数据填充, 具体将在后续实施例中详细叙 述。
S 103 ' 控制写线程在第一预设文件目录下写入数据, 以触发移动终端的操作系统根据预 设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。
其中,预设的缓存释放规则包括释放预设数量的、且由后台运行程序所占用的存储空间。 具体地, 处理器可通过控制写线程不断写入数据占用存储空间, 以触发操作系统中的预设缓 存释放规则, 从而清理存储空间中的至少一个第二预设文件目录下的临时文件, 至少一个第 二预设文件为除第一预设文件之外的其他应用程序对应的文件目录。
在本发明的一个实施例中, 本清理过程可通过用于清理临时文件的应用程序来实现, 以 iOS操作系统 (iOS是由苹果公司开发的手持设备操作系统)为例, 根据 iOS操作系统的原理, 任何在应用程序中产生的临时文件都会存放在各应用程序自身的 library/caches或 tmp文件夹 (用于存放临时文件, 在不同的操作系统中可以有不同的命名) 下, 操作系统根据 library/caches或 tmp文件夹中写入数据的大小分配存储空间,该段存储空间将被应用程序占 用直到应用程序被手动释放或强行释放为止。当由于可用存储空间不足导致向应用程序对应 的 library/caches或 tmp文件夹中写入数据失败时, 根据 iOS操作系统的原理, 操作系统将 清理至少一个其他应用程序对应的 library/caches或 tmp文件夹中的数据,从而释放更多可用 存储空间。
例如, 用于清理临时文件的应用程序对应第一预设文件目录, 其他需要清理的至少一个 第二预设文件目录可以是其他应用程序的文件目录,通过控制用于清理临时文件的应用程序 向第一预设文件目录中写入数据, 以释放至少一个第二预设文件目录下的临时文件。
本发明实施例的移动终端, 可根据清理指令创建写线程, 并通过写线程在临时文件中写 入数据, 有效利用操作系统清理机制, 根据预设的缓存释放规则清理其他应用程序的临时文 件, 从而达到释放更多存储空间的目的, 用户体验好。
在本发明的另一个实施例中, 处理器还用于执行以下步骤:
S201 ' , 接收输入的清理指令。
S202', 根据清理指令创建多个写线程。
具体地, 在接收到清理指令后, 可根据清理指令创建多个写线程, 以提高向应用程序的 临时文件中写入数据的效率。
在本发明的实施例中, 移动终端应用程序为可用于存储空间检测和清理的应用程序, 例 如移动终端临时文件清理器、手机管家等, 也可为其他具有存储空间检测和清理功能的应用 程序。
S203 ', 获取移动终端中存储空间的剩余量, 并根据在第一预设文件目录下写入的数据 的大小获取清理的存储空间大小。
具体地, 处理器可获取到当前移动终端中存储空间的剩余量。 在本发明的实施例中, 在 第一预设文件目录下写入的数据的大小与当前移动终端中存储空间的剩余量的差应不大于 操作系统预设的最低存储空间剩余量,从而能够在第一预设文件目录下写入预设大小的数据 后, 触发操作系统的缓存释放规则, 达到清理其他应用程序对应的临时文件的目的。
S204 ', 根据存储空间的剩余量分别为多个写线程分配写入任务。
具体地, 根据可用存储空间的剩余量, 处理器将剩余存储空间按照多线程的数量进行任 务划分, 通过操作系统提供的相应接口, 多个线程同时向任务对应的临时文件中写入数据。
S205 ', 控制写线程持续地在第一预设文件目录下写入预设大小的预置文件或内存数据 直至移动终端的存储空间达到预设阈值为止, 以触发移动终端的操作系统根据预设的缓存释 放规则清理至少一个第二预设文件目录下的临时文件。
具体地, 处理器根据当前存储空间剩余量, 首先判定当前存储空间剩余量是否小于预设 阈值。其中, 预设阈值可以为应用程序可用缓存所占总缓存的预设比例, 根据移动终端具体 的运行情况设定。预设的缓存释放规则包括操作系统释放预设数量的, 且由后台运行程序所 占用的存储空间。在移动终端的运行中, 每当满足缓存释放规则, 操作系统就会释放预设数 量的, 且由后台运行的应用程序所占用的存储空间。例如存储空间使用量大于某一预设阈值 (如 90% )时, 移动终端中产生告警并自动清理一定量的临时文件。 应当理解, 处理器会优 先处理当前没有被调用的应用程序对应的临时文件。
需要注意的是,为了触发操作系统中预设的缓存释放规则,需要根据当前可用存储空间, 来设定写线程在第一预设文件目录下写入的预置文件或内存数据的大小, 以保证移动终端的 存储空间达到缓存释放规则中的预设阈值, 从而触发操作系统清理临时文件。
S206 ', 当接收到写线程的写入失败消息时, 清理第一预设目录文件下写入的数据。 具体地, 写线程在第一预设目录文件下写入的数据不断占用操作系统的存储空间, 最终 操作系统将会返回两种结果:一种是在缓存释放规则未被触发时,返回写入数据成功的信号; 另一种是在操作系统存储空间不足以致缓存释放规则被触发后, 返回写入数据失败的信号, 接收到失败信号的写线程即停止运行。
在本发明的一个实施例中, 当所有运行中的写线程都结束任务后, 处理器将删除第一预 设目录文件下写线程已写入的所有临时文件, 再计算新的剩余存储空间, 与之清理前的数值 对比, 得出此次清理的结果。
本发明实施例的移动终端, 通过创建多个写线程提高数据写入速度, 在临时文件中持续 写入数据触发缓存释放规则, 从而清理其他应用程序对应的临时文件, 然后删除之前写入的 数据, 清理应用程序自身的临时文件, 进一步释放存储空间, 合理利用了操作系统规则, 提 高了应用程序临时文件的清理效率, 操作简便, 改善了移动终端运行流畅度, 提升了用户体 验。
为了实现上述实施例, 本发明提出一种存储介质, 用于存储应用程序, 应用程序用于执 行本发明任一项实施例所述的清理移动终端中临时文件的方法。
应当理解, 本发明的各部分可以用硬件、 软件、 固件或它们的组合来实现。 在上述实施 方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件 来实现。 例如, 如果用硬件来实现, 和在另一实施方式中一样, 可用本领域公知的下列技术 中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻 辑电路, 具有合适的组合逻辑门电路的专用集成电路, 可编程门阵列 (PGA), 现场可编程 门阵列 (FPGA) 等。
在本说明书的描述中, 参考术语"一个实施例"、 "一些实施例"、 "示例"、 "具体示例"、 或"一些示例"等的描述意指结合该实施例或示例描述的具体特征、 结构、 材料或者特点包含 于本发明的至少一个实施例或示例中。在本说明书中, 对上述术语的示意性表述不一定指的 是相同的实施例或示例。 而且, 描述的具体特征、 结构、 材料或者特点可以在任何的一个或 多个实施例或示例中以合适的方式结合。
尽管已经示出和描述了本发明的实施例, 本领域的普通技术人员可以理解: 在不脱离本 发明的原理和宗旨的情况下可以对这些实施例进行多种变化、 修改、 替换和变型, 本发明的 范围由权利要求及其等同物限定。

Claims

权 利 要 求 书
1、 一种清理移动终端中临时文件的方法, 其特征在于, 包括以下步骤:
接收输入的清理指令;
根据所述清理指令创建写线程; 以及
控制所述写线程在第一预设文件目录下写入数据, 以触发所述移动终端的操作系统 根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。
2、 根据权利要求 1所述的清理移动终端中临时文件的方法, 其特征在于, 还包括: 当接收到所述写线程的写入失败消息时, 清理所述第一预设目录文件下所述写入的 数据。
3、 根据权利要求 1或 2所述的清理移动终端中临时文件的方法, 其特征在于, 所 述预设的缓存释放规则包括释放预设数量的, 且由后台运行程序所占用的存储空间。
4、 根据权利要求 1或 2所述的清理移动终端中临时文件的方法, 其特征在于, 所 述控制写线程在第一预设文件目录下写入数据具体包括:
控制所述写线程持续地在所述第一预设文件目录下写入预设大小的预置文件直至 所述移动终端的存储空间达到预设阈值为止; 或
控制所述写线程持续地向所述第一预设文件目录中写入预设大小的内存数据直至 所述移动终端的存储空间达到预设阈值为止。
5、 根据权利要求 2所述的清理移动终端中临时文件的方法, 其特征在于, 在所述 控制写线程持续地向第一预设文件目录中写入数据之前, 还包括:
获取所述移动终端中存储空间的剩余量, 并根据在所述第一预设文件目录下写入的 所述数据的大小获取清理的所述存储空间大小。
6、 根据权利要求 1或 5所述的清理移动终端中临时文件的方法, 其特征在于, 所 述写线程包括多个, 在所述控制写线程在第一预设文件目录下写入数据之前, 还包括: 根据所述存储空间的剩余量分别为所述多个写线程分配写入任务。
7、 一种清理移动终端中临时文件的装置, 其特征在于, 包括:
清理指令接收模块, 用于接收输入的清理指令;
写线程创建模块, 用于根据所述清理指令创建写线程; 以及
控制模块, 用于控制所述写线程在第一预设文件目录下写入数据, 以触发所述移动 终端的操作系统根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时文 件。
8、 根据权利要求 7所述的清理移动终端中临时文件的装置, 其特征在于, 还包括: 清理模块, 用于当接收到所述写线程的写入失败消息时, 清理所述第一预设目录文 件下所述写入的数据。
9、 根据权利要求 7或 8所述的清理移动终端中临时文件的装置, 其特征在于, 所 述预设的缓存释放规则包括释放预设数量的, 且由后台运行程序所占用的存储空间。
10、 根据权利要求 7或 8所述的清理移动终端中临时文件的装置, 其特征在于, 所 述控制模块还用于: 控制所述写线程持续地在所述第一预设文件目录下写入预设大小的 预置文件直至所述移动终端的存储空间达到预设阈值为止; 或控制所述写线程持续地向 所述第一预设文件目录中写入预设大小的内存数据直至所述移动终端的存储空间达到 预设阈值为止。
11、 根据权利要求 8所述的清理移动终端中临时文件的装置, 还包括:
存储空间获取模块, 用于在所述控制模块控制写线程持续地向第一预设文件目录中 写入数据之前获取所述移动终端中存储空间的剩余量, 并根据在所述第一预设文件目录 下写入的所述数据的大小获取清理的所述存储空间大小。
12、 根据权利要求 7或 11所述的清理移动终端中临时文件的装置, 其特征在于, 所述写线程包括多个, 所述装置还包括:
任务分配模块, 用于在所述控制模块控制写线程在第一预设文件目录下写入数据之 前, 根据所述存储空间的剩余量分别为所述多个写线程分配写入任务。
13、 一种移动终端, 其特征在于, 包括: 外壳, 屏幕, 处理器, 存储器和电路板; 所述屏幕安置在所述外壳上, 所述电路板安置在所述外壳围成的空间内部, 所述处 理器和所述存储器设置在所述电路板上;
所述存储器用于存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程 序代码对应的程序, 以用于:
接收输入的清理指令;
根据所述清理指令创建写线程; 以及
控制所述写线程在第一预设文件目录下写入数据, 以触发所述移动终端的操作系统 根据预设的缓存释放规则清理至少一个第二预设文件目录下的临时文件。
14、 根据权利要求 13所述的移动终端, 其特征在于, 所述处理器还用于: 当接收到所述写线程的写入失败消息时, 清理所述第一预设目录文件下所述写入的 数据。
15、 根据权利要求 13或 14所述的移动终端, 其特征在于, 所述预设的缓存释放规 则包括释放预设数量的, 且由后台运行程序所占用的存储空间。
16、 根据权利要求 13或 14所述的移动终端, 其特征在于, 所述处理器还用于: 控制所述写线程持续地在所述第一预设文件目录下写入预设大小的预置文件直至 所述移动终端的存储空间达到预设阈值为止; 或
控制所述写线程持续地向所述第一预设文件目录中写入预设大小的内存数据直至 所述移动终端的存储空间达到预设阈值为止。
17、 根据权利要求 14所述的移动终端, 其特征在于, 所述处理器还用于: 在所述控制写线程持续地向第一预设文件目录中写入数据之前, 获取所述移动终端 中存储空间的剩余量, 并根据在所述第一预设文件目录下写入的所述数据的大小获取清 理的所述存储空间大小。
18、 根据权利要求 13或 17所述的移动终端, 其特征在于, 所述写线程包括多个, 所述处理器还用于:
在所述控制写线程在第一预设文件目录下写入数据之前, 根据所述存储空间的剩余 量分别为所述多个写线程分配写入任务。
19、 一种存储介质, 其特征在于, 用于存储应用程序, 所述应用程序用于执行权利 要求 1至 6中任一项所述的清理移动终端中临时文件的方法。
PCT/CN2014/084322 2013-12-19 2014-08-13 清理移动终端中临时文件的方法、装置和移动终端 WO2015090080A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/106,298 US10198453B2 (en) 2013-12-19 2014-08-13 Method, device, and mobile terminal for cleaning up temporary files in a mobile terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310706604.3A CN103677977B (zh) 2013-12-19 2013-12-19 清理移动终端中临时文件的方法、装置和移动终端
CN201310706604.3 2013-12-19

Publications (1)

Publication Number Publication Date
WO2015090080A1 true WO2015090080A1 (zh) 2015-06-25

Family

ID=50315634

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084322 WO2015090080A1 (zh) 2013-12-19 2014-08-13 清理移动终端中临时文件的方法、装置和移动终端

Country Status (3)

Country Link
US (1) US10198453B2 (zh)
CN (1) CN103677977B (zh)
WO (1) WO2015090080A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224335A (zh) * 2015-10-22 2016-01-06 上海斐讯数据通信技术有限公司 一种自动清理终端设备的控制方法、系统及终端设备
CN109062689A (zh) * 2018-07-17 2018-12-21 武汉斗鱼网络科技有限公司 自动释放文件资源的方法、存储介质、电子设备以及系统

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677977B (zh) 2013-12-19 2017-05-17 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端
CN103714016B (zh) * 2014-01-14 2017-10-27 北京猎豹移动科技有限公司 缓存的清理方法、装置及客户端
CN105446980B (zh) 2014-06-27 2018-12-14 北京金山安全软件有限公司 一种鉴别图片垃圾文件的方法及装置
CN104933187B (zh) * 2015-07-06 2019-02-01 张兆琦 一种用于操作系统或者应用程序的临时文件管理方法
CN105224259A (zh) * 2015-10-22 2016-01-06 深圳市创想天空科技股份有限公司 一种移动终端内存释放方法、装置及移动终端
CN105975301B (zh) * 2016-04-29 2018-09-04 北京小米移动软件有限公司 内存清理方法及装置、电子设备
CN106339470B (zh) * 2016-08-29 2020-02-04 北京小米移动软件有限公司 文件处理方法及装置
CN111247504A (zh) * 2017-08-22 2020-06-05 深圳传音通讯有限公司 电子终端的存储空间清理方法与电子终端
CN107958072B (zh) * 2017-12-06 2020-03-20 珠海市魅族科技有限公司 垃圾清理方法及装置、计算机装置和计算机可读存储介质
CN108920271A (zh) * 2018-05-17 2018-11-30 广州优视网络科技有限公司 应用缓存清理方法、装置、存储介质和终端
US10819695B2 (en) * 2018-05-25 2020-10-27 Citrix Systems, Inc. Electronic device including local identity provider server for single sign on and related methods
CN108829616A (zh) * 2018-06-15 2018-11-16 佛山长意云信息技术有限公司 一种缓存数据管理方法、装置、计算机设备及存储介质
CN111221468B (zh) * 2018-11-26 2023-10-13 杭州海康威视系统技术有限公司 存储块数据删除方法、装置、电子设备及云存储系统
CN111459385B (zh) * 2020-03-31 2022-05-17 维沃移动通信有限公司 信息显示方法和电子设备
CN111611510B (zh) * 2020-06-11 2023-08-15 上海乾臻信息科技有限公司 缓存清除方法、装置及系统
CN112947859A (zh) * 2021-02-26 2021-06-11 拉卡拉支付股份有限公司 临时文件处理方法、装置、电子设备、介质及程序产品
CN113590367B (zh) * 2021-06-22 2023-03-10 展讯半导体(南京)有限公司 应用程序的退出处理方法、系统、设备及存储介质
CN113452867A (zh) * 2021-06-25 2021-09-28 珠海奔图电子有限公司 数据清除方法、主机、图像形成装置、系统及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654872A (zh) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 一种清理应用程序产生的垃圾文件的方法及装置
CN102902672A (zh) * 2011-07-25 2013-01-30 腾讯科技(深圳)有限公司 清理文件系统的方法和装置
US20130198470A1 (en) * 2010-02-02 2013-08-01 Kabushiki Kaisha Toshiba Communication device with storage function
CN103677977A (zh) * 2013-12-19 2014-03-26 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100672317B1 (ko) * 2005-02-22 2007-01-24 엘지전자 주식회사 Pvr 장치에서 사용자 설정 우선 순위에 따른 예약 녹화방법 및 장치
KR101506166B1 (ko) * 2008-09-24 2015-03-27 삼성전자주식회사 단말기 관리 시스템 및 방법
US8397052B2 (en) * 2009-08-19 2013-03-12 International Business Machines Corporation Version pressure feedback mechanisms for speculative versioning caches
US8521961B2 (en) * 2009-08-20 2013-08-27 International Business Machines Corporation Checkpointing in speculative versioning caches
CN101795320A (zh) * 2010-01-28 2010-08-04 惠州Tcl移动通信有限公司 一种移动通信终端文件清理的方法
US9426145B2 (en) * 2012-02-17 2016-08-23 Blackberry Limited Designation of classes for certificates and keys
CN103324575B (zh) * 2012-03-23 2017-04-05 腾讯科技(深圳)有限公司 清理内存的方法和移动终端
US9141544B2 (en) * 2012-06-26 2015-09-22 Qualcomm Incorporated Cache memory with write through, no allocate mode
US9305322B2 (en) * 2013-07-23 2016-04-05 Facebook, Inc. Native application testing
CN104424125A (zh) * 2013-09-10 2015-03-18 腾讯科技(深圳)有限公司 移动终端缓存的清理方法、装置及移动终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130198470A1 (en) * 2010-02-02 2013-08-01 Kabushiki Kaisha Toshiba Communication device with storage function
CN102654872A (zh) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 一种清理应用程序产生的垃圾文件的方法及装置
CN102902672A (zh) * 2011-07-25 2013-01-30 腾讯科技(深圳)有限公司 清理文件系统的方法和装置
CN103677977A (zh) * 2013-12-19 2014-03-26 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224335A (zh) * 2015-10-22 2016-01-06 上海斐讯数据通信技术有限公司 一种自动清理终端设备的控制方法、系统及终端设备
CN105224335B (zh) * 2015-10-22 2018-06-29 上海斐讯数据通信技术有限公司 一种自动清理终端设备的控制方法、系统及终端设备
CN109062689A (zh) * 2018-07-17 2018-12-21 武汉斗鱼网络科技有限公司 自动释放文件资源的方法、存储介质、电子设备以及系统
CN109062689B (zh) * 2018-07-17 2020-07-31 武汉斗鱼网络科技有限公司 自动释放文件资源的方法、存储介质、电子设备以及系统

Also Published As

Publication number Publication date
US10198453B2 (en) 2019-02-05
CN103677977B (zh) 2017-05-17
CN103677977A (zh) 2014-03-26
US20160350296A1 (en) 2016-12-01

Similar Documents

Publication Publication Date Title
WO2015090080A1 (zh) 清理移动终端中临时文件的方法、装置和移动终端
KR100951107B1 (ko) 최적의 성능을 위한 파일 관리 방법
TWI446168B (zh) 記憶體系統
JP5981563B2 (ja) 情報記憶システム及び情報記憶システムの制御方法
KR102050725B1 (ko) 컴퓨팅 시스템 및 컴퓨팅 시스템의 데이터 관리 방법
JP5955870B2 (ja) 仮想ディスクの最適圧縮のための方法、コンピュータ可読記憶媒体及びシステム
JP4778942B2 (ja) 不揮発性メモリを管理する装置及び方法
US20150268861A1 (en) Scheduling requests in a solid state memory device
WO2017000658A1 (zh) 存储系统、存储管理装置、存储器、混合存储装置及存储管理方法
JP2018125025A (ja) 適応持続性システム、方法、インタフェース
CN107615261B (zh) 多个云环境之间的共享存储的方法和装置
JP6316895B2 (ja) ホスト側フラッシュストレージデバイスの容量を仮想マシンに利用可能にする技術
JP2009181148A (ja) ストレージサブシステム
JP2019008729A (ja) メモリシステムおよび制御方法
JP2013232216A (ja) 情報処理装置およびプログラム
CN110196681B (zh) 业务写操作的磁盘数据写入控制方法及装置、电子设备
CN111881135A (zh) 一种数据聚合方法、装置、设备及计算机可读存储介质
WO2015106563A1 (zh) 缓存的清理方法、装置及客户端
US8930955B2 (en) Controlling growth in virtual disks via utilization of previously used and free disk block space
JP2010535379A (ja) フラッシュメモリに最適化された入出力制御方法および装置
WO2015018305A1 (zh) 一种存储器的存储方法及存储系统
US10073851B2 (en) Fast new file creation cache
Byeon et al. A free-space adaptive runtime zone-reset algorithm for enhanced ZNS efficiency
US11132134B2 (en) Flexible over-provisioning of storage space within solid-state storage devices (SSDs)
JP6720357B2 (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: 14870899

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15106298

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14870899

Country of ref document: EP

Kind code of ref document: A1