CN105335405B - The detection method and device of system file - Google Patents
The detection method and device of system file Download PDFInfo
- Publication number
- CN105335405B CN105335405B CN201410366321.3A CN201410366321A CN105335405B CN 105335405 B CN105335405 B CN 105335405B CN 201410366321 A CN201410366321 A CN 201410366321A CN 105335405 B CN105335405 B CN 105335405B
- Authority
- CN
- China
- Prior art keywords
- data
- root directory
- subdirectory
- system file
- database
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种系统文件的检测方法及装置。其中方法包括:定时查找包含系统文件的根目录和至少一个子目录,计算根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据;根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。该方法可供用户随时查看,直观的反应系统文件与数据之间的关系,能够防止系统崩溃。
The invention discloses a system file detection method and device. The methods include: regularly searching the root directory and at least one subdirectory containing system files, calculating the total size of all system files in the root directory as root directory data, and/or the total size of all system files in each subdirectory as subdirectory data , and/or the size of each system file as system file data; store or update root directory data and/or subdirectory data and/or system file data in the database; according to the viewing command entered by the user, the data stored in the database Perform processing to present the processed data in a preset presentation mode; clean up system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value according to the processed data. This method can be viewed by users at any time, intuitively reflects the relationship between system files and data, and can prevent system crashes.
Description
技术领域technical field
本发明涉及互联网技术领域,具体涉及一种系统文件的检测方法及装置。The invention relates to the technical field of the Internet, in particular to a system file detection method and device.
背景技术Background technique
用户访问网站时网站服务器会不停的生成系统文件,并且随着时间的推移系统文件会越来越多,最后将磁盘填满,影响网站的正常使用。现有技术只是通过一些命令来查看各个分区的磁盘的使用状况,例如能够通过命令得知C盘的已用空间已经占用了存储空间的90%,但并不能清楚的知道C盘中具体文件所占用的空间,若想知道文件的大小,只能一个一个目录的查看。现有技术没有提供一种有效的手段,解决查看系统文件繁琐的问题。When users visit the website, the website server will continuously generate system files, and as time goes by, there will be more and more system files, which will eventually fill up the disk and affect the normal use of the website. The prior art only uses some commands to check the usage status of the disks of each partition. For example, it can be known that the used space of the C disk has taken up 90% of the storage space through commands, but it is not clear what the specific files in the C disk are. The occupied space, if you want to know the size of the file, you can only view it one by one. The prior art does not provide an effective means to solve the troublesome problem of checking system files.
发明内容Contents of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的系统文件的检测方法和相应的系统文件的检测装置。In view of the above problems, the present invention is proposed to provide a system file detection method and a corresponding system file detection device that overcome the above problems or at least partially solve the above problems.
根据本发明的一个方面,提供了一种系统文件的检测方法,其包括:According to one aspect of the present invention, a method for detecting system files is provided, which includes:
定时查找包含系统文件的根目录和至少一个子目录,计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;Regularly search for the root directory and at least one subdirectory containing system files, calculate the total size of all system files under the root directory as root directory data, and/or the total size of all system files under each subdirectory as subdirectory data, and /or the size of each system file as system file data;
在数据库中存储或更新所述根目录数据和/或所述子目录数据和/或所述系统文件数据;storing or updating the root directory data and/or the subdirectory data and/or the system file data in a database;
根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;Processing the data stored in the database according to the viewing command input by the user, and presenting the processed data in a preset presentation manner;
根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。According to the processed data, system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value are cleaned up.
根据本发明的另一方面,提供了一种系统文件的检测装置,其包括:According to another aspect of the present invention, a system file detection device is provided, which includes:
查找模块,适于定时查找包含系统文件的根目录和至少一个子目录;A search module, suitable for regularly searching the root directory and at least one subdirectory containing system files;
计算模块,适于计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;A calculation module, adapted to calculate the total size of all system files under the root directory as root directory data, and/or the total size of all system files under each subdirectory as subdirectory data, and/or the size of each system file as system file data;
数据库,适于存储所述根目录数据和/或所述子目录数据和/或所述系统文件数据;a database adapted to store the root directory data and/or the subdirectory data and/or the system file data;
更新模块,适于更新所述数据库中存储的所述根目录数据和/或所述子目录数据和/或所述系统文件数据;An update module, adapted to update the root directory data and/or the subdirectory data and/or the system file data stored in the database;
处理模块,适于根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;The processing module is adapted to process the data stored in the database according to the viewing command input by the user, and present the processed data in a preset display mode;
清理模块,适于根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。The cleaning module is adapted to clean up system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value according to the processed data.
根据本发明提供的方案,通过定时查找包含系统文件的根目录和至少一个子目录,计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;在数据库中存储或更新所述根目录数据和/或所述子目录数据和/或所述系统文件数据;根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。本发明在计算存储根目录数据和/或子目录数据和/或系统文件数据之后,将对应的数据存储在数据库中,以备后期用户随时查看的需要,避免了用户想要查看相关数据时需要临时计算的缺陷,并且以预设的展现方式呈现处理后的数据可以很直观的反应系统文件与数据之间的关系,节省了用户一个一个查看目录的时间,并用户查看的过程进行了简化;根据呈现的数据,进一步对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理,由此可以防止因某些系统文件过大或系统文件大小突然增大而导致的系统崩溃。According to the solution provided by the present invention, by regularly searching the root directory and at least one subdirectory containing system files, the total size of all system files under the root directory is calculated as the root directory data and/or the total size of all system files under each subdirectory Total size as subdirectory data, and/or the size of each system file as system file data; store or update said root directory data and/or said subdirectory data and/or said system file data in a database; according to According to the viewing command input by the user, the data stored in the database is processed, and the processed data is presented in a preset display mode; according to the processed data, the size of the system file is greater than the first predetermined value or the growth of the system file data System files whose speed is greater than the second predetermined value are cleaned up. After calculating and storing the root directory data and/or subdirectory data and/or system file data, the present invention stores the corresponding data in the database, so as to prepare for the needs of later users to view at any time, avoiding the need for users to view related data. The defect of temporary calculation, and presenting the processed data in a preset way can intuitively reflect the relationship between system files and data, saving the time for users to view directories one by one, and simplifying the viewing process for users; According to the presented data, the system files whose size is greater than the first predetermined value or the growth rate of the system file data is greater than the second predetermined value are further cleaned up, thereby preventing certain system files from being too large or suddenly The system crashes due to the increase.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:
图1示出了根据本发明一个实施例的系统文件的检测方法的流程图;Fig. 1 shows the flow chart of the detection method of system file according to one embodiment of the present invention;
图2示出了根据本发明另一个实施例的系统文件的检测方法的流程图;Fig. 2 shows the flowchart of the detection method of system file according to another embodiment of the present invention;
图3示出了根据本发明一个实施例的系统文件的检测装置的结构框图。Fig. 3 shows a structural block diagram of an apparatus for detecting system files according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
图1示出了根据本发明一个实施例的系统文件的检测方法的流程图。如图1所示,该方法包括以下步骤:Fig. 1 shows a flowchart of a system file detection method according to an embodiment of the present invention. As shown in Figure 1, the method includes the following steps:
步骤S100,定时查找包含系统文件的根目录和至少一个子目录,计算根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据。Step S100, regularly search the root directory and at least one subdirectory containing system files, calculate the total size of all system files in the root directory as root directory data, and/or the total size of all system files in each subdirectory as subdirectory data, and/or the size of each system file as system file data.
可选地,可通过定时运行的程序查找包含系统文件的根目录和至少一个子目录,例如设定每天22:00点运行程序。Optionally, a root directory containing system files and at least one subdirectory may be searched through a program that is run regularly, for example, the program is set to run at 22:00 every day.
在计算机的文件系统中,根目录指逻辑驱动器的最上一级目录,它是相对子目录而言的;子目录就是根目录里的一个目录,而子目录里还可以有子目录,子目录是没有限制的。以计算机的文件系统为例来说明根目录与子目录,例如:C:\是根目录,C:\Windows就是C:\的子目录;C:\Windows\System32\就是C:\Windows的子目录。In the file system of the computer, the root directory refers to the top-level directory of the logical drive, which is relative to the subdirectory; the subdirectory is a directory in the root directory, and there can be subdirectories in the subdirectory, and the subdirectory is There is no limit. Take the file system of the computer as an example to illustrate the root directory and subdirectories, for example: C:\ is the root directory, C:\Windows is the subdirectory of C:\; C:\Windows\System32\ is the subdirectory of C:\Windows Table of contents.
步骤S110,在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据。Step S110, storing or updating root directory data and/or subdirectory data and/or system file data in the database.
由于服务器一直处于运行状态,因此在运行过程中会不断生成新的系统文件或更新原有系统文件,因此需要在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据。Since the server is always running, new system files will be continuously generated or original system files will be updated during the running process. Therefore, it is necessary to store or update root directory data and/or subdirectory data and/or system file data in the database.
步骤S120,根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据。Step S120, process the data stored in the database according to the viewing command input by the user, and present the processed data in a preset presentation manner.
当用户想要查看根目录数据和/或子目录数据和/或系统文件数据时,可以通过输入查看命令来查看根目录数据和/或子目录数据和/或系统文件数据。在将根目录数据和/或子目录数据和/或系统文件数据呈现给用户之前,服务器会对数据库所存储的数据进行处理,并以预设的展现方式呈现处理后的数据。When the user wants to view root directory data and/or subdirectory data and/or system file data, he can view root directory data and/or subdirectory data and/or system file data by inputting a view command. Before presenting the root directory data and/or subdirectory data and/or system file data to the user, the server processes the data stored in the database, and presents the processed data in a preset presentation manner.
步骤S130,根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。Step S130, cleaning up system files whose size is greater than a first predetermined value or whose data growth rate is greater than a second predetermined value according to the processed data.
根据步骤S120中对数据的处理对系统文件的大小大于第一预定值例如2G或者系统文件数据的增长速度大于第二预定值例如1G/每天的系统文件进行清理,例如将系统文件移至备选服务器保存。According to the processing of data in step S120, the size of the system files is greater than the first predetermined value, such as 2G, or the growth rate of the system file data is greater than the second predetermined value, such as 1G/per day. System files are cleaned, such as moving the system files to an alternative Saved by the server.
具体地,第一预定值以及第二预定值的设定是根据磁盘的使用状况、磁盘的内存大小以及系统的运行情况进行设定的,举例来说,磁盘的内存大小为200G,磁盘已使用50%,那么第一预定值可设为10G,第二预定值可设为5G,当某系统文件的大小大于10G时可以对该系统文件进行清理,以防止系统文件过大以及大于10G的系统文件过多时导致磁盘的存储空间不够用,影响系统运行而导致系统崩溃;当系统文件的数据增长速度大于5G/每天时,说明该系统文件增长后的数据可能会很大,有可能在下次定时时间还未到达之前,会因为系统文件增长过快导致磁盘没有足够的存储空间来存储该系统文件,使得该系统文件的数据丢失,通过对系统文件数据的增长速度大于5G/每天的系统文件进行清理可以避免上述问题。其中,本领域技术人员可以根据实际应用的需要具体设定第一预定值和第二预定值的数值,本实施例不做具体限制。Specifically, the settings of the first predetermined value and the second predetermined value are set according to the usage status of the disk, the memory size of the disk, and the operating conditions of the system. For example, the memory size of the disk is 200G, and the disk has been used 50%, then the first predetermined value can be set to 10G, and the second predetermined value can be set to 5G. When the size of a certain system file is larger than 10G, the system file can be cleaned up to prevent the system file from being too large and the system file size larger than 10G. When there are too many files, the storage space of the disk is not enough, which affects the operation of the system and causes the system to crash; when the data growth rate of the system files is greater than 5G/day, it means that the data of the system files may be very large after the growth, and it is possible that the next scheduled Before the time arrives, the disk will not have enough storage space to store the system file due to the rapid growth of the system file, causing the data of the system file to be lost. Cleaning can avoid the above problems. Wherein, those skilled in the art can specifically set the values of the first predetermined value and the second predetermined value according to the needs of practical applications, which are not specifically limited in this embodiment.
通过以上描述可知,将上述处理后的数据与第一预定值和第二预定值进行比较可以起到指导对系统文件中哪些文件进行清理的作用,用以及时地发现系统文件的变化情况,避免由此导致的系统文件数据丢失和系统崩溃的问题。From the above description, it can be seen that comparing the above-mentioned processed data with the first predetermined value and the second predetermined value can play a role in guiding which files in the system files to clean up, so as to discover the changes of the system files in time and avoid The resulting system file data loss and system crash issues.
根据本发明上述实施例提供的方法,通过定时查找包含系统文件的根目录和至少一个子目录,计算根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据;根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。在计算存储根目录数据和/或子目录数据和/或系统文件数据之后,将对应的数据存储在数据库中,以备后期用户随时查看的需要,避免了用户想要查看相关数据时需要临时计算的缺陷,并且以预设的展现方式呈现处理后的数据可以很直观的反应系统文件与数据之间的关系,节省了用户一个一个查看目录的时间,并用户查看的过程进行了简化;根据呈现的数据,进一步对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理,由此可以防止因某些系统文件过大或系统文件大小突然增大而导致的系统崩溃。According to the method provided by the above-mentioned embodiments of the present invention, by regularly searching the root directory and at least one subdirectory containing system files, the total size of all system files under the root directory is calculated as root directory data, and/or all system files under each subdirectory as subdirectory data, and/or the size of each system file as system file data; store or update root directory data and/or subdirectory data and/or system file data in the database; view commands entered by the user , process the data stored in the database, and present the processed data in a preset display mode; according to the processed data, the size of the system file is greater than the first predetermined value or the growth rate of the system file data is greater than the second predetermined value System files are cleaned up. After calculating and storing the root directory data and/or subdirectory data and/or system file data, the corresponding data is stored in the database for the later needs of users to view at any time, avoiding the need for temporary calculation when users want to view relevant data defects, and presenting the processed data in a preset presentation mode can intuitively reflect the relationship between system files and data, saving the time for users to view directories one by one, and simplifying the viewing process for users; according to the presentation data, and further clean up the system files whose size is greater than the first predetermined value or the growth rate of the system file data is greater than the second predetermined value, thereby preventing some system files from being too large or suddenly increasing in size resulting in a system crash.
图2示出了根据本发明另一个实施例的系统文件的检测方法的流程图。如图2所示,该方法包括以下步骤:Fig. 2 shows a flowchart of a system file detection method according to another embodiment of the present invention. As shown in Figure 2, the method includes the following steps:
步骤S200,定时查找包含系统文件的根目录和至少一个子目录。Step S200, periodically search for the root directory and at least one subdirectory containing system files.
在计算机的文件系统中,根目录指逻辑驱动器的最上一级目录,它是相对子目录而言的;子目录就是根目录里的一个目录,而子目录里还可以有子目录,子目录是没有限制的。以计算机的文件系统为例来说明根目录与子目录,例如:C:\是根目录,C:\Windows就是C:\的子目录;C:\Windows\System32\就是C:\Windows的子目录。In the file system of the computer, the root directory refers to the top-level directory of the logical drive, which is relative to the subdirectory; the subdirectory is a directory in the root directory, and there can be subdirectories in the subdirectory, and the subdirectory is There is no limit. Take the file system of the computer as an example to illustrate the root directory and subdirectories, for example: C:\ is the root directory, C:\Windows is the subdirectory of C:\; C:\Windows\System32\ is the subdirectory of C:\Windows Table of contents.
具体地,服务器可以启动定时运行的程序进行查找,例如可以选择系统文件变化较为缓慢的每天晚上十二点开始运行程序,通过该程序来查找包含系统文件的根目录和至少一个子目录。Specifically, the server can start a program to be run regularly to search, for example, the program can be selected to run at 12 o'clock every night when the system files change slowly, and the root directory and at least one subdirectory containing the system files can be searched through this program.
步骤S210,检测根目录和/或子目录和/或系统文件的MD5值是否发生变化,若检测到根目录和/或子目录和/或系统文件的MD5值发生变化,则执行步骤S220;若检测到根目录和/或子目录和/或系统文件的MD5值没有发生变化,则执行步骤S230。Step S210, detect whether the MD5 value of the root directory and/or subdirectories and/or system files changes, if it is detected that the MD5 value of the root directory and/or subdirectories and/or system files changes, then perform step S220; if If it is detected that the MD5 value of the root directory and/or subdirectories and/or system files has not changed, step S230 is executed.
利用哈希算法计算根目录和/或子目录和/或系统文件的MD5值,该MD5值是根据根目录和/或子目录和/或系统文件当时的各种综合信息计算得到的,并且根目录和/或子目录和/或系统文件的MD5值是唯一的,当根目录和/或子目录和/或系统文件发生变化时,对应的MD5值也会发生变化。其中综合信息可以是根目录和/或子目录和/或系统文件的名称、修改日期等,本发明对此不做限制。因此可以通过检测根目录和/或子目录和/或系统文件的MD5值是否发生变化,来判断根目录和/或子目录和/或系统文件是否发生变化。Use the hash algorithm to calculate the MD5 value of the root directory and/or subdirectory and/or system file. The MD5 value is calculated based on various comprehensive information of the root directory and/or subdirectory and/or system file at that time, and the root The MD5 value of a directory and/or subdirectory and/or system file is unique, and when the root directory and/or subdirectory and/or system file change, the corresponding MD5 value will also change. The comprehensive information may be the name of the root directory and/or subdirectory and/or system file, modification date, etc., which is not limited in the present invention. Therefore, it can be determined whether the root directory and/or subdirectories and/or system files change by detecting whether the MD5 value of the root directory and/or subdirectories and/or system files changes.
由于服务器的程序每天都会更新系统文件,因此会每天计算根目录和/或子目录和/或系统文件的MD5值,检测根目录和/或子目录和/或系统文件的MD5值是否发生变化主要是通过将当天计算得到的MD5与上次计算得到的MD5进行比较,判断两次的MD5值是否相同,若相同根目录和/或子目录和/或系统文件的MD5值没有发生变化,若不同则根目录和/或子目录和/或系统文件的MD5值发生变化,根目录和/或子目录和/或系统文件发生了变化。采用比较MD5值的方法判断MD5值是否发生变化,因此需要将每次计算得到的MD5值存储在数据库中,以供下一次比较之用。Since the server program will update the system files every day, it will calculate the MD5 value of the root directory and/or subdirectory and/or system file every day, and detect whether the MD5 value of the root directory and/or subdirectory and/or system file has changed mainly By comparing the MD5 calculated on the current day with the MD5 calculated last time, it is judged whether the MD5 values of the two times are the same, if the MD5 values of the same root directory and/or subdirectory and/or system file have not changed, Then the MD5 value of the root directory and/or subdirectories and/or system files changes, and the root directory and/or subdirectories and/or system files change. The method of comparing the MD5 value is used to determine whether the MD5 value has changed, so the MD5 value obtained by each calculation needs to be stored in the database for the next comparison.
步骤S220,计算对应的根目录数据和/或子目录数据和/或系统文件数据。Step S220, calculating corresponding root directory data and/or subdirectory data and/or system file data.
检测到根目录和/或子目录和/或系统文件的MD5值发生变化说明根目录和/或子目录和/或系统文件发生了变化,需要计算对应的根目录数据和/或子目录数据和/或系统文件数据。Detecting that the MD5 value of the root directory and/or subdirectories and/or system files has changed indicates that the root directory and/or subdirectories and/or system files have changed, and it is necessary to calculate the corresponding root directory data and/or subdirectory data and /or system file data.
步骤S230,不对数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新。Step S230, do not update the corresponding root directory data and/or subdirectory data and/or system file data in the database.
检测到根目录和/或子目录和/或系统文件的MD5值没有发生变化说明根目录和/或子目录和/或系统文件没有发生变化,则不对数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新。If it is detected that the MD5 value of the root directory and/or subdirectories and/or system files has not changed, indicating that the root directory and/or subdirectories and/or system files have not changed, then the corresponding root directory data and/or subdirectories in the database will not be updated. Directory data and/or system file data are updated.
步骤S240,在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据。Step S240, storing or updating root directory data and/or subdirectory data and/or system file data in the database.
具体地,在数据库中存储或更新以下数据:根目录标识、根目录数据和根目录标识与根目录数据的映射关系;Specifically, the following data is stored or updated in the database: the root directory identifier, the root directory data, and the mapping relationship between the root directory identifier and the root directory data;
和/或,每个子目录标识、每个子目录数据和子目录标识与子目录数据的映射关系;And/or, each sub-directory identifier, each sub-directory data, and the mapping relationship between the sub-directory identifier and the sub-directory data;
和/或,每个系统文件标识、每个系统文件数据和系统文件标识与系统文件数据的映射关系。And/or, each system file identifier, each system file data, and the mapping relationship between the system file identifier and the system file data.
其中,标识可以是根目录、子目录、系统文件的名称或路径,本发明对此不做限制,本领域技术人员可以根据实际需要对标识做具体限定。标识与数据的映射关系体现了标识与数据之间的对应关系,以根目录C:\的根目录标识为C盘、根目录数据为30G为例,查到标识为C盘,则相应地查到数据为30G。Wherein, the identifier may be the name or path of a root directory, a subdirectory, or a system file, which is not limited in the present invention, and those skilled in the art may specifically define the identifier according to actual needs. The mapping relationship between the identifier and the data reflects the corresponding relationship between the identifier and the data. Taking the root directory C:\ as an example, the root directory identifier is the C drive, and the root directory data is 30G. To the data is 30G.
步骤S250,根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据。In step S250, according to the viewing command input by the user, the data stored in the database is processed, and the processed data is presented in a preset presentation manner.
具体地,可以通过以下方法对数据进行处理并呈现处理后的数据:Specifically, the following methods can be used to process the data and present the processed data:
方法一:根据用户输入的查看数据库中所有数据的命令,提取数据库中所有数据,以树状结构或表格结构呈现所提取的数据。Method 1: Extract all the data in the database according to the command input by the user to view all the data in the database, and present the extracted data in a tree structure or a table structure.
在步骤S240中已将根目录数据和/或子目录数据和/或系统文件数据存储在数据库中,因此用户可以根据需要随时查看相应的数据。当用户输入查看数据库中所有数据的命令时,服务器在接收到用户发送的查看命令后,从数据库中提取所有数据,将所提取的数据以树状结构或表格结构呈现给用户。In step S240, the root directory data and/or subdirectory data and/or system file data have been stored in the database, so the user can check the corresponding data at any time as needed. When the user inputs a command to view all the data in the database, the server extracts all the data from the database after receiving the view command sent by the user, and presents the extracted data to the user in a tree structure or a table structure.
方法二:根据用户输入的查看排序数据的命令,依据根目录数据和/或子目录数据和/或系统文件数据对根目录和/或子目录和/或系统文件进行排序,顺序呈现排序后的数据。Method 2: sort the root directory and/or subdirectories and/or system files based on the root directory data and/or subdirectory data and/or system file data according to the command entered by the user to view sorted data, and present the sorted files in sequence data.
在步骤S240中已将根目录数据和/或子目录数据和/或系统文件数据存储在数据库中,因此用户可以根据需要随时查看相应的数据。当用户输入查看排序数据的命令时,服务器在接收到用户发送的查看排序数据的命令后,先对数据库中的所有数据进行排序例如以从大到小的顺序排序,将最大的数据排在最前面,在依据根目录数据和/或子目录数据和/或系统文件数据对根目录和/或子目录和/或系统文件进行排序之后,顺序呈现排序后的数据。In step S240, the root directory data and/or subdirectory data and/or system file data have been stored in the database, so the user can check the corresponding data at any time as required. When the user enters the command to view the sorted data, after receiving the command to view the sorted data from the user, the server first sorts all the data in the database. In the foregoing, after the root directory and/or subdirectories and/or system files are sorted according to the root directory data and/or subdirectory data and/or system file data, the sorted data is presented sequentially.
方法三:根据用户输入的查看增长速度的命令,依据根目录数据和/或子目录数据和/或系统文件数据的增长速度对根目录和/或子目录和/或系统文件进行排序,顺序呈现排序后的数据。Method 3: sort the root directory and/or subdirectories and/or system files according to the growth rate of the root directory data and/or subdirectory data and/or system file data according to the command to view the growth rate entered by the user, and present them in order sorted data.
在步骤S240中已将根目录数据和/或子目录数据和/或系统文件数据存储在数据库中,因此用户可以根据需要随时查看相应的数据。当用户输入查看增长速度的命令时,服务器在接收到用户发送的查看增长速度的命令后,依据根目录数据和/或子目录数据和/或系统文件数据的增长速度对根目录和/或子目录和/或系统文件进行排序,顺序呈现排序后的数据。其中,增长速度体现了数据的变化情况,例如1天内数据由1G增长到10G。In step S240, the root directory data and/or subdirectory data and/or system file data have been stored in the database, so the user can check the corresponding data at any time as required. When the user inputs a command to check the growth rate, after receiving the command to check the growth rate sent by the user, the server checks the root directory and/or subdirectory data according to the growth rate of the root directory data and/or subdirectory data and/or system file data. Directories and/or system files are sorted, and the sorted data is presented sequentially. Among them, the growth rate reflects the change of data, for example, the data increases from 1G to 10G within one day.
方法四:根据用户输入的查看大于设定阈值的数据的命令,将根目录数据和/或子目录数据和/或系统文件数据与设定阈值进行比较,呈现大于设定阈值的数据。Method 4: compare the root directory data and/or subdirectory data and/or system file data with the set threshold according to the command entered by the user to view data greater than the set threshold, and present the data greater than the set threshold.
在步骤S240中已将根目录数据和/或子目录数据和/或系统文件数据存储在数据库中,因此用户可以根据需要随时查看相应的数据。当用户输入查看大于设定阈值的数据的命令时,服务器在接收到用户发送的查看大于设定阈值的数据的命令后,将根目录数据和/或子目录数据和/或系统文件数据与设定阈值进行比较,呈现大于设定阈值的数据。例如,用户输入查看大于2G的数据的命令,服务器在接收到命令后,将根目录数据和/或子目录数据和/或系统文件数据与阈值2G进行比较,然后呈现大于2G的数据。In step S240, the root directory data and/or subdirectory data and/or system file data have been stored in the database, so the user can check the corresponding data at any time as required. When the user inputs a command to view data greater than the set threshold, the server will combine the root directory data and/or subdirectory data and/or system file data with the set Compared with the set threshold, the data greater than the set threshold is presented. For example, the user inputs a command to view data larger than 2G, and after receiving the command, the server compares the root directory data and/or subdirectory data and/or system file data with the threshold 2G, and then presents the data larger than 2G.
上述方法一至四介绍了数据的展现方式,但本发明并不限于此,本领域技术人员可根据实际需要设置展现方式,在此不再赘述。The above-mentioned methods 1 to 4 have introduced the display methods of data, but the present invention is not limited thereto, and those skilled in the art can set the display methods according to actual needs, which will not be repeated here.
步骤S260,根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。Step S260, cleaning up system files whose size is greater than a first predetermined value or whose data growth rate is greater than a second predetermined value according to the processed data.
根据步骤S250中对数据的处理对系统文件的大小大于第一预定值例如2G或者系统文件数据的增长速度大于第二预定值例如1G/每天的系统文件进行清理,例如将系统文件移至备选服务器保存。According to the processing of data in step S250, the system files whose size is greater than a first predetermined value such as 2G or the growth rate of system file data is greater than a second predetermined value such as 1G/per day are cleaned up, for example, the system files are moved to an alternative Saved by the server.
具体地,第一预定值以及第二预定值的设定是根据磁盘的使用状况、磁盘的内存大小以及系统的运行情况进行设定的,举例来说,磁盘的内存大小为200G,磁盘已使用50%,那么第一预定值可设为10G,第二预定值可设为5G,当某系统文件的大小大于10G时可以对该系统文件进行清理,以防止系统文件过大以及大于10G的系统文件过多时导致磁盘的存储空间不够用,影响系统运行而导致系统崩溃;当系统文件的数据增长速度大于5G/每天时,说明该系统文件增长后的数据可能会很大,有可能在下次定时时间还未到达之前,会因为系统文件增长过快导致磁盘没有足够的存储空间来存储该系统文件,使得该系统文件的数据丢失,通过对系统文件数据的增长速度大于5G/每天的系统文件进行清理可以避免上述问题。其中,本领域技术人员可以根据实际应用的需要具体设定第一预定值和第二预定值的数值,本实施例不做具体限制。Specifically, the settings of the first predetermined value and the second predetermined value are set according to the usage status of the disk, the memory size of the disk, and the operating conditions of the system. For example, the memory size of the disk is 200G, and the disk has been used 50%, then the first predetermined value can be set to 10G, and the second predetermined value can be set to 5G. When the size of a certain system file is larger than 10G, the system file can be cleaned up to prevent the system file from being too large and the system file size larger than 10G. When there are too many files, the storage space of the disk is not enough, which affects the operation of the system and causes the system to crash; when the data growth rate of the system files is greater than 5G/day, it means that the data of the system files may be very large after the growth, and it is possible that the next scheduled Before the time arrives, the disk will not have enough storage space to store the system file due to the rapid growth of the system file, causing the data of the system file to be lost. Cleaning can avoid the above problems. Wherein, those skilled in the art can specifically set the values of the first predetermined value and the second predetermined value according to the needs of practical applications, which are not specifically limited in this embodiment.
通过以上描述可知,将上述处理后的数据与第一预定值和第二预定值进行比较可以起到指导对系统文件中哪些文件进行清理的作用,用以及时地发现系统文件的变化情况,避免由此导致的系统文件数据丢失和系统崩溃的问题。From the above description, it can be seen that comparing the above-mentioned processed data with the first predetermined value and the second predetermined value can play a role in guiding which files in the system files to clean up, so as to discover the changes of the system files in time and avoid The resulting system file data loss and system crash issues.
根据本发明上述实施例提供的方法,通过定时查找包含系统文件的根目录和至少一个子目录,检测所述根目录和/或所述子目录和/或所述系统文件的MD5值是否发生变化,若检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值发生变化,则计算对应的根目录数据和/或子目录数据和/或系统文件数据;若检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值没有发生变化,则不对所述数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新,在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据,根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。通过比较MD5值,可以降低服务器的计算任务,对于数据没有变化的根目录和/或子目录和/或系统文件可以不进行相应数据的计算,在计算存储根目录数据和/或子目录数据和/或系统文件数据之后,将对应的数据存储在数据库中,以备后期用户随时查看的需要,避免了用户想要查看相关数据时需要临时计算的缺陷,并且以预设的展现方式呈现处理后的数据可以很直观的反应系统文件与数据之间的关系,节省了用户一个一个查看目录的时间,并用户查看的过程进行了简化;根据呈现的数据,进一步对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理,由此可以防止因某些系统文件过大或系统文件大小突然增大而导致的系统崩溃。According to the method provided by the above-mentioned embodiments of the present invention, by regularly searching the root directory and at least one subdirectory containing the system file, it is detected whether the MD5 value of the root directory and/or the subdirectory and/or the system file changes. , if it is detected that the MD5 value of the root directory and/or the subdirectory and/or the system file changes, then calculate the corresponding root directory data and/or subdirectory data and/or system file data; if detected If the MD5 value of the root directory and/or the subdirectory and/or the system file has not changed, then the corresponding root directory data and/or subdirectory data and/or system file data in the database will not be processed. Update, store or update the root directory data and/or subdirectory data and/or system file data in the database, process the data stored in the database according to the view command input by the user, and present the processed data in a preset presentation mode Data: according to the processed data, system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value are cleaned up. By comparing the MD5 value, the calculation task of the server can be reduced. For the root directory and/or subdirectory and/or system files whose data has not changed, the calculation of the corresponding data may not be performed, and the calculation and storage of the root directory data and/or subdirectory data and After / or system file data, store the corresponding data in the database for future users to view at any time, avoiding the defect of temporary calculation when the user wants to view relevant data, and present the processed data in a preset presentation mode The data can intuitively reflect the relationship between system files and data, which saves the time for users to view directories one by one, and simplifies the process of viewing by users; according to the presented data, the size of system files is further determined to be larger than the first predetermined The value or the growth rate of the system file data is greater than the second predetermined value to clean up the system files, thereby preventing the system from crashing due to the excessive size of some system files or the sudden increase in the size of the system files.
图3示出了根据本发明一个实施例的系统文件的检测装置的结构框图。如图3所示,该装置包括:查找模块300、计算模块310、数据库320、更新模块330、处理模块340、清理模块350。Fig. 3 shows a structural block diagram of an apparatus for detecting system files according to an embodiment of the present invention. As shown in FIG. 3 , the device includes: a search module 300 , a calculation module 310 , a database 320 , an update module 330 , a processing module 340 , and a cleaning module 350 .
查找模块300,适于定时查找包含系统文件的根目录和至少一个子目录。The search module 300 is adapted to regularly search the root directory and at least one subdirectory containing system files.
计算模块310,适于计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据。Calculation module 310, adapted to calculate the total size of all system files under the root directory as root directory data, and/or the total size of all system files under each subdirectory as subdirectory data, and/or the size of each system file as system file data.
数据库320,适于存储所述根目录数据和/或所述子目录数据和/或所述系统文件数据。The database 320 is adapted to store the root directory data and/or the subdirectory data and/or the system file data.
数据库320具体适于存储以下数据:The database 320 is specifically adapted to store the following data:
根目录标识、根目录数据和根目录标识与根目录数据的映射关系;The root directory identifier, the root directory data, and the mapping relationship between the root directory identifier and the root directory data;
和/或,每个子目录标识、每个子目录数据和子目录标识与子目录数据的映射关系;And/or, each sub-directory identifier, each sub-directory data, and the mapping relationship between the sub-directory identifier and the sub-directory data;
和/或,每个系统文件标识、每个系统文件数据和系统文件标识与系统文件数据的映射关系。And/or, each system file identifier, each system file data, and the mapping relationship between the system file identifier and the system file data.
更新模块330,适于更新所述数据库中存储的根目录数据和/或所述子目录数据和/或所述系统文件数据。The update module 330 is adapted to update the root directory data and/or the subdirectory data and/or the system file data stored in the database.
更新模块330具体适于更新以下数据:The update module 330 is specifically adapted to update the following data:
根目录标识、根目录数据和根目录标识与根目录数据的映射关系;The root directory identifier, the root directory data, and the mapping relationship between the root directory identifier and the root directory data;
和/或,每个子目录标识、每个子目录数据和子目录标识与子目录数据的映射关系;And/or, each sub-directory identifier, each sub-directory data, and the mapping relationship between the sub-directory identifier and the sub-directory data;
和/或,每个系统文件标识、每个系统文件数据和系统文件标识与系统文件数据的映射关系。And/or, each system file identifier, each system file data, and the mapping relationship between the system file identifier and the system file data.
处理模块340,适于根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据。The processing module 340 is adapted to process the data stored in the database according to the viewing command input by the user, and present the processed data in a preset presentation manner.
处理模块340进一步适于:根据用户输入的查看数据库中所有数据的命令,提取数据库中所有数据,以树状结构或表格结构呈现所提取的数据。The processing module 340 is further adapted to: extract all the data in the database according to the command input by the user to view all the data in the database, and present the extracted data in a tree structure or a table structure.
处理模块340进一步适于:根据用户输入的查看排序数据的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。The processing module 340 is further adapted to: according to the command input by the user for viewing sorted data, sort the root directory and/or the subdirectory data according to the root directory data and/or the subdirectory data and/or the system file data The directories and/or the system files are sorted, and the sorted data is presented sequentially.
处理模块340进一步适于:根据用户输入的查看增长速度的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据的增长速度对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。The processing module 340 is further adapted to: according to the command to view the growth rate input by the user, the root directory and/or the root directory and/or The subdirectories and/or the system files are sorted, and the sorted data is presented sequentially.
处理模块340进一步适于:根据用户输入的查看大于设定阈值的数据的命令,将所述根目录数据和/或所述子目录数据和/或所述系统文件数据与所述设定阈值进行比较,呈现大于所述设定阈值的数据。The processing module 340 is further adapted to: compare the root directory data and/or the subdirectory data and/or the system file data with the set threshold according to the command input by the user to view data larger than the set threshold For comparison, data greater than the set threshold is presented.
清理模块350,适于根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。The cleaning module 350 is adapted to clean up system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value according to the processed data.
该装置还包括:检测模块360,适于检测所述根目录和/或所述子目录和/或所述系统文件的MD5值是否发生变化。The device also includes: a detection module 360, adapted to detect whether the MD5 value of the root directory and/or the subdirectory and/or the system file changes.
计算模块310,进一步适于若检测模块360检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值发生变化,则计算对应的根目录数据和/或子目录数据和/或系统文件数据。The calculation module 310 is further adapted to calculate the corresponding root directory data and/or subdirectory data if the detection module 360 detects that the MD5 value of the root directory and/or the subdirectory and/or the system file changes and/or system file data.
更新模块330,进一步适于若检测模块360检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值没有发生变化,则不对所述数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新。The update module 330 is further adapted to not update the corresponding root directory data and /or subdirectory data and/or system file data are updated.
根据本发明上述实施例提供的装置,通过定时查找包含系统文件的根目录和至少一个子目录,计算根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;在数据库中存储或更新根目录数据和/或子目录数据和/或系统文件数据;根据用户输入的查看命令,对数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。在计算存储根目录数据和/或子目录数据和/或系统文件数据之后,将对应的数据存储在数据库中,以备后期用户随时查看的需要,避免了用户想要查看相关数据时需要临时计算的缺陷,并且以预设的展现方式呈现处理后的数据可以很直观的反应系统文件与数据之间的关系,节省了用户一个一个查看目录的时间,并用户查看的过程进行了简化;根据呈现的数据,进一步对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理,由此可以防止因某些系统文件过大或系统文件大小突然增大而导致的系统崩溃。According to the device provided by the above-mentioned embodiments of the present invention, by regularly searching the root directory and at least one subdirectory containing system files, the total size of all system files under the root directory is calculated as root directory data, and/or all system files under each subdirectory as subdirectory data, and/or the size of each system file as system file data; store or update root directory data and/or subdirectory data and/or system file data in the database; view commands entered by the user , process the data stored in the database, and present the processed data in a preset display mode; according to the processed data, the size of the system file is greater than the first predetermined value or the growth rate of the system file data is greater than the second predetermined value System files are cleaned up. After calculating and storing the root directory data and/or subdirectory data and/or system file data, the corresponding data is stored in the database for the later needs of users to view at any time, avoiding the need for temporary calculation when users want to view relevant data defects, and presenting the processed data in a preset presentation mode can intuitively reflect the relationship between system files and data, saving the time for users to view directories one by one, and simplifying the viewing process for users; according to the presentation data, and further clean up the system files whose size is greater than the first predetermined value or the growth rate of the system file data is greater than the second predetermined value, thereby preventing some system files from being too large or suddenly increasing in size resulting in a system crash.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的系统文件的检测设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the system file detection device according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
本发明公开了:A1、一种系统文件的检测方法,其包括:The invention discloses: A1, a method for detecting system files, which includes:
定时查找包含系统文件的根目录和至少一个子目录,计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;Regularly search for the root directory and at least one subdirectory containing system files, calculate the total size of all system files under the root directory as root directory data, and/or the total size of all system files under each subdirectory as subdirectory data, and /or the size of each system file as system file data;
在数据库中存储或更新所述根目录数据和/或所述子目录数据和/或所述系统文件数据;storing or updating the root directory data and/or the subdirectory data and/or the system file data in a database;
根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;Processing the data stored in the database according to the viewing command input by the user, and presenting the processed data in a preset presentation manner;
根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。According to the processed data, system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value are cleaned up.
A2、根据A1所述的方法,其中,在数据库中存储或更新所述根目录数据和/或所述子目录数据和/或所述系统文件数据进一步包括:A2. The method according to A1, wherein storing or updating the root directory data and/or the subdirectory data and/or the system file data in the database further comprises:
在数据库中存储或更新以下数据:Store or update the following data in the database:
根目录标识、根目录数据和根目录标识与根目录数据的映射关系;The root directory identifier, the root directory data, and the mapping relationship between the root directory identifier and the root directory data;
和/或,每个子目录标识、每个子目录数据和子目录标识与子目录数据的映射关系;And/or, each sub-directory identifier, each sub-directory data, and the mapping relationship between the sub-directory identifier and the sub-directory data;
和/或,每个系统文件标识、每个系统文件数据和系统文件标识与系统文件数据的映射关系。And/or, each system file identifier, each system file data, and the mapping relationship between the system file identifier and the system file data.
A3、根据A1或A2所述的方法,其中,在计算所述根目录数据和/或所述子目录数据和/或所述系统文件数据之前还包括:检测所述根目录和/或所述子目录和/或所述系统文件的MD5值是否发生变化;A3. The method according to A1 or A2, wherein, before calculating the root directory data and/or the subdirectory data and/or the system file data, it also includes: detecting the root directory and/or the Whether the MD5 value of the subdirectory and/or the system file changes;
若检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值发生变化,则计算对应的根目录数据和/或子目录数据和/或系统文件数据;If it is detected that the MD5 value of the root directory and/or the subdirectory and/or the system file changes, then calculate the corresponding root directory data and/or subdirectory data and/or system file data;
若检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值没有发生变化,则不对所述数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新。If it is detected that the MD5 value of the root directory and/or the subdirectory and/or the system file has not changed, then the corresponding root directory data and/or subdirectory data and/or system file in the database will not be updated. The data is updated.
A4、根据A1或A2或A3所述的方法,其中,根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据进一步包括:A4. The method according to A1 or A2 or A3, wherein, according to the viewing command input by the user, processing the data stored in the database, and presenting the processed data in a preset presentation mode further includes:
根据用户输入的查看数据库中所有数据的命令,提取数据库中所有数据,以树状结构或表格结构呈现所提取的数据。Extract all the data in the database according to the command entered by the user to view all the data in the database, and present the extracted data in a tree structure or a table structure.
A5、根据A1或A2或A3所述的方法,其中,根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据进一步包括:A5. The method according to A1 or A2 or A3, wherein, according to the viewing command input by the user, processing the data stored in the database, and presenting the processed data in a preset presentation mode further includes:
根据用户输入的查看排序数据的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。According to the order of viewing and sorting data input by the user, the root directory and/or the subdirectory and/or the system are sorted according to the root directory data and/or the subdirectory data and/or the system file data The file is sorted, and the sorted data is presented sequentially.
A6、根据A1或A2或A3所述的方法,其中,根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据进一步包括:A6. The method according to A1 or A2 or A3, wherein, according to the viewing command input by the user, processing the data stored in the database, and presenting the processed data in a preset presentation manner further includes:
根据用户输入的查看增长速度的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据的增长速度对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。According to the command to check the growth rate input by the user, the root directory and/or the subdirectory and/or the growth rate of the root directory data and/or the subdirectory data and/or the system file data The system files are sorted, and the sorted data is presented sequentially.
A7、根据A1或A2或A3所述的方法,其中,根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据进一步包括:A7. The method according to A1 or A2 or A3, wherein, according to the viewing command input by the user, processing the data stored in the database, and presenting the processed data in a preset presentation mode further includes:
根据用户输入的查看大于设定阈值的数据的命令,将所述根目录数据和/或所述子目录数据和/或所述系统文件数据与所述设定阈值进行比较,呈现大于所述设定阈值的数据。According to the command input by the user to view the data greater than the set threshold, compare the root directory data and/or the subdirectory data and/or the system file data with the set threshold, and show that the data is greater than the set threshold. Threshold data.
本发明还公开了:B8、一种系统文件的检测装置,其包括:The present invention also discloses: B8, a system file detection device, which includes:
查找模块,适于定时查找包含系统文件的根目录和至少一个子目录;A search module, suitable for regularly searching the root directory and at least one subdirectory containing system files;
计算模块,适于计算所述根目录下所有系统文件的总大小作为根目录数据、和/或每个子目录下所有系统文件的总大小作为子目录数据、和/或每个系统文件的大小作为系统文件数据;A calculation module, adapted to calculate the total size of all system files under the root directory as root directory data, and/or the total size of all system files under each subdirectory as subdirectory data, and/or the size of each system file as system file data;
数据库,适于存储所述根目录数据和/或所述子目录数据和/或所述系统文件数据;a database adapted to store the root directory data and/or the subdirectory data and/or the system file data;
更新模块,适于更新所述数据库中存储的所述根目录数据和/或所述子目录数据和/或所述系统文件数据;An update module, adapted to update the root directory data and/or the subdirectory data and/or the system file data stored in the database;
处理模块,适于根据用户输入的查看命令,对所述数据库所存储的数据进行处理,以预设的展现方式呈现处理后的数据;The processing module is adapted to process the data stored in the database according to the viewing command input by the user, and present the processed data in a preset display mode;
清理模块,适于根据处理后的数据对系统文件的大小大于第一预定值或者系统文件数据的增长速度大于第二预定值的系统文件进行清理。The cleaning module is adapted to clean up system files whose size is greater than a first predetermined value or whose growth rate of system file data is greater than a second predetermined value according to the processed data.
B9、根据B8所述的装置,其中,所述数据库存储或所述更新模块更新以下数据:B9. The device according to B8, wherein the database stores or the update module updates the following data:
根目录标识、根目录数据和根目录标识与根目录数据的映射关系;The root directory identifier, the root directory data, and the mapping relationship between the root directory identifier and the root directory data;
和/或,每个子目录标识、每个子目录数据和子目录标识与子目录数据的映射关系;And/or, each sub-directory identifier, each sub-directory data, and the mapping relationship between the sub-directory identifier and the sub-directory data;
和/或,每个系统文件标识、每个系统文件数据和系统文件标识与系统文件数据的映射关系。And/or, each system file identifier, each system file data, and the mapping relationship between the system file identifier and the system file data.
B10、根据B8或B9所述的装置,其中,还包括:检测模块,适于检测所述根目录和/或所述子目录和/或所述系统文件的MD5值是否发生变化;B10. The device according to B8 or B9, further comprising: a detection module adapted to detect whether the MD5 value of the root directory and/or the subdirectory and/or the system file changes;
所述计算模块进一步适于:若所述检测模块检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值发生变化,则计算对应的根目录数据和/或子目录数据和/或系统文件数据;The calculation module is further adapted to: if the detection module detects that the MD5 value of the root directory and/or the subdirectory and/or the system file changes, calculate the corresponding root directory data and/or subdirectory directory data and/or system file data;
所述更新模块进一步适于:若所述检测模块检测到所述根目录和/或所述子目录和/或所述系统文件的MD5值没有发生变化,则不对所述数据库中对应的根目录数据和/或子目录数据和/或系统文件数据进行更新。The update module is further adapted to: if the detection module detects that the MD5 value of the root directory and/or the subdirectory and/or the system file has not changed, then the corresponding root directory in the database is not updated. data and/or subdirectory data and/or system file data are updated.
B11、根据B8或B9或B10所述的装置,其中,处理模块进一步适于:B11. The device according to B8 or B9 or B10, wherein the processing module is further adapted to:
根据用户输入的查看数据库中所有数据的命令,提取数据库中所有数据,以树状结构或表格结构呈现所提取的数据。Extract all the data in the database according to the command entered by the user to view all the data in the database, and present the extracted data in a tree structure or a table structure.
B12、根据B8或B9或B10所述的装置,其中,处理模块进一步适于:B12. The device according to B8 or B9 or B10, wherein the processing module is further adapted to:
根据用户输入的查看排序数据的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。According to the order of viewing and sorting data input by the user, the root directory and/or the subdirectory and/or the system are sorted according to the root directory data and/or the subdirectory data and/or the system file data The file is sorted, and the sorted data is presented sequentially.
B13、根据B8或B9或B10所述的装置,其中,处理模块进一步适于:B13. The device according to B8 or B9 or B10, wherein the processing module is further adapted to:
根据用户输入的查看增长速度的命令,依据所述根目录数据和/或所述子目录数据和/或所述系统文件数据的增长速度对所述根目录和/或所述子目录和/或所述系统文件进行排序,顺序呈现排序后的数据。According to the command to check the growth rate input by the user, the root directory and/or the subdirectory and/or the growth rate of the root directory data and/or the subdirectory data and/or the system file data The system files are sorted, and the sorted data is presented sequentially.
B14、根据B8或B9或B10所述的装置,其中,处理模块进一步适于:B14. The device according to B8 or B9 or B10, wherein the processing module is further adapted to:
根据用户输入的查看大于设定阈值的数据的命令,将所述根目录数据和/或所述子目录数据和/或所述系统文件数据与所述设定阈值进行比较,呈现大于所述设定阈值的数据。According to the command input by the user to view the data greater than the set threshold, compare the root directory data and/or the subdirectory data and/or the system file data with the set threshold, and show that the data is greater than the set threshold. threshold data.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410366321.3A CN105335405B (en) | 2014-07-29 | 2014-07-29 | The detection method and device of system file |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410366321.3A CN105335405B (en) | 2014-07-29 | 2014-07-29 | The detection method and device of system file |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105335405A CN105335405A (en) | 2016-02-17 |
| CN105335405B true CN105335405B (en) | 2018-10-12 |
Family
ID=55285941
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410366321.3A Active CN105335405B (en) | 2014-07-29 | 2014-07-29 | The detection method and device of system file |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105335405B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113760856B (en) * | 2020-06-05 | 2024-06-18 | 京东科技控股股份有限公司 | Database management method and device, computer readable storage medium and electronic equipment |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102077179A (en) * | 2008-06-30 | 2011-05-25 | 日立系统解决方案有限公司 | File management device |
| CN102402571A (en) * | 2010-09-09 | 2012-04-04 | 佳能株式会社 | Data processing apparatus, control method |
| CN102880713A (en) * | 2012-09-29 | 2013-01-16 | 北京奇虎科技有限公司 | File deleting method and file deleting device |
-
2014
- 2014-07-29 CN CN201410366321.3A patent/CN105335405B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102077179A (en) * | 2008-06-30 | 2011-05-25 | 日立系统解决方案有限公司 | File management device |
| CN102402571A (en) * | 2010-09-09 | 2012-04-04 | 佳能株式会社 | Data processing apparatus, control method |
| CN102880713A (en) * | 2012-09-29 | 2013-01-16 | 北京奇虎科技有限公司 | File deleting method and file deleting device |
Non-Patent Citations (4)
| Title |
|---|
| "专业软件出手,文件整理无忧";王莹;《电脑迷》;20120131;全文 * |
| "垃圾文件,你惹着我了";党伟;《电脑爱好者》;20081231;全文 * |
| "硬盘数据管理专家DiskState";如果不爱;《电脑迷》;20060331;全文 * |
| "磁盘空间占用"大户"查看我最行";dancer;《Solutions&Tips 技术应用》;20131231;全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105335405A (en) | 2016-02-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103645914B (en) | Software cleaning method and device | |
| US9165089B2 (en) | Presenting unique search result contexts | |
| CN103984776B (en) | Repeated image identification method and image search duplicate removal method and device | |
| CN106294206B (en) | Cache data processing method and device | |
| CN104516966A (en) | High-availability solving method and device of database cluster | |
| CN103984757B (en) | Search results pages is inserted the method and system of news information entry | |
| CN104572920A (en) | Data arrangement method and data arrangement device | |
| JP2015510174A (en) | Location independent files | |
| CN107608860A (en) | A kind of method, apparatus, the equipment of error log classification storage | |
| CN109496292A (en) | Disk management method, disk management device and electronic device | |
| CN110209798B (en) | Data display method and device of redis database | |
| CN106599247B (en) | Method and device for merging data files in LSM-tree structure | |
| CN118229361A (en) | Content management system and method of operating the same | |
| CN106201602B (en) | Label providing method, label obtaining method, server and electronic equipment | |
| CN106899879A (en) | A kind for the treatment of method and apparatus of multi-medium data | |
| CN105589847A (en) | Weighted article identification method and device | |
| CN105335405B (en) | The detection method and device of system file | |
| CN106681665A (en) | Cache data persistent storage method and device | |
| WO2017107835A1 (en) | Browser starting method and apparatus | |
| CN105159921A (en) | Method and apparatus for de-duplicating point-of-interest (POI) data in map | |
| CN106201601B (en) | A kind of file clean-up method, electronic equipment and server | |
| CN106681837A (en) | Data sheet based data eliminating method and device | |
| CN105553767A (en) | Website backdoor file detection method and device | |
| CN105224583A (en) | The method for cleaning of journal file and device | |
| CN113220992B (en) | A method, system and medium for recommending information flow content |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20220718 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |