WO2017005125A1 - 一种用于操作系统或者应用程序的临时文件管理方法 - Google Patents

一种用于操作系统或者应用程序的临时文件管理方法 Download PDF

Info

Publication number
WO2017005125A1
WO2017005125A1 PCT/CN2016/087638 CN2016087638W WO2017005125A1 WO 2017005125 A1 WO2017005125 A1 WO 2017005125A1 CN 2016087638 W CN2016087638 W CN 2016087638W WO 2017005125 A1 WO2017005125 A1 WO 2017005125A1
Authority
WO
WIPO (PCT)
Prior art keywords
delete
next time
content directory
content
directory
Prior art date
Application number
PCT/CN2016/087638
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/739,708 priority Critical patent/US10540320B2/en
Publication of WO2017005125A1 publication Critical patent/WO2017005125A1/zh

Links

Images

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management policies
    • G06F16/125File system administration, e.g. details of archiving or snapshots using management policies characterised by the use of retention policies
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • 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/1737Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files

Definitions

  • the present invention relates to a computer operating system file management technology, and in particular to a temporary file management method for an operating system or an application.
  • Temporary files are required for operating systems or applications on many computers. However, due to abnormal program exits, execution errors, power outages, crashes, software writer negligence, or other purposes, a significant number of temporary files were not deleted in time after they were used up. At present, temporary files in the operating system tend to be more and more used with the use of various software in the system, which takes up a large amount of storage space that can be released. If such extra files take up too much space, it may affect the normal use of the operating system or applications. At this time, it usually takes some time and effort to clean up the "junk files" and even need to reinstall the system. At some point, people take advantage of the memory's loss of content when power is lost, virtualizing the memory into a partition and storing temporary files in it.
  • the temporary file directory will be empty each time the computer starts. But this will also bring some problems. For example, memory space is a very valuable resource in many cases, and it is not always appropriate to use it for temporary files. Also, some temporary files need to be used after the system is restarted. This temporary file cannot be stored in memory. At the same time, emptying temporary files when exiting the system or starting the system will cause the user to lose the opportunity to retrieve important temporary files, which may cause irreparable damage.
  • the technical problem to be solved by the present invention is that, in view of the above problems of the prior art, it is provided that a temporary file is not directly deleted, so that the user has the opportunity to retrieve important temporary files several times, and avoids irreparable loss as much as possible. Prevent temporary files from occupying storage space for a long time, ensuring efficient operation of the operating system, saving storage space, and user experience for temporary file management methods for operating systems or applications.
  • the technical solution provided by the present invention is:
  • a temporary file management method for an operating system or an application including:
  • the detailed steps include: first determining that "the next time Whether the delete content directory exists, if "the next time you want to delete the content directory” does not exist, then create “the next time you want to delete the content directory”; then determine whether all the "next delete content directory” exists, if a "next” If the content directory is not deleted, the "Do not delete the content directory next time" is established.
  • the temporary file cleaning triggering condition in the step 1) specifically refers to an operating system startup, an operating system exit, a user login, a user logout, an application startup, an application exit, a timer timing trigger, a user issuing a switching instruction,
  • the time difference between the time stamp when the content in the next time the content directory is to be deleted is deleted and the current system time reaches at least one of the specified times.
  • the temporary file is placed in the specified "the next time to delete the content directory" or "the next time the content directory is not deleted", specifically by using a temporary file set for the operating system or the application in advance.
  • the location map is stored to specify "the next time to delete the content directory” or a "next delete content directory” as the temporary file storage location of the operating system or application.
  • step 2) the detailed steps of step 2) include:
  • the number of "next delete content directories" pre-established in the step 1) is plural, and the names of the plurality of “next delete content directories" are consecutively numbered; in the step 2.2A)
  • the specified "next delete content directory next time” specifically refers to the first “do not delete the content directory next time” in the consecutive number, and in the specified one "next delete content directory” becomes new under After deleting the content directory, the name of each subsequent "non-deleted content directory" in the consecutive numbering is changed to the name of the previous "next delete content directory”; the step is created in step 2.3A)
  • a new "Do not delete the content directory next time” specifically refers to creating the last one in the new consecutive number "Do not delete the content directory next time”.
  • the detailed steps of the step 2) include:
  • the number of "next delete content directories" pre-established in the step 1) is plural, and the names of the plurality of “next delete content directories” are consecutively numbered; in the step 2.2B) The specified one will not delete the content next time.
  • “Specific” refers to the first “continued deletion of the content directory” in the consecutive number, and moves the content in the specified "next delete content directory” to "the next time you want to delete the content directory” , in turn, the content in each subsequent "non-deleted content directory" in the consecutive numbering is moved to the previous "next delete content directory".
  • the temporary file management method for an operating system or an application of the present invention has the following advantages: the present invention pre-establishes "the next time to delete the content directory" and at least one "do not delete the content directory next time", running in the operating system or application
  • the temporary file is placed in the specified "Next time to delete the content directory” or "Do not delete the content directory next time”
  • the preset temporary file cleaning trigger condition is reached, the next time you want to delete the content directory
  • the content is deleted, and the content switching in the specified "Do not delete the content directory next time” is placed in the "Next time to delete the content directory”.
  • the content storage location switching operation based on "the next time to delete the content directory" and at least one "do not delete the content directory next time” can realize abnormal exit of the program, execution error, power failure, crash, software writer negligence or other purposes.
  • Temporary files generated by (such as malware) are deleted in time to ensure that the computer has good performance and available storage space at runtime, and it also prevents malware from occupying and running in the temporary folder for a long time, and has the ability to prevent temporary files for a long time. Occupying storage space, ensuring efficient operation of the operating system, saving storage space and good user experience, and the present invention makes temporary files not directly deleted, so that the user has several opportunities to retrieve important temporary files, and try to avoid irreparable damage. Loss.
  • FIG. 1 is a schematic diagram of a basic process of a method according to an embodiment of the present invention.
  • the steps of the temporary file management method for the operating system or the application in this embodiment include:
  • the execution step 2) is called; in this embodiment, the name of the next time the content directory is to be deleted is /hdtmp/0/, The number of "Do not delete the content directory next time” is five, and the names are "/hdtmp/1/" to "/hdtmp/5/".
  • the number of "do not delete the content directory next time” can also be selected in other quantities. For example, when the number of "the next time the content directory is not deleted" is one, the subsequent designated one will not delete the content next time. The directory is the only one that does not delete the content directory next time.
  • the embodiment is based on the content storage location switching operation of "the next time to delete the content directory" and at least one "the next time the content directory is not deleted", which can realize abnormal exit of the program, execution error, power failure, crash, software writer negligence or Temporary files generated by other purposes (such as malware) are deleted in time to ensure that the computer client has Good performance and available storage space, but also to prevent malware from occupying the temporary folder and running for a long time.
  • step 1) when the operating system or the application program is running, the steps of determining the next time the content directory is to be deleted and the content directory not to be deleted next time are included, and the detailed steps include: first determining Whether the delete content directory exists, if "the next time you want to delete the content directory" does not exist, then create “the next time you want to delete the content directory”; then determine whether all the "next delete content directory” exists, if a "next” If the content directory is not deleted, the "Do not delete the content directory next time" is established.
  • the temporary file cleaning trigger condition in step 1) may select an operating system startup, an operating system exit, a user login, a user logout, an application startup, an application exit, a timer timing trigger, and a user issuing a switching instruction according to requirements. And the time difference between the time stamp when the content in the next time the content directory is to be deleted is deleted from the current system time reaches at least one of the specified time.
  • the temporary file cleanup trigger condition is that the operating system starts, or the user logs in, or the application starts, it can ensure the smooth transition of the temporary file directory to the maximum extent, and prevent the operating system or application from occupying the content directory next time or next time. If the content directory is not deleted, the temporary file directory switch fails, and the reliability is better.
  • the temporary file is placed in the specified "the next time to delete the content directory" or "the next time the content directory is not deleted", specifically by the temporary file set for the operating system or the application in advance.
  • the location map is stored to specify "the next time to delete the content directory” or a "next delete content directory” as the temporary file storage location of the operating system or application.
  • step 2) the detailed steps of step 2) include:
  • the timestamp when the content in the next time the content directory is to be deleted is specifically created with a new timestamp set when the content directory is not deleted next time, and the timestamp can be selected and stored in the directory.
  • the timestamp can be selected and stored in the directory.
  • the file in the properties of the folder, in the extended properties of the folder, or in the database.
  • Temporary files of existing applications are generally stored in the specified directory. For the application, if the temporary files are deleted directly, some important temporary files will be lost, which may cause irreparable damage; Temporary files are not deleted, which in turn causes temporary files to occupy unnecessary storage space, resulting in wasted computer resources and slowing down the operation of the operating system.
  • the number of "next delete content directories" pre-established in step 1) is plural, and the names of multiple “next delete content directories” are consecutive numbers ("/hdtmp/1/" ⁇ "/hdtmp/5/");
  • One of the "Do not delete the content directory next time” specified in step 2.2A) refers specifically to the first "Continuous deletion of the content directory" in the consecutive number ("/hdtmp/1 /"), and after the specified "Do not delete the content directory next time" ("/hdtmp/1/") becomes the new "Next time to delete the content directory" ("/hdtmp/0/), in turn
  • the name of each subsequent "Do not delete the content directory" in the consecutive numbering is changed to the name of the previous "Do not delete the content directory next time", that is, "/hdtmp/2/” is changed to "/hdtmp/1/", Modify "/hdtmp/3/" to "/hdtmp/2/", "/hdtmp/4/” to "/hd
  • the temporary files of the application will not be deleted directly, but will be moved in the order of "/hdtmp/5/" ⁇ "/hdtmp/1/", so that the user exists multiple times (specifically 5 times in this embodiment)
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • This embodiment is basically the same as the first embodiment. The main differences are as follows: (1) In this embodiment, the name of "the next time you want to delete the content directory" is "/temp/”, and the next time you do not delete the content directory. The number is one and the name is "/tempbak/”. (2) Step 2) is different. In this embodiment, the content of "the next time to delete the content directory" ("/temp/”) is only to delete the content, and does not involve "the next time to delete the content directory" ("/temp /") The folder itself is deleted.
  • step 2) the detailed steps of step 2) include:
  • the timestamp when the content in the next time the content directory is to be deleted is deleted in the embodiment, specifically when the content in the next time the content directory is to be deleted ("/temp/") is deleted.
  • the timestamp, the timestamp can be selected to be stored in a file in the directory, in the properties of the folder, in the extended properties of the folder, or in the database.
  • the number of "next delete content directories" which are also pre-established in step 1) of the embodiment is plural, and the names of the plurality of "next delete content directories" are consecutively numbered;
  • a “next delete content directory” specified in step 2.2B) of the embodiment specifically refers to the first "next delete content directory" ("/tempbak/") in the consecutive number.
  • the temporary files of the operating system or application in the "Do not delete the content directory next time” will not be deleted directly, but will be moved in the "Do not delete the content directory next time” and finally enter the "Next time to delete the content directory.
  • the user has the opportunity to retrieve important temporary files to prevent irreparable damage; on the other hand, because the temporary files are moved between the next time you do not delete the content directory and finally enter the next time
  • After deleting the content directory it will be deleted, and will be deleted after multiple moves, thus effectively preventing temporary files from occupying unnecessary storage space, reducing waste of computer resources, and ensuring efficient operation of the operating system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种用于操作系统或者应用程序的临时文件管理方法,步骤包括:预先建立"下次要删内容目录"和至少一个"下次不删内容目录",在操作系统或应用程序运行时,将临时文件放在指定的"下次要删内容目录"或"下次不删内容目录"中,当达到预设的临时文件清理触发条件时,将"下次要删内容目录"中的内容删除,并将指定的一个"下次不删内容目录"中的内容切换放置到"下次要删内容目录"中。本发明具有能够防止临时文件长时间占用存储空间,确保操作系统高效运行,节约存储空间、用户体验好的优点。

