CN114064567B - File scanning method, device, equipment and computer storage medium - Google Patents

File scanning method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN114064567B
CN114064567B CN202111277664.9A CN202111277664A CN114064567B CN 114064567 B CN114064567 B CN 114064567B CN 202111277664 A CN202111277664 A CN 202111277664A CN 114064567 B CN114064567 B CN 114064567B
Authority
CN
China
Prior art keywords
file
scanning
target
attribute information
characteristic value
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
Application number
CN202111277664.9A
Other languages
Chinese (zh)
Other versions
CN114064567A (en
Inventor
林文辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111277664.9A priority Critical patent/CN114064567B/en
Publication of CN114064567A publication Critical patent/CN114064567A/en
Application granted granted Critical
Publication of CN114064567B publication Critical patent/CN114064567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/172Caching, prefetching or hoarding of files

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)

Abstract

本申请公开了一种文件扫描方法、装置、设备及计算机存储介质。该方法包括:监控配置路径下的文件夹所占用的存储空间大小,得到存储空间大小发生变化的目标文件夹;获取目标文件夹中的目标文件、目标文件对应的目标源文件的第一特征值和目标源文件的第一属性信息;根据目标文件、第一特征值和第一属性信息,对目标文件进行扫描,得到扫描结果。采用本申请提供的文件扫描方法、装置、设备及计算机存储介质,可以提升监控效率,便于及时发现存储空间大小发生变化的目标文件夹,从而可以及时对目标文件夹中的目标文件进行扫描。

The present application discloses a file scanning method, device, equipment and computer storage medium. The method comprises: monitoring the storage space occupied by the folder under the configuration path, obtaining the target folder whose storage space size has changed; obtaining the target file in the target folder, the first characteristic value of the target source file corresponding to the target file and the first attribute information of the target source file; scanning the target file according to the target file, the first characteristic value and the first attribute information to obtain the scanning result. The file scanning method, device, equipment and computer storage medium provided by the present application can improve the monitoring efficiency, facilitate timely discovery of the target folder whose storage space size has changed, and thus can timely scan the target file in the target folder.

Description

