A file scanning method, device, electronic device and storage medium
By structuring the multi-forktree file information and generating a collection of storage tree file information, the problem of pause and continued operation during directory scanning is solved, and efficient processing and performance improvement of complex directory structures is achieved.
Patent Information
- Application Number
- CN202210377071.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-04-12
AI Technical Summary
Existing file transfer applications do not support pause and continue operations during directory scanning, and cannot retain the original directory tree structure, especially when processing massive or complex directory files, it is easy to cause program stuck.
By structuring the multi-forktree file information, a collection of storage tree file information is generated, which supports pause and continue operations during file storage, and the directory tree is paging to improve scanning performance.
It realizes hierarchical scanning processing of complex directory structures, retains the directory tree structure, supports pause and continue operations during the scanning process, and improves scanning performance and response speed.
Smart Images

Figure CN114860656B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a file scanning method, device, electronic equipment and storage medium. Background Art
[0002] As the number of files on computers and mobile phones increases, the transfer of directory files has become an indispensable function in people's demand for file transfer. Currently, the transfer applications on the market are prone to the following problems during the scanning process of the transfer directory: they do not support pause and resume operations during the directory scanning process; the transferred directory file displays all sub-files as the first level, without retaining the original directory tree structure; when transferring directory files with large quantum files or complex directory tree structures, the program will freeze. Summary of the invention
[0003] The present invention provides a file scanning method, device, electronic device and storage medium that can scan and process a complex directory structure level by level, retain the directory tree structure, and store the directory tree in pages, which is beneficial to improving the scanning performance, supporting pause and resume operations during the scanning process, and quickly responding to pause and resume operations.
[0004] In order to solve the technical problems in the above background technology, a first aspect of an embodiment of the present invention discloses a file scanning method, the method comprising:
[0005] Performing file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a plurality of directory object information;
[0006] The multi-tree file information is structured to obtain a storage tree file information set including a plurality of storage tree file information; the storage tree file information set is used to respond to the suspend storage operation and continue storage operation of the file storage process in the file information to be scanned.
[0007] As an optional implementation manner, in the first aspect of the embodiment of the present invention,
[0008] The multi-tree file information is subjected to structural processing to obtain a storage tree file information set including a plurality of storage tree file information, including:
[0009] Determine target scan directory information according to the multi-tree file information, and update the multi-tree file information; the target scan directory information includes first path information and first primary key information;
[0010] Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information;
[0011] Determine whether the updated multi-tree file information contains the directory object information, and obtain a second determination result;
[0012] When the second judgment result is yes, triggering the step of determining target scan directory information according to the multi-tree file information and updating the multi-tree file information;
[0013] When the second judgment result is no, a storage tree file information set including a plurality of storage tree file information is determined.
[0014] As an optional implementation manner, in the first aspect of the embodiment of the present invention,
[0015] The obtained file information to be scanned is subjected to file scanning processing to obtain multi-branch tree file information, including:
[0016] Determine whether the acquired file information to be scanned contains directory object information, and obtain a first determination result;
[0017] When the first judgment result is no, determining a root directory object information set according to the task root path information corresponding to the to-be-scanned file information; the root directory object information set includes a plurality of root directory object information; the root directory object information includes second path information and second primary key information;
[0018] Determine the multi-tree file information according to the root directory object information set;
[0019] When the first judgment result is yes, it is determined that the file information to be scanned is the multi-tree file information.
[0020] As an optional implementation manner, in the first aspect of the embodiment of the present invention, determining the storage tree file information corresponding to the target scan directory information according to the target scan directory information includes:
[0021] Determining subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information;
[0022] Performing value assignment processing on the sub-file information according to the first primary key information corresponding to the target scan directory information to obtain attribute file information corresponding to the target scan directory information;
[0023] The attribute file information corresponding to the target scanning directory information is grouped to obtain the storage tree file information corresponding to the target scanning directory information.
[0024] As an optional implementation, in the first aspect of the embodiment of the present invention, before determining the subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information, the method further includes:
[0025] Determine whether the cached file information in the database satisfies a value condition, and obtain a third determination result; the value condition is related to the file information that has been cached in the cached file information;
[0026] When the third judgment result is yes, the sub-file information is filtered and updated using the cache file information.
[0027] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the grouping of the attribute file information corresponding to the target scan directory information to obtain the storage tree file information corresponding to the target scan directory information includes:
[0028] Get the grouping threshold;
[0029] The attribute file information corresponding to the target scan directory information is grouped using the grouping threshold to obtain storage tree file information corresponding to the target scan directory information; the storage tree file information includes M storage file information; M is a non-negative number less than or equal to the grouping threshold.
[0030] As an optional implementation, in the first aspect of the embodiment of the present invention, after the multi-tree file information is structured to obtain a storage tree file information set, the method further includes:
[0031] Determine whether the storage tree file information set meets a directory file condition to obtain a fourth determination result; the directory file condition indicates that the storage tree file information exists in a directory file;
[0032] When the fourth judgment result is yes, a sub-directory object information set is determined according to the storage tree file information set; the sub-directory object information set includes a plurality of sub-directory object information;
[0033] The multi-tree file information is updated using the sub-directory object information set, and the structured processing of the multi-tree file information is triggered to obtain a storage tree file information set.
[0034] A second aspect of an embodiment of the present invention discloses a document scanning device, the device comprising:
[0035] The first processing module is used to perform file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a plurality of directory object information;
[0036] The second processing module is used to perform structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information; the storage tree file information set is used to respond to the suspend storage operation and the continue storage operation in the file storage process in the file information to be scanned.
[0037] As an optional implementation, in the second aspect of the embodiment of the present invention,
[0038] The specific method in which the second processing module performs structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information is:
[0039] Determine target scan directory information according to the multi-tree file information, and update the multi-tree file information; the target scan directory information includes first path information and first primary key information;
[0040] Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information;
[0041] Determine whether the updated multi-tree file information contains the directory object information, and obtain a second determination result;
[0042] When the second judgment result is yes, triggering the step of determining target scan directory information according to the multi-tree file information and updating the multi-tree file information;
[0043] When the second judgment result is no, a storage tree file information set including a plurality of storage tree file information is determined.
[0044] As an optional implementation, in the second aspect of the embodiment of the present invention,
[0045] The first processing module performs file scanning processing on the acquired file information to be scanned, and obtains the multi-branch tree file information in the following specific manner:
[0046] Determine whether the acquired file information to be scanned contains directory object information, and obtain a first determination result;
[0047] When the first judgment result is no, determining a root directory object information set according to the task root path information corresponding to the to-be-scanned file information; the root directory object information set includes a plurality of root directory object information; the root directory object information includes second path information and second primary key information;
[0048] Determine the multi-tree file information according to the root directory object information set;
[0049] When the first judgment result is yes, it is determined that the file information to be scanned is the multi-tree file information.
[0050] As an optional implementation, in the second aspect of the embodiment of the present invention, the second processing module determines the storage tree file information corresponding to the target scan directory information according to the target scan directory information in a specific manner as follows:
[0051] Determining subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information;
[0052] Performing value assignment processing on the sub-file information according to the first primary key information corresponding to the target scan directory information to obtain attribute file information corresponding to the target scan directory information;
[0053] The attribute file information corresponding to the target scanning directory information is grouped to obtain the storage tree file information corresponding to the target scanning directory information.
[0054] As an optional implementation, in the second aspect of the embodiment of the present invention, before the second processing module determines the sub-file information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information, the device further includes:
[0055] A first judgment module is used to judge whether the cached file information in the database meets the value condition, and obtain a third judgment result; the value condition is related to the file information that has been cached in the cached file information;
[0056] The first updating module is used to filter and update the sub-file information by using the cache file information when the third judgment result is yes.
[0057] As an optional implementation, in the second aspect of the embodiment of the present invention, the second processing module performs group processing on the attribute file information corresponding to the target scan directory information, and obtains the storage tree file information corresponding to the target scan directory information in a specific manner as follows:
[0058] Get the grouping threshold;
[0059] The attribute file information corresponding to the target scan directory information is grouped using the grouping threshold to obtain storage tree file information corresponding to the target scan directory information; the storage tree file information includes M storage file information; M is a non-negative number less than or equal to the grouping threshold.
[0060] As an optional implementation, in the second aspect of the embodiment of the present invention, after the second processing module performs structured processing on the multi-tree file information to obtain a storage tree file information set, the device further includes:
[0061] A second judgment module is used to judge whether the storage tree file information set meets the directory file condition to obtain a fourth judgment result; the directory file condition indicates that the storage tree file information exists in a directory file;
[0062] a determination module, configured to determine a sub-directory object information set according to the storage tree file information set when the fourth judgment result is yes; the sub-directory object information set includes a plurality of sub-directory object information;
[0063] The second updating module is used to update the multi-tree file information by using the sub-directory object information set, and trigger the execution of the structured processing of the multi-tree file information to obtain the storage tree file information set.
[0064] A third aspect of the present invention discloses another document scanning device, the device comprising:
[0065] A memory storing executable program code;
[0066] a processor coupled to the memory;
[0067] The processor calls the executable program code stored in the memory to execute part or all of the steps in the file scanning method disclosed in the first aspect of the embodiment of the present invention.
[0068] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute some or all of the steps in the file scanning method disclosed in the first aspect of the embodiment of the present invention.
[0069] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0070] The method of the present invention includes: performing file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a plurality of directory object information; the directory object information includes a first path information and a first primary key information; performing structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information; the storage tree file information set can quickly respond to the suspend storage operation and the continue storage operation in the file storage process. It can be seen that the present invention can scan and process the complex directory structure level by level, and retain the directory tree structure, and can store the directory tree in pages, which is conducive to improving the scanning performance, supporting the suspend and continue operations in the scanning process, and quickly responding to the suspend and continue operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 It is a flowchart of a file scanning method disclosed in an embodiment of the present invention;
[0073] Figure 2 It is a flowchart of another file scanning method disclosed in an embodiment of the present invention;
[0074] Figure 3 It is a structural schematic diagram of a document scanning device disclosed in an embodiment of the present invention;
[0075] Figure 4 It is a structural schematic diagram of another document scanning device disclosed in an embodiment of the present invention;
[0076] Figure 5 A schematic structural diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0077] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0078] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.
[0079] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0080] The present invention discloses a file scanning method, device, electronic device and storage medium, which can perform directory scanning on the file information to be scanned, construct a directory tree structure and store the files in groups, which is beneficial to improving the scanning performance, supporting the scanning of a million-level complex directory structure, supporting the pause and continue operation during the scanning process, and quickly responding to the pause and continue operation. The following are detailed descriptions respectively.
[0081] Embodiment 1
[0082] See also Figure 1 , Figure 1 : is a flowchart of a file scanning method disclosed in an embodiment of the present invention. Figure 1 The described file scanning method is applied to a data processing system, such as a local server or a cloud server for file scanning management, and the embodiments of the present invention are not limited thereto. Figure 1 As shown, the file scanning method may include the following operations:
[0083] 101. Perform file scanning processing on the acquired file information to be scanned to obtain multi-branch tree file information.
[0084] In the embodiment of the present invention, the multi-tree file information includes a plurality of directory object information.
[0085] In the embodiment of the present invention, the above directory object information includes first path information and first primary key information.
[0086] 102. Perform structured processing on the multi-tree file information to obtain a storage tree file information set including several storage tree file information.
[0087] In the embodiment of the present invention, the storage tree file information set is used to respond to the suspend storage operation and the resume storage operation of the file storage process in the file information to be scanned.
[0088] Optionally, the first primary key information represents the primary key of the parent directory stored in the database.
[0089] Optionally, the first path information represents a directory path of the sub-file.
[0090] Optionally, the above storage tree file information includes M storage file information.
[0091] In this optional embodiment, as an optional implementation, after the multi-branch tree file information is structured to obtain a storage tree file information set, the method further includes:
[0092] For any storage tree file information, the storage file information in the storage tree file information is stored in the database in sequence.
[0093] In this optional embodiment, as an optional implementation, after the multi-branch tree file information is structured to obtain a storage tree file information set, the method further includes:
[0094] Detect whether an interrupt scan signal is received;
[0095] When receiving an interruption scanning signal, the storage of the storage file information is terminated and interruption node information is generated;
[0096] Detect whether a continue operation signal is received;
[0097] When a continuing operation signal is received, the storage file information continues to be stored in the database according to the above interrupted node information.
[0098] Optionally, the above interrupt node information represents a current storage record of the storage file information.
[0099] Optionally, the above storage tree file information can display all sub-files according to the directory tree structure.
[0100] Optionally, the above file scanning method scans and processes the complex directory structure level by level to optimize the scanning performance.
[0101] Optionally, the above file scanning method may update the total number of files and directories currently scanned, as well as the total size of the scanned files in real time during the directory scanning process.
[0102] It can be seen that the file scanning method described in the embodiment of the present invention can perform directory scanning on the file information to be scanned, build a directory tree structure and store the files in groups, which is conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0103] In an optional embodiment, the communication system information also includes the second device information of the second system
[0104] The above-mentioned method performs file scanning processing on the acquired file information to be scanned to obtain multi-tree file information, including:
[0105] Determine whether the acquired file information to be scanned contains directory object information, and obtain a first determination result;
[0106] When the first judgment result is no, a root directory object information set is determined according to the task root path information corresponding to the file information to be scanned; the root directory object information set includes a plurality of root directory object information; the root directory object information includes the second path information and the second primary key information;
[0107] Determine the multi-tree file information according to the root directory object information set;
[0108] When the first judgment result is yes, it is determined that the file information to be scanned is multi-tree file information.
[0109] Optionally, the second path information represents a task root path corresponding to the file information to be scanned.
[0110] Optionally, the second primary key information represents the primary key of the root path in the database.
[0111] It can be seen that the file scanning method described in the embodiment of the present invention can obtain multi-tree file information through comprehensive processing such as judgment processing of the scanned file information, which is beneficial to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0112] In another optional embodiment, the multi-tree file information is structured to obtain a storage tree file information set including several storage tree file information, including:
[0113] According to the multi-tree file information, target scanning directory information is determined, and the multi-tree file information is updated; the target scanning directory information includes first path information and first primary key information;
[0114] Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information;
[0115] Determine whether the updated multi-tree file information contains the directory object information, and obtain a second determination result;
[0116] When the second judgment result is yes, triggering execution to determine target scan directory information according to the multi-tree file information, and updating the multi-tree file information;
[0117] When the second judgment result is no, a storage tree file information set including several storage tree file information is determined.
[0118] Optionally, the above-mentioned determining the target scanning directory information based on the multi-tree file information and updating the multi-tree file information is to sequentially select directory object information from the multi-tree file information as the target scanning directory information, and delete the directory object information from the multi-tree file information to generate new multi-tree file information to improve scanning efficiency.
[0119] It can be seen that the file scanning method described in the embodiment of the present invention can determine the target scanning directory information through the multi-tree file information, and then determine the storage tree file information, which is beneficial to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0120] In yet another optional embodiment, the above-mentioned determining the storage tree file information corresponding to the target scan directory information according to the target scan directory information includes:
[0121] Determining subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information;
[0122] Perform value assignment processing on the sub-file information according to the first primary key information corresponding to the target scan directory information to obtain the attribute file information corresponding to the target scan directory information;
[0123] The attribute file information corresponding to the target scanning directory information is grouped to obtain the storage tree file information corresponding to the target scanning directory information.
[0124] Optionally, the above-mentioned use of the first primary key information to assign values to the sub-file information is to use the primary key of the parent directory stored in the database as the pid field of the sub-file, so as to quickly query all sub-files under the directory through the primary key of the directory.
[0125] It can be seen that the file scanning method described in the embodiment of the present invention can generate attribute file information using the first path information and the first primary key information, and group it to obtain storage tree file information, which is more conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0126] In yet another optional embodiment, before determining the sub-file information corresponding to the target scanning directory information according to the first path information corresponding to the target scanning directory information, the method further includes:
[0127] Determine whether the cached file information in the database satisfies the value condition, and obtain a third determination result; the value condition is related to the file information that has been cached in the cached file information;
[0128] When the third judgment result is yes, the sub-file information is filtered and updated using the cache file information.
[0129] Optionally, the cache file information represents the status of the sub-files that have been cached in the directory path corresponding to the first primary key information of the target scan directory information.
[0130] Optionally, the above-mentioned filtering and updating of the sub-file information by using the cached file information is to filter out all sub-files in the directory path corresponding to the first primary key information of the target scan directory information that match the cached sub-files.
[0131] It can be seen that the file scanning method described in the embodiment of the present invention can filter and update the sub-file information by judging and processing the cached file information, which is more conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting the pause and continue operations during the scanning process, and quickly responding to the pause and continue operations.
[0132] In an optional embodiment, the above-mentioned grouping process of the attribute file information corresponding to the target scan directory information to obtain the storage tree file information corresponding to the target scan directory information includes:
[0133] Get the grouping threshold;
[0134] The attribute file information corresponding to the target scan directory information is grouped using a grouping threshold to obtain storage tree file information corresponding to the target scan directory information; the storage tree file information includes M storage file information; M is a non-negative number less than or equal to the grouping threshold.
[0135] Preferably, the above grouping threshold is 256.
[0136] Optionally, the above-mentioned use of the grouping threshold to group the attribute file information corresponding to the target scan directory information is to group all sub-files of the same level in the target scan directory information into groups of 256 sub-files, so that when a pause is encountered during the storage process, it is possible to fall back to the storage record corresponding to the current storage tree file information, thereby quickly responding to the pause and continuing the operation.
[0137] It can be seen that the file scanning method described in the embodiment of the present invention can use the grouping threshold to group the attribute file information to obtain the storage tree file information, which is more conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting the pause and continue operations during the scanning process, and quickly responding to the pause and continue operations.
[0138] Embodiment 2
[0139] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another file scanning method disclosed in an embodiment of the present invention. Figure 2 The described file scanning method is applied to a data processing system, such as a local server or a cloud server for file scanning management, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the file scanning method may include the following operations:
[0140] 201. Perform file scanning processing on the acquired file information to be scanned to obtain multi-branch tree file information.
[0141] 202. Perform structured processing on the multi-tree file information to obtain a storage tree file information set including several storage tree file information.
[0142] 203. Determine whether the storage tree file information set meets the directory file condition, and obtain a fourth determination result.
[0143] In the embodiment of the present invention, the above directory file condition indicates that the storage tree file information exists in the directory file.
[0144] 204. When the fourth judgment result is yes, determine the sub-directory object information set according to the storage tree file information set.
[0145] In the embodiment of the present invention, the sub-directory object information set includes a plurality of sub-directory object information.
[0146] 205. Use the sub-directory object information set to update the multi-tree file information, and trigger execution of structured processing of the multi-tree file information to obtain a storage tree file information set.
[0147] In the embodiment of the present invention, for the specific technical details and technical terminology of step 201-step 202, reference can be made to the detailed description of step 101-step 102 in embodiment 1, and the embodiment of the present invention will not be repeated here.
[0148] Optionally, the above sub-directory object information includes sub-directory path information and sub-directory primary key information.
[0149] Optionally, the above sub-directory primary key information represents the primary key of the sub-directory stored in the database.
[0150] It can be seen that the file scanning method described in the embodiment of the present invention can perform directory scanning on the file information to be scanned, build a directory tree structure and store the files in groups, which is conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0151] Embodiment 3
[0152] See also Figure 3 , Figure 3 : is a schematic diagram of the structure of a document scanning device disclosed in an embodiment of the present invention. Figure 3 The described device can be applied to a data processing system, such as a local server or a cloud server for file scanning management, etc., which is not limited in the embodiments of the present invention. Figure 3 As shown, the device may include:
[0153] The first processing module 301 is used to perform file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a number of directory object information; the directory object information includes first path information and first primary key information;
[0154] The second processing module 302 is used to perform structured processing on the multi-tree file information to obtain a storage tree file information set including several storage tree file information; the storage tree file information set includes several storage tree file information; the storage tree file information set is used to respond to the suspend storage operation and the continue storage operation in the file storage process in the file information to be scanned.
[0155] It can be seen that the implementation Figure 3 The described file scanning device can perform directory scanning on the file information to be scanned, build a directory tree structure and store the files in groups, which is beneficial to improving the scanning performance, supports scanning of complex directory structures at the million level, supports pause and resume operations during the scanning process, and quickly responds to pause and resume operations.
[0156] In another optional embodiment, Figure 4As shown, the second processing module 302 performs structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information in the following specific manner:
[0157] According to the multi-tree file information, target scanning directory information is determined, and the multi-tree file information is updated; the target scanning directory information includes first path information and first primary key information;
[0158] Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information;
[0159] Determine whether the updated multi-tree file information has directory object information, and obtain a second determination result;
[0160] When the second judgment result is yes, triggering execution to determine target scan directory information according to the multi-tree file information, and updating the multi-tree file information;
[0161] When the second judgment result is no, a storage tree file information set including several storage tree file information is determined.
[0162] It can be seen that implementation Figure 4 The described file scanning device can obtain multi-tree file information through comprehensive processing such as judgment processing of the scanned file information, which is beneficial to improving the scanning performance, supports scanning of complex directory structures of millions of levels, supports pause and continue operations during the scanning process, and quickly responds to pause and continue operations.
[0163] In yet another optional embodiment, Figure 4 As shown, the first processing module 301 performs file scanning processing on the acquired file information to be scanned, and obtains the multi-branch tree file information in the following specific manner:
[0164] Determine whether the acquired file information to be scanned contains directory object information, and obtain a first determination result;
[0165] When the first judgment result is no, a root directory object information set is determined according to the task root path information corresponding to the file information to be scanned; the root directory object information set includes a plurality of root directory object information; the root directory object information includes the second path information and the second primary key information;
[0166] Determine the multi-tree file information according to the root directory object information set;
[0167] When the first judgment result is yes, it is determined that the file information to be scanned is the multi-tree file information.
[0168] It can be seen that implementation Figure 4The described file scanning device can determine the target scanning directory information through the multi-branch tree file information, and then determine the storage tree file information, which is beneficial to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting the pause and continue operations during the scanning process, and quickly responding to the pause and continue operations.
[0169] In yet another optional embodiment, Figure 4 As shown, the specific manner in which the second processing module 302 determines the storage tree file information corresponding to the target scanning directory information according to the target scanning directory information is:
[0170] Determining sub-file information corresponding to the target scanning directory information according to the first path information corresponding to the target scanning directory information;
[0171] Perform value assignment processing on the sub-file information according to the first primary key information corresponding to the target scan directory information to obtain the attribute file information corresponding to the target scan directory information;
[0172] The attribute file information corresponding to the target scanning directory information is grouped to obtain the storage tree file information corresponding to the target scanning directory information.
[0173] It can be seen that implementation Figure 4 The described file scanning device can use the first path information and the first primary key information to generate attribute file information, and group it to obtain storage tree file information, which is more conducive to improving the scanning performance, supporting the scanning of millions of complex directory structures, supporting pause and continue operations during the scanning process, and quickly responding to pause and continue operations.
[0174] In yet another optional embodiment, Figure 4 As shown, before the second processing module 302 determines the sub-file information corresponding to the target scanning directory information according to the first path information corresponding to the target scanning directory information, the device further includes:
[0175] The first judgment module 303 is used to judge whether the cached file information in the database meets the value condition, and obtain a third judgment result; the value condition is related to the file information that has been cached in the cached file information;
[0176] The first updating module 304 is configured to filter and update the sub-file information using the cached file information when the third judgment result is yes.
[0177] It can be seen that implementation Figure 4 The described file scanning device can filter and update sub-file information by judging and processing cached file information, which is more conducive to improving scanning performance, supporting scanning of millions of complex directory structures, supporting pause and resume operations during the scanning process, and quickly responding to pause and resume operations.
[0178] In yet another optional embodiment, Figure 4 As shown, the second processing module 302 performs group processing on the attribute file information corresponding to the target scan directory information, and obtains the storage tree file information corresponding to the target scan directory information in a specific manner as follows:
[0179] Get the grouping threshold;
[0180] The attribute file information corresponding to the target scan directory information is grouped using a grouping threshold to obtain storage tree file information corresponding to the target scan directory information; the storage tree file information includes M storage file information; M is a non-negative number less than or equal to the grouping threshold.
[0181] It can be seen that implementation Figure 4 The described file scanning device can use grouping thresholds to group attribute file information to obtain storage tree file information, which is more conducive to improving scanning performance, supporting scanning of millions of complex directory structures, supporting pause and resume operations during the scanning process, and quickly responding to pause and resume operations.
[0182] In yet another optional embodiment, Figure 4 As shown, after the second processing module 302 performs structured processing on the multi-tree file information to obtain a storage tree file information set, the device further includes:
[0183] The second judgment module 305 is used to judge whether the storage tree file information set meets the directory file condition to obtain a fourth judgment result; the directory file condition indicates that the storage tree file information exists in the directory file;
[0184] The determination module 306 is used to determine a sub-directory object information set according to the storage tree file information set when the fourth judgment result is yes; the sub-directory object information set includes a plurality of sub-directory object information;
[0185] The second updating module 307 is used to update the multi-tree file information using the sub-directory object information set, and trigger the execution of structured processing of the multi-tree file information to obtain a storage tree file information set.
[0186] It can be seen that implementation Figure 4 The described file scanning device can perform directory scanning on the file information to be scanned, build a directory tree structure and store the files in groups, which is beneficial to improving the scanning performance, supports scanning of complex directory structures at the million level, supports pause and resume operations during the scanning process, and quickly responds to pause and resume operations.
[0187] Embodiment 4
[0188] See also Figure 5 , Figure 5 is a schematic diagram of the structure of another electronic device disclosed in an embodiment of the present invention. Figure 5 The electronic device described can be applied to a data processing system, such as a local server or a cloud server for file scanning management, etc., which is not limited in the embodiments of the present invention. Figure 5 As shown, the device may include:
[0189] A memory 401 storing executable program codes;
[0190] a processor 402 coupled to the memory 401;
[0191] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the file scanning method described in the first or second embodiment.
[0192] Embodiment 5
[0193] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the file scanning method described in the first or second embodiment.
[0194] Embodiment 6
[0195] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the file scanning method described in the first or second embodiment.
[0196] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0197] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0198] Finally, it should be noted that the file scanning method, device, electronic device and storage medium disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A file scanning method, It is characterized in that The method comprises: Performing file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a plurality of directory object information; Performing structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information; the storage tree file information set is used to respond to a suspend storage operation and a resume storage operation of a file storage process in the file information to be scanned; The multi-tree file information is structured to obtain a storage tree file information set including a plurality of storage tree file information, including: According to the multi-tree file information, target scanning directory information is determined, directory object information is selected in sequence from the multi-tree file information as the target scanning directory information, and the directory object information is deleted from the multi-tree file information to update the multi-tree file information; the target scanning directory information includes first path information and first primary key information, the first primary key information represents the primary key of the parent directory stored in the database, and the first path information represents the directory path of the child file; Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information; Determine whether the updated multi-tree file information contains the directory object information, and obtain a second determination result; When the second judgment result is yes, triggering the step of determining target scan directory information according to the multi-tree file information and updating the multi-tree file information; When the second judgment result is no, a storage tree file information set including a plurality of storage tree file information is determined.
2. The document scanning method according to claim 1, It is characterized in that The obtained file information to be scanned is subjected to file scanning processing to obtain multi-branch tree file information, including: Determine whether the acquired file information to be scanned contains directory object information, and obtain a first determination result; When the first judgment result is no, a root directory object information set is determined according to the task root path information corresponding to the file information to be scanned; the root directory object information set includes a plurality of root directory object information; the root directory object information includes second path information and second primary key information, the second path information represents the task root path corresponding to the file information to be scanned, and the second primary key information represents the primary key of the root path in the database; Determine the multi-tree file information according to the root directory object information set; When the first judgment result is yes, it is determined that the file information to be scanned is the multi-tree file information.
3. The document scanning method according to claim 2, It is characterized in that The step of determining storage tree file information corresponding to the target scan directory information according to the target scan directory information includes: Determining subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information; Performing value assignment processing on the sub-file information according to the first primary key information corresponding to the target scan directory information to obtain attribute file information corresponding to the target scan directory information; The attribute file information corresponding to the target scanning directory information is grouped to obtain the storage tree file information corresponding to the target scanning directory information.
4. The document scanning method according to claim 3, It is characterized in that Before determining the subfile information corresponding to the target scan directory information according to the first path information corresponding to the target scan directory information, the method further includes: Determine whether the cached file information in the database satisfies a value condition, and obtain a third determination result; the value condition is related to the file information that has been cached in the cached file information; When the third judgment result is yes, the sub-file information is filtered and updated using the cache file information.
5. The document scanning method according to claim 3, It is characterized in that The grouping process of the attribute file information corresponding to the target scan directory information to obtain the storage tree file information corresponding to the target scan directory information includes: Get the grouping threshold; The attribute file information corresponding to the target scan directory information is grouped using the grouping threshold to obtain storage tree file information corresponding to the target scan directory information; the storage tree file information includes M storage file information; M is a non-negative number less than or equal to the grouping threshold.
6. The document scanning method according to claim 1, It is characterized in that After the multi-branch tree file information is structured to obtain a storage tree file information set, the method further includes: Determine whether the storage tree file information set meets a directory file condition to obtain a fourth determination result; the directory file condition indicates that the storage tree file information exists in a directory file; When the fourth judgment result is yes, a sub-directory object information set is determined according to the storage tree file information set; the sub-directory object information set includes a plurality of sub-directory object information; The multi-tree file information is updated using the sub-directory object information set, and the structured processing of the multi-tree file information is triggered to obtain a storage tree file information set.
7. A document scanning device, It is characterized in that The device comprises: The first processing module is used to perform file scanning processing on the acquired file information to be scanned to obtain multi-tree file information; the multi-tree file information includes a plurality of directory object information; A second processing module is used to perform structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information; the storage tree file information set is used to respond to the suspend storage operation and the continue storage operation of the file storage process in the file information to be scanned; The specific method in which the second processing module performs structured processing on the multi-tree file information to obtain a storage tree file information set including a plurality of storage tree file information includes: According to the multi-tree file information, target scanning directory information is determined, directory object information is selected in sequence from the multi-tree file information as the target scanning directory information, and the directory object information is deleted from the multi-tree file information to update the multi-tree file information; the target scanning directory information includes first path information and first primary key information, the first primary key information represents the primary key of the parent directory stored in the database, and the first path information represents the directory path of the child file; Determine storage tree file information corresponding to the target scan directory information according to the target scan directory information; Determine whether the updated multi-tree file information contains the directory object information, and obtain a second determination result; When the second judgment result is yes, triggering the step of determining target scan directory information according to the multi-tree file information and updating the multi-tree file information; When the second judgment result is no, a storage tree file information set including a plurality of storage tree file information is determined.
8. An electronic device, It is characterized in that The electronic device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the file scanning method according to any one of claims 1 to 6.
9. A computer storage medium, It is characterized in that The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the file scanning method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for reconstructing an NTFS file directory tree, and storage medium
CN111125298A
File scanning method and device, terminal and storage medium
CN112286878A