Description

一种用于操作系统或者应用程序的临时文件管理方法 【技术领域】
本发明涉及计算机操作系统文件管理技术,具体涉及一种用于操作系统或者应用程序的临时文件管理方法。
【背景技术】
许多计算机中的操作系统或者应用程序都需要用到临时文件。然而,由于程序异常退出、执行出错、停电、死机、软件编写者疏忽或者有其它的目的,相当数量的临时文件没能在用完后及时被删除。目前,操作系统中临时文件往往会随着系统中各种软件的使用而越来越多,这些文件占用了大量本来可以释放的存储空间。如果这类多余文件所占的空间过大,则可能会影响到操作系统或应用程序的正常使用。这时往往就需要花费一些时间和精力来进行“垃圾文件”清理工作,甚至需要重新安装系统。某些时候,人们会利用内存在断电时内容会丢失的特性,将内存虚拟成一个分区,并将临时文件保存在其中。这样,每次计算机启动时,临时文件目录将会是空的。但这也会带来一些问题。比如,内存空间在很多情况下是十分宝贵的资源,将其用来存放临时文件不总是合适的。并且,有些临时文件需要在系统重新启动之后使用,这种临时文件就不能存放在内存中。同时,退出系统或启动系统时清空临时文件,将会使得用户失去找回重要临时文件的机会,可能会造成难以挽回的损失。
【发明内容】
本发明要解决的技术问题是:针对现有技术的上述问题,提供一种临时文件不会被直接删除,使得用户存在若干次找回重要临时文件的机会,尽量避免造成难以挽回的损失,能够防止临时文件长时间占用存储空间,确保操作系统高效运行,节约存储空间、用户体验好的用于操作系统或者应用程序的临时文件管理方法。
为了解决上述技术问题,本发明提供的技术方案为:
一种用于操作系统或者应用程序的临时文件管理方法,步骤包括:
1)预先建立“下次要删内容目录”和至少一个“下次不删内容目录”,在操作系统或应用程序运行时,将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中,当达到预设的临时文件清理触发条件时调用执行步骤2);
2)将“下次要删内容目录”中的内容删除,并将指定的一个“下次不删内容目录” 中的内容切换放置到“下次要删内容目录”中。
优选地,所述步骤1)中在操作系统或应用程序运行时还包括判断“下次要删内容目录”和“下次不删内容目录”的步骤,详细步骤包括:首先判断“下次要删内容目录”是否存在,如果“下次要删内容目录”不存在则建立“下次要删内容目录”;然后判断所有的“下次不删内容目录”是否存在,如果某个“下次不删内容目录”不存在则建立该“下次不删内容目录”。
优选地,所述步骤1)中的临时文件清理触发条件具体是指操作系统启动、操作系统退出、用户登录、用户注销、应用程序启动、应用程序退出、定时器定时触发、用户发出切换指令、将“下次要删内容目录”中的内容删除时的时间戳和当前系统时间之间的时间差达到指定时间中的至少一种。
优选地,所述步骤1)中将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中时,具体是通过预先为操作系统或应用程序设置的临时文件存储位置映射表来指定“下次要删内容目录”或某一个“下次不删内容目录”来作为操作系统或应用程序的临时文件存储位置。
优选地,所述步骤2)的详细步骤包括:
2.1A)将“下次要删内容目录”删除;
2.2A)将指定的一个“下次不删内容目录”的名字修改为“下次要删内容目录”的名字,使得所述指定的一个“下次不删内容目录”成为新的“下次要删内容目录”;
2.3A)创建一个新的“下次不删内容目录”。
优选地,所述步骤1)中预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号;所述步骤2.2A)中指定的一个“下次不删内容目录”具体是指连续编号中的第一个“下次不删内容目录”,且在所述指定的一个“下次不删内容目录”成为新的“下次要删内容目录”后,依次将连续编号中后续的每一个“下次不删内容目录”的名称更改为上一个“下次不删内容目录”的名称;所述步骤2.3A)中创建一个新的“下次不删内容目录”具体是指创建一个新的连续编号中的最后一个“下次不删内容目录”。
或者优选地,所述步骤2)的详细步骤包括:
2.1B)将“下次要删内容目录”中的内容删除;
2.2B)将指定的一个“下次不删内容目录”中的内容移动到“下次要删内容目录”里。
优选地,所述步骤1)中预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号;所述步骤2.2B)中指定的一个“下次不删内容目 录”具体是指连续编号中的第一个“下次不删内容目录”,且在将指定的一个“下次不删内容目录”中的内容移动到“下次要删内容目录”里后,依次将连续编号中后续的每一个“下次不删内容目录”中的内容移动到上一个“下次不删内容目录”里。
本发明用于操作系统或者应用程序的临时文件管理方法具有下述优点:本发明预先建立“下次要删内容目录”和至少一个“下次不删内容目录”,在操作系统或应用程序运行时,将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中,当达到预设的临时文件清理触发条件时,将“下次要删内容目录”中的内容删除,并将指定的一个“下次不删内容目录”中的内容切换放置到“下次要删内容目录”中。基于“下次要删内容目录”和至少一个“下次不删内容目录”的内容存储位置切换操作,能够实现将程序异常退出、执行出错、停电、死机、软件编写者疏忽或者有其它的目的(例如恶意软件)产生的临时文件及时删除,确保计算机在运行时具有良好的性能以及可用存储空间,而且还能够防止恶意软件长期占据在临时文件夹中并得以运行,具有能够防止临时文件长时间占用存储空间,确保操作系统高效运行,节约存储空间、用户体验好的优点,而且本发明使得临时文件不会被直接删除,使得用户存在若干次找回重要临时文件的机会,尽量避免造成难以挽回的损失。
【附图说明】
图1为本发明实施例方法的基本流程示意图。
【具体实施方式】
如图1所示,本实施例用于操作系统或者应用程序的临时文件管理方法的步骤包括:
1)预先建立“下次要删内容目录”和至少一个“下次不删内容目录”,在操作系统或应用程序运行时,将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中,当达到预设的临时文件清理触发条件时调用执行步骤2);本实施例中,“下次要删内容目录”的名称为“/hdtmp/0/”,“下次不删内容目录”的数量为5个,名称依次为“/hdtmp/1/”~“/hdtmp/5/”。但是毫无疑问,“下次不删内容目录”的数量也可以选择其他数量,例如当“下次不删内容目录”的数量为1个时,则后续的指定的一个“下次不删内容目录”即为唯一的一个“下次不删内容目录”。
2)将“下次要删内容目录”中的内容删除,并将指定的一个“下次不删内容目录”(“/hdtmp/1/”~“/hdtmp/5/”中的一个)中的内容切换放置到“下次要删内容目录”中。
本实施例基于“下次要删内容目录”和至少一个“下次不删内容目录”的内容存储位置切换操作,能够实现将程序异常退出、执行出错、停电、死机、软件编写者疏忽或者有其它的目的(例如恶意软件)产生的临时文件及时删除,确保计算机客户端在运行时具有 良好的性能以及可用存储空间,而且还能够防止恶意软件长期占据在临时文件夹中并得以运行。
本实施例中,步骤1)中在操作系统或应用程序运行时还包括判断“下次要删内容目录”和“下次不删内容目录”的步骤,详细步骤包括:首先判断“下次要删内容目录”是否存在,如果“下次要删内容目录”不存在则建立“下次要删内容目录”;然后判断所有的“下次不删内容目录”是否存在,如果某个“下次不删内容目录”不存在则建立该“下次不删内容目录”。例如,如果“/hdtmp/0/”不存在则建立“/hdtmp/0/”,如果“/hdtmp/1/”~“/hdtmp/5/”中任意一个“下次要删内容目录”不存在,则建立该“下次要删内容目录”。
本实施例中,步骤1)中的临时文件清理触发条件可以根据需要选择操作系统启动、操作系统退出、用户登录、用户注销、应用程序启动、应用程序退出、定时器定时触发、用户发出切换指令、将“下次要删内容目录”中的内容删除时的时间戳和当前系统时间之间的时间差达到指定时间中的至少一种。当临时文件清理触发条件为操作系统启动、或者用户登录、或者应用程序启动时,能够最大程度确保临时文件目录切换的顺利进行,防止由于操作系统或者应用程序占用下次要删内容目录或下次不删内容目录而导致临时文件目录切换失败,可靠性更好。
本实施例中,步骤1)中将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中时,具体是通过预先为操作系统或应用程序设置的临时文件存储位置映射表来指定“下次要删内容目录”或某一个“下次不删内容目录”来作为操作系统或应用程序的临时文件存储位置。通过设置临时文件存储位置映射表来从“下次要删内容目录”或“下次不删内容目录”中找到一个目录位置来放置操作系统或者应用程序的临时文件,使得操作系统和应用程序对临时文件存储位置的定义更加灵活和方便。
本实施例中,步骤2)的详细步骤包括:
2.1A)将“下次要删内容目录”(“/hdtmp/0/”)删除;
2.2A)将指定的一个“下次不删内容目录”的名字修改为“下次要删内容目录”的名字,使得指定的一个“下次不删内容目录”成为新的“下次要删内容目录”(“/hdtmp/0/”);
2.3A)创建一个新的“下次不删内容目录”。
本实施例中,将“下次要删内容目录”中的内容删除时的时间戳具体创建一个新的“下次不删内容目录”时设置的时间戳,时间戳可以选择存储在目录下的文件中、文件夹的属性中、文件夹的扩展属性中或者数据库中。
现有的应用程序的临时文件一般是存储在指定的目录下,对于应用程序而言,如果直接把临时文件删除,则会导致某些重要的临时文件丢失,可能导致难以挽回的损失;如果 将临时文件不删除,又会导致临时文件占用不必要的存储空间,导致计算机资源的浪费,拖慢操作系统的运行。本实施例中,步骤1)中预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号(“/hdtmp/1/”~“/hdtmp/5/”);步骤2.2A)中指定的一个“下次不删内容目录”具体是指连续编号中的第一个“下次不删内容目录”(“/hdtmp/1/”),且在指定的一个“下次不删内容目录”(“/hdtmp/1/”)成为新的“下次要删内容目录”(“/hdtmp/0/”)后,依次将连续编号中后续的每一个“下次不删内容目录”的名称更改为上一个“下次不删内容目录”的名称,即将“/hdtmp/2/”修改为“/hdtmp/1/”、将“/hdtmp/3/”修改为“/hdtmp/2/”、将“/hdtmp/4/”修改为“/hdtmp/3/”、将“/hdtmp/5/”修改为“/hdtmp/4/”;步骤2.3A)中创建一个新的“下次不删内容目录”具体是指创建一个新的连续编号中的最后一个“下次不删内容目录”(“/hdtmp/5/”)。通过上述规则,能够确保每一个应用程序对应的临时文件目录的存储规则简单明确,不需要额外的目录映射,比如某应用程序的临时文件本次放置在“/hdtmp/3/”中,那么在满足临时文件清理触发条件并进行一次临时文件目录切换后,则该应用程序的临时文件就会进入到“/hdtmp/2/”中,应用程序自动从“/hdtmp/2/”中读取临时文件即可。一方面,应用程序的临时文件不会被直接删除,而是依次在“/hdtmp/5/”~“/hdtmp/1/”中移动,使得用户存在多次(本实施例具体为5次)找回重要临时文件的机会,防止造成难以挽回的损失;另一方面,由于临时文件依次在“/hdtmp/5/”~“/hdtmp/1/”中移动,最终经过多次移动后会被删除,从而有效防止临时文件占用不必要的存储空间,减少计算机资源的浪费,确保操作系统的高效运行。
实施例二:
本实施例与实施例一基本相同,其主要区别点为:(1)本实施例中,“下次要删内容目录”的名称为“/temp/”,“下次不删内容目录”的数量为1个,名称为“/tempbak/”。(2)步骤2)不同,本实施例中针对“下次要删内容目录”(“/temp/”)仅仅是删除其中的内容,而不涉及“下次要删内容目录”(“/temp/”)本身的文件夹删除。
本实施例中,步骤2)的详细步骤包括:
2.1B)将“下次要删内容目录”(“/temp/”)中的内容删除;
2.2B)将指定的一个“下次不删内容目录”中的内容移动到“下次要删内容目录”(“/temp/”)里。
毫无疑问,本实施例中将“下次要删内容目录”中的内容删除时的时间戳具体是指将“下次要删内容目录”(“/temp/”)中的内容删除时设置的时间戳,时间戳可以选择存储在目录下的文件中、文件夹的属性中、文件夹的扩展属性中或者数据库中。
与实施例一相同,本实施例步骤1)中同样也预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号;而本实施例步骤2.2B)中指定的一个“下次不删内容目录”具体是指连续编号中的第一个“下次不删内容目录”(“/tempbak/”)。由于本实施例中“下次不删内容目录”的数量为1个,因此就不需要且在将指定的一个“下次不删内容目录”(“/tempbak/”)中的内容移动到“下次要删内容目录”(“/temp/”)里后,依次将连续编号中后续的每一个“下次不删内容目录”中的内容移动到上一个“下次不删内容目录”里,毫无疑问,“下次不删内容目录”的数量为多个,则在将指定的一个“下次不删内容目录”(“/tempbak/”)中的内容移动到“下次要删内容目录”(“/temp/”)里后,则需要依次将连续编号中后续的每一个“下次不删内容目录”中的内容移动到上一个“下次不删内容目录”里。同理,通过上述规则能够确保每一个应用程序对应的临时文件目录的存储规则简单明确,不需要额外的目录映射。一方面,操作系统或者应用程序在“下次不删内容目录”的临时文件不会被直接删除,而是依次在“下次不删内容目录”间移动并最终进入“下次要删内容目录”后才被删除,使得用户存在找回重要临时文件的机会,防止造成难以挽回的损失;另一方面,由于临时文件依次在“下次不删内容目录”间移动并最终进入“下次要删内容目录”后才被删除,最终经过多次移动后会被删除,从而有效防止临时文件占用不必要的存储空间,减少计算机资源的浪费,确保操作系统的高效运行。
以上所述仅是本发明的优选实施方式,本发明的保护范围并不仅局限于上述实施例,凡属于本发明思路下的技术方案均属于本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理前提下的若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (8)

  1. 一种用于操作系统或者应用程序的临时文件管理方法,其特征在于步骤包括:
    1)预先建立“下次要删内容目录”和至少一个“下次不删内容目录”,在操作系统或应用程序运行时,将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中,当达到预设的临时文件清理触发条件时调用执行步骤2);
    2)将“下次要删内容目录”中的内容删除,并将指定的一个“下次不删内容目录”中的内容切换放置到“下次要删内容目录”中。
  2. 根据权利要求1所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤1)中在操作系统或应用程序运行时还包括判断“下次要删内容目录”和“下次不删内容目录”的步骤,详细步骤包括:首先判断“下次要删内容目录”是否存在,如果“下次要删内容目录”不存在则建立“下次要删内容目录”;然后判断所有的“下次不删内容目录”是否存在,如果某个“下次不删内容目录”不存在则建立该“下次不删内容目录”。
  3. 根据权利要求2所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤1)中的临时文件清理触发条件具体是指操作系统启动、操作系统退出、用户登录、用户注销、应用程序启动、应用程序退出、定时器定时触发、用户发出切换指令、将“下次要删内容目录”中的内容删除时的时间戳和当前系统时间之间的时间差达到指定时间中的至少一种。
  4. 根据权利要求3所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤1)中将临时文件放在指定的“下次要删内容目录”或“下次不删内容目录”中时,具体是通过预先为操作系统或应用程序设置的临时文件存储位置映射表来指定“下次要删内容目录”或某一个“下次不删内容目录”来作为操作系统或应用程序的临时文件存储位置。
  5. 根据权利要求1或2或3或4所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤2)的详细步骤包括:
    2.1A)将“下次要删内容目录”删除;
    2.2A)将指定的一个“下次不删内容目录”的名字修改为“下次要删内容目录”的名字,使得所述指定的一个“下次不删内容目录”成为新的“下次要删内容目录”;
    2.3A)创建一个新的“下次不删内容目录”。
  6. 根据权利要求5所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤1)中预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号;所述步骤2.2A)中指定的一个“下次不删内容目录”具体是指连续编号中的第一个“下次不删内容目录”,且在所述指定的一个“下次不删内容目录”成为新的“下次要删内容目录”后,依次将连续编号中后续的每一个“下次不删内容目录”的名称更改为上一个“下次不删内容目录”的名称;所述步骤2.3A)中创建一个新的“下次不删内容目录”具体是指创建一个新的连续编号中的最后一个“下次不删内容目录”。
  7. 根据权利要求1或2或3或4所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤2)的详细步骤包括:
    2.1B)将“下次要删内容目录”中的内容删除;
    2.2B)将指定的一个“下次不删内容目录”中的内容移动到“下次要删内容目录”里。
  8. 根据权利要求7所述的用于操作系统或者应用程序的临时文件管理方法,其特征在于,所述步骤1)中预先建立的“下次不删内容目录”的数量为多个,且多个“下次不删内容目录”的名称采用连续编号;所述步骤2.2B)中指定的一个“下次不删内容目录”具体是指连续编号中的第一个“下次不删内容目录”,且在将指定的一个“下次不删内容目录”中的内容移动到“下次要删内容目录”里后,依次将连续编号中后续的每一个“下次不删内容目录”中的内容移动到上一个“下次不删内容目录”里。