File scanning method, device, equipment and computer storage medium
Technical Field
The present application relates to the field of data monitoring technologies, and in particular, to a method, an apparatus, a device, and a computer storage medium for scanning a file.
Background
With the popularity of networks, a large number of files need to be transmitted through the network, but due to various uncertain factors in the file transmission process, errors or deletions in the file transmission process are likely to occur.
In order to ensure the accuracy and the integrity of the received file, the received file needs to be scanned, in the prior art, all the files are monitored through monitoring software, and when the changed file is monitored, the changed file is scanned through the scanning software, so that whether the received file is accurate and complete is determined.
However, many files have high requirements on timeliness, the scanning needs to be completed as soon as possible to determine whether the files are accurate and complete, and the existing monitoring software is used for monitoring all the files, so that when the number of the files is too large, it is difficult to monitor the changed files in time, and therefore the files cannot be scanned in time.
Disclosure of Invention
The embodiment of the application provides a file scanning method, device, equipment and computer storage medium, which can at least solve the problem that in the prior art, when the number of files is too large, the changed files are difficult to monitor in time, so that the files cannot be scanned in time.
In a first aspect, an embodiment of the present application provides a method for scanning a file, including:
Monitoring the size of the storage space occupied by the folders under the configuration path to obtain target folders with the changed storage space size;
Acquiring a target file in a target folder, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file;
And scanning the target file according to the target file, the first characteristic value and the first attribute information to obtain a scanning result.
In a second aspect, an embodiment of the present application provides a document scanning apparatus, including:
The monitoring module is used for monitoring the size of the storage space occupied by the folders under the configuration path to obtain target folders with the changed size of the storage space;
The acquisition module is used for acquiring the target file in the target folder, the first characteristic value of the target source file corresponding to the target file and the first attribute information of the target source file;
And the scanning module is used for scanning the target file according to the target file, the first characteristic value and the first attribute information to obtain a scanning result.
In a third aspect, an embodiment of the present application provides an electronic device, the device comprising a processor and a memory storing computer program instructions;
the processor when executing the computer program instructions implements a file scanning method as shown in any of the embodiments of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of scanning a file as shown in any of the embodiments of the first aspect.
According to the file scanning method, the device, the equipment and the computer storage medium, the target file with the changed storage space is obtained by monitoring the storage space occupied by the file under the configuration path, the target file in the target file, the first characteristic value of the target source file corresponding to the target file and the first attribute information of the target source file are obtained, and then the target file is scanned according to the target file, the first characteristic value and the first attribute information, so that a scanning result is obtained. Therefore, the granularity of monitoring is the folder level, not the file level, the number of monitoring objects is reduced, the monitoring efficiency can be improved, and the target folders with the changed storage space can be found conveniently in time, so that the target files in the target folders can be scanned in time.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings that are needed to be used in the embodiments of the present application will be briefly described, and it is possible for a person skilled in the art to obtain other drawings according to these drawings without inventive effort.
FIG. 1 is a flow chart illustrating a method of scanning a file according to an exemplary embodiment;
FIG. 2 is a flowchart illustrating another method of scanning a file according to an exemplary embodiment;
FIG. 3 is a flowchart illustrating yet another method of scanning a file according to an exemplary embodiment;
FIG. 4 is an architecture diagram of a file scanning system, shown in accordance with an exemplary embodiment;
FIG. 5 is a schematic diagram of a document scanning device according to an exemplary embodiment;
fig. 6 is a schematic diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings and the detailed embodiments. It should be understood that the particular embodiments described herein are meant to be illustrative of the application only and not limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the application by showing examples of the application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of additional identical elements in a process, method, article, or apparatus that comprises an element.
Fig. 1 is a schematic flow chart of a file scanning method according to an embodiment of the present application.
As shown in fig. 1, the document scanning method may include the steps of:
firstly, S110, monitoring the size of a storage space occupied by a folder in a configuration path to obtain a target folder with the size of the storage space changed;
S120, acquiring a target file in a target folder, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file;
Then, S130, scanning the target file according to the target file, the first feature value and the first attribute information, to obtain a scanning result.
The method comprises the steps of obtaining a target folder with the size of storage space changed by monitoring the size of storage space occupied by the folder under a configuration path, obtaining a target file in the target folder, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file, and then scanning the target file according to the target file, the first characteristic value and the first attribute information to obtain a scanning result. Therefore, the granularity of monitoring is the folder level, not the file level, the number of monitoring objects is reduced, the monitoring efficiency can be improved, and the target folders with the changed storage space can be found conveniently in time, so that the target files in the target folders can be scanned in time.
The following describes the above steps in detail, as follows:
First, referring to S110, a storage path of a received file may be included in a configuration path. Because many files, particularly data files, have high timeliness requirements, scanning needs to be completed as quickly as possible, and thus newly received files need to be discovered in time in order to be scanned in time. The application can obtain the target folder with the changed storage space size by monitoring the storage space size occupied by the folder under the configuration path, and the change of the storage space size can indicate that the newly received file is stored in the target folder, so that the file stored in the target folder can be determined to be the newly received file which needs to be scanned.
Furthermore, in an alternative embodiment, before S110, the method may further include:
Naming the received file according to a preset naming rule to obtain a file name;
Analyzing the file name and determining a receiving path;
the received file is stored to the receive path.
Here, after the file is received, the file may be named according to a preset naming rule, so as to obtain a standardized file name, from which a receiving path of the file may be parsed, and then the file may be stored under the receiving path. The monitored configuration path may include the receiving path, so that the receiving path may be monitored, so that in a case where the size of the storage space occupied by the folder under the receiving path is monitored to change, files stored in the folder with the changed size of the storage space under the receiving path may be scanned.
In addition, the file name can be named by the file sender according to a preset naming rule before sending, so that the file is convenient to receive without naming, the file name can be directly analyzed, a receiving path is determined, and the received file is stored in the receiving path.
In one example, the preset naming convention may be that the file name is a combination of the file sender system name, source file name, file type, date, and batch. Specifically, the received file A may be named according to the preset naming rule, so as to obtain the file name "S1-a-w-2021.09.02-1". Since the file type is w and the receiving path of the first batch of files with the date of 2021 and 9 is U, the file name is analyzed to determine that the receiving path of the file a is U, and then the file a can be stored in the receiving path U.
Therefore, the receiving path of the file can be determined, the received file can be stored in the receiving path conveniently, and the receiving path is arranged below the configuration path, so that the received file can be timely monitored, and the received file can be timely scanned. In addition, the number of the receiving paths is limited because the receiving paths are resolved from the standardized file names, so that the number of folders under the monitored configuration paths is also limited, the folders with the changed occupied storage space can be monitored in time, and the monitoring efficiency is improved.
Next, referring to S120, since the size of the storage space occupied by the target folder is changed, the target file in the target folder may be a newly received file that needs to be scanned. Before scanning, the target file, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file need to be acquired. The destination source file may be the destination file before being sent. The first characteristic value may be calculated by the sender before transmission and then transmitted to the receiver together with the target file and the first attribute information.
In addition, the first characteristic value and the first attribute information of the target source file can be stored in a database, and when the target source file needs to be used, the target source file accesses the database and is acquired from the database. However, this method needs to access the database every time the first feature value and the first attribute information are used, so that the database needs to be accessed multiple times in the process of scanning the file, and the efficiency of scanning the file is reduced. And the sender directly sends the first characteristic value and the first attribute information to the receiver, so that the receiver can directly use the first characteristic value and the first attribute information in scanning without accessing the database for multiple times, and the scanning efficiency is improved.
Then, referring to S130, according to the obtained target file, the first feature value of the target source file corresponding to the target file, and the first attribute information of the target source file, the target file may be scanned, so as to obtain a scanning result.
Based on this, in an alternative embodiment, S130 may specifically include:
calculating a second characteristic value of the target file based on the target file;
comparing the first characteristic value with the second characteristic value;
comparing the first attribute information with the second attribute information of the target file under the condition that the first characteristic value is consistent with the second characteristic value;
And under the condition that the first attribute information and the second attribute information are consistent, recording the first file information of the target file into the database and moving the target file to a first preset path.
Here, the characteristic value of the received file, that is, the second characteristic value of the target file may be calculated, and then the characteristic value of the received file is compared with the characteristic value calculated before the transmission of the file, that is, the first characteristic value of the target source file, and if the characteristic values are consistent, the attribute information of the received file, that is, the second attribute information of the target file, is continuously compared with the attribute information of the file before the transmission, that is, the first attribute information of the target source file, and if the attribute information of the received file and the first attribute information of the target source file are consistent, the first file information of the target file is recorded in the database and the target file is moved to the first preset path. The first preset path can be different from the receiving path and is used for storing the scanned file and confirming the error-free file, so that the scanned file is prevented from being repeatedly scanned. The first preset path may be determined by parsing a file name of the received file. When the first file information of the target file is recorded in the database, the first preset path can be used as a main key. The first file information may include a first feature value, a second feature value, first attribute information, second attribute information, a scanning time of the target file, and a scanning number. The scanning time may be the time at which scanning is started or the time at which scanning is ended, but is not limited to this, and the scanning time may be the same as the scanning time at which scanning is started or the scanning time may be the scanning time at which scanning is ended.
In one example, the MD5 value of the object file B, that is, the second feature value, may be calculated based on a message-digest algorithm (md5), and the MD5 value of the object file B is compared with the MD5 value of the object source file B corresponding to the object file B, that is, the first feature value, and if the MD5 value of the object file B is consistent with the MD5 value of the object source file B, the attribute information of the object file B is continuously compared, that is, the second attribute information is consistent with the attribute information of the object source file B, that is, the first attribute information is consistent with the attribute information of the object source file B, and if the attribute information of the object file B is consistent with the attribute information of the object source file B, the received object file B is accurate, then the MD5 value of the object file B, the attribute information of the object source file B, the scan time and the scan number of times of the object file B are recorded in the database, and the object file B is moved to the path N, that is, the first preset path.
Therefore, through the process, the target file can be scanned, and the target file is moved to the first preset path under the condition that the characteristic value and the attribute information of the target file are confirmed to be consistent with the target source file, so that the scanned target file is prevented from being repeatedly scanned, and the scanning efficiency is improved.
Additionally, in an alternative embodiment, the method may further comprise:
comparing the first attribute information with the second attribute information of the target file under the condition that the first characteristic value is consistent with the second characteristic value;
and sending the first feedback information to the sender of the target file under the condition that the first attribute information and the second attribute information are inconsistent.
If the first characteristic value is consistent with the second characteristic value, the first attribute information and the second attribute information are continuously compared, if the attribute information is consistent, the fact that the target file received by the receiver is inconsistent with the target source file before transmission can be indicated, first feedback information can be sent to the sender of the target file, and the first feedback information can be used for feeding back information that the attribute of the target file is inconsistent with the attribute of the target source file to the sender of the target file.
In one example, if the MD5 value of the target file C is consistent with the MD5 value of the target source file C, the attribute information of the target file C, that is, the second attribute information and the attribute information of the target source file C, that is, the first attribute information, are continuously compared, and if the attribute information of the target file C is inconsistent with the attribute information of the target source file C, it is indicated that the target file C received by the receiving side is different from the target source file C before transmission, and information that the attribute of the target file C is inconsistent with the attribute of the target source file C can be fed back to the transmitting side.
Therefore, through the process, the characteristic value can be compared first, the attribute information can be further compared under the condition that the characteristic value is consistent, so that the number of times of comparing the attribute information is reduced, and because the information to be compared is relatively responsible during comparing the attribute information, the number of times of comparing the attribute information is reduced, the scanning efficiency can be improved.
Furthermore, in an alternative embodiment, after comparing the first characteristic value and the second characteristic value, the method may further include:
and storing the target file and the second file information of the target file to a second preset path under the condition that the first characteristic value and the second characteristic value are inconsistent.
Here, if the second characteristic value of the received target file is inconsistent with the first characteristic value of the target source file before transmission, it is possible that the target file is inconsistent with the target source file, but it is also possible that the target file is not completely received due to transmission delay, and in order to avoid inaccurate scanning results caused by the transmission delay, the target file and the second file information of the target file may be stored in a second preset path so as to scan the target file again. The second preset path may be a path storing a file that needs to be scanned again. The second file information may include a first feature value, a second feature value, first attribute information, a scanning time of the target file, and a scanning number. In addition, the second file information may be recorded in the database, and the receiving path corresponding to the target file may be used as a primary key during recording.
In one example, if the MD5 value of the target file D received by the receiving side is inconsistent with the MD5 value of the target source file sent by the sending side, the target file D, the MD5 value of the target source file, the attribute information of the target source file, the scanning time and the scanning number of the target file D are all stored in the path M, that is, the second preset path.
Therefore, the received target file with the second characteristic value inconsistent with the first characteristic value of the target source file before transmission can be stored in the second preset path, so that the target file can be scanned again, and inaccurate scanning results caused by transmission delay are avoided.
In addition, since the second characteristic value of the target file and the first characteristic value of the target source file may not be identical, the target file is not completely received due to transmission delay, so that the second file information of the target file and the target file needs to be stored in a second preset path for storing the file to be scanned again, and then the file under the second preset path needs to be scanned again. The rescanning method is as follows:
On the basis of the above S110-S130, in a possible embodiment, as shown in fig. 2, after storing the target file and the second file information of the target file in the second preset path in the case that the first feature value and the second feature value are not identical, the method may further include S210-S250, where:
S210, acquiring the first file and third file information of the first file from the second preset path.
Here, the first file may be a file that needs to be scanned again, and the third file information may include a feature value of the first file calculated in each scanning process, a scanning time of each scanning the first file, a number of times the first file is scanned, a third feature value of the first source file corresponding to the first file, and third attribute information of the first source file. The first file and the third file information may be stored in the second preset path after the previous scanning of the first file.
In one example, the first file E, the MD5 value of the first file E calculated in the first scanning process, the scanning time 00:20:30 of the first file E scanned for the first time, the number of times of scanning 1 the first file E is scanned, the MD5 value of the first source file E corresponding to the first file E, and the attribute information of the first source file E may be obtained from the path M.
S220, calculating a fourth characteristic value of the first file based on the first file.
Here, a fourth characteristic value of the first file may be calculated based on the first file, which may be one of the bases for determining whether the first file and the first source file are identical. Since the first file may not be completely received due to transmission delay when the first file is scanned the previous time, the fourth characteristic value may be different from the characteristic value calculated when the first file is scanned the previous time.
In one example, the MD5 value of the first file E, i.e. the fourth eigenvalue, may be calculated based on the MD5 algorithm.
S230, comparing the third characteristic value with the fourth characteristic value.
Here, since the fourth characteristic value may be different from the characteristic value calculated when the first file was scanned the previous time, it is necessary to recalculate the characteristic value at the time of the re-scanning, and compare it with the characteristic value of the first source file before transmission, that is, the third characteristic value, again based on the recalculated fourth characteristic value.
In one example, the MD5 value of the first file E may be compared with the MD5 value of the first source file E, i.e., the third feature value.
Based on this, in an alternative embodiment, after S230, the method may further include:
under the condition that the third characteristic value and the fourth characteristic value are inconsistent, acquiring the first scanning time and the second scanning time of the first file;
Calculating the time difference between the initial scanning time and the scanning time;
Under the condition that the time difference is larger than the preset time difference, acquiring the scanning times of the first file;
And storing the first file and the third file information to a second preset path under the condition that the scanning times are not more than the preset scanning times.
Here, in the case where the third characteristic value and the fourth characteristic value do not coincide, it may be determined whether or not to perform the next scanning on the first document based on the time difference between the first scanning time and the present scanning time and the number of times of scanning.
Specifically, the first scanning time and the second scanning time of the first file may be obtained, a time difference between the first scanning time and the second scanning time may be calculated, and then the time difference may be compared with a preset time difference. If the time difference is greater than the preset time difference, there are two possibilities, that is, first, the first file is completely received even if there is a transmission delay, so that the third characteristic value and the fourth characteristic value are inconsistent because the first file is inconsistent with the first source file due to an error in the transmission process, and second, the transmission delay is too serious, the first file is not completely received, so that the first file and the first source file may be consistent although the third characteristic value and the fourth characteristic value are inconsistent. Based on this, in order to avoid that the transmission delay is too serious, the first file is not completely received, so that the scanning result is wrong, the number of times the first file is scanned, that is, the number of times of scanning, and the preset number of times of scanning are compared to further determine whether the first file needs to be scanned next time, specifically, the first file needs to be scanned next time when the number of times of scanning is not greater than the preset number of times of scanning, so that the first file and the third file information are stored in the second preset path to wait for the next scanning.
In one example, under the condition that the MD5 value of the first file E is inconsistent with the MD5 value of the first source file E, the first scanning time 00:20:30 and the current scanning time 00:25:30 of the first file E are obtained, the time difference between the first scanning time and the current scanning time is calculated to be 5 minutes, then the time difference is compared with a preset time difference, the preset time difference may be 3 minutes, since the time difference between the first scanning time and the current scanning time is greater than the preset time difference, the scanning times of the first file E and the preset scanning times need to be further compared, and since the first file E is scanned only once before the current scanning, the scanning times are 1, the preset scanning times may be 3, the scanning times of the first file E are smaller than the preset scanning times, the first file E needs to be stored in the path M, and the next scanning is waited for.
Therefore, whether the first file needs to be scanned next time or not can be determined through two factors of the scanning time and the scanning times, and the scanning result caused by transmission delay is prevented from being wrong by the maximum strength.
In addition, in an optional embodiment, after the scanning number of the first file is acquired in a case that the time difference is greater than the preset time difference, the method may further include:
And under the condition that the scanning times are larger than the preset scanning times, sending third feedback information to the sender of the first file.
Here, in the case where the third characteristic value and the fourth characteristic value are inconsistent and the time difference between the first scanning time and the current scanning time is greater than the preset time difference, if the scanning number is greater than the preset scanning number, it may be indicated that the first file is inconsistent with the first source file, and third feedback information may be sent to the sender of the first file, where the third feedback information may be used to feedback information that the characteristic values of the first file and the first source file are inconsistent to the sender of the first file.
In one example, when the MD5 value of the first file F is inconsistent with the MD5 value of the first source file F and the time difference between the first scanning time of the first file F and the time of this scanning time is 1 minute (less than the preset time difference of 3 minutes), the number of scanning times of the first file F is obtained to be 4, and the preset number of scanning times may be 3, so that the number of scanning times of the first file F is greater than the preset number of scanning times, which may indicate that the first file F received by the receiving side is different from the first source file F before sending, and may feed back information that the first file F is inconsistent with the characteristic value of the first source file F to the sending side.
Therefore, under the condition that the scanning time and the scanning times exceed preset values, the first file and the first source file are determined to be inconsistent, and timely feedback to a sender is facilitated, so that the accurate file can be obtained again.
In addition, in an alternative embodiment, after calculating the time difference between the initial scan time and the current scan time, the method may further include:
And storing the first file and the third file information to a second preset path under the condition that the time difference is not larger than the preset time difference.
Here, if the time difference between the first scanning time and the second scanning time is not greater than the preset time difference, it may indicate that the first file may not be completely received due to the transmission delay, so that the first file and the third file information may be stored in the second preset path to wait for the next scanning.
In one example, the first file G has a first scanning time of 00:21:30, and a time difference from this scanning time of 00:22:30 is 1 minute, which is less than a preset time difference of 3 minutes, so that the first file G may not be completely received due to a transmission delay, and the first file G and the third file information may be stored in the path M to wait for the next scanning.
Therefore, when the time difference between the initial scanning time of the first file and the current scanning time is not larger than the preset time difference, the first file and the third file information are stored in the second preset path, so that the first file can be scanned again, and the error of a scanning result caused by transmission delay is avoided.
S240, comparing the third attribute information with the fourth attribute information of the first file when the third characteristic value and the fourth characteristic value are consistent.
Here, in addition to the case where the third characteristic value and the fourth characteristic value do not coincide, there is a case where the third characteristic value and the fourth characteristic value coincide. The attribute information may be further compared in case the third characteristic value and the fourth characteristic value coincide, specifically, fourth attribute information of the first file and third attribute information of the first source file are compared.
In one example, if the MD5 value of the first file H is consistent with the MD5 value of the first source file H, the attribute information of the first file H is compared with the attribute information of the first source file H.
S250, when the third attribute information and the fourth attribute information are consistent, recording the third file information into a database and moving the first file to a first preset path.
Here, if the fourth attribute information of the first file is consistent with the third attribute information of the first source file, it may indicate that the first file is consistent with the first source file, and the third file information may be recorded in the database and moved to the first preset path, so as to avoid being repeatedly scanned.
In one example, the attribute information of the first file H is consistent with the attribute information of the first source file H, which indicates that the first file H is consistent with the first source file H, the third file information of the first file H may be recorded in the database and moved to the path N.
Therefore, after scanning again, the first file consistent with the first source file is confirmed to be moved to the first preset path, so that the scanned first file is prevented from being scanned repeatedly, and the scanning efficiency is improved.
Additionally, in an alternative embodiment, the method may further comprise:
Comparing the third attribute information with the fourth attribute information of the first file under the condition that the third characteristic value is consistent with the fourth characteristic value;
And transmitting second feedback information to the sender of the first file in the case that the third attribute information and the fourth attribute information are inconsistent.
Here, the third attribute information of the first source file may be compared with the fourth attribute information of the first file when the third feature value and the fourth feature value are identical, and if the third attribute information and the fourth attribute information are not identical, it indicates that the first file and the first source file are not identical, and the second feedback information may be transmitted to the sender of the first file. The second feedback information may be used to feed back information that the attributes of the first file and the first source file are inconsistent to the sender of the first file.
In one example, when the MD5 value of the first file J is consistent with the MD5 value of the first source file J, the attribute information of the first file J is compared with the attribute information of the first source file J, if the attribute information of the first file J is inconsistent with the attribute information of the first source file J, it indicates that the first file J received by the receiving side is different from the first source file J before transmission, and the information that the attribute of the first file J is inconsistent with the attribute of the first source file J can be fed back to the transmitting side.
Thus, through the above process, when the characteristic values of the first file and the first source file are consistent, but the attribute information is inconsistent, the second feedback information is sent to the sender of the first file, so that the sender can resend the accurate file.
In addition to the method for triggering the scanning of the target file in the target folder by monitoring the size of the storage space occupied by the folder under the configuration path and monitoring the target folder with the changed size of the storage space, the embodiment of the application also provides a method for triggering the scanning of the file at fixed time by setting a fixed time task, and the specific fixed time scanning method comprises the following steps:
according to a preset time task, scanning the folder under the configuration path is triggered at fixed time, and recursively scanning is carried out to a second file in the folder;
Calculating a fifth characteristic value of the second file;
Comparing the fifth characteristic value with a sixth characteristic value of the second source file corresponding to the second file;
Comparing the fifth attribute information of the second file with the sixth attribute information of the second source file under the condition that the fifth characteristic value is consistent with the sixth characteristic value;
recording fourth file information of the second file in the database and moving the second file to a first preset path under the condition that the fifth attribute information and the sixth attribute information are consistent, wherein the fourth file information comprises the fifth characteristic value, the sixth characteristic value, the fifth attribute information, the sixth attribute information, the scanning time and the scanning times of the second file;
And transmitting fourth feedback information to the sender of the second file in case that the fifth attribute information and the sixth attribute information are not identical.
The timing scanning method further comprises the following steps:
And storing the second file and fourth file information of the second file to a second preset path when the fifth characteristic value is inconsistent with the sixth characteristic value, wherein the fourth file information comprises the fifth characteristic value, the sixth attribute information, the scanning time and the scanning times of the second file.
In one example, it may be set to scan the folder under the configuration path once every half an hour, recursively scan the folder to a second file Q in the folder, calculate an MD5 value of the second file Q, compare the MD5 value of the second file Q with the MD5 value of the second source file Q, further compare attribute information of the second file Q with attribute information of the second source file Q if the MD5 value of the second file Q is identical with the MD5 value of the second source file Q, and record the MD5 value of the second file Q, the MD5 value of the second source file Q, the attribute information of the second source file Q, the scanning time and the scanning number of times of the second file Q in the database if the attribute information of the second file Q is identical with the attribute information of the second source file Q, and move the second file Q to the path N to avoid being repeatedly scanned. If the attribute information of the second file Q is inconsistent with the attribute information of the second source file Q, feeding back the information that the attribute of the second file Q is inconsistent with the attribute of the second source file Q to the sender of the second file Q, so that the sender can resend the accurate file. If the MD5 value of the second file Q and the MD5 value of the second source file Q are not identical, the second file Q, the MD5 value of the second source file Q, the attribute information of the second source file Q, the scanning time and the scanning times of the second file Q are stored in the path M, and waiting for rescanning.
Based on the above, when three scanning processes for scanning the target file, the first file and the second file collide, the first file is preferentially scanned, the target file is scanned, and finally the second file is scanned. That is, when three scanning processes collide, the first file stored in the second preset path and needing to be scanned again is scanned preferentially, the target file in the target folder with the changed storage space is scanned again, and finally, the timing scanning task is executed, and all files in the configuration path are scanned.
In order to better describe the whole scheme, the document scanning method provided by the embodiment of the present application is described in the following in detail with reference to a specific example of the document scanning method in fig. 3 and the document scanning system in fig. 4 based on the above embodiments.
Fig. 3 shows a flowchart of a file scanning method according to an embodiment of the present application, where the file scanning method may be applied to the file scanning system shown in fig. 4, and the file scanning system may specifically include a transmission module 401, a standardization module 402, a file monitoring module 403, a file scanning module 404, a recording module 405, and a file moving module 406. As shown in FIG. 3, the file scanning method may include S301-S312, specifically as follows:
s301, file name and path standardization.
In one example, the transmission module 401 sends the received file Y, the MD5 value of the file Y, and the attribute information of the file Y to the normalization module 402, and the normalization module 402 names the file Y according to a preset naming rule "sender system name-source file name-file type-date-batch", determines that the file name of the file Y is "S1-Y-k-2021.08.05-2", parses the file name "S1-Y-k-2021.08.05-2", determines that the receiving path of the file Y is path X, and determines that the first preset path corresponding to the file Y is path Z according to the file name "S1-Y-k-2021.08.05-2". After determining that the reception path of the file Y is the path X, the file Y is stored under the path X.
S302, determining a folder x.
In one example, the file monitoring module 403 monitors the size of the storage space occupied by the folder under the configuration path in real time, determines a file x with a changed size of the storage space, indicates that the file stored in the file x is a newly received file, and sends the file Y, the MD5 value of the file Y, and attribute information of the file Y to the file scanning module 404.
S303, calculating a first MD5 value of the file Y.
In one example, the file scan module 404 calculates a first MD5 value for file Y from the received file Y.
S304, judging whether the first MD5 value of the file Y is consistent with the MD5 value of the file Y.
In one example, the document scanning module 404 determines whether the first MD5 value of the document Y is consistent with the MD5 value of the document Y, and if so, performs S310, and if not, performs S305.
S305, storing file Y and file information of the file Y.
In one example, if the first MD5 value of the file Y does not match the MD5 value of the file Y, the file moving module 406 stores the file information such as the first MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of the file Y, and the file Y to the path M, and waits for the re-scanning. In addition, the recording module 405 records the first MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of the file Y, and other file information into the database.
S306, calculating a second MD5 value of the file Y.
In one example, the file scanning module 404 obtains, from the path M, the file Y and the file information such as the first MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of times of the file Y, and the like. Then, a second MD5 value of the file Y is calculated based on the file Y.
S307, it is determined whether the second MD5 value of the file Y is consistent with the MD5 value of the file Y.
In one example, the document scanning module 404 determines whether the second MD5 value of the document Y is consistent with the MD5 value of the document Y, and if so, performs S310, and if not, performs S308.
S308, judging whether the scanning time of the file Y is longer than the preset scanning time.
In one example, if the second MD5 value of the file Y is inconsistent with the MD5 value of the file Y, it is further determined whether the scanning time of the file Y is greater than the preset scanning time, if yes, S309 is executed, if not, S305 is returned to, and the file moving module 406 stores the first MD5 value of the file Y, the second MD5 value of the file Y, the MD5 value of the file Y, attribute information of the file Y, the file information such as the scanning time and the scanning number of times of each time of the file Y, and the file Y to the path M, and waits for the next scanning. In addition, the recording module 405 records the first MD5 value of the file Y, the second MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of times of each time of the file Y, and other file information into the database.
S309, judging whether the scanning times of the file Y are larger than the preset scanning times.
In one example, if the scanning time of the file Y is greater than the preset scanning time, it is further determined whether the scanning number of times of the file Y is greater than the preset scanning number of times, if yes, S312 is executed, if not, S305 is returned, and the file moving module 406 stores the first MD5 value of the file Y, the second MD5 value of the file Y, the MD5 value of the file Y, attribute information of the file Y, file information such as the scanning time and the scanning number of times of each time of the file Y, and the file Y to the path M, and waits for the next scanning. In addition, the recording module 405 records the first MD5 value of the file Y, the second MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of times of each time of the file Y, and other file information into the database.
S310, judging whether the attribute information of the file Y is consistent with the attribute information of the file Y.
In one example, if the first MD5 value of the file Y is identical to the MD5 value of the file Y, or if the second MD5 value of the file Y is identical to the MD5 value of the file Y, it is further determined whether the attribute information of the file Y is identical to the attribute information of the file Y, if so, S311 is executed, and if not, S312 is executed.
S311, record the file information of the file Y and move the file Y.
In one example, if the attribute information of the file Y matches the attribute information of the file Y, it indicates that the file Y matches the file Y, and the file moving module 406 moves the file Y to the path N, and the recording module 405 records the MD5 value of the file Y, the attribute information of the file Y, the scanning time and the scanning number of times of the attribute information of the file Y, and other file information calculated at each scanning into the database.
S312, feedback information is sent.
In one example, if the attribute information of the file Y is inconsistent with the attribute information of the file Y, the transmission module 401 sends feedback information of inconsistent attribute to the sender of the file Y, and if the number of scans of the file Y is greater than the preset number of scans, the transmission module 401 sends feedback information of inconsistent feature values to the sender of the file Y.
In this way, the size of the storage space occupied by the folder under the configuration path is monitored to obtain a target folder with the size of the storage space changed, a target file in the target folder, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file are obtained, and then the target file is scanned according to the target file, the first characteristic value and the first attribute information to obtain a scanning result. Therefore, the granularity of monitoring is the folder level, not the file level, the number of monitoring objects is reduced, the monitoring efficiency can be improved, and the target folders with the changed storage space can be found conveniently in time, so that the target files in the target folders can be scanned in time.
Based on the same inventive concept, the application also provides a file scanning device. The following describes a document scanning device according to an embodiment of the present application in detail with reference to fig. 5.
Fig. 5 is a block diagram illustrating a structure of a document scanning apparatus according to an exemplary embodiment.
As shown in fig. 5, the document scanning apparatus may include:
The monitoring module 501 is configured to monitor the size of a storage space occupied by a folder in a configuration path, and obtain a target folder with a changed size of the storage space;
The obtaining module 502 is configured to obtain a target file in a target folder, a first feature value of a target source file corresponding to the target file, and first attribute information of the target source file;
The scanning module 503 is configured to scan the target file according to the target file, the first feature value and the first attribute information, so as to obtain a scanning result.
In one embodiment, the scanning module 503 may specifically include:
The first computing sub-module is used for computing a second characteristic value of the target file based on the target file;
The first comparison submodule is used for comparing the first characteristic value with the second characteristic value;
the second comparison sub-module is used for comparing the first attribute information with the second attribute information of the target file under the condition that the first characteristic value is consistent with the second characteristic value;
the first processing sub-module is used for recording first file information of the target file in the database and moving the target file to a first preset path under the condition that the first attribute information and the second attribute information are consistent, wherein the first file information comprises a first characteristic value, a second characteristic value, the first attribute information, the second attribute information, the scanning time and the scanning times of the target file.
In one embodiment, the scanning module 503 may further include:
the third comparison sub-module is used for comparing the first attribute information with the second attribute information of the target file under the condition that the first characteristic value is consistent with the second characteristic value;
and the first sending sub-module is used for sending the first feedback information to the sender of the target file under the condition that the first attribute information and the second attribute information are inconsistent.
In one embodiment, the scanning module 503 may further include:
The first storage sub-module is used for storing the target file and second file information of the target file to a second preset path under the condition that the first characteristic value is inconsistent with the second characteristic value after comparing the first characteristic value with the second characteristic value, wherein the second file information comprises the first characteristic value, the second characteristic value, the first attribute information, the scanning time and the scanning times of the target file.
In one embodiment, the document scanning apparatus may further include:
the naming module is used for naming the received files according to a preset naming rule before monitoring the size of the storage space occupied by the folders in the configuration path to obtain target folders with the changed storage space size, so as to obtain file names;
the analysis module is used for analyzing the file name and determining a receiving path;
and the storage module is used for storing the received file to a receiving path, and the configuration path comprises the receiving path.
In one embodiment, the scanning module 503 may further include:
The first obtaining sub-module is used for obtaining a first file and third file information of the first file from a second preset path after storing the second file information of the target file and the target file to the second preset path under the condition that the first characteristic value and the second characteristic value are inconsistent, wherein the third file information comprises the characteristic value of the first file calculated in each scanning process, the scanning time of the first file, the scanning times of the first file, the third characteristic value of a first source file corresponding to the first file and the third attribute information of the first source file;
the second computing sub-module is used for computing a fourth characteristic value of the first file based on the first file;
the fourth comparison sub-module is used for comparing the third characteristic value with the fourth characteristic value;
a fifth comparing sub-module, configured to compare the third attribute information with the fourth attribute information of the first file when the third feature value and the fourth feature value are consistent;
and the second processing sub-module is used for recording the third file information into the database and moving the first file to the first preset path under the condition that the third attribute information and the fourth attribute information are consistent.
In one embodiment, the document scanning apparatus may further include:
the fourth comparison module is used for comparing the third attribute information with the fourth attribute information of the first file under the condition that the third characteristic value is consistent with the fourth characteristic value;
and the second sending module is used for sending second feedback information to the sender of the first file when the third attribute information and the fourth attribute information are inconsistent.
In one embodiment, the scanning module 503 may further include:
the second acquisition sub-module is used for acquiring the initial scanning time and the scanning time of the first file under the condition that the third characteristic value is inconsistent with the fourth characteristic value after comparing the third characteristic value with the fourth characteristic value;
the third calculation sub-module is used for calculating the time difference between the initial scanning time and the scanning time;
the third acquisition sub-module is used for acquiring the scanning times of the first file under the condition that the time difference is larger than the preset time difference;
And the second storage sub-module is used for storing the first file and the third file information to a second preset path under the condition that the scanning times are not more than the preset scanning times.
In one embodiment, the scanning module 503 may further include:
And the second sending sub-module is used for sending third feedback information to the sender of the first file under the condition that the scanning times are larger than the preset scanning times after the scanning times of the first file are acquired under the condition that the time difference is larger than the preset time difference.
In one embodiment, the scanning module 503 may further include:
And the third storage sub-module is used for storing the first file and the third file information to a second preset path under the condition that the time difference is not larger than the preset time difference after calculating the time difference between the initial scanning time and the current scanning time.
The method comprises the steps of obtaining a target folder with the size of storage space changed by monitoring the size of storage space occupied by the folder under a configuration path, obtaining a target file in the target folder, a first characteristic value of a target source file corresponding to the target file and first attribute information of the target source file, and then scanning the target file according to the target file, the first characteristic value and the first attribute information to obtain a scanning result. Therefore, the granularity of monitoring is the folder level, not the file level, the number of monitoring objects is reduced, the monitoring efficiency can be improved, and the target folders with the changed storage space can be found conveniently in time, so that the target files in the target folders can be scanned in time.
Fig. 6 is a schematic diagram of an electronic device according to an exemplary embodiment.
As shown in fig. 6, the electronic device 6 is capable of implementing a structure diagram of an exemplary hardware architecture of the electronic device according to the file scanning method and the file scanning apparatus in the embodiment of the present application. The electronic device may refer to an electronic device in an embodiment of the present application.
The electronic device 6 may comprise a processor 601 and a memory 602 storing computer program instructions.
In particular, the processor 601 may include a Central Processing Unit (CPU), or an Application SPECIFIC INTEGRATED Circuit (ASIC), or may be configured as one or more integrated circuits that implement embodiments of the present application.
Memory 602 may include a mass storage for information or instructions. By way of example, and not limitation, memory 602 may include a hard disk drive (HARD DISK DRIVE, HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or universal serial bus (universal serial bus, USB) drive, or a combination of two or more of these. The memory 602 may include removable or non-removable (or fixed) media, where appropriate. The memory 602 may be internal or external to the integrated gateway device, where appropriate. In a particular embodiment, the memory 602 is a non-volatile solid state memory. In particular embodiments, memory 602 includes Read Only Memory (ROM). The ROM may be mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these, where appropriate.
The processor 601 reads and executes the computer program instructions stored in the memory 602 to implement the method in the embodiment shown in fig. 1 or fig. 4, and achieve the corresponding technical effects, which are not described herein for brevity.
In one embodiment, the electronic device 6 may also include a transceiver 603 and a bus 604. As shown in fig. 6, the processor 601, the memory 602, and the transceiver 603 are connected to each other through the bus 604 and perform communication with each other.
Bus 604 includes hardware, software, or both. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Control Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. Bus 604 may include one or more buses, where appropriate. Although embodiments of the application have been described and illustrated with respect to a particular bus, the application contemplates any suitable bus or interconnect.
The embodiment of the application also provides a computer storage medium, wherein the computer storage medium is stored with computer executable instructions, and the computer executable instructions are used for realizing the file scanning method described in the embodiment of the application.
In some possible embodiments, aspects of the method provided by the present application may also be implemented in the form of a program product, which includes a program code for causing a computer device to perform the steps of the method according to the various exemplary embodiments of the present application described in the present specification, when the program product is run on the computer device, for example, the computer device may perform the file scanning method described in the embodiments of the present application.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of a readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable information processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable information processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable information processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1.一种文件扫描方法,其特征在于,所述方法包括:1. A file scanning method, characterized in that the method comprises: 监控配置路径下的文件夹所占用的存储空间大小,得到所述存储空间大小发生变化的目标文件夹;Monitor the storage space occupied by the folders under the configuration path, and obtain the target folder whose storage space size has changed; 获取所述目标文件夹中的目标文件、所述目标文件对应的目标源文件的第一特征值和所述目标源文件的第一属性信息;Acquire a target file in the target folder, a first feature value of a target source file corresponding to the target file, and first attribute information of the target source file; 根据所述目标文件、所述第一特征值和所述第一属性信息,对所述目标文件进行扫描,得到扫描结果;Scan the target file according to the target file, the first feature value and the first attribute information to obtain a scanning result; 所述根据所述目标文件、所述第一特征值和所述第一属性信息,对所述目标文件进行扫描,得到扫描结果,包括:The step of scanning the target file according to the target file, the first feature value and the first attribute information to obtain a scanning result includes: 基于所述目标文件,计算所述目标文件的第二特征值;Based on the target file, calculating a second characteristic value of the target file; 对比所述第一特征值和所述第二特征值;comparing the first eigenvalue and the second eigenvalue; 在所述第一特征值和所述第二特征值一致的情况下,对比所述第一属性信息和所述目标文件的第二属性信息;When the first characteristic value and the second characteristic value are consistent, comparing the first attribute information with the second attribute information of the target file; 在所述第一属性信息和所述第二属性信息一致的情况下,向数据库中记录所述目标文件的第一文件信息并将所述目标文件移动至第一预设路径,所述第一文件信息包括所述第一特征值、所述第二特征值、所述第一属性信息、所述第二属性信息、所述目标文件的扫描时刻和扫描次数;When the first attribute information and the second attribute information are consistent, recording the first file information of the target file in a database and moving the target file to a first preset path, the first file information including the first feature value, the second feature value, the first attribute information, the second attribute information, the scanning time and the scanning number of the target file; 在所述对比所述第一特征值和所述第二特征值之后,所述方法还包括:After comparing the first eigenvalue and the second eigenvalue, the method further includes: 在所述第一特征值和所述第二特征值不一致的情况下,将所述目标文件和所述目标文件的第二文件信息存储到第二预设路径,所述第二文件信息包括所述第一特征值、所述第二特征值、所述第一属性信息、所述目标文件的扫描时刻和扫描次数;When the first characteristic value and the second characteristic value are inconsistent, the target file and second file information of the target file are stored in a second preset path, where the second file information includes the first characteristic value, the second characteristic value, the first attribute information, the scanning time and the scanning number of the target file; 在所述第一特征值和所述第二特征值不一致的情况下,将所述目标文件和所述目标文件的第二文件信息存储到第二预设路径之后,所述方法还包括:In the case where the first characteristic value and the second characteristic value are inconsistent, after storing the target file and the second file information of the target file in a second preset path, the method further includes: 从所述第二预设路径获取第一文件和所述第一文件的第三文件信息,所述第三文件信息包括每次扫描过程中计算的所述第一文件的特征值、每次扫描所述第一文件的扫描时刻、所述第一文件被扫描的扫描次数、所述第一文件对应的第一源文件的第三特征值和所述第一源文件的第三属性信息;Acquire a first file and third file information of the first file from the second preset path, the third file information including a feature value of the first file calculated during each scanning process, a scanning time of each scanning of the first file, a number of scanning times of the first file, a third feature value of a first source file corresponding to the first file, and third attribute information of the first source file; 基于所述第一文件,计算所述第一文件的第四特征值;Based on the first file, calculating a fourth characteristic value of the first file; 对比所述第三特征值和所述第四特征值;comparing the third eigenvalue and the fourth eigenvalue; 在所述第三特征值和所述第四特征值一致的情况下,对比所述第三属性信息和所述第一文件的第四属性信息;When the third characteristic value and the fourth characteristic value are consistent, comparing the third attribute information with the fourth attribute information of the first file; 在所述第三属性信息和所述第四属性信息一致的情况下,向所述数据库中记录所述第三文件信息并将所述第一文件移动至所述第一预设路径。When the third attribute information and the fourth attribute information are consistent, the third file information is recorded in the database and the first file is moved to the first preset path. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 在所述第一特征值和所述第二特征值一致的情况下,对比所述第一属性信息和所述目标文件的第二属性信息;When the first characteristic value and the second characteristic value are consistent, comparing the first attribute information with the second attribute information of the target file; 在所述第一属性信息和所述第二属性信息不一致的情况下,向所述目标文件的发送方发送第一反馈信息。When the first attribute information and the second attribute information are inconsistent, first feedback information is sent to a sender of the target file. 3.根据权利要求1所述的方法,其特征在于,在所述监控配置路径下的文件夹所占用的存储空间大小,得到所述存储空间大小发生变化的目标文件夹之前,所述方法还包括:3. The method according to claim 1 is characterized in that, before the storage space size occupied by the folder under the monitoring configuration path is obtained, the method further comprises: 按照预设命名规则,对接收到的文件进行命名,得到文件名称;Name the received file according to the preset naming rule to obtain the file name; 对所述文件名称进行解析,确定接收路径;Parsing the file name to determine the receiving path; 将所述接收到的文件存储到所述接收路径,所述配置路径包括所述接收路径。The received file is stored in the receiving path, and the configuration path includes the receiving path. 4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, characterized in that the method further comprises: 在所述第三特征值和所述第四特征值一致的情况下,对比所述第三属性信息和所述第一文件的第四属性信息;When the third characteristic value and the fourth characteristic value are consistent, comparing the third attribute information with the fourth attribute information of the first file; 在所述第三属性信息和所述第四属性信息不一致的情况下,向所述第一文件的发送方发送第二反馈信息。When the third attribute information and the fourth attribute information are inconsistent, second feedback information is sent to the sender of the first file. 5.根据权利要求1所述的方法,其特征在于,在所述对比所述第三特征值和所述第四特征值之后,所述方法还包括:5. The method according to claim 1, characterized in that after comparing the third eigenvalue and the fourth eigenvalue, the method further comprises: 在所述第三特征值和所述第四特征值不一致的情况下,获取所述第一文件的初次扫描时刻和此次扫描时刻;When the third characteristic value and the fourth characteristic value are inconsistent, obtaining the initial scanning time and the current scanning time of the first file; 计算所述初次扫描时刻距离所述此次扫描时刻的时间差;Calculate the time difference between the initial scanning time and the current scanning time; 在所述时间差大于预设时间差的情况下,获取所述第一文件的扫描次数;When the time difference is greater than a preset time difference, obtaining the number of scans of the first file; 在所述扫描次数不大于预设扫描次数的情况下,将所述第一文件和所述第三文件信息存储到所述第二预设路径。When the scanning number is not greater than the preset scanning number, the first file and the third file information are stored in the second preset path. 6.根据权利要求5所述的方法,其特征在于,在所述时间差大于预设时间差的情况下,获取所述第一文件的扫描次数之后,所述方法还包括:6. The method according to claim 5, characterized in that, when the time difference is greater than a preset time difference, after obtaining the number of scans of the first file, the method further comprises: 在所述扫描次数大于预设扫描次数的情况下,向所述第一文件的发送方发送第三反馈信息。When the scanning number is greater than the preset scanning number, third feedback information is sent to the sender of the first file. 7.根据权利要求5所述的方法,其特征在于,在所述计算所述初次扫描时刻距离所述此次扫描时刻的时间差之后,所述方法还包括:7. The method according to claim 5, characterized in that after calculating the time difference between the initial scanning time and the current scanning time, the method further comprises: 在所述时间差不大于预设时间差的情况下,将所述第一文件和所述第三文件信息存储到所述第二预设路径。When the time difference is not greater than the preset time difference, the first file and the third file information are stored in the second preset path. 8.一种文件扫描装置,其特征在于,所述装置包括:8. A document scanning device, characterized in that the device comprises: 监控模块,用于监控配置路径下的文件夹所占用的存储空间大小,得到所述存储空间大小发生变化的目标文件夹;A monitoring module, used to monitor the storage space occupied by the folders under the configuration path, and obtain the target folder whose storage space size has changed; 获取模块,用于获取所述目标文件夹中的目标文件、所述目标文件对应的目标源文件的第一特征值和所述目标源文件的第一属性信息;An acquisition module, used for acquiring a target file in the target folder, a first feature value of a target source file corresponding to the target file, and first attribute information of the target source file; 扫描模块,用于根据所述目标文件、所述第一特征值和所述第一属性信息,对所述目标文件进行扫描,得到扫描结果;A scanning module, configured to scan the target file according to the target file, the first feature value and the first attribute information to obtain a scanning result; 所述扫描模块包括:The scanning module comprises: 第一计算子模块,用于基于所述目标文件,计算所述目标文件的第二特征值;A first calculation submodule, configured to calculate a second characteristic value of the target file based on the target file; 第一对比子模块,用于对比所述第一特征值和所述第二特征值;A first comparison submodule, used for comparing the first characteristic value and the second characteristic value; 第二对比子模块,用于在所述第一特征值和所述第二特征值一致的情况下,对比所述第一属性信息和所述目标文件的第二属性信息;A second comparison submodule, configured to compare the first attribute information with the second attribute information of the target file when the first feature value and the second feature value are consistent; 第一处理子模块,用于在所述第一属性信息和所述第二属性信息一致的情况下,向数据库中记录所述目标文件的第一文件信息并将所述目标文件移动至第一预设路径,所述第一文件信息包括所述第一特征值、所述第二特征值、所述第一属性信息、所述第二属性信息、所述目标文件的扫描时刻和扫描次数;A first processing submodule is configured to record first file information of the target file in a database and move the target file to a first preset path when the first attribute information and the second attribute information are consistent, wherein the first file information includes the first feature value, the second feature value, the first attribute information, the second attribute information, a scanning time and a scanning number of the target file; 所述扫描模块还包括:The scanning module also includes: 第一存储子模块,用于在所述对比所述第一特征值和所述第二特征值之后,在所述第一特征值和所述第二特征值不一致的情况下,将所述目标文件和所述目标文件的第二文件信息存储到第二预设路径,所述第二文件信息包括所述第一特征值、所述第二特征值、所述第一属性信息、所述目标文件的扫描时刻和扫描次数;A first storage submodule is used for storing the target file and second file information of the target file in a second preset path after comparing the first feature value and the second feature value, if the first feature value and the second feature value are inconsistent, wherein the second file information includes the first feature value, the second feature value, the first attribute information, and the scanning time and scanning number of the target file; 所述扫描模块还包括:The scanning module also includes: 第一获取子模块,用于在所述第一特征值和所述第二特征值不一致的情况下,将所述目标文件和所述目标文件的第二文件信息存储到第二预设路径之后,从所述第二预设路径获取第一文件和所述第一文件的第三文件信息,所述第三文件信息包括每次扫描过程中计算的所述第一文件的特征值、每次扫描所述第一文件的扫描时刻、所述第一文件被扫描的扫描次数、所述第一文件对应的第一源文件的第三特征值和所述第一源文件的第三属性信息;A first acquisition submodule is used for acquiring, when the first characteristic value and the second characteristic value are inconsistent, the first file and the third file information of the first file from the second preset path after storing the target file and the second file information of the target file in a second preset path, wherein the third file information includes the characteristic value of the first file calculated during each scanning process, the scanning time of each scanning of the first file, the number of scanning times of the first file, the third characteristic value of the first source file corresponding to the first file, and the third attribute information of the first source file; 第二计算子模块,用于基于所述第一文件,计算所述第一文件的第四特征值;A second calculation submodule, configured to calculate a fourth characteristic value of the first file based on the first file; 第四对比子模块,用于对比所述第三特征值和所述第四特征值;A fourth comparison submodule, used for comparing the third characteristic value with the fourth characteristic value; 第五对比子模块,用于在所述第三特征值和所述第四特征值一致的情况下,对比所述第三属性信息和所述第一文件的第四属性信息;A fifth comparison submodule, configured to compare the third attribute information with the fourth attribute information of the first file when the third characteristic value and the fourth characteristic value are consistent; 第二处理子模块,用于在所述第三属性信息和所述第四属性信息一致的情况下,向所述数据库中记录所述第三文件信息并将所述第一文件移动至所述第一预设路径。The second processing submodule is used to record the third file information in the database and move the first file to the first preset path when the third attribute information is consistent with the fourth attribute information. 9.一种电子设备,其特征在于,所述设备包括:处理器以及存储有计算机程序指令的存储器;9. An electronic device, characterized in that the device comprises: a processor and a memory storing computer program instructions; 所述处理器执行所述计算机程序指令时实现如权利要求1-7任意一项所述的文件扫描方法。When the processor executes the computer program instructions, the file scanning method according to any one of claims 1 to 7 is implemented. 10.一种计算机存储介质,其特征在于,所述计算机存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1-7任意一项所述的文件扫描方法。10. A computer storage medium, characterized in that computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the file scanning method according to any one of claims 1 to 7 is implemented.
CN202111277664.9A 2021-10-29 2021-10-29 File scanning method, device, equipment and computer storage medium Active CN114064567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111277664.9A CN114064567B (en) 2021-10-29 2021-10-29 File scanning method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111277664.9A CN114064567B (en) 2021-10-29 2021-10-29 File scanning method, device, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN114064567A CN114064567A (en) 2022-02-18
CN114064567B true CN114064567B (en) 2025-07-08

Family

ID=80236138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111277664.9A Active CN114064567B (en) 2021-10-29 2021-10-29 File scanning method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN114064567B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922142A (en) * 2019-02-21 2019-06-21 阿里巴巴集团控股有限公司 A kind of document down loading method, apparatus and system
CN111769933A (en) * 2020-06-29 2020-10-13 北京天融信网络安全技术有限公司 Method and device for monitoring file change, electronic equipment and storage medium
CN111930324A (en) * 2020-08-11 2020-11-13 深圳市汉森软件有限公司 Automatic import file printing method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10256977B2 (en) * 2014-02-18 2019-04-09 Synopsys, Inc. Methods and systems for efficient representation of file sets
CN104503864A (en) * 2014-11-20 2015-04-08 北京世纪高蓝科技有限公司 Method and device for file backup based on local area network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922142A (en) * 2019-02-21 2019-06-21 阿里巴巴集团控股有限公司 A kind of document down loading method, apparatus and system
CN111769933A (en) * 2020-06-29 2020-10-13 北京天融信网络安全技术有限公司 Method and device for monitoring file change, electronic equipment and storage medium
CN111930324A (en) * 2020-08-11 2020-11-13 深圳市汉森软件有限公司 Automatic import file printing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114064567A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN113127338B (en) A firmware testing method, server and computer readable storage medium
CN102222183A (en) Mobile terminal software package security detection method and system
CN112087468A (en) Message processing method, related device and readable storage medium
CN114064567B (en) File scanning method, device, equipment and computer storage medium
CN116582614B (en) Vehicle control method, device, electronic device and storage medium
CN115905145A (en) File processing method, device, equipment and computer storage medium
CN118981480B (en) Data aggregation methods, apparatus, equipment, and media based on DPU
CN115794752A (en) A data processing method, device, equipment, medium and product
CN113128848B (en) Data quality monitoring method of all-service index, electronic equipment and storage medium
CN119045870A (en) Real-time index calculation method, device, equipment and medium based on low-code configuration
CN111294613A (en) Video processing method, client and server
CN118677803A (en) File transmission testing method, platform, electronic equipment and storage medium
CN111242256B (en) Information verification method, device and terminal
CN113590234A (en) Method, device and equipment for automatically acquiring data and storage medium
CN119271300B (en) Parameter conversion methods, apparatus, equipment, computer storage media and program products
CN119210757B (en) Data packet-based authentication credential identification method, apparatus and equipment
CN113133010A (en) Wireless networking method, device, terminal equipment and storage medium
CN113704320B (en) Data processing method, device, electronic equipment and storage medium
CN118747142B (en) Data analysis methods, devices, equipment, and media based on data tracking points
CN121597544A (en) Dynamic data verification method and device based on context awareness
CN116828026B (en) PCIe (peripheral component interconnect express) equipment access method, communication system, device and electronic equipment
CN114513697B (en) Television system, control method and non-transitory computer readable medium
CN111294610B (en) Video processing method and device
CN112597109B (en) Data storage methods, devices, electronic equipment and storage media
CN120705144A (en) Data aggregation method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant