WO2016000553A1 - 鉴别垃圾目录的方法及装置 - Google Patents

鉴别垃圾目录的方法及装置 Download PDF

Info

Publication number
WO2016000553A1
WO2016000553A1 PCT/CN2015/082211 CN2015082211W WO2016000553A1 WO 2016000553 A1 WO2016000553 A1 WO 2016000553A1 CN 2015082211 W CN2015082211 W CN 2015082211W WO 2016000553 A1 WO2016000553 A1 WO 2016000553A1
Authority
WO
WIPO (PCT)
Prior art keywords
directory
file
authenticated
files
identified
Prior art date
Application number
PCT/CN2015/082211
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/321,694 priority Critical patent/US20170206209A1/en
Publication of WO2016000553A1 publication Critical patent/WO2016000553A1/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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • 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

Definitions

  • the present application relates to the field of file processing, and in particular, to a method and apparatus for identifying a garbage directory.
  • various application software can usually be installed in an electronic device to meet different needs of users.
  • the application software due to improper development of application software, the application software usually creates some directories automatically when the user runs the application software, and each directory can be booted to a folder in the folder (that is, under the directory).
  • Some files are cached, where the cached image files can usually occupy more than 80% of the total number of files; and these cached files are usually useless for the user, which makes useless files occupy a large amount of storage space. , affecting the overall performance of electronic devices.
  • a garbage directory that is, a directory in which a file that is useless to the user is cached.
  • the embodiment of the present application discloses a method and device for identifying a garbage directory to effectively identify whether a directory in the application software is a garbage directory.
  • the technical solutions are as follows:
  • the embodiment of the present application provides a method for identifying a garbage directory, including:
  • the directory to be authenticated is determined as a garbage directory.
  • the method before obtaining the file name of the file in the to-be-identified directory, the method further includes:
  • the determining, by the file name of the file in the to-be-identified directory, the temporary file naming rules including:
  • the determining, by the file name of the file in the to-be-identified directory, the temporary file naming rules including:
  • the determining, by the file name of the file in the to-be-identified directory, the temporary file naming rules including:
  • the obtaining, by the file name of the file in the directory to be authenticated includes:
  • the obtaining the to-be-identified directory includes:
  • the method further includes:
  • the directory to be authenticated is output, and the user is prompted to delete, and after the user confirms the deletion, the folder to which the directory to be authenticated is directed is deleted.
  • the method further includes:
  • the file is a picture file.
  • the embodiment of the present application provides an apparatus for identifying a garbage directory, including:
  • a directory obtaining module configured to obtain a directory to be authenticated; wherein the directory to be authenticated is a directory generated after the application software runs;
  • a file name obtaining module configured to obtain a file name of a file in the directory to be authenticated
  • a file name judging module configured to determine whether the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules; if yes, triggering the junk directory determining module;
  • the garbage directory determining module is configured to determine the to-be-identified directory as a garbage directory.
  • the embodiment of the present application provides an apparatus for identifying a garbage directory, and further includes:
  • a file quantity obtaining module configured to obtain the number of files in the to-be-authenticated directory before obtaining the file name of the file in the directory to be authenticated
  • the file quantity determining module is configured to determine whether the number of the files reaches a predetermined number, and if yes, trigger the file name obtaining module.
  • the file name judging module includes:
  • a first file name judging unit configured to determine whether the file names of the files in the to-be-identified directory are all named by a numeric string having a predetermined number of digits, and if so, indicating that the file names of the files in the directory to be detected are
  • the garbage catalog determination module is triggered by conforming to the temporary file naming rules.
  • the file name judging module includes:
  • a second file name determining unit configured to determine whether a file name of the file in the directory to be authenticated is All are named after the md5 string. If yes, it indicates that the file name of the file in the directory to be detected conforms to the temporary file naming rule, and the garbage directory determining module is triggered.
  • the file name judging module includes:
  • a second file name determining unit configured to determine whether the file names of the files in the directory to be authenticated are all named by a numeric string having a predetermined number of digits, and if yes, indicating that the file names of the files in the directory to be detected are Matching the temporary file naming rule, triggering the garbage directory determining module;
  • the file name obtaining module is specifically configured to:
  • the directory obtaining module includes:
  • the directory determining unit is configured to select one of the directories generated after the application software is simulated to be the directory to be authenticated.
  • the embodiment of the present application provides an apparatus for identifying a garbage directory, and further includes:
  • a first processing module configured to report the to-be-authenticated directory to the server after determining the to-be-identified directory as the garbage directory, so that the server adds the to-be-identified directory to the pre-established garbage catalog;
  • a second processing module configured to automatically delete the folder to be identified by the directory to be identified after determining the to-be-identified directory as a garbage directory
  • a third processing module configured to output the to-be-authenticated directory after determining the to-be-identified directory as a garbage directory, and prompt the user to delete, and delete the to-be-identified directory after the user confirms the deletion folder.
  • the embodiment of the present application provides an apparatus for identifying a garbage directory, and further includes:
  • a fourth processing module configured to add the to-be-authenticated directory to the pre-established garbage catalog after determining the to-be-identified directory as a garbage directory.
  • the file is a picture file.
  • an embodiment of the present application further provides an electronic device, including: a processor, a memory, a communication interface, and a bus;
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable program code
  • the processor by reading the executable program code stored in the memory, runs a program corresponding to the executable program code for executing any one of the methods for identifying a garbage directory provided by the embodiments of the present application.
  • the embodiment of the present application further provides a storage medium for storing an application, where the application is used to execute any method for identifying a garbage directory provided by the embodiment of the present application.
  • the embodiment of the present application further provides an application program for performing any method for identifying a garbage directory provided by the embodiment of the present application.
  • the directory to be authenticated is obtained; wherein the directory to be authenticated is a directory generated after the application software is run; the file name of the file in the directory to be authenticated is obtained; and the file name of the file in the directory to be authenticated is determined. Whether the temporary file naming rules are met; if so, the directory to be authenticated is determined to be a garbage directory. It can be seen that, in this solution, whether the file name of the file in the directory to be authenticated is consistent with the temporary file naming rule is used to identify whether the to-be-identified directory is a junk file, and the directory cache file automatically created by the application software is fully utilized. The unique naming method, therefore, can effectively identify whether the directory in the application software is a spam directory.
  • FIG. 1 is a flowchart of a method for identifying a garbage directory according to an embodiment of the present application
  • FIG. 2 is another flowchart of a method for identifying a garbage directory according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an apparatus for identifying a garbage directory according to an embodiment of the present application.
  • the embodiment of the present application provides a method and device for identifying a garbage directory.
  • a method for identifying a garbage directory provided by the embodiment of the present application is first introduced.
  • the method for identifying the garbage directory provided by the embodiment of the present application may be applied to the terminal by using software, or may be applied to the server by using the software, and the application software for the method may be various types of client application software, for example, various types of instant messaging.
  • the terminal can be a smart phone, a tablet or a laptop with various application software installed.
  • the directory local to the terminal may be authenticated based on the method, and the corresponding operation is performed based on the authentication result; when the method for authenticating the garbage directory applies the software to the server
  • the garbage catalog library can be constructed based on the method, so that the catalog uploaded by each terminal is identified according to the constructed garbage catalog, and the recognition result is fed back to the corresponding terminal, thereby realizing remote identification of the catalog in the terminal.
  • the directory referred to in the embodiment of the present application is a folder path, and the directory can be directed to the corresponding folder.
  • the complete directory directed to the folder generally includes: a path for indicating a local storage location and a path for indicating a location in the application software, and, for an application software, When running on different terminals, the installation location of the application software may be different, causing the path indicating the local storage location to change but the path for indicating the location in the application software is unchanged. Therefore, in order to ensure extensive application software,
  • the authentication directory is a path for indicating the location in the application software.
  • /mnt/sdcard/kingsoft/ksnmgsdk is the complete directory that leads to the folder ksnmgsdk, where the directory to be authenticated can be kingsoft/ksnmgsdk, not including the previous one. Indicates the path /mnt/sdcard/ of the local storage location.
  • a method for identifying a garbage directory may include:
  • the directory to be authenticated may be obtained first, and then the subsequent processing is performed.
  • the directory to be authenticated is a directory generated after the application software runs, and the directory can be directed to a folder.
  • the application software can automatically create a directory, and the automatically created directory is a garbage directory that caches files that are useless to the user. Therefore, if the application software corresponding to the directory to be authenticated has been run, the directory to be authenticated can be obtained directly; and when the application software to be authenticated is not run, further,
  • the obtaining the directory to be identified may include:
  • the method for identifying the garbage directory provided by the embodiment of the present application is described by taking a directory to be identified as an example. It can be understood that for an application software, it has a large number of directories, and for each directory, The method provided by the embodiment of the present application can be used for identification.
  • the file name of the file in the directory to be authenticated can be obtained for subsequent processing. It can be understood by those skilled in the art that since the picture file in the file cached in the automatic creation directory accounts for more than 80% of the total number, the file may be a picture file, which is of course not limited thereto.
  • the directory can be authenticated based on the partial files. Accordingly, the file name of the file in the directory to be authenticated can be obtained, which can include : Obtain the file name of some files in the directory to be authenticated, for example, obtain the file name of 90% of the files in the directory to be authenticated or the file name of 95% of the files in the directory to be authenticated.
  • obtaining the file name of the file in the directory to be authenticated may include: obtaining the file name of all the files in the directory to be authenticated.
  • the file Since the file is named by the temporary file naming rule when the file is cached in the garbage directory, after obtaining the file name of the file in the directory to be authenticated, it can be determined whether the file name of the file in the directory to be authenticated is consistent with the temporary file name. File naming rules, and perform different operations according to different judgment results. When it is determined that the file names of the files in the to-be-identified directory all conform to the temporary file naming rules, S104 may be performed; otherwise, S105 may be performed.
  • the determining whether the file name of the file in the directory to be authenticated meets the temporary file naming rules may include:
  • the predetermined number of bits can be 8 or 11 bits.
  • the number string of the predetermined number of bits of the named picture file may be, for example, a time stamp such as 20140626204839 or 20140626204840.
  • the determining whether the file name of the file in the directory to be authenticated meets the temporary file naming rules may include:
  • the md5 string is a string of a specific format formed based on the md5 algorithm. Specifically, the string includes a part of 32 characters of 0-9 and A-Z (or a-z). Taking an image file as an example, when the image file is automatically cached, the md5 string of the named image file can be, for example:
  • determining whether the file name of the file in the directory to be authenticated conforms to the temporary file naming rule may include:
  • determining whether the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules may include:
  • the directory to be identified is determined as a garbage directory.
  • the to-be-identified directory is determined to be a non-spam directory.
  • the directory to be authenticated is obtained; wherein the directory to be authenticated is a directory generated after the application software is run; the file name of the file in the directory to be authenticated is obtained; and the file name of the file in the directory to be authenticated is determined. Whether the temporary file naming rules are met; if so, the directory to be authenticated is determined to be a garbage directory. It can be seen that, in this solution, whether the file name of the file in the directory to be authenticated is consistent with the temporary file naming rule is used to identify whether the to-be-identified directory is a junk file, and the directory cache file automatically created by the application software is fully utilized. The unique naming method, therefore, can effectively identify whether the directory in the application software is a spam directory.
  • the method for authenticating the garbage directory may further include:
  • the directory to be authenticated is output, and the user is prompted to delete, and after the user confirms the deletion, the folder to which the directory to be authenticated is directed is deleted.
  • the method for authenticating the garbage directory applies the software to the server, after determining the to-be-identified directory as the garbage directory, the method may further include: adding the to-be-identified directory to the pre-established garbage catalog.
  • the garbage catalog is improved by adding the to-be-identified directory to the garbage catalog, so that after receiving the authentication request carried by the terminal and carrying the directory, the server will identify the directory in the request and the garbage directory in the garbage catalog. A match is made to feed back the matching result to the terminal.
  • the embodiment of the present application further provides a method for identifying a garbage directory.
  • the method for identifying the garbage directory provided by the embodiment of the present application may be applied to the terminal by using software, or may be applied to the server by using the software, and the application software for the method may be various types of client application software, for example, various types of instant messaging.
  • the terminal can be a smart phone, a tablet or a laptop with various application software installed.
  • the directory local to the terminal may be authenticated based on the method, and the corresponding operation is performed based on the authentication result; when the method for authenticating the garbage directory applies the software to the server
  • the garbage catalog library can be constructed based on the method, so that the catalog uploaded by each terminal is identified according to the constructed garbage catalog, and the recognition result is fed back to the corresponding terminal, thereby realizing remote identification of the catalog in the terminal.
  • the directory referred to in the embodiment of the present application is a folder path, and the directory can be directed to the corresponding folder.
  • the complete directory directed to the folder generally includes: a path for indicating a local storage location and a path for indicating a location in the application software, and, for an application software, When running on different terminals, the installation location of the application software may be different, causing the path indicating the local storage location to change but the path for indicating the location in the application software is unchanged. Therefore, in order to ensure extensive application software, The directory to be authenticated is a path for indicating the location in the application software.
  • /mnt/sdcard/kingsoft/ksnmgsdk is the complete directory that leads to the folder ksnmgsdk, where the directory to be authenticated can be kingsoft/ksnmgsdk, not including the previous one for indicating local storage.
  • a method for identifying a garbage directory may include:
  • the directory to be authenticated may be obtained first, and then the subsequent processing is performed.
  • the directory to be authenticated is a directory generated after the application software runs, and the directory can be directed to a folder.
  • the application software can automatically create a directory, and the automatically created directory is a garbage directory that caches files that are useless to the user. Therefore, if the application software corresponding to the directory to be authenticated has been run, the directory to be authenticated can be obtained directly; and when the application software to be authenticated is not run, further,
  • the obtaining the directory to be identified may include:
  • the method for identifying the garbage directory provided by the embodiment of the present application is described by taking a directory to be identified as an example. It can be understood that for an application software, it has a large number of directories, and for each directory, The method provided by the embodiment of the present application can be used for identification.
  • the subsequent judgment may be performed when there are many files in the directory. Therefore, after obtaining the directory to be authenticated, the number of files in the directory to be authenticated may be obtained, thereby determining whether the number of the files reaches a predetermined number. If yes, S204 can be performed; otherwise, the authentication process can be ended.
  • the predetermined number may be 10, 12, or 15, etc., and may be set according to actual conditions.
  • the file name of the file in the directory to be authenticated may be obtained for subsequent processing. It can be understood by those skilled in the art that since the picture file in the file cached in the automatic creation directory accounts for more than 80% of the total number, the file may be a picture file, which is of course not limited thereto.
  • the directory can be authenticated based on the partial files. Accordingly, the file name of the file in the directory to be authenticated can be obtained, which can include : Obtain the file name of some files in the directory to be authenticated, for example, obtain the file name of 90% of the files in the directory to be authenticated or the file name of 95% of the files in the directory to be authenticated.
  • obtaining the file name of the file in the directory to be authenticated may include: obtaining the file name of all the files in the directory to be authenticated.
  • the file Since the file is named by the temporary file naming rule when the file is cached in the garbage directory, after obtaining the file name of the file in the directory to be authenticated, it can be determined whether the file name of the file in the directory to be authenticated is consistent with the temporary file name. File naming rules, and perform different operations according to different judgment results. When it is determined that the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules, S206 may be performed; otherwise, S207 may be performed.
  • the determining whether the file name of the file in the directory to be authenticated meets the temporary file naming rules may include:
  • the predetermined number of bits can be 8 or 11 bits.
  • the number string of the predetermined number of bits of the named picture file may be, for example, a time stamp such as 20140626204839 or 20140626204840.
  • the determining whether the file name of the file in the directory to be authenticated meets the temporary file naming rules may include:
  • the md5 string is a string of a specific format formed based on the md5 algorithm. Specifically, the string includes a part of 32 characters of 0-9 and A-Z (or a-z). Taking an image file as an example, when the image file is automatically cached, the md5 string of the named image file can be, for example:
  • determining whether the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules may include:
  • determining whether the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules may include:
  • the directory to be identified is determined as a garbage directory.
  • the to-be-identified directory may be determined as a non-spam directory.
  • the directory to be authenticated is obtained; wherein the directory to be authenticated is a directory generated after the application software is run; the number of files in the directory to be authenticated is obtained, and when it is determined whether the number of the files reaches a predetermined number And obtaining a file name of the file in the directory to be authenticated; determining whether the file name of the file in the directory to be authenticated conforms to the temporary file naming rule; if yes, determining the directory to be authenticated as a garbage directory.
  • the method for authenticating the garbage directory may further include:
  • the directory to be authenticated is output, and the user is prompted to delete, and after the user confirms the deletion, the folder to which the directory to be authenticated is directed is deleted.
  • the method for authenticating the garbage directory applies the software to the server, after determining the to-be-identified directory as the garbage directory, the method may further include: adding the to-be-identified directory to the pre-established garbage catalog.
  • the garbage catalog is improved by adding the to-be-identified directory to the garbage catalog, so that after receiving the authentication request carried by the terminal and carrying the directory, the server will identify the directory in the request and the garbage directory in the garbage catalog. A match is made to feed back the matching result to the terminal.
  • the embodiment of the present application provides a device for identifying a garbage directory.
  • the method may include:
  • a directory obtaining module 310 configured to obtain a directory to be authenticated; wherein the directory to be authenticated is a directory generated after the application software runs;
  • a file name obtaining module 320 configured to obtain a file name of a file in the directory to be authenticated
  • the file name judging module 330 is configured to determine whether the file names of the files in the to-be-identified directory are consistent with the temporary file naming rules; if yes, triggering the junk directory determining module;
  • the garbage directory determining module 340 is configured to determine the to-be-identified directory as a garbage directory.
  • the directory to be authenticated is obtained; wherein the directory to be authenticated is a directory generated after the application software is run; the file name of the file in the directory to be authenticated is obtained; and the file name of the file in the directory to be authenticated is determined. Whether the temporary file naming rules are met; if so, the directory to be authenticated is determined to be a garbage directory. It can be seen that, in this solution, whether the file name of the file in the directory to be authenticated is consistent with the temporary file naming rule is used to identify whether the to-be-identified directory is a junk file, and the directory cache file automatically created by the application software is fully utilized. The unique naming method, therefore, can effectively identify whether the directory in the application software is a spam directory.
  • the apparatus for identifying a garbage list provided by the embodiment of the present application may further include:
  • a file quantity obtaining module configured to obtain the number of files in the to-be-authenticated directory before obtaining the file name of the file in the directory to be authenticated
  • the file quantity determining module is configured to determine whether the number of the files reaches a predetermined number, and if yes, trigger the file name obtaining module.
  • the file name judging module 330 may include:
  • a first file name judging unit configured to determine whether the file names of the files in the to-be-identified directory are all named by a numeric string having a predetermined number of digits, and if so, indicating that the file names of the files in the directory to be detected are
  • the garbage catalog determination module is triggered by conforming to the temporary file naming rules.
  • the file name judging module 330 may include:
  • a second file name judging unit configured to determine whether the file names of the files in the to-be-identified directory are all named by the md5 string, and if yes, indicating that the file names of the files in the to-be-detected directory are consistent with the temporary file name
  • the rule triggers the garbage list determination module.
  • the file name judging module 330 may include:
  • a second file name judging unit configured to determine whether the file names of the files in the to-be-identified directory are all named by a numeric string having a predetermined number of digits, and if yes, indicating the files in the directory to be detected The file name is consistent with the temporary file naming rule, and the garbage directory determining module is triggered;
  • the file name obtaining module 320 is specifically configured to:
  • the directory obtaining module 310 may include:
  • a directory determining unit for selecting one of the directories generated after running the application software as a to-be-identified directory
  • the device may further include:
  • a first processing module configured to report the to-be-authenticated directory to the server after determining the to-be-identified directory as the garbage directory, so that the server adds the to-be-identified directory to the pre-established garbage catalog;
  • a second processing module configured to automatically delete the folder to be identified by the directory to be identified after determining the to-be-identified directory as a garbage directory
  • a third processing module configured to output the to-be-authenticated directory after determining the to-be-identified directory as a garbage directory, and prompt the user to delete, and delete the to-be-identified directory after the user confirms the deletion folder.
  • the device may further include:
  • a fourth processing module configured to add the to-be-authenticated directory to the pre-established garbage catalog after determining the to-be-identified directory as a garbage directory.
  • the file may be a picture file.
  • the embodiment of the present application further provides an electronic device, including: a processor, a memory, Communication interface and bus;
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable program code
  • the processor by reading the executable program code stored in the memory, runs a program corresponding to the executable program code for executing any one of the methods for identifying a garbage directory provided by the embodiments of the present application.
  • the method for identifying a garbage directory provided by the embodiment of the present application includes:
  • the directory to be authenticated is determined as a garbage directory.
  • the embodiment of the present application further provides a storage medium for storing an application, and the application is used to execute any method for identifying a garbage directory provided by the embodiment of the present application.
  • the method for identifying a garbage directory provided by the embodiment of the present application includes:
  • the directory to be authenticated is determined as a garbage directory.
  • the embodiment of the present application further provides an application program for performing any method for identifying a garbage directory provided by the embodiment of the present application.
  • the method for identifying a garbage directory provided by the embodiment of the present application includes:
  • the directory to be authenticated is determined as a garbage directory.