PCT/CN2016/087638 2015-07-06 2016-06-29 一种用于操作系统或者应用程序的临时文件管理方法 WO2017005125A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/739,708 US10540320B2 (en) 2015-07-06 2016-06-29 Temporary file management method for operating system or applications

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510389664.6 2015-07-06
CN201510389664.6A CN104933187B (zh) 2015-07-06 2015-07-06 一种用于操作系统或者应用程序的临时文件管理方法

Publications (1)

Publication Number Publication Date
WO2017005125A1 true WO2017005125A1 (zh) 2017-01-12

Family

ID=54120354

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/087638 WO2017005125A1 (zh) 2015-07-06 2016-06-29 一种用于操作系统或者应用程序的临时文件管理方法

Country Status (3)

Country Link
US (1) US10540320B2 (zh)
CN (1) CN104933187B (zh)
WO (1) WO2017005125A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114936387A (zh) * 2022-07-25 2022-08-23 深圳市明源云科技有限公司 文本文件读取方法、写入方法、电子设备及可读存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104933187B (zh) * 2015-07-06 2019-02-01 张兆琦 一种用于操作系统或者应用程序的临时文件管理方法
CN112380175B (zh) * 2021-01-15 2021-07-02 北京东方通软件有限公司 一种针对操作系统接收临时文件的时间管理方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685450A (zh) * 2008-09-27 2010-03-31 比亚迪股份有限公司 一种在嵌入式操作系统中实现数据库功能的方法
CN102279892A (zh) * 2011-09-07 2011-12-14 盛乐信息技术(上海)有限公司 临时文件清理方法及系统
CN103853806A (zh) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 一种表格转换方法及装置
US20150066160A1 (en) * 2013-08-30 2015-03-05 Kabushiki Kaisha Toshiba Control program management device, information processing device, and control program processing method
CN104933187A (zh) * 2015-07-06 2015-09-23 张兆琦 一种用于操作系统或者应用程序的临时文件管理方法
CN104978224A (zh) * 2015-07-06 2015-10-14 张兆琦 一种面向多硬件平台的应用程序管理方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8560709B1 (en) * 2004-02-25 2013-10-15 F5 Networks, Inc. System and method for dynamic policy based access over a virtual private network
JP2004038515A (ja) * 2002-07-03 2004-02-05 Sanyo Electric Co Ltd データ記録装置
JP4244572B2 (ja) * 2002-07-04 2009-03-25 ソニー株式会社 キャッシュ装置、およびキャッシュデータ管理方法、並びにコンピュータ・プログラム
US20040267705A1 (en) * 2003-06-17 2004-12-30 Connie Lemus Memory with file deletion system
US7958325B2 (en) * 2007-09-11 2011-06-07 International Business Machines Corporation Handling temporary files in a file system with snapshots
US8826443B1 (en) * 2008-09-18 2014-09-02 Symantec Corporation Selective removal of protected content from web requests sent to an interactive website
US8380676B1 (en) * 2009-05-27 2013-02-19 Google Inc. Automatic deletion of temporary files
US8527466B2 (en) * 2009-05-31 2013-09-03 Red Hat Israel, Ltd. Handling temporary files of a virtual machine
US8706698B2 (en) * 2011-09-21 2014-04-22 International Business Machines Corporation Coordination of event logging operations and log management
CN103645914B (zh) * 2013-11-26 2017-02-08 北京奇虎科技有限公司 一种软件清理方法及装置
CN103677977B (zh) * 2013-12-19 2017-05-17 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端
CN104143069B (zh) * 2014-08-04 2017-09-29 上海斐讯数据通信技术有限公司 一种保护系统文件的方法及系统
CN104750869A (zh) * 2015-04-20 2015-07-01 安一恒通(北京)科技有限公司 文件管理方法和装置
US10084844B2 (en) * 2015-11-16 2018-09-25 International Business Machines Corporation System and method for improved user-controlled electronic file and trash management

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685450A (zh) * 2008-09-27 2010-03-31 比亚迪股份有限公司 一种在嵌入式操作系统中实现数据库功能的方法
CN102279892A (zh) * 2011-09-07 2011-12-14 盛乐信息技术(上海)有限公司 临时文件清理方法及系统
US20150066160A1 (en) * 2013-08-30 2015-03-05 Kabushiki Kaisha Toshiba Control program management device, information processing device, and control program processing method
CN103853806A (zh) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 一种表格转换方法及装置
CN104933187A (zh) * 2015-07-06 2015-09-23 张兆琦 一种用于操作系统或者应用程序的临时文件管理方法
CN104978224A (zh) * 2015-07-06 2015-10-14 张兆琦 一种面向多硬件平台的应用程序管理方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114936387A (zh) * 2022-07-25 2022-08-23 深圳市明源云科技有限公司 文本文件读取方法、写入方法、电子设备及可读存储介质

