File Scanning Method, Apparatus, Device, and Computer Storage Medium
By monitoring the changes in the storage space of the folder, obtaining the feature value and attribute information of the file, and performing folder-level scanning, it solves the problem of difficult time monitoring when there are too many files, and improves the efficiency and accuracy of file scanning.
Patent Information
- Application Number
- CN202111277664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In the prior art, when the number of files is too large, it is difficult to monitor the changed files in time, so that the files cannot be scanned in time, resulting in errors or missing during file transfer.
By monitoring the storage space occupied by the folder under the configuration path, obtain the target folder where the storage space has changed, and obtain the characteristic value and attribute information of the target file, perform folder-level scanning, reduce the number of monitoring objects, and improve monitoring efficiency.
It realizes the timely discovery of target folders with changes in storage space size, and timely scans the target files in the target folder, improving the efficiency and accuracy of file scanning, and avoiding repeated files scanning caused by transmission delays or errors.
Smart Images

Figure CN114064567B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of data monitoring, and particularly relates to a file scanning method, apparatus, device, and computer storage medium. Background Art
[0002] With the popularization of the network, a large number of files need to be transmitted through the network. However, due to various uncertain factors during the file transmission process, it is very likely that errors or omissions will occur to the files during transmission.
[0003] In order to ensure the accuracy and integrity of the received files, it is necessary to scan the received files. In the prior art, all files are monitored by monitoring software. When a changed file is monitored, the changed file is scanned by scanning software to determine whether the received file is accurate and complete.
[0004] However, many files have high requirements for timeliness and need to be scanned as soon as possible to determine whether the files are accurate and complete. However, the existing monitoring software monitors all files. When the number of files is too large, it is difficult to monitor the changed files in a timely manner, thus unable to scan the files in a timely manner. Summary of the Invention
[0005] The embodiments of this application provide a file scanning method, apparatus, device, and computer storage medium, which can at least solve the problem in the prior art that when the number of files is too large, it is difficult to monitor the changed files in a timely manner, thus unable to scan the files in a timely manner.
[0006] In a first aspect, the embodiments of this application provide a file scanning method, which includes:
[0007] Monitoring the storage space size occupied by the folders under the configured path to obtain target folders whose storage space size has changed;
[0008] Obtaining the target files in the target folders, the first feature values of the target source files corresponding to the target files, and the first attribute information of the target source files;
[0009] Scanning the target files according to the target files, the first feature values, and the first attribute information to obtain a scanning result.
[0010] In a second aspect, the embodiments of this application provide a file scanning apparatus, which includes:
[0011] A monitoring module, configured to monitor the storage space size occupied by the folders under the configured path to obtain target folders whose storage space size has changed;
[0012] An acquisition module, configured to acquire 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;
[0013] 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.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions;
[0015] When the processor executes the computer program instructions, the file scanning method shown in any one of the embodiments of the first aspect is implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the file scanning method shown in any one of the embodiments of the first aspect is implemented.
[0017] The file scanning method, device, equipment, and computer storage medium according to the embodiments of the present application monitor the storage space size occupied by the folders under the configured path, obtain the target folder whose storage space size has changed, and acquire the target file in the target folder, the first feature value of the target source file corresponding to the target file, and the first attribute information of the target source file, and then scan the target file according to the target file, the first feature value, and the first attribute information to obtain a scanning result. In this way, the monitoring granularity is at the folder level rather than the file level, reducing the number of monitored objects, improving the monitoring efficiency, facilitating timely discovery of the target folder whose storage space size has changed, and thus enabling timely scanning of the target files in the target folder. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0019] Figure 1 is a flowchart of a file scanning method shown according to an exemplary embodiment;
[0020] Figure 2 is a flowchart of another file scanning method shown according to an exemplary embodiment;
[0021] Figure 3 is a flowchart of still another file scanning method shown according to an exemplary embodiment;
[0022] Figure 4 It is an architecture diagram of a document scanning system shown according to an exemplary embodiment;
[0023] Figure 5 It is a schematic structural diagram of a document scanning device shown according to an exemplary embodiment;
[0024] Figure 6 It is a schematic structural diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners
[0025] The features and exemplary embodiments of various aspects of the present application will be described in detail below. To make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than limiting the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only intended to provide a better understanding of the present application by showing examples of the present application.
[0026] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the elements defined by the statement "comprising..." do not exclude the presence of additional identical elements in the process, method, article or device comprising the elements.
[0027] Figure 1 It shows a schematic flow diagram of a document scanning method provided by an embodiment of the present application.
[0028] As Figure 1 shown, the document scanning method may include the following steps:
[0029] First, S110, monitor the storage space size occupied by the folders in the configuration path to obtain the target folder whose storage space size has changed;
[0030] Secondly, S120, obtain the target file in the target folder, the first feature value of the target source file corresponding to the target file, and the first attribute information of the target source file;
[0031] Then, in S130, scan the target file based on the target file, the first eigenvalue, and the first attribute information to obtain a scan result.
[0032] Thus, by monitoring the storage space size occupied by the folders under the configured path, the target folder with a changed storage space size is obtained, and the target file in the target folder, the first eigenvalue of the target source file corresponding to the target file, and the first attribute information of the target source file are acquired. Then, the target file is scanned based on the target file, the first eigenvalue, and the first attribute information to obtain a scan result. In this way, the monitoring granularity is at the folder level rather than the file level, reducing the number of monitored objects, improving the monitoring efficiency, facilitating the timely discovery of the target folder with a changed storage space size, and thus enabling the timely scanning of the target files in the target folder.
[0033] The above steps are described in detail below, as follows:
[0034] First, regarding S110, the configured path may include the storage path of the received files. Since many files, especially data files, have high requirements for timeliness and need to be scanned as soon as possible, it is necessary to promptly discover newly received files for timely scanning. This application can obtain the target folder with a changed storage space size by monitoring the storage space size occupied by the folders under the configured path. A changed storage space size can indicate that newly received files have been stored in the target folder, thereby determining that the files stored in the target folder are newly received files that need to be scanned.
[0035] In addition, in an optional implementation manner, before S110, the method may further include:
[0036] Name the received file according to a preset naming rule to obtain a file name;
[0037] Parse the file name to determine the receiving path;
[0038] Store the received file in the receiving path.
[0039] Here, after receiving a file, it can be named according to a preset naming rule to obtain a standardized file name. The receiving path of the file can be parsed from the file name, and then the file can be stored under the receiving path. The monitored configured path may include the receiving path, so that the receiving path can be monitored. In the case where it is monitored that the storage space size of the folder under the receiving path has changed, the files stored in the folder with a changed storage space size under the receiving path can be scanned.
[0040] In addition, the file name can also be named by the file sender according to the preset naming rules before sending. In this way, the file receiver does not need to name the file and can directly parse the file name to determine the receiving path, and then store the received file in this receiving path.
[0041] In one example, the preset naming rule can be that the file name is composed of the file sender's system name, the source file name, the file type, the date, and the batch number. Specifically, the received file A can be named according to this preset naming rule to obtain the file name "S1-a-w-2021.09.02-1". Since the receiving path for files with file type w and date being the first batch in September 2021 is U, the receiving path of file A can be determined by parsing this file name, and then file A can be stored in the receiving path U.
[0042] In this way, the receiving path of the file can be determined, which is convenient for storing the received file in this receiving path. And since this receiving path is under the configured path, it can ensure that the received file can be monitored in a timely manner, so that the received file can be scanned in a timely manner. In addition, since the receiving path is parsed from the standardized file name, the number of receiving paths is limited, so the number of folders under the monitored configured path is also limited, which is convenient for timely monitoring of folders whose occupied storage space size has changed, improving the monitoring efficiency.
[0043] Secondly, regarding S120, since the occupied storage space size of the target folder has changed, the target file in the target folder can be a newly received file that needs to be scanned. Before scanning, it is necessary to first obtain the target file, the first eigenvalue of the target source file corresponding to the target file, and the first attribute information of the target source file. The target source file can be the target file before being sent. The first eigenvalue can be calculated by the sender before sending and then sent to the receiver together with the target file and the first attribute information.
[0044] In addition, the first eigenvalue and the first attribute information of the target source file can also be stored in the database. When needed, access the database to obtain them from the database. However, this method requires accessing the database every time the first eigenvalue and the first attribute information are used. Therefore, the database needs to be accessed multiple times during the file scanning process, reducing the file scanning efficiency. While directly sending the first eigenvalue and the first attribute information from the sender to the receiver, the receiver can directly use the first eigenvalue and the first attribute information during scanning without accessing the database multiple times, improving the scanning efficiency.
[0045] Then, regarding S130, based on the obtained target file, the first eigenvalue of the target source file corresponding to the target file, and the first attribute information of the target source file, the target file can be scanned to obtain a scan result.
[0046] Based on this, in an alternative embodiment, S130 may specifically include:
[0047] Calculate the second eigenvalue of the target file based on the target file;
[0048] Compare the first eigenvalue and the second eigenvalue;
[0049] In the case where the first eigenvalue and the second eigenvalue are consistent, compare the first attribute information and the second attribute information of the target file;
[0050] In the case where the first attribute information and the second attribute information are consistent, record the first file information of the target file in the database and move the target file to the first preset path.
[0051] Here, the eigenvalue of the received file, that is, the second eigenvalue of the target file, can be calculated, and then the eigenvalue of the received file is compared with the eigenvalue calculated before the file is sent, that is, the first eigenvalue of the target source file. If the two eigenvalues are consistent, then continue to compare the attribute information of the received file, that is, the second attribute information of the target file, with the attribute information before the file is sent, that is, the first attribute information of the target source file. If the two attribute information are consistent, record the first file information of the target file in the database and move the target file to the first preset path. The first preset path can be different from the receiving path and is used to store the files that have been scanned and confirmed to be correct to avoid repeated scanning of the scanned files. The first preset path can be determined by parsing the file name of the received file. When recording the first file information of the target file in the database, the first preset path can be used as the primary key. The first file information may include the first eigenvalue, the second eigenvalue, the first attribute information, the second attribute information, the scanning time and the number of scans of the target file. The scanning time can be the start time of scanning or the end time of scanning, which is not limited here, but in a system, it should be unified, either using the start time of scanning as the scanning time or using the end time of scanning as the scanning time.
[0052] In one example, based on the Message-Digest Algorithm 5 (MD5), the MD5 value of the target file B, which is also the second eigenvalue, can be calculated, and the MD5 value of the target file B is compared with the MD5 value of the target source file b corresponding to the target file B, which is also the first eigenvalue. If the MD5 value of the target file B is the same as the MD5 value of the target source file b, then the attribute information of the target file B, which is also the second attribute information, and the attribute information of the target source file b, which is also the first attribute information, are further compared. If the attribute information of the target file B and the attribute information of the target source file b are also the same, it indicates that the target file B is the same as the target source file b, and the received target file B is accurate. Then, record the MD5 value of the target file B, the MD5 value of the target source file b, the attribute information of the target file B, the attribute information of the target source file b, the scanning time and the number of scans of the target file B in the database, and move the target file B to path N, which is also the first preset path.
[0053] In this way, through the above process, the target file can be scanned, and when it is confirmed that the eigenvalue and attribute information of the target file are both the same as those of the target source file, the target file is moved to the first preset path, thus avoiding repeated scanning of the target files that have been scanned and improving the scanning efficiency.
[0054] In addition, in an alternative embodiment, the method may further include:
[0055] When the first eigenvalue and the second eigenvalue are the same, compare the first attribute information and the second attribute information of the target file;
[0056] When the first attribute information and the second attribute information are different, send a first feedback message to the sender of the target file.
[0057] Here, if the first eigenvalue and the second eigenvalue are the same, then the first attribute information and the second attribute information are further compared. If the attribute information is the same, it can indicate that the target file received by the receiver is different from the target source file before sending, and a first feedback message can be sent to the sender of the target file. The first feedback message can be used to feedback the information that the attributes of the target file and the target source file are inconsistent to the sender of the target file.
[0058] In one example, if the MD5 value of the target file C is the same as the MD5 value of the target source file c, then the attribute information of the target file C, which is also the second attribute information, and the attribute information of the target source file c, which is also the first attribute information, are further compared. If the attribute information of the target file C and the attribute information of the target source file c are different, it indicates that the target file C received by the receiver is different from the target source file c before sending, and the information that the attributes of the target file C and the target source file c are inconsistent can be feedback to the sender.
[0059] In this way, through the above process, the eigenvalue can be compared first, and when the eigenvalues are the same, the attribute information can be further compared, thereby reducing the number of times of comparing the attribute information. Since the information to be compared is relatively complex when comparing the attribute information, reducing the number of times of comparing the attribute information can improve the scanning efficiency. In addition, when the attribute information is inconsistent, a first feedback message can be sent to the sender of the target file, enabling the sender to resend the accurate file.
[0060] In addition, in an optional implementation manner, after comparing the first eigenvalue and the second eigenvalue, the method may further include:
[0061] When the first eigenvalue and the second eigenvalue are inconsistent, the target file and the second file information of the target file are stored in a second preset path.
[0062] Here, if the second eigenvalue of the received target file is inconsistent with the first eigenvalue of the target source file before sending, it may be that the target file is inconsistent with the target source file, but it may also be that the target file has not been fully received due to transmission delay. To avoid inaccurate scanning results caused by transmission delay, the target file and the second file information of the target file can be stored in a second preset path for re-scanning the target file. The second preset path can be a path for storing files that need to be re-scanned. The second file information may include the first eigenvalue, the second eigenvalue, the first attribute information, the scanning time and the number of scans of the target file. In addition, the second file information can be recorded in the database, and when recording, the receiving path corresponding to the target file can be used as the primary key.
[0063] In an example, if the MD5 value of the received target file D is inconsistent with the MD5 value of the target source file sent by the sender, then the target file D, the MD5 value of 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 number of scans of the target file D are all stored in path M, that is, the second preset path.
[0064] In this way, the target file with the second eigenvalue of the received target file inconsistent with the first eigenvalue of the target source file before sending can be stored in the second preset path for re-scanning the target file, avoiding inaccurate scanning results caused by transmission delay.
[0065] In addition, since the reason for the inconsistency between the second eigenvalue of the target file and the first eigenvalue of the target source file may be that the target file has not been fully received due to transmission delay, it is necessary to store the target file and the second file information of the target file in a second preset path for storing files that need to be scanned again. Subsequently, the files in the second preset path need to be scanned again. The method for the re-scanning is as follows:
[0066] Based on the above S110 - S130, in a possible embodiment, as Figure 2 shown, when the first eigenvalue and the second eigenvalue are inconsistent, after storing the target file and the second file information of the target file in the second preset path, the method may further include: S210 - S250, where:
[0067] S210, Obtain a first file and the third file information of the first file from the second preset path.
[0068] Here, the first file may be a file that needs to be scanned again, and the third file information may include the eigenvalue of the first file calculated during each scan, the scan time of the first file during each scan, the number of scan times of the first file being scanned, the third eigenvalue of the first source file corresponding to the first file, and the 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 scan of the first file.
[0069] In one example, the first file E, the MD5 value of the first file E calculated during the first scan, the scan time 00:20:30 of the first file E during the first scan, the number of scan times 1 of the first file E being 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 can be obtained from path M.
[0070] S220, Calculate the fourth eigenvalue of the first file based on the first file.
[0071] Here, the fourth eigenvalue of the first file can be calculated based on the first file, and this fourth eigenvalue can be used as one of the bases for determining whether the first file and the first source file are consistent. Since the first file may not have been fully received during the previous scan of the first file due to transmission delay, the fourth eigenvalue may be different from the eigenvalue calculated during the previous scan of the first file.
[0072] In one example, the MD5 value of the first file E, that is, the fourth eigenvalue, can be calculated based on the MD5 algorithm.
[0073] S230, Compare the third eigenvalue and the fourth eigenvalue.
[0074] Here, since the fourth eigenvalue may be different from the eigenvalue calculated during the previous scan of the first file, during the next scan, it is necessary to recalculate the eigenvalue and, based on the recalculated fourth eigenvalue, compare it again with the eigenvalue of the first source file before transmission, that is, the third eigenvalue.
[0075] In one example, the MD5 value of the first file E can be compared with the MD5 value of the first source file e, that is, the third eigenvalue.
[0076] Based on this, in an alternative embodiment, after S230, the method may further include:
[0077] In the case where the third eigenvalue and the fourth eigenvalue are inconsistent, obtain the initial scan time and the current scan time of the first file;
[0078] Calculate the time difference between the initial scan time and the current scan time;
[0079] In the case where the time difference is greater than the preset time difference, obtain the number of scans of the first file;
[0080] In the case where the number of scans is not greater than the preset number of scans, store the first file and the third file information in the second preset path.
[0081] Here, in the case where the third eigenvalue and the fourth eigenvalue are inconsistent, it is possible to determine whether to perform the next scan on the first file based on the time difference between the initial scan time and the current scan time and the number of scans.
[0082] Specifically, the initial scan time and the current scan time of the first file can be obtained, the time difference between the initial scan time and the current scan time can be calculated, and then the time difference can be compared with the preset time difference. If the time difference is greater than the preset time difference, there are two possibilities: First, even if there is a transmission delay, the first file has been completely received, so the inconsistency between the third eigenvalue and the fourth eigenvalue is due to an error in the first file during transmission, resulting in inconsistency with the first source file; Second, the transmission delay is too severe and the first file has not been completely received yet. Therefore, although the third eigenvalue and the fourth eigenvalue are inconsistent, the first file and the first source file may be consistent. Based on this, in order to avoid incorrect scan results caused by the first file not being completely received due to too severe transmission delay, it is possible to further determine whether to perform the next scan on the first file by comparing the number of times the first file has been scanned, that is, the number of scans, with the preset number of scans. Specifically, in the case where the number of scans is not greater than the preset number of scans, it is determined that the next scan needs to be performed on the first file. Therefore, the first file and the third file information are stored in the second preset path and waiting for the next scan.
[0083] In one example, when the MD5 value of the first file E is inconsistent with the MD5 value of the first source file e, obtain the initial scan time 00:20:30 of the first file E and the current scan time 00:25:30, and calculate the time difference between the initial scan time and the current scan time to be 5 minutes. Then compare this time difference with the preset time difference, which can be 3 minutes. Since the time difference between the initial scan time and the current scan time is greater than the preset time difference, it is necessary to further compare the scan count of the first file E with the preset scan count. Since the first file E has only been scanned once before this scan, the scan count is 1, and the preset scan count can be 3. Therefore, the scan count of the first file E is less than the preset scan count, and the first file E needs to be stored in path M and wait for the next scan.
[0084] In this way, it is possible to determine whether the first file needs to be scanned next based on two factors: scan time and scan count, and to avoid incorrect scan results caused by transmission delay to the greatest extent.
[0085] In addition, in an alternative embodiment, after obtaining the scan count of the first file when the time difference is greater than the preset time difference, the method may further include:
[0086] When the scan count is greater than the preset scan count, send a third feedback message to the sender of the first file.
[0087] Here, when the third eigenvalue and the fourth eigenvalue are inconsistent and the time difference between the initial scan time and the current scan time is greater than the preset time difference, if the scan count is greater than the preset scan count, it can be indicated that the first file is inconsistent with the first source file, and a third feedback message can be sent to the sender of the first file. This third feedback message can be used to feedback to the sender of the first file the information that the eigenvalues of the first file and the first source file are inconsistent.
[0088] 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 initial scan time of the first file F and the current scan time is 1 minute (less than the preset time difference of 3 minutes), the scan count of the first file F is obtained as 4, and the preset scan count can be 3. Therefore, the scan count of the first file F is greater than the preset scan count, indicating that the first file F received by the receiver is different from the first source file f before sending, and information that the eigenvalues of the first file F and the first source file f are inconsistent can be fed back to the sender.
[0089] In this way, when both the scan time and the scan count exceed the preset values, it can be determined that the first file is inconsistent with the first source file, which is convenient for timely feedback to the sender so as to obtain an accurate and error-free file again.
[0090] 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:
[0091] When the time difference is not greater than a preset time difference, store the first file and the third file information in a second preset path.
[0092] Here, if the time difference between the initial scan time and the current scan time is not greater than the preset time difference, it may indicate that the first file may not have been fully received due to transmission delay. Therefore, the first file and the third file information can be stored in the second preset path and wait for the next scan.
[0093] In an example, the initial scan time of the first file G is 00:21:30, and the time difference from the current scan time 00:22:30 is 1 minute, which is less than the preset time difference of 3 minutes. Therefore, the first file G may not have been fully received due to transmission delay, and the first file G and the third file information can be stored in path M and wait for the next scan.
[0094] In this way, when the time difference between the initial scan time of the first file and the current scan time is not greater than the preset time difference, by storing the first file and the third file information in the second preset path, the first file can be scanned again, avoiding incorrect scan results caused by transmission delay.
[0095] S240, when the third eigenvalue and the fourth eigenvalue are the same, compare the third attribute information with the fourth attribute information of the first file.
[0096] Here, in addition to the above situation where the third eigenvalue and the fourth eigenvalue are different, there is also a situation where the third eigenvalue and the fourth eigenvalue are the same. When the third eigenvalue and the fourth eigenvalue are the same, the attribute information can be further compared. Specifically, compare the fourth attribute information of the first file with the third attribute information of the first source file.
[0097] In an example, if the MD5 value of the first file H is the same as the MD5 value of the first source file h, compare the attribute information of the first file H with the attribute information of the first source file h.
[0098] S250, when the third attribute information and the fourth attribute information are the same, record the third file information in the database and move the first file to a first preset path.
[0099] Here, if the fourth attribute information of the first file is consistent with the third attribute information of the first source file, it can be indicated that the first file and the first source file are consistent. The third file information can be recorded in the database and the first file can be moved to the first preset path to avoid being scanned repeatedly.
[0100] In an example, the attribute information of the first file H is consistent with the attribute information of the first source file h, indicating that the first file H and the first source file h are consistent. The third file information of the first file H can be recorded in the database and the first file H can be moved to the path N.
[0101] In this way, after re-scanning, the first file confirmed to be consistent with the first source file can be moved to the first preset path, thus avoiding repeated scanning of the first file that has been scanned, and improving the scanning efficiency.
[0102] In addition, in an alternative embodiment, the method may further include:
[0103] When the third eigenvalue is consistent with the fourth eigenvalue, compare the third attribute information with the fourth attribute information of the first file;
[0104] When the third attribute information is inconsistent with the fourth attribute information, send a second feedback message to the sender of the first file.
[0105] Here, when the third eigenvalue is consistent with the fourth eigenvalue, the third attribute information of the first source file and the fourth attribute information of the first file can be compared. If the third attribute information is inconsistent with the fourth attribute information, it indicates that the first file and the first source file are inconsistent, and a second feedback message can be sent to the sender of the first file. The second feedback message can be used to feedback to the sender of the first file the information that the attributes of the first file and the first source file are inconsistent.
[0106] In an example, when the MD5 value of the first file J is consistent with the MD5 value of the first source file j, compare the attribute information of the first file J 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 receiver is different from the first source file j before sending, and the information that the attributes of the first file J and the first source file j are inconsistent can be feedback to the sender.
[0107] In this way, through the above process, when re-scanning, in the case where the eigenvalues of the first file and the first source file are consistent but the attribute information is inconsistent, a second feedback message can be sent to the sender of the first file so that the sender can re-send the accurate file.
[0108] In addition to the method described above, which monitors the storage space occupied by the folders in the configuration path and triggers the scanning of the target files in the target folder when the storage space size changes, the embodiments of the present application also provide a method of triggering file scanning at regular intervals by setting a scheduled task. The specific scheduled scanning method includes:
[0109] According to the preset scheduled task, trigger the scanning of the folders in the configuration path at regular intervals, and recursively scan to the second files in the folders;
[0110] Calculate the fifth eigenvalue of the second file;
[0111] Compare the fifth eigenvalue with the sixth eigenvalue of the second source file corresponding to the second file;
[0112] When the fifth eigenvalue is consistent with the sixth eigenvalue, compare the fifth attribute information of the second file with the sixth attribute information of the second source file;
[0113] When the fifth attribute information is consistent with the sixth attribute information, record the fourth file information of the second file in the database and move the second file to the first preset path. The fourth file information includes the above-mentioned fifth eigenvalue, sixth eigenvalue, fifth attribute information, sixth attribute information, scanning time and scanning times of the second file;
[0114] When the fifth attribute information is inconsistent with the sixth attribute information, send the fourth feedback information to the sender of the second file.
[0115] The scheduled scanning method further includes:
[0116] When the fifth eigenvalue is inconsistent with the sixth eigenvalue, store the second file and the fourth file information of the second file in the second preset path. The fourth file information includes the above-mentioned fifth eigenvalue, sixth eigenvalue, sixth attribute information, scanning time and scanning times of the second file.
[0117] In one example, it is possible to set a scan of the folder under the configuration path every half hour, recursively scan to the second file Q in the folder, calculate the MD5 value of the second file Q, and compare it with the MD5 value of the second source file q. If the MD5 value of the second file Q is the same as the MD5 value of the second source file q, then further compare the attribute information of the second file Q and the attribute information of the second source file q. If the attribute information of the second file Q is the same as the attribute information of the second source file q, then record the MD5 value of the second file Q, the MD5 value of the second source file q, the attribute information of the second file Q, the attribute information of the second source file q, the scan time and the number of scans of the second file Q in the database, and move the second file Q to path N to avoid being scanned repeatedly. If the attribute information of the second file Q is inconsistent with the attribute information of the second source file q, then feedback the information that the second file Q is inconsistent with 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 is inconsistent with the MD5 value of the second source file q, then store the second file Q, 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 scan time and the number of scans of the second file Q in path M and wait for the next scan.
[0118] Based on this, when there are conflicts among the three scanning processes for scanning the target file, the first file and the second file, the first file is scanned first, then the target file is scanned, and finally the second file is scanned. That is to say, when there are conflicts among the three scanning processes, the first file that needs to be scanned again and is stored in the second preset path is scanned first, then the target file in the target folder whose storage space size has changed is scanned, and finally the timed scanning task is executed to scan all files under the configuration path.
[0119] To better describe the entire solution, based on the above embodiments, combined with Figure 3 the specific examples of the file scanning method in Figure 4 and the file scanning system in
[0120] Figure 3 FIG. shows the flowchart of a file scanning method provided by an embodiment of the present application. This file scanning method can be applied to Figure 4 the file scanning system shown in Figure 3 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
[0121] S301, standardize the file name and path.
[0122] In one example, the transmission module 401 sends the received file Y, the MD5 value of file y, and the attribute information of file y to the standardization module 402. The standardization module 402 names file Y according to the preset naming rule "sender system name - source file name - file type - date - batch", determines that the file name of file Y is "S1 - y - k - 2021.08.05 - 2"; parses the file name "S1 - y - k - 2021.08.05 - 2" to determine that the receiving path of file Y is path X; also determines that the first preset path corresponding to file Y according to the file name "S1 - y - k - 2021.08.05 - 2" is path Z. After determining that the receiving path of file Y is path X, file Y is stored under path X.
[0123] S302. Determine folder x.
[0124] In one example, the file monitoring module 403 monitors in real time the storage space size occupied by the folders under the configured path, determines the file x whose storage space size has changed, indicates that the file stored in file x is a newly received file, and sends the file Y, the MD5 value of file y, and the attribute information of file y to the file scanning module 404.
[0125] S303. Calculate the first MD5 value of file Y.
[0126] In one example, the file scanning module 404 calculates the first MD5 value of file Y according to the received file Y.
[0127] S304. Determine whether the first MD5 value of file Y is consistent with the MD5 value of file y.
[0128] In one example, the file scanning module 404 determines whether the first MD5 value of file Y is consistent with the MD5 value of file y. If they are consistent, then execute S310. If they are not consistent, then execute S305.
[0129] S305. Store file Y and the file information of file Y.
[0130] In one example, if the first MD5 value of file Y is not consistent with the MD5 value of file y, then the file moving module 406 stores the file information such as the first MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y, and file Y to path M, and waits for re - scanning. In addition, the recording module 405 also records the file information such as the first MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y into the database.
[0131] S306, calculate the second MD5 value of file Y.
[0132] In one example, the file scanning module 404 obtains file information such as the first MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y, and file Y from path M. Then, based on file Y, calculate the second MD5 value of file Y.
[0133] S307, determine whether the second MD5 value of file Y is the same as the MD5 value of file y.
[0134] In one example, the file scanning module 404 determines whether the second MD5 value of file Y is the same as the MD5 value of file y. If they are the same, execute S310; if not, execute S308.
[0135] S308, determine whether the scanning time of file Y is greater than the preset scanning time.
[0136] In one example, if the second MD5 value of file Y is not the same as the MD5 value of file y, further determine whether the scanning time of file Y is greater than the preset scanning time. If so, execute S309; if not, return to S305. The file moving module 406 stores file information such as the first MD5 value of file Y, the second MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y each time, and file Y to path M and waits for the next scan. In addition, the recording module 405 also records file information such as the first MD5 value of file Y, the second MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y each time to the database.
[0137] S309, determine whether the number of scans of file Y is greater than the preset number of scans.
[0138] In one example, if the scanning time of file Y is greater than the preset scanning time, further determine whether the number of scans of file Y is greater than the preset number of scans. If so, execute S312; if not, return to S305. The file moving module 406 stores file information such as the first MD5 value of file Y, the second MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y each time, and file Y to path M and waits for the next scan. In addition, the recording module 405 also records file information such as the first MD5 value of file Y, the second MD5 value of file Y, the MD5 value of file y, the attribute information of file y, the scanning time and the number of scans of file Y each time to the database.
[0139] S310, determine whether the attribute information of file Y is the same as the attribute information of file y.
[0140] In one example, if the first MD5 value of file Y is the same as the MD5 value of file y, or the second MD5 value of file Y is the same as the MD5 value of file y, it is further determined whether the attribute information of file Y is the same as the attribute information of file y. If they are the same, S311 is executed; if they are different, S312 is executed.
[0141] S311, record the file information of file Y and move file Y.
[0142] In one example, if the attribute information of file Y is the same as the attribute information of file y, it indicates that file Y is the same as file y. The file moving module 406 moves file Y to path N, and the recording module 405 records in the database the MD5 value of file Y calculated during each scan, the attribute information of file Y, the attribute information of file y, the scanning time and the number of scans of file Y, etc.
[0143] S312, send feedback information.
[0144] In one example, if the attribute information of file Y is different from the attribute information of file y, the transmission module 401 sends feedback information indicating inconsistent attributes to the sender of file Y; if the number of scans of file Y is greater than the preset number of scans, the transmission module 401 sends feedback information indicating inconsistent feature values to the sender of file Y.
[0145] In this way, by monitoring the storage space size occupied by the folders under the configured path, the target folder with the changed storage space size is obtained, and the target file in the target folder, the first feature value of the target source file corresponding to the target file, and the first attribute information of the target source file are acquired. Then, based on the target file, the first feature value, and the first attribute information, the target file is scanned to obtain the scan result. In this way, the monitoring granularity is at the folder level rather than the file level, reducing the number of monitoring objects, improving the monitoring efficiency, facilitating the timely discovery of the target folder with the changed storage space size, and thus enabling the timely scanning of the target files in the target folder.
[0146] Based on the same inventive concept, the present application also provides a file scanning device. The following combines Figure 5 to detail the file scanning device provided in the embodiments of the present application.
[0147] Figure 5 is a structural block diagram of a file scanning device shown according to an exemplary embodiment.
[0148] As Figure 5 shown, the file scanning device may include:
[0149] The monitoring module 501 is used to monitor the storage space size occupied by the folders under the configured path, and obtain the target folders whose storage space size has changed;
[0150] The obtaining module 502 is used to obtain the target files in the target folders, the first eigenvalue of the target source files corresponding to the target files, and the first attribute information of the target source files;
[0151] The scanning module 503 is used to scan the target files according to the target files, the first eigenvalue, and the first attribute information, and obtain a scanning result.
[0152] In one embodiment, the scanning module 503 may specifically include:
[0153] The first calculation sub-module is used to calculate the second eigenvalue of the target file based on the target file;
[0154] The first comparison sub-module is used to compare the first eigenvalue and the second eigenvalue;
[0155] The second comparison sub-module is used to compare the first attribute information and the second attribute information of the target file when the first eigenvalue and the second eigenvalue are consistent;
[0156] The first processing sub-module is used to record the first file information of the target file in the database and move the target file to the first preset path when the first attribute information and the second attribute information are consistent. The first file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the second attribute information, the scanning time and the scanning times of the target file.
[0157] In one embodiment, the scanning module 503 may further include:
[0158] The third comparison sub-module is used to compare the first attribute information and the second attribute information of the target file when the first eigenvalue and the second eigenvalue are consistent;
[0159] The first sending sub-module is used to send the first feedback information to the sender of the target file when the first attribute information and the second attribute information are inconsistent.
[0160] In one embodiment, the scanning module 503 may further include:
[0161] The first storage sub-module is used to store the target file and the second file information of the target file to the second preset path when the first eigenvalue and the second eigenvalue are inconsistent after comparing the first eigenvalue and the second eigenvalue. The second file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the scanning time of the target file, and the scanning times.
[0162] In one embodiment, the file scanning device may further include:
[0163] A naming module, configured to name the received file according to a preset naming rule to obtain a file name before monitoring the storage space size occupied by the folder in the monitoring configuration path and obtaining a target folder whose storage space size has changed;
[0164] A parsing module, configured to parse the file name to determine a receiving path;
[0165] A storage module, configured to store the received file in the receiving path, where the configuration path includes the receiving path.
[0166] In one embodiment, the scanning module 503 may further include:
[0167] A first obtaining sub-module, configured to, when the first eigenvalue and the second eigenvalue are inconsistent, after storing the target file and the second file information of the target file in a second preset path, obtain a first file and the third file information of the first file from the second preset path, where the third file information includes the eigenvalue of the first file calculated during each scanning process, the scanning time of the first file during each scanning, the number of scanning times of the first file, the third eigenvalue of the first source file corresponding to the first file, and the third attribute information of the first source file;
[0168] A second calculating sub-module, configured to calculate a fourth eigenvalue of the first file based on the first file;
[0169] A fourth comparing sub-module, configured to compare the third eigenvalue and the fourth eigenvalue;
[0170] A fifth comparing sub-module, configured to, when the third eigenvalue and the fourth eigenvalue are consistent, compare the third attribute information and the fourth attribute information of the first file;
[0171] A second processing sub-module, configured to, when the third attribute information and the fourth attribute information are consistent, record the third file information in the database and move the first file to a first preset path.
[0172] In one embodiment, the file scanning device may further include:
[0173] A fourth comparing module, configured to, when the third eigenvalue and the fourth eigenvalue are consistent, compare the third attribute information and the fourth attribute information of the first file;
[0174] A second sending module, configured to, when the third attribute information and the fourth attribute information are inconsistent, send second feedback information to the sender of the first file.
[0175] In one embodiment, the scanning module 503 may further include:
[0176] A second acquisition sub-module, configured to, after comparing a third eigenvalue with a fourth eigenvalue, and when the third eigenvalue is inconsistent with the fourth eigenvalue, acquire the initial scan time and the current scan time of the first file;
[0177] A third calculation sub-module, configured to calculate the time difference between the initial scan time and the current scan time;
[0178] A third acquisition sub-module, configured to, when the time difference is greater than a preset time difference, acquire the number of scans of the first file;
[0179] A second storage sub-module, configured to, when the number of scans is not greater than a preset number of scans, store the first file and the third file information to a second preset path.
[0180] In one embodiment, the scanning module 503 may further include:
[0181] A second sending sub-module, configured to, when the time difference is greater than a preset time difference, after acquiring the number of scans of the first file, and when the number of scans is greater than a preset number of scans, send third feedback information to the sender of the first file.
[0182] In one embodiment, the scanning module 503 may further include:
[0183] A third storage sub-module, configured to, after calculating the time difference between the initial scan time and the current scan time, and when the time difference is not greater than a preset time difference, store the first file and the third file information to a second preset path.
[0184] Thus, by monitoring the storage space size occupied by the folders under the configuration path, the target folder with the changed storage space size is obtained, and the target file in the target folder, the first eigenvalue of the target source file corresponding to the target file, and the first attribute information of the target source file are acquired. Then, based on the target file, the first eigenvalue, and the first attribute information, the target file is scanned to obtain a scan result. In this way, the monitoring granularity is at the folder level instead of the file level, reducing the number of monitoring objects, improving the monitoring efficiency, facilitating the timely discovery of the target folder with the changed storage space size, and thus enabling the timely scanning of the target file in the target folder.
[0185] Figure 6 It is a schematic structural diagram of an electronic device shown according to an exemplary embodiment.
[0186] Such as Figure 6As shown, the electronic device 6 can implement the structural diagram of an exemplary hardware architecture of an electronic device according to the document scanning method and the document scanning device in the embodiments of the present application. The electronic device may refer to the electronic device in the embodiments of the present application.
[0187] The electronic device 6 may include a processor 601 and a memory 602 storing computer program instructions.
[0188] Specifically, the above-mentioned processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0189] The memory 602 may include a mass storage for information or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 602 may include a removable or non-removable (or fixed) medium. In a suitable case, the memory 602 may be internal or external to the integrated gateway device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory. In a specific embodiment, the memory 602 includes a read-only memory (ROM). In a suitable case, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0190] The processor 601 reads and executes the computer program instructions stored in the memory 602 to implement Figure 1 or Figure 4 the method in the shown embodiments and achieve the corresponding technical effects, which will not be elaborated here for the sake of brevity.
[0191] In one embodiment, the electronic device 6 may further include a transceiver 603 and a bus 604. Among them, as Figure 6 shown, the processor 601, the memory 602, and the transceiver 603 are connected through the bus 604 and complete communication with each other.
[0192] The bus 604 includes hardware, software, or both. By way of example and not limitation, the bus can 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 MicroChannel Architecture (MCA) bus, a Peripheral Component 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 buses, or a combination of two or more of these. Where appropriate, the bus 604 can include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0193] Embodiments of the present application also provide a computer storage medium storing computer-executable instructions for implementing the document scanning method described in the embodiments of the present application.
[0194] In some possible implementation manners, aspects of the method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code causes the computer device to execute the steps in the method according to various exemplary implementation manners of the present application described above in this specification. For example, the computer device can execute the document scanning method described in the embodiments of the present application.
[0195] The program product can employ any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection with 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 above.
[0196] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses, and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable information processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable information processing devices generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.
[0197] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable information processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.
[0198] These computer program instructions can also be loaded onto a computer or other programmable information processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.
[0199] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims
1. A document scanning method, characterized in that, The method includes: Monitoring the storage space size occupied by the folders under the configuration path to obtain a target folder whose storage space size has changed; Obtaining a target file in the target folder, a first eigenvalue of the target source file corresponding to the target file, and first attribute information of the target source file; Scanning the target file according to the target file, the first eigenvalue, and the first attribute information to obtain a scanning result; The scanning the target file according to the target file, the first eigenvalue, and the first attribute information to obtain a scanning result includes: Calculating a second eigenvalue of the target file based on the target file; Comparing the first eigenvalue and the second eigenvalue; When the first eigenvalue and the second eigenvalue are consistent, comparing the first attribute information and second attribute information of the target file; When the first attribute information and the second attribute information are consistent, recording first file information of the target file in a database and moving the target file to a first preset path, where the first file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the second attribute information, the scanning time and the number of scans of the target file; After comparing the first eigenvalue and the second eigenvalue, the method further includes: When the first eigenvalue and the second eigenvalue are inconsistent, storing the target file and second file information of the target file in a second preset path, where the second file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the scanning time of the target file, and the number of scans; After storing the target file and the second file information of the target file in the second preset path when the first eigenvalue and the second eigenvalue are inconsistent, the method further includes: Obtaining a first file and third file information of the first file from the second preset path, where the third file information includes the eigenvalue of the first file calculated during each scan, the scanning time of each scan of the first file, the number of scans of the first file, a third eigenvalue of the first source file corresponding to the first file, and third attribute information of the first source file; Calculating a fourth eigenvalue of the first file based on the first file; Comparing the third eigenvalue and the fourth eigenvalue; When the third eigenvalue and the fourth eigenvalue are consistent, comparing the third attribute information and fourth attribute information of the first file; When the third attribute information and the fourth attribute information are consistent, recording the third file information in the database and moving the first file to the first preset path.
2. The method according to claim 1, characterized in that The method further includes: When the first eigenvalue and the second eigenvalue are consistent, comparing the first attribute information and second attribute information of the target file; When the first attribute information and the second attribute information are inconsistent, sending first feedback information to the sender of the target file.
3. The method according to claim 1, wherein Before obtaining the target folder whose storage space size has changed, which is the storage space size occupied by the folder under the monitoring configuration path, the method further includes: Naming the received file according to a preset naming rule to obtain a file name; Parsing the file name to determine a receiving path; Storing the received file to the receiving path, where the configuration path includes the receiving path.
4. The method according to claim 1, characterized in that, The method further includes: When the third eigenvalue is consistent with the fourth eigenvalue, comparing the third attribute information with the fourth attribute information of the first file; When the third attribute information is inconsistent with the fourth attribute information, sending second feedback information to the sender of the first file.
5. The method according to claim 1, wherein After comparing the third eigenvalue and the fourth eigenvalue, the method further includes: When the third eigenvalue is inconsistent with the fourth eigenvalue, obtaining the initial scanning time and the current scanning time of the first file; Calculating 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 scanning times of the first file; When the scanning times are not greater than a preset number of scanning times, storing the first file and the third file information to the second preset path.
6. The method according to claim 5, wherein After obtaining the scanning times of the first file when the time difference is greater than a preset time difference, the method further includes: When the scanning times are greater than a preset number of scanning times, sending third feedback information to the sender of the first file.
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 includes: When the time difference is not greater than a preset time difference, storing the first file and the third file information to the second preset path.
8. A document scanning device, characterized in that, The device includes: A monitoring module, configured to monitor the storage space size occupied by the folder under the configuration path to obtain the target folder whose storage space size has changed; An obtaining module, configured to obtain the target file in the target folder, the first eigenvalue of the target source file corresponding to the target file, and the first attribute information of the target source file; A scanning module, configured to scan the target file according to the target file, the first eigenvalue, and the first attribute information to obtain a scanning result; The scanning module includes: A first calculation sub-module, configured to calculate the second eigenvalue of the target file based on the target file; A first comparison sub-module, configured to compare the first eigenvalue and the second eigenvalue; A second comparison sub-module, configured to compare the first attribute information with the second attribute information of the target file when the first eigenvalue is consistent with the second eigenvalue; The first processing sub-module is configured to record the first file information of the target file in the database and move the target file to a first preset path when the first attribute information is consistent with the second attribute information. The first file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the second attribute information, the scanning time and the number of scans of the target file. The scanning module further includes: The first storage sub-module is configured to store the target file and the second file information of the target file to a second preset path when the first eigenvalue is inconsistent with the second eigenvalue after comparing the first eigenvalue and the second eigenvalue. The second file information includes the first eigenvalue, the second eigenvalue, the first attribute information, the scanning time and the number of scans of the target file. The scanning module further includes: The first acquisition sub-module is configured to, when the first eigenvalue is inconsistent with the second eigenvalue, after storing the target file and the second file information of the target file to the second preset path, obtain a first file and the third file information of the first file from the second preset path. The third file information includes the eigenvalue of the first file calculated during each scanning process, the scanning time of each scan of the first file, the number of scans of the first file, the third eigenvalue of the first source file corresponding to the first file, and the third attribute information of the first source file. The second calculation sub-module is configured to calculate a fourth eigenvalue of the first file based on the first file. The fourth comparison sub-module is configured to compare the third eigenvalue and the fourth eigenvalue. The fifth comparison sub-module is configured to compare the third attribute information and the fourth attribute information of the first file when the third eigenvalue is consistent with the fourth eigenvalue. The second processing sub-module is configured 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. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the file scanning method according to any one of claims 1-7 is implemented.
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 the processor, the file scanning method according to any one of claims 1-7 is implemented.
Citation Information
Patent Citations
File downloading method, device and system
CN109922142A
File change monitoring method and device, electronic equipment and storage medium
CN111769933A
Automatic imported file printing method, device, equipment and storage medium
CN111930324A