Landscapes

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

Abstract

一种鉴别垃圾目录的方法及装置。其中,该鉴别垃圾目录的方法,包括:获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;获得所述待鉴别目录中的文件的文件名;判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,将所述待鉴别目录确定为垃圾目录。可见,本方案中,采用判断待鉴别目录中的文件的文件名是否均符合临时文件命名规则的方式,来鉴别该待鉴别目录是否为垃圾文件,充分利用了应用软件自动创建的目录缓存文件时特有的命名方式,因此,可以有效鉴别应用软件中的目录是否为垃圾目录。

Description

鉴别垃圾目录的方法及装置
本申请要求于2014年06月30日提交中国专利局、申请号为201410307300.4申请名称为“鉴别垃圾目录的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及文件处理领域,特别涉及一种鉴别垃圾目录的方法及装置。
背景技术
随着科学技术飞速的发展,各种电子设备不断的丰富并方便了大众生活。由于利用电子设备处理信息具有方便快捷、节省资源等优势,使得电子设备成为人们的生活或工作中不可或缺的一部分。
现有技术中,电子设备中通常可以安装各种应用软件,以满足用户的不同需求。但是,由于应用软件的开发规范不当,导致在用户运行应用软件的过程中,应用软件通常会自动创建一些目录,而每一目录能够引导到一个文件夹,在该文件夹中(即该目录下)会缓存一些文件,其中,所缓存的图片文件通常可以占据文件总个数的80%以上;而这些缓存的文件对于用户而言通常是无用的,这样使得无用的文件占据了大量的存储空间,影响电子设备的整体性能。
基于上述的应用软件的不当运行机制,鉴别应用软件中的目录是否为垃圾目录(即缓存有对用户无用的文件的目录)是一个亟待解决的问题。
发明内容
基于上述问题,本申请实施例公开了一种鉴别垃圾目录的方法及装置,以有效鉴别应用软件中的目录是否为垃圾目录。技术方案如下:
第一方面,本申请实施例提供了一种鉴别垃圾目录的方法,包括:
获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
获得所述待鉴别目录中的文件的文件名;
判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;
如果是,将所述待鉴别目录确定为垃圾目录。
可选的,在获得所述待鉴别目录中的文件的文件名之前,还包括:
获得所述待鉴别目录中的文件的数量;
判断所述文件的数量是否达到预定数量,如果是,再执行所述获得所述待鉴别目录中的文件的文件名的步骤。
可选的,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
可选的,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
可选的,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则;
如果否,继续判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
可选的,所述获得所述待鉴别目录中的文件的文件名,包括:
获得所述待鉴别目录中的所有的文件的文件名。
可选的,所述获得待鉴别目录,包括:
模拟运行应用软件;
从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录。
可选的,在将所述待鉴别目录确定为垃圾目录后,还包括:
将所述待鉴别目录上报服务器,以使得所述服务器将所述待鉴别目录增加到预先建立的垃圾目录库中;
或者,
自动删除所述待鉴别目录所指引到的文件夹;
或者,
输出所述待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除所述待鉴别目录所指引到的文件夹。
可选的,在将所述待鉴别目录确定为垃圾目录后,还包括:
将所述待鉴别目录增加到预先建立的垃圾目录库中。
可选的,所述文件为图片文件。
第二方面,本申请实施例提供了一种鉴别垃圾目录的装置,包括:
目录获得模块,用于获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
文件名获得模块,用于获得所述待鉴别目录中的文件的文件名;
文件名判断模块,用于判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,触发垃圾目录确定模块;
所述垃圾目录确定模块,用于将所述待鉴别目录确定为垃圾目录。
可选的,本申请实施例提供了一种鉴别垃圾目录的装置,还包括:
文件数量获得模块,用于在获得所述待鉴别目录中的文件的文件名之前,获得所述待鉴别目录中的文件的数量;
文件数量判断模块,用于判断所述文件的数量是否达到预定数量,如果是,触发所述文件名获得模块。
可选的,所述文件名判断模块,包括:
第一文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
可选的,所述文件名判断模块,包括:
第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否 均以md5字符串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
可选的,所述文件名判断模块,包括:
第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块;
如果否,继续判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
可选的,所述文件名获得模块,具体用于:
获得所述待鉴别目录中的所有的文件的文件名。
可选的,所述目录获得模块,包括:
模拟运行单元,用于模拟运行应用软件;
目录确定单元,用于从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录。
可选的,本申请实施例提供了一种鉴别垃圾目录的装置,还包括:
第一处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录上报服务器,以使得所述服务器将所述待鉴别目录增加到预先建立的垃圾目录库中;
或者,
第二处理模块,用于在将所述待鉴别目录确定为垃圾目录后,自动删除所述待鉴别目录指引的文件夹;
或者,
第三处理模块,用于在将所述待鉴别目录确定为垃圾目录后,输出所述待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除所述待鉴别目录所指引到的文件夹。
可选的,本申请实施例提供了一种鉴别垃圾目录的装置,还包括:
第四处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录增加到预先建立的垃圾目录库中。
可选的,所述文件为图片文件。
第三方面,本申请实施例还提供了一种电子设备,包括:处理器、存储器、通信接口和总线;
所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
所述存储器存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。
第四方面,本申请实施例还提供了一种存储介质,用于存储应用程序,所述应用程序用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。
第五方面,本申请实施例还提供了一种应用程序,用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。
本申请实施例中,获得待鉴别目录;其中,该待鉴别目录为应用软件运行后所产生的目录;获得该待鉴别目录中的文件的文件名;判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,将该待鉴别目录确定为垃圾目录。可见,本方案中,采用判断待鉴别目录中的文件的文件名是否均符合临时文件命名规则的方式,来鉴别该待鉴别目录是否为垃圾文件,充分利用了应用软件自动创建的目录缓存文件时特有的命名方式,因此,可以有效鉴别应用软件中的目录是否为垃圾目录。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例所提供的一种鉴别垃圾目录的方法的流程图;
图2为本申请实施例所提供的一种鉴别垃圾目录的方法的另一流程图;
图3为本申请实施例所提供的一种鉴别垃圾目录的装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了有效鉴别应用软件中的目录是否为垃圾目录,从而基于鉴别结果执行相应操作,本申请实施例提供了一种鉴别垃圾目录的方法及装置。
下面首先对本申请实施例所提供的一种鉴别垃圾目录的方法进行介绍。
其中,本申请实施例所提供的鉴别垃圾目录的方法可以应用软件于终端,也可以应用软件于服务器,且该方法所针对的应用软件可以为各类客户端应用软件,例如:各类即时通讯应用软件、各类浏览器应用软件、各类助手应用软件等。该终端可以为安装有各类应用软件的智能手机、平板电脑或笔记本电脑等。需要说明的是,当该鉴别垃圾目录的方法应用软件于终端时,可以基于该方法对终端本地的目录进行鉴别,并基于鉴别结果执行相应操作;当该鉴别垃圾目录的方法应用软件于服务器时,可以基于该方法来构建垃圾目录库,从而依据所构建的垃圾目录库识别各个终端所上传的目录,并将识别结果反馈给相应终端,以此实现终端中的目录的远程识别。
需要强调的是,本申请实施例所指的目录即为文件夹路径,通过目录能够指引到相应文件夹。进一步的,实际应用软件中,由于指引到文件夹的完整目录通常包括:用于指示本地存储位置的路径和用于指示在应用软件中的位置的路径,并且,对于一个应用软件而言,当运行于不同终端时,由于应用软件的安装位置可能不同,导致指示本地存储位置的路径会发生变化但是用于指示在应用软件中的位置的路径不变,因此,为了保证广泛应用软件性,待鉴别目录为用于指示在应用软件中的位置的路径。举例而言:对于应用软件kingsoft而言,/mnt/sdcard/kingsoft/ksnmgsdk为指引到文件夹ksnmgsdk的完整目录,其中,待鉴别目录可以为kingsoft/ksnmgsdk,而不包括之前的用于 指示本地存储位置的路径/mnt/sdcard/。
如图1所示,一种鉴别垃圾目录的方法,可以包括:
S101,获得待鉴别目录;
当需要鉴别应用软件中的目录时,可以首先获得待鉴别目录,进而执行后续的处理。其中,该待鉴别目录为应用软件运行后所产生的目录,通过该目录可以指引到一个文件夹。
本领域技术人员可以理解的是,在应用软件运行过程中,应用软件可以自动创建目录,所自动创建的目录为缓存有对于用户无用的文件的垃圾目录。因此,如果待鉴别目录所对应的应用软件已经运行过,可以直接获得该待鉴别目录;而当待鉴别目录的应用软件未运行过,更进一步的,
所述获得待鉴别目录,可以包括:
模拟运行应用软件;
从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录。
需要强调的是,上述以一个待鉴别目录为例对本申请实施例所提供的鉴别垃圾目录的方法进行介绍,可以理解的是,对于一个应用软件而言,其具有大量目录,对于每一个目录均可以采用本申请实施例所提供方法进行鉴别。
S102,获得该待鉴别目录中的文件的文件名;
其中,在获得待鉴别目录后,可以获得该待鉴别目录中的文件的文件名,以进行后续的处理。本领域技术人员可以理解的是,由于自动创建目录中缓存的文件中图片文件占总数量的80%以上,因此,所述文件可以为图片文件,当然并不局限于此。
需要强调的是,由于一个目录为垃圾目录,其中的文件通常都是自动缓存的文件,因此,可以基于部分文件来鉴别目录,相应的,获得该待鉴别目录中的文件的文件名,可以包括:获得待鉴别目录中部分文件的文件名,例如:获得待鉴别目录中90%的文件的文件名或获得待鉴别目录中95%的文件的文件名等。
更进一步的,而为了提高鉴别准确性,获得该待鉴别目录中的文件的文件名,可以包括:可以获得该待鉴别目录中的所有的文件的文件名。
S103,判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规 则;如果是,执行S104;否则,执行S105;
由于在垃圾目录中缓存文件时采用临时文件命名规则对文件进行命名,因此,在获得该待鉴别目录中的文件的文件名后,可以判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,并根据不同的判断结果执行不同的操作。其中,当判断出该待鉴别目录中的文件的文件名均符合临时文件命名规则时,可以执行S104;否则,可以执行S105。
在一种实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
其中,预定位数可以为8位或11位。以图片文件为例,在自动缓存图片文件时,命名图片文件的预定位数的数字串可以例如:20140626204839、20140626204840等时间戳。
在一种实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
其中,md5字符串为基于md5算法形成的特定格式的字符串,具体的,该字符串包括0-9和A-Z(或a-z)这32个字符中的部分。以图片文件为例,自动缓存图片文件时,命名图片文件的md5字符串可以例如:
97B50E82354EE3240C8A46F2D7B5C3A0、
8FC1A28AE7C533E6599192C7CEEE8202、
2AADBD6DB9F59A83D8D40C6BFCE28031等。
在另一种实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则;
如果否,继续判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规 则。
在另一实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则;
如果否,继续判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
上述所给出的判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则的具体实现方式仅仅作为示例,并不应该构成对本申请实施例的限定。
S104,将该待鉴别目录确定为垃圾目录;
其中,当判断出该待鉴别目录中的文件的文件名均符合临时文件命名规则时,表明该目录中的文件均是自动缓存的,进而表明该目录为应用软件运行过程中自动创建的,因此,将该待鉴别目录确定为垃圾目录。
S105,将该待鉴别目录确定为非垃圾目录。
其中,当判断出该待鉴别目录中的文件的文件名不均符合临时文件命名规则时,将该待鉴别目录确定为非垃圾目录。
本申请实施例中,获得待鉴别目录;其中,该待鉴别目录为应用软件运行后所产生的目录;获得该待鉴别目录中的文件的文件名;判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,将该待鉴别目录确定为垃圾目录。可见,本方案中,采用判断待鉴别目录中的文件的文件名是否均符合临时文件命名规则的方式,来鉴别该待鉴别目录是否为垃圾文件,充分利用了应用软件自动创建的目录缓存文件时特有的命名方式,因此,可以有效鉴别应用软件中的目录是否为垃圾目录。
更进一步的,当该鉴别垃圾目录的方法应用软件于终端时,在将该待鉴别目录确定为垃圾目录之后,该方法还可以包括:
将该待鉴别目录上报服务器,以使得该服务器将该待鉴别目录增加到预先建立的垃圾目录库中;
或者,
自动删除该待鉴别目录所指引到的文件夹;
或者,
输出该待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除该待鉴别目录所指引到的文件夹。
更进一步的,当该鉴别垃圾目录的方法应用软件于服务器时,在将该待鉴别目录确定为垃圾目录之后,该方法还可以包括:将该待鉴别目录增加到预先建立的垃圾目录库中。
其中,通过将该待鉴别目录增加到垃圾目录库,来完善垃圾目录库,从而使得服务器接收到终端上传的携带有目录的鉴别请求后,将鉴别请求中的目录与垃圾目录库中的垃圾目录进行匹配,从而反馈匹配结果给终端。
为了提高鉴别的准确性,本申请实施例还提供了一种鉴别垃圾目录的方法。
其中,本申请实施例所提供的鉴别垃圾目录的方法可以应用软件于终端,也可以应用软件于服务器,且该方法所针对的应用软件可以为各类客户端应用软件,例如:各类即时通讯应用软件、各类浏览器应用软件、各类助手应用软件等。该终端可以为安装有各类应用软件的智能手机、平板电脑或笔记本电脑等。需要说明的是,当该鉴别垃圾目录的方法应用软件于终端时,可以基于该方法对终端本地的目录进行鉴别,并基于鉴别结果执行相应操作;当该鉴别垃圾目录的方法应用软件于服务器时,可以基于该方法来构建垃圾目录库,从而依据所构建的垃圾目录库识别各个终端所上传的目录,并将识别结果反馈给相应终端,以此实现终端中的目录的远程识别。
需要强调的是,本申请实施例所指的目录即为文件夹路径,通过目录能够指引到相应文件夹。进一步的,实际应用软件中,由于指引到文件夹的完整目录通常包括:用于指示本地存储位置的路径和用于指示在应用软件中的位置的路径,并且,对于一个应用软件而言,当运行于不同终端时,由于应用软件的安装位置可能不同,导致指示本地存储位置的路径会发生变化但是用于指示在应用软件中的位置的路径不变,因此,为了保证广泛应用软件性, 待鉴别目录为用于指示在应用软件中的位置的路径。举例而言:对于应用软件kingsoft而言,/mnt/sdcard/kingsoft/ksnmgsdk为指引到文件夹ksnmgsdk的完整目录,其中,待鉴别目录可以为kingsoft/ksnmgsdk,而不包括之前的用于指示本地存储位置的路径/mnt/sdcard/。
如图2所示,一种鉴别垃圾目录的方法,可以包括:
S201,获得待鉴别目录;
当需要鉴别应用软件中的目录时,可以首先获得待鉴别目录,进而执行后续的处理。其中,该待鉴别目录为应用软件运行后所产生的目录,通过该目录可以指引到一个文件夹。
本领域技术人员可以理解的是,在应用软件运行过程中,应用软件可以自动创建目录,所自动创建的目录为缓存有对于用户无用的文件的垃圾目录。因此,如果待鉴别目录所对应的应用软件已经运行过,可以直接获得该待鉴别目录;而当待鉴别目录的应用软件未运行过,更进一步的,
所述获得待鉴别目录,可以包括:
模拟运行应用软件;
从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录。
需要强调的是,上述以一个待鉴别目录为例对本申请实施例所提供的鉴别垃圾目录的方法进行介绍,可以理解的是,对于一个应用软件而言,其具有大量目录,对于每一个目录均可以采用本申请实施例所提供方法进行鉴别。
S202,获得该待鉴别目录中的文件的数量;
S203,判断该文件的数量是否达到预定数量,如果是,触发S204;否则,结束鉴别流程;
为了提高准确性,可以在目录中的文件较多时执行后续的判断,因此,在获得待鉴别目录后,可以获得该待鉴别目录中的文件的数量,进而判断该文件的数量是否达到预定数量,如果是,可以执行S204,否则,结束鉴别流程即可。
其中,该预定数量可以为10个、12个或15个等,可以根据实际情况进行设定。
S204,获得该待鉴别目录中的文件的文件名;
其中,在判断该文件的数量达到预定数量时,可以获得该待鉴别目录中的文件的文件名,以进行后续的处理。本领域技术人员可以理解的是,由于自动创建目录中缓存的文件中图片文件占总数量的80%以上,因此,所述文件可以为图片文件,当然并不局限于此。
需要强调的是,由于一个目录为垃圾目录,其中的文件通常都是自动缓存的文件,因此,可以基于部分文件来鉴别目录,相应的,获得该待鉴别目录中的文件的文件名,可以包括:获得待鉴别目录中部分文件的文件名,例如:获得待鉴别目录中90%的文件的文件名或获得待鉴别目录中95%的文件的文件名等。
更进一步的,而为了提高鉴别准确性,获得该待鉴别目录中的文件的文件名,可以包括:可以获得该待鉴别目录中的所有的文件的文件名。
S205,判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,执行S206;否则,执行S207;
由于在垃圾目录中缓存文件时采用临时文件命名规则对文件进行命名,因此,在获得该待鉴别目录中的文件的文件名后,可以判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,并根据不同的判断结果执行不同的操作。其中,当判断出该待鉴别目录中的文件的文件名均符合临时文件命名规则时,可以执行S206;否则,可以执行S207。
在一种实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
其中,预定位数可以为8位或11位。以图片文件为例,在自动缓存图片文件时,命名图片文件的预定位数的数字串可以例如:20140626204839、20140626204840等时间戳。
在一种实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
其中,md5字符串为基于md5算法形成的特定格式的字符串,具体的,该字符串包括0-9和A-Z(或a-z)这32个字符中的部分。以图片文件为例,自动缓存图片文件时,命名图片文件的md5字符串可以例如:
97B50E82354EE3240C8A46F2D7B5C3A0、
8FC1A28AE7C533E6599192C7CEEE8202、
2AADBD6DB9F59A83D8D40C6BFCE28031等。
在另一种实现方式中,具体的,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则;
如果否,继续判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
在另一实现方式中,具体的,所述判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则,可以包括:
判断该待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则;
如果否,继续判断该待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明该待鉴别目录中的文件的文件名均符合临时文件命名规则。
上述所给出的判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则的具体实现方式仅仅作为示例,并不应该构成对本申请实施例的限定。
S206,将该待鉴别目录确定为垃圾目录;
其中,当判断出该待鉴别目录中的文件的文件名均符合临时文件命名规则时,表明该目录中的文件均是自动缓存的,进而表明该目录为应用软件运行过程中自动创建的,因此,将该待鉴别目录确定为垃圾目录。
S207,将该待鉴别目录确定为非垃圾目录。
其中,当判断出该待鉴别目录中的文件的文件名不均符合临时文件命名规则时,可以将该待鉴别目录确定为非垃圾目录。
本申请实施例中,获得待鉴别目录;其中,该待鉴别目录为应用软件运行后所产生的目录;获得该待鉴别目录中的文件的数量,当判断出该文件的数量是否达到预定数量时,可以获得该待鉴别目录中的文件的文件名;判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,将该待鉴别目录确定为垃圾目录。可见,本方案中,采用判断待鉴别目录中的文件的文件名是否均符合临时文件命名规则的方式,来鉴别该待鉴别目录是否为垃圾文件,充分利用了应用软件自动创建的目录缓存文件时特有的命名方式,因此,可以有效鉴别应用软件中的目录是否为垃圾目录。并且,在目录中的文件数量足够时,继续鉴别流程,可以进一步提高鉴别准确性。
更进一步的,当该鉴别垃圾目录的方法应用软件于终端时,在将该待鉴别目录确定为垃圾目录之后,该方法还可以包括:
将该待鉴别目录上报服务器,以使得该服务器将该待鉴别目录增加到预先建立的垃圾目录库中;
或者,
自动删除该待鉴别目录所指引到的文件夹;
或者,
输出该待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除该待鉴别目录所指引到的文件夹。
更进一步的,当该鉴别垃圾目录的方法应用软件于服务器时,在将该待鉴别目录确定为垃圾目录之后,该方法还可以包括:将该待鉴别目录增加到预先建立的垃圾目录库中。
其中,通过将该待鉴别目录增加到垃圾目录库,来完善垃圾目录库,从而使得服务器接收到终端上传的携带有目录的鉴别请求后,将鉴别请求中的目录与垃圾目录库中的垃圾目录进行匹配,从而反馈匹配结果给终端。
相应于上述方法实施例,本申请实施例提供了一种鉴别垃圾目录的装置,如图3所示,可以包括:
目录获得模块310,用于获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
文件名获得模块320,用于获得所述待鉴别目录中的文件的文件名;
文件名判断模块330,用于判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,触发垃圾目录确定模块;
所述垃圾目录确定模块340,用于将所述待鉴别目录确定为垃圾目录。
本申请实施例中,获得待鉴别目录;其中,该待鉴别目录为应用软件运行后所产生的目录;获得该待鉴别目录中的文件的文件名;判断该待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,将该待鉴别目录确定为垃圾目录。可见,本方案中,采用判断待鉴别目录中的文件的文件名是否均符合临时文件命名规则的方式,来鉴别该待鉴别目录是否为垃圾文件,充分利用了应用软件自动创建的目录缓存文件时特有的命名方式,因此,可以有效鉴别应用软件中的目录是否为垃圾目录。
更进一步的,本申请实施例所提供鉴别垃圾目录的装置,还可以包括:
文件数量获得模块,用于在获得所述待鉴别目录中的文件的文件名之前,获得所述待鉴别目录中的文件的数量;
文件数量判断模块,用于判断所述文件的数量是否达到预定数量,如果是,触发所述文件名获得模块。
具体的,所述文件名判断模块330,可以包括:
第一文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
具体的,所述文件名判断模块330,可以包括:
第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
具体的,所述文件名判断模块330,可以包括:
第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件 的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块;
如果否,继续判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
具体的,所述文件名获得模块320,具体用于:
获得所述待鉴别目录中的所有的文件的文件名。
具体的,所述目录获得模块310,可以包括:
模拟运行单元,用于模拟运行应用软件;
目录确定单元,用于从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录
更进一步的,本申请实施例所提供鉴别垃圾目录的装置应用软件于终端时,该装置还可以包括:
第一处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录上报服务器,以使得所述服务器将所述待鉴别目录增加到预先建立的垃圾目录库中;
或者,
第二处理模块,用于在将所述待鉴别目录确定为垃圾目录后,自动删除所述待鉴别目录指引的文件夹;
或者,
第三处理模块,用于在将所述待鉴别目录确定为垃圾目录后,输出所述待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除所述待鉴别目录所指引到的文件夹。
更进一步的,本申请实施例所提供鉴别垃圾目录的装置应用软件于服务器时,该装置还可以包括:
第四处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录增加到预先建立的垃圾目录库中。
具体的,所述文件可以为图片文件。
另外,本申请实施例还提供了一种电子设备,包括:处理器、存储器、 通信接口和总线;
所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
所述存储器存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。其中,本申请实施例所提供的一种鉴别垃圾目录的方法,包括:
获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
获得所述待鉴别目录中的文件的文件名;
判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;
如果是,将所述待鉴别目录确定为垃圾目录。
另外,本申请实施例还提供了一种存储介质,用于存储应用程序,所述应用程序用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。其中,本申请实施例所提供的一种鉴别垃圾目录的方法,包括:
获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
获得所述待鉴别目录中的文件的文件名;
判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;
如果是,将所述待鉴别目录确定为垃圾目录。
另外,本申请实施例还提供了一种应用程序,用于执行本申请实施例所提供的任意一种鉴别垃圾目录的方法。其中,本申请实施例所提供的一种鉴别垃圾目录的方法,包括:
获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
获得所述待鉴别目录中的文件的文件名;
判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;
如果是,将所述待鉴别目录确定为垃圾目录。
对于系统或装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (20)

  1. 一种鉴别垃圾目录的方法,其特征在于,包括:
    获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
    获得所述待鉴别目录中的文件的文件名;
    判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;
    如果是,将所述待鉴别目录确定为垃圾目录。
  2. 根据权利要求1所述的方法,其特征在于,在获得所述待鉴别目录中的文件的文件名之前,还包括:
    获得所述待鉴别目录中的文件的数量;
    判断所述文件的数量是否达到预定数量,如果是,再执行所述获得所述待鉴别目录中的文件的文件名的步骤。
  3. 根据权利要求1或2所述的方法,其特征在于,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
    判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
  4. 根据权利要求1或2所述的方法,其特征在于,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
    判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
  5. 根据权利要求1或2所述的方法,其特征在于,所述判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则,包括:
    判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则;
    如果否,继续判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则。
  6. 根据权利要求1或2所述的方法,其特征在于,所述获得所述待鉴别目录中的文件的文件名,包括:
    获得所述待鉴别目录中的所有的文件的文件名。
  7. 根据权利要求1或2所述的方法,其特征在于,所述获得待鉴别目录,包括:
    模拟运行应用软件;
    从模拟运行应用软件后所产生的目录中任选一个作为待鉴别目录。
  8. 根据权利要求1或2所述的方法,其特征在于,在将所述待鉴别目录确定为垃圾目录后,还包括:
    将所述待鉴别目录上报服务器,以使得所述服务器将所述待鉴别目录增加到预先建立的垃圾目录库中;
    或者,
    自动删除所述待鉴别目录所指引到的文件夹;
    或者,
    输出所述待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除所述待鉴别目录所指引到的文件夹。
  9. 根据权利要求1或2所述的方法,其特征在于,在将所述待鉴别目录确定为垃圾目录后,还包括:
    将所述待鉴别目录增加到预先建立的垃圾目录库中。
  10. 根据权利要求1或2所述的方法,其特征在于,所述文件为图片文件。
  11. 一种鉴别垃圾目录的装置,其特征在于,包括:
    目录获得模块,用于获得待鉴别目录;其中,所述待鉴别目录为应用软件运行后所产生的目录;
    文件名获得模块,用于获得所述待鉴别目录中的文件的文件名;
    文件名判断模块,用于判断所述待鉴别目录中的文件的文件名是否均符合临时文件命名规则;如果是,触发垃圾目录确定模块;
    所述垃圾目录确定模块,用于将所述待鉴别目录确定为垃圾目录。
  12. 根据权利要求11所述的装置,其特征在于,还包括:
    文件数量获得模块,用于在获得所述待鉴别目录中的文件的文件名之前,获得所述待鉴别目录中的文件的数量;
    文件数量判断模块,用于判断所述文件的数量是否达到预定数量,如果是,触发所述文件名获得模块。
  13. 根据权利要求11或12所述的装置,其特征在于,所述文件名判断模块,包括:
    第一文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
  14. 根据权利要求11或12所述的装置,其特征在于,所述文件名判断模块,包括:
    第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
  15. 根据权利要求11或12所述的装置,其特征在于,所述文件名判断模块,包括:
    第二文件名判断单元,用于判断所述待鉴别目录中的文件的文件名是否均以具有预定位数的数字串命名,如果是,表明所述待检测的目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块;
    如果否,继续判断所述待鉴别目录中的文件的文件名是否均以md5字符串命名,如果是,表明所述待鉴别目录中的文件的文件名均符合临时文件命名规则,则触发所述垃圾目录确定模块。
  16. 根据权利要求11或12所述的装置,其特征在于,所述文件名获得模块,具体用于:
    获得所述待鉴别目录中的所有的文件的文件名。
  17. 根据权利要求11或12所述的装置,其特征在于,所述目录获得模块,包括:
    模拟运行单元,用于模拟运行应用软件;
    目录确定单元,用于从模拟运行应用软件后所产生的目录中任选一个作 为待鉴别目录。
  18. 根据权利要求11或12所述的装置,其特征在于,还包括:
    第一处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录上报服务器,以使得所述服务器将所述待鉴别目录增加到预先建立的垃圾目录库中;
    或者,
    第二处理模块,用于在将所述待鉴别目录确定为垃圾目录后,自动删除所述待鉴别目录指引的文件夹;
    或者,
    第三处理模块,用于在将所述待鉴别目录确定为垃圾目录后,输出所述待鉴别目录,并提示用户是否删除,并在用户确认删除后,删除所述待鉴别目录所指引到的文件夹。
  19. 根据权利要求11或12所述的装置,其特征在于,还包括:
    第四处理模块,用于在将所述待鉴别目录确定为垃圾目录后,将所述待鉴别目录增加到预先建立的垃圾目录库中。
  20. 根据权利要求11或12所述的装置,其特征在于,所述文件为图片文件。
PCT/CN2015/082211 2014-06-30 2015-06-24 鉴别垃圾目录的方法及装置 WO2016000553A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/321,694 US20170206209A1 (en) 2014-06-30 2015-06-24 Junk directory identification method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410307300.4A CN105224572B (zh) 2014-06-30 2014-06-30 鉴别垃圾目录的方法及装置
CN201410307300.4 2014-06-30

Publications (1)

Publication Number Publication Date
WO2016000553A1 true WO2016000553A1 (zh) 2016-01-07

Family

ID=54993541

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/082211 WO2016000553A1 (zh) 2014-06-30 2015-06-24 鉴别垃圾目录的方法及装置

Country Status (3)

Country Link
US (1) US20170206209A1 (zh)
CN (1) CN105224572B (zh)
WO (1) WO2016000553A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10660369B2 (en) 2016-07-14 2020-05-26 Altria Client Services Llc Fluid permeable heater assembly and cartridge for an aerosol-generating system
CN112015702A (zh) * 2020-09-15 2020-12-01 支付宝(杭州)信息技术有限公司 一种报文文件名处理方法、装置及设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609066A (zh) * 2017-08-30 2018-01-19 努比亚技术有限公司 清理文件的方法、设备及计算机可存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654872A (zh) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 一种清理应用程序产生的垃圾文件的方法及装置
CN102880713A (zh) * 2012-09-29 2013-01-16 北京奇虎科技有限公司 文件清理方法及装置
CN102880714A (zh) * 2012-09-29 2013-01-16 北京奇虎科技有限公司 文件清理方法及装置
CN103559299A (zh) * 2013-11-14 2014-02-05 贝壳网际(北京)安全技术有限公司 清理文件的方法、装置及移动终端
CN104317840A (zh) * 2014-10-10 2015-01-28 北京金山安全软件有限公司 一种文件清理方法、装置及终端

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5202982A (en) * 1990-03-27 1993-04-13 Sun Microsystems, Inc. Method and apparatus for the naming of database component files to avoid duplication of files
JP3865775B2 (ja) * 1995-04-11 2007-01-10 キネテック インコーポレイテッド データ処理システムにおけるデータの識別
US7689601B2 (en) * 2004-05-06 2010-03-30 Oracle International Corporation Achieving web documents using unique document locators
JP2006092268A (ja) * 2004-09-24 2006-04-06 Fuji Photo Film Co Ltd 画像ファイル記録システムおよびその制御方法
EP1934840A4 (en) * 2005-10-06 2010-12-15 Guidance Software Inc ELECTRONIC DISCOVERY SYSTEM AND METHOD
JP5163264B2 (ja) * 2008-05-07 2013-03-13 株式会社ニコン カメラ
KR100996855B1 (ko) * 2008-08-29 2010-11-26 주식회사 안철수연구소 정상 파일 데이터베이스 제공 시스템 및 방법
US8380676B1 (en) * 2009-05-27 2013-02-19 Google Inc. Automatic deletion of temporary files
CN102761627B (zh) * 2012-06-27 2015-12-09 北京奇虎科技有限公司 基于终端访问统计的云网址推荐方法及系统及相关设备
CN102902922B (zh) * 2012-09-29 2016-04-20 北京奇虎科技有限公司 文件修复方法和系统
US10346358B2 (en) * 2014-06-04 2019-07-09 Waterline Data Science, Inc. Systems and methods for management of data platforms

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654872A (zh) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 一种清理应用程序产生的垃圾文件的方法及装置
CN102880713A (zh) * 2012-09-29 2013-01-16 北京奇虎科技有限公司 文件清理方法及装置
CN102880714A (zh) * 2012-09-29 2013-01-16 北京奇虎科技有限公司 文件清理方法及装置
CN103559299A (zh) * 2013-11-14 2014-02-05 贝壳网际(北京)安全技术有限公司 清理文件的方法、装置及移动终端
CN104317840A (zh) * 2014-10-10 2015-01-28 北京金山安全软件有限公司 一种文件清理方法、装置及终端

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10660369B2 (en) 2016-07-14 2020-05-26 Altria Client Services Llc Fluid permeable heater assembly and cartridge for an aerosol-generating system
CN112015702A (zh) * 2020-09-15 2020-12-01 支付宝(杭州)信息技术有限公司 一种报文文件名处理方法、装置及设备

Also Published As

Publication number Publication date
CN105224572A (zh) 2016-01-06
CN105224572B (zh) 2019-11-15
US20170206209A1 (en) 2017-07-20

Similar Documents

Publication Publication Date Title
US10705748B2 (en) Method and device for file name identification and file cleaning
US10754634B1 (en) Customized application package with context specific token
US7734914B1 (en) System and method for allowing applications to securely access files
WO2015062389A1 (zh) 一种终端设备卸载系统应用的方法和装置
WO2016201819A1 (zh) 检测恶意文件的方法和装置
US10673823B2 (en) Migration containers
US9355250B2 (en) Method and system for rapidly scanning files
WO2017107961A1 (zh) 一种备份系统及方法
WO2015139539A1 (zh) 一种视频信息推送方法及装置
US10540325B2 (en) Method and device for identifying junk picture files
WO2019076102A1 (zh) 一种数据回滚方法、系统、设备及计算机可读存储介质
US20190005057A1 (en) Methods and Devices for File Folder Path Identification and File Folder Cleaning
WO2016110203A1 (zh) 一种文件路径的存储和本地文件的访问方法及装置
AU2014328401B2 (en) Methods, systems, and devices for identifying an application type of unknown data
WO2016000553A1 (zh) 鉴别垃圾目录的方法及装置
CN108846129B (zh) 存储数据访问方法、装置及存储介质
CN114328029B (zh) 一种应用资源的备份方法、装置、电子设备及存储介质
US9665732B2 (en) Secure Download from internet marketplace
CN110365776B (zh) 图片批量下载方法、装置、电子设备及存储介质
CN108459927B (zh) 一种数据备份方法、装置和服务器
US11023426B1 (en) Method and system for detection of open source web application version
CN115277677B (zh) 批量档案挂接方法、装置、计算机设备及存储介质
US10726109B2 (en) Method and system for identifying whether an application is genuine by means of digital watermarks
JP2015523633A (ja) 情報を削除する方法
CN113626409B (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: 15815304

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15321694

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

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 03/05/17)

122 Ep: pct application non-entry in european phase

Ref document number: 15815304

Country of ref document: EP

Kind code of ref document: A1