Also Published As

Publication number Publication date
US20180189302A1 (en) 2018-07-05
US10540320B2 (en) 2020-01-21
CN104933187B (zh) 2019-02-01
CN104933187A (zh) 2015-09-23

Similar Documents

Publication Publication Date Title
US20220188003A1 (en) Distributed Storage Method and Device
US20210011817A1 (en) Virtual Machine Recovery Method and Virtual Machine Management Device
US9501487B1 (en) Change tree incremental backup
JP5871583B2 (ja) 文書管理装置及びその制御方法、並びにプログラム
JP2005084963A (ja) ファイル共有装置及びファイル共有装置間のデータ移行方法
WO2017005126A1 (zh) 一种面向多硬件平台的应用程序管理方法
WO2019020081A1 (zh) 分布式系统及其故障恢复方法、装置、产品和存储介质
WO2017005125A1 (zh) 一种用于操作系统或者应用程序的临时文件管理方法
US10261696B2 (en) Performance during playback of logged data storage operations
EP3147797B1 (en) Data management method, node and system for database cluster
US20150293719A1 (en) Storage Space Processing Method and Apparatus, and Non-Volatile Computer Readable Storage Medium
WO2015135370A1 (zh) 一种数据更新的方法和系统
US9934110B2 (en) Methods for detecting out-of-order sequencing during journal recovery and devices thereof
CN111666266A (zh) 一种数据迁移方法及相关设备
CN110858168B (zh) 集群节点故障处理方法、装置及集群节点
EP3035215A1 (en) File system, control method for file system, and control program for file system
US10521119B1 (en) Hybrid copying garbage collector
US20230376357A1 (en) Scaling virtualization resource units of applications
CN105573867A (zh) 一种MySQL高可用性的实现方法及系统
CN109426563B (zh) 一种进程管理方法及装置
JP2022125253A5 (zh)
EP3396553A1 (en) Method and device for processing data after restart of node
JP5601587B2 (ja) プロセス再起動装置、プロセス再起動方法およびプロセス再起動プログラム
CN104461382A (zh) 运行多个文件系统的文件服务器的内部写方法和服务器
CN109241011B (zh) 一种虚拟机文件处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16820776

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16820776

Country of ref document: EP

Kind code of ref document: A1

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 16.08.2018)

122 Ep: pct application non-entry in european phase

Ref document number: 16820776

Country of ref document: EP

Kind code of ref document: A1