File scanning method and device, electronic equipment and computer readable storage medium

By performing snapshot processing of files to be scanned and scanning using data processing units, the problem of excessive CPU resource utilization during file scanning is solved, and the efficiency of file scanning is improved.

CN119473712APending Publication Date: 2025-02-18CHINA GREATWALL TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411484160.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the era of big data, a large number of CPU resources are occupied during file scanning, resulting in low file scanning efficiency.

Method used

The file to be scanned is processed by the central processor, a read-only snapshot file is generated, and the snapshot file is scanned by the data processing unit, thereby offloading the CPU-intensive file scanning operation to the data processing unit.

Benefits of technology

This reduces the use of CPU resources during file scanning, improves the efficiency of file scanning, and even if the CPU performs other operations on the scanned file, it will not affect the progress of file scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473712A_ABST
    Figure CN119473712A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of file scanning, and provides a file scanning method and device, electronic equipment and a computer readable storage medium, the method is applied to a data processing system comprising a central processing unit and a data processing unit, and the method comprises the following steps: performing snapshot processing on a to-be-scanned file by utilizing the central processing unit to obtain a snapshot file; the snapshot file is a read-only file of data in the file to be scanned, and the data processing unit is used for scanning the snapshot file. The file scanning efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of document scanning technology, and in particular, relates to a document scanning method, device, electronic device and computer-readable storage medium. Background Art

[0002] In the era of big data, data processing is becoming more and more important. Usually, a large number of data files can be stored in a distributed file system, and various algorithms and query languages ​​can be used to comprehensively scan the files. However, file scanning requires the participation of the central processing unit (CPU). As the amount of data continues to increase, a large number of file scanning and reading will occupy more CPU resources, resulting in low efficiency of file scanning. Summary of the invention

[0003] The embodiments of the present application provide a file scanning method, device and electronic device, which can improve the efficiency of file scanning.

[0004] In a first aspect, an embodiment of the present application provides a file scanning method, which is applied to a data processing system including a central processing unit and a data processing unit, and the file scanning method includes:

[0005] Utilize the central processing unit to perform snapshot processing on the file to be scanned to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned;

[0006] The snapshot file is scanned using the data processing unit.

[0007] Optionally, before the central processor is used to perform snapshot processing on the scanned file, the method further includes:

[0008] Acquire a scanning task; the scanning task includes first location information, and the first location information is used to indicate the location of the file to be scanned;

[0009] The file to be scanned is determined according to the first location information.

[0010] Optionally, the using the central processor to perform snapshot processing on the file to be scanned to obtain a snapshot file includes:

[0011] Determining second position information of the file to be scanned by using the central processor; the second position information is used to indicate the position of data in the file to be scanned;

[0012] The snapshot file is constructed according to the second location information and data corresponding to the second location information.

[0013] Optionally, the scanning the snapshot file by using the data processing unit includes:

[0014] Detecting whether the central processor performs a data writing operation on the file to be scanned; the data writing operation includes one or more of a data adding operation, a data deleting operation and a data modifying operation;

[0015] When it is determined that the central processor has not performed a data writing operation on the file to be scanned, the data processing unit is used to parse out the root directory of the snapshot file;

[0016] Using the data processing unit to open the file corresponding to the root directory;

[0017] Using the data processing unit to read the content of the file;

[0018] The read file is closed by using the data processing unit.

[0019] Optionally, it also includes:

[0020] When it is determined that the central processor performs a data writing operation on the file to be scanned, the file to be scanned is backed up according to the snapshot file.

[0021] Optionally, after backing up the file to be scanned according to the snapshot file, the method further includes:

[0022] Obtaining a data recovery instruction; the data recovery instruction includes a data recovery time point, and the data recovery time point is used to indicate the time to which the to-be-scanned file needs to be recovered;

[0023] The file to be scanned at the data recovery point in time is obtained by using the snapshot file corresponding to the data recovery point in time.

[0024] Optionally, it also includes:

[0025] Multi-version control is performed on the file to be scanned according to the snapshot file. The multi-version control refers to using the snapshot files at different points in time to switch and / or compare the files to be scanned at different points in time, wherein the snapshot file at one point in time corresponds to the file to be scanned at one point in time.

[0026] In a second aspect, an embodiment of the present application provides a file scanning device, which is applied to a data processing system including a central processing unit and a data processing unit, including:

[0027] A file snapshot module, used for performing snapshot processing on the file to be scanned by the central processor to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned;

[0028] The file scanning module is used to scan the snapshot file using the data processing unit.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the file scanning method described in the first aspect when executing the computer program.

[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the file scanning method described in the first aspect are implemented.

[0031] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the file scanning method described in any one of the first aspects above.

[0032] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0033] In the embodiment of the present application, the efficiency of file scanning can be improved by scanning the snapshot file through the data processing unit. Specifically, the snapshot file is obtained by performing snapshot processing on the file to be scanned through the central processing unit (i.e., CPU). Since the above-mentioned CPU only performs snapshot processing, and snapshot processing refers to an instant copy operation of the file to be scanned, it means that when scanning and reading data, it is not necessary to consume CPU resources for scanning and reading, thereby reducing the occupation of CPU resources during file scanning. At the same time, using the above-mentioned data processing unit to scan the snapshot file means that the file scanning operation that occupies more CPU resources can be unloaded to the data processing unit, thereby solving the efficiency problem caused by the large occupation of CPU resources during the scanning and reading of large batches of files; and since the above-mentioned snapshot file is a read-only file of the data in the file to be scanned, when the above-mentioned data processing unit is used to scan the snapshot file, even if the CPU performs other operations on the file to be scanned, it will not affect the progress of file scanning, thereby greatly improving the efficiency of file scanning. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1It is a flowchart of a file scanning method provided by an embodiment of the present application;

[0036] Figure 2 is a structural schematic diagram of a file scanning device provided in an embodiment of the present application;

[0037] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0039] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0040] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0041] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0042] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0043] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0044] With the advent of the big data era, a single storage system can no longer meet the needs of data processing. Usually, a large amount of data is stored in a distributed storage system, and the data is read and analyzed through the distributed storage system. However, with the continuous increase in data volume, reading a large number of files is a process that consumes a lot of CPU resources. For example, in large-volume data scanning scenarios such as scanning and reading operations and virus scanning in big data systems, even if the direct memory access (DMA) mode is used, the opening and closing of files, and the startup of DMA still require the participation of the CPU, which means that for the reading of massive files, especially small files, frequent CPU operations will still be generated, which will greatly reduce the efficiency of file scanning.

[0045] In order to improve the efficiency of file scanning, the present application provides a file scanning method based on snapshot technology and a data processing unit.

[0046] Figure 1 A flowchart of a file scanning method provided by an embodiment of the present application is shown, which is applied to a data processing system including a central processing unit and a data processing unit, and is described in detail as follows:

[0047] S10, using the central processing unit to perform snapshot processing on the file to be scanned to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned.

[0048] In the embodiment of the present application, the above-mentioned data processing system refers to a system that often needs to perform a comprehensive scan and read of files. For example, the above-mentioned data processing system may include a big data management system and a distributed storage system and other systems that need to perform a large amount of data scanning and reading operations. The above-mentioned data processing unit refers to a chip unit that specifically processes data. The data processing unit can unload one or more key virtualization, network, storage, security and other businesses from the central processing unit (CPU), thereby releasing CPU computing resources. For example, the above-mentioned data processing unit can be a data processor (Data Processing Unit, DPU), or a data acceleration card, etc.

[0049] The above-mentioned snapshot processing refers to the operation of copying and pasting the basic content of the file to be scanned, or extracting the key attributes of the file to be scanned, to generate a new file similar to or related to the file to be scanned at the moment of snapshot processing. The new file is the above-mentioned snapshot file. The snapshot file is a read-only file, and the snapshot file can be used as a reference mark or pointer to the data in the file to be scanned, that is, the data in the file to be scanned can be quickly accessed through the above-mentioned snapshot file.

[0050] S11. Scan the snapshot file using the data processing unit.

[0051] In the embodiment of the present application, scanning the snapshot file by the above-mentioned data processing unit means that the file scanning can be transferred from the CPU to the data processing unit, thereby reducing the occupancy of CPU resources during large-scale data processing and improving the file scanning efficiency; and, since the snapshot file is a read-only file, the scanning and reading of the snapshot file by the data processing unit will not affect other program operations of the CPU, further improving the file scanning efficiency.

[0052] In some embodiments, it is assumed that the above-mentioned data processing unit is a data processing unit (DPU). Since the DPU can provide data center-level network, storage, security, and management services, by transferring file scanning to the DPU, more CPU resources can be released, thereby improving data reading efficiency when scanning and reading large quantities of files.

[0053] For example, assuming that the files to be scanned include file 1 and file 2, the operations involved in the scanning include: file directory opening operation (opendir), file directory traversal operation (readdir), file directory closing operation (closedir), two file opening operations (open) and two file closing operations (close), etc. By processing the operations involved in the scanning by the data processing unit, the occupation of CPU resources can be greatly reduced.

[0054] In the embodiment of the present application, the efficiency of file scanning can be improved by scanning the snapshot file through the data processing unit. Specifically, the snapshot file is obtained by performing snapshot processing on the file to be scanned through the central processing unit (i.e., CPU). Since the above-mentioned CPU only performs snapshot processing, and snapshot processing refers to an instant copy operation of the file to be scanned, it means that when scanning and reading data, it is not necessary to consume CPU resources for scanning and reading, thereby reducing the occupation of CPU resources during file scanning. At the same time, using the above-mentioned data processing unit to scan the snapshot file means that the file scanning operation that occupies more CPU resources can be unloaded to the data processing unit, thereby solving the efficiency problem caused by the large occupation of CPU resources during the scanning and reading of large batches of files; and since the above-mentioned snapshot file is a read-only file of the data in the file to be scanned, when the above-mentioned data processing unit is used to scan the snapshot file, even if the CPU performs other operations on the file to be scanned, it will not affect the progress of file scanning, thereby greatly improving the efficiency of file scanning.

[0055] In another optional embodiment of the present application, before the central processor is used to perform snapshot processing on the scanned file, the method further includes:

[0056] Obtaining a scanning task; the scanning task includes first location information, and the first location information is used to indicate the location of the file to be scanned;

[0057] The file to be scanned is determined according to the first position information.

[0058] In the embodiment of the present application, a corresponding scanning task can be constructed according to the business scenario. The scanning task is used to determine the files to be scanned in the corresponding business scenario, and may include the area information, system information, folder information, etc. to be scanned in the above business scenario. The scanning task is parsed to obtain the first location information. The above first location information is used to indicate the area, system, folder, etc. that need to be scanned in the current business scenario. The corresponding files to be scanned can be quickly determined through the above first location information.

[0059] In some embodiments, assuming that a virus scanning task is constructed based on a virus scanning business scenario, the virus scanning task includes the area location information of the area to be scanned that needs to be scanned for viruses (such as the C drive location information), and the area location information is the first location information mentioned above, that is, all the files to be scanned in the area to be scanned can be obtained according to the first location information. Optionally, the corresponding files to be scanned can also be determined according to the file name, system name, folder name, etc.

[0060] In the embodiment of the present application, the above-mentioned central processor is used to perform snapshot processing on the scanned file to obtain the snapshot file, including:

[0061] Determine the second position information of the file to be scanned by using the central processor; the second position information is used to indicate the position of the data in the file to be scanned;

[0062] The snapshot file is constructed according to the second location information and the data corresponding to the second location information.

[0063] In some embodiments, the second location information may be information reflecting the hierarchical structure of the file to be scanned and the data in the file to be scanned. For example, the second location information may be a file directory, a detailed address of data, etc. By determining the second location information of the file to be scanned through the central processor, the data in the file to be scanned may be quickly determined based on the second location information, thereby constructing a snapshot file based on the second location information and the data corresponding to the second location information.

[0064] Assuming that the file to be scanned is a folder A containing two sub-files, the specific contents of the two sub-files contained therein can be determined based on the directory of the folder A (i.e., the second location information), and the specific contents of the directory and the two sub-files can be copied to obtain a read-only version of the snapshot file.

[0065] In the embodiment of the present application, the scanning of the snapshot file by the data processing unit includes:

[0066] Detecting whether the central processor performs a data writing operation on the file to be scanned; the data writing operation includes one or more of a data adding operation, a data deleting operation and a data modifying operation;

[0067] When it is determined that the central processor has not performed a data writing operation on the file to be scanned, the data processing unit is used to parse out the root directory of the snapshot file;

[0068] Using the data processing unit to open the file corresponding to the root directory;

[0069] Using the data processing unit to read the content of the file;

[0070] The data processing unit is used to close the read file.

[0071] In some embodiments, the snapshot file is a read-only file of the file to be scanned, that is, the snapshot file and the file to be scanned are two independent files, and other file operations performed by the CPU on the file to be scanned may cause the file to be scanned to change, thereby causing inconsistency between the file to be scanned and the snapshot file. By detecting whether the CPU performs a data write operation on the file to be scanned, since the data write operation includes one or more of a data addition operation, a data deletion operation, and a data change operation, it is possible to more accurately determine whether the file to be scanned has changed; when it is determined that the CPU does not perform a data write operation on the file to be scanned, it indicates that the contents of the snapshot file and the file to be scanned are consistent, so the root directory of the snapshot file can be parsed according to the data processing unit; since the root directory can indicate all the files contained in the snapshot file and their corresponding data, the files and the contents of the files in the snapshot file can be quickly determined through the root directory, thereby indirectly realizing the scanning and reading of the file to be scanned by scanning the snapshot file by the data processing unit.

[0072] The above describes the processing process when the data writing operation is not performed on the file to be scanned. The following describes the processing process when the data writing operation is performed on the file to be scanned. That is, in another optional embodiment of the present application, the file scanning method provided in the embodiment of the present application further includes:

[0073] In the case where it is determined that the central processor performs a data writing operation on the file to be scanned, the file to be scanned is backed up according to the snapshot file.

[0074] Optionally, when it is determined that the CPU performs a data writing operation on the file to be scanned, it indicates that the contents of the file to be scanned and the snapshot file may be inconsistent, and in this case, a backup may be performed according to the time when the CPU performs the data writing operation on the file to be scanned. For example, the time point when the CPU performs the data writing operation on the file to be scanned is determined, that is, the time when the CPU performs the data writing operation on the file to be scanned, and a snapshot process is performed again at this time point, so that the modified file to be scanned obtained by the data writing operation can be backed up using a new snapshot file; or, the file to be scanned can also be backed up according to the snapshot file at a preset time interval, that is, a snapshot process is performed every certain period of time.

[0075] In some embodiments, since the file scanning operation does not have high requirements for the real-time performance of data, the CPU's data writing operation on the file to be scanned will not affect the data processing unit's scanning operation on the above-mentioned snapshot file; but since the data writing operation will cause the file to be scanned to change, in order to ensure the recoverability of the file to be scanned, when it is determined that the CPU is performing a data writing operation on the file to be scanned, the file to be scanned can be backed up according to the above-mentioned snapshot file, thereby preventing data loss caused by the loss or damage of the file to be scanned.

[0076] In another optional embodiment of the present application, after backing up the file to be scanned according to the snapshot file, the method further includes:

[0077] Obtaining a data recovery instruction; the data recovery instruction includes a data recovery time point, and the data recovery time point is used to indicate the time to which the scanned file needs to be recovered;

[0078] The snapshot file corresponding to the data recovery time point is used to obtain the file to be scanned at the data recovery time point.

[0079] In some embodiments, the data recovery time point can be any time during the file scanning process selected by the user. After backing up the file to be scanned through the snapshot file, due to the instant copy feature of the snapshot file, the corresponding file to be scanned can be found through the snapshot file at a certain time point during the file scanning process; and due to the read-only feature of the snapshot file, the content of the snapshot file will not be modified, so the file to be scanned at the corresponding time point can be restored based on the snapshot file at a certain time point.

[0080] In an optional embodiment, assuming that the CPU performs data writing operations (such as one or more of data addition, data deletion, data change, etc.) on the file to be scanned at different time points, and the file to be scanned changes at the time of the data writing operation, the file to be scanned will be backed up according to the snapshot file, that is, snapshot processing is performed at the time when the CPU performs the data writing operation on the file to be scanned, and snapshot files at multiple time points are obtained. The snapshot file corresponding to the data recovery time point can be matched through the above-mentioned data recovery instruction, so that the file to be scanned at the data recovery time point can be obtained through the matching snapshot file.

[0081] For example, suppose a file C starts to be scanned at time 1, and snapshot file 1 is obtained at this time; if data is written to the file at subsequent time 2, the content of file C changes, and file C becomes file C1, and snapshot file 2 is obtained through backup; if file C1 does not change at subsequent times, data of file C can be restored through snapshot file 1 at the corresponding time points from time 1 to time 2.

[0082] In another optional embodiment of the present application, it also includes:

[0083] Multi-version control is performed on the above-mentioned file to be scanned according to the above-mentioned snapshot file. The above-mentioned multi-version control refers to using the above-mentioned snapshot files at different points in time to switch and / or compare the above-mentioned files to be scanned at different points in time, wherein the above-mentioned snapshot file at one point in time corresponds to the above-mentioned file to be scanned at one point in time.

[0084] In some embodiments, snapshot processing can be re-performed at the point in time when the CPU performs a data writing operation on the file to be scanned, or snapshot processing can be re-performed according to a preset time interval, thereby obtaining a snapshot file at the corresponding point in time; for snapshot files at different points in time, due to their read-only and instant copy characteristics, it means that multiple versions of the same file to be scanned can be saved based on snapshot files at different points in time, so that different versions of the file to be scanned can be compared and / or switched.

[0085] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0086] Corresponding to the file scanning method described in the above embodiment, Figure 2 A schematic diagram of the structure of a document scanning device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0087] Reference Figure 2 The device may be a file scanning device 21, and the file scanning device 21 is applied to a data processing system including a central processing unit and a data processing unit. The file scanning device 21 may include a file snapshot module 211 and a file scanning module 212.

[0088] Reference Figure 2 , the document scanning device 21 comprises:

[0089] The file snapshot module 211 is used to use the central processor to perform snapshot processing on the file to be scanned to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned;

[0090] The file scanning module 212 is used to scan the snapshot file using the data processing unit.

[0091] In some other embodiments, the file scanning device 21 further includes a file determination module, and the file determination module is used to, before the central processor performs snapshot processing on the file to be scanned, include:

[0092] Acquire a scanning task; the scanning task includes first location information, and the first location information is used to indicate the location of the file to be scanned;

[0093] The file to be scanned is determined according to the first location information.

[0094] In some embodiments, the file snapshot module 211 uses the central processor to perform snapshot processing on the file to be scanned to obtain a snapshot file through the following steps, including:

[0095] Determining second position information of the file to be scanned by using the central processor; the second position information is used to indicate the position of data in the file to be scanned;

[0096] The snapshot file is constructed according to the second location information and data corresponding to the second location information.

[0097] In some embodiments, the file scanning module 212 uses the data processing unit to scan the snapshot file through the following steps, including:

[0098] Detecting whether the central processor performs a data writing operation on the file to be scanned; the data writing operation includes one or more of a data adding operation, a data deleting operation and a data modifying operation;

[0099] When it is determined that the central processor has not performed a data writing operation on the file to be scanned, the data processing unit is used to parse out the root directory of the snapshot file;

[0100] Using the data processing unit to open the file corresponding to the root directory;

[0101] Using the data processing unit to read the content of the file;

[0102] The read file is closed by using the data processing unit.

[0103] In some other embodiments, the file scanning device 21 further includes a backup module, and the backup module is used to back up the file to be scanned according to the snapshot file when it is determined that the central processor performs a data writing operation on the file to be scanned.

[0104] In some other embodiments, the file scanning device 21 further includes a recovery module, and the recovery module is used to, after backing up the file to be scanned according to the snapshot file, include:

[0105] Obtaining a data recovery instruction; the data recovery instruction includes a data recovery time point, and the data recovery time point is used to indicate the time to which the to-be-scanned file needs to be recovered;

[0106] The file to be scanned at the data recovery point in time is obtained by using the snapshot file corresponding to the data recovery point in time.

[0107] In some other embodiments, the file scanning device 21 also includes a version control module, which is used to perform multi-version control on the file to be scanned based on the snapshot file. The multi-version control refers to using the snapshot files at different points in time to switch and / or compare the files to be scanned at different points in time, wherein the snapshot file at one point in time corresponds to the file to be scanned at one point in time.

[0108] It should be noted that the information interaction, execution process, etc. between the devices / units are based on the same concept as the method embodiments of the present application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0109] Figure 3 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment includes: at least one processor 30 ( Figure 3 The at least one processor 30 includes a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the method embodiments are implemented.

[0110] The electronic device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include an input sending device, a network access device, a bus, etc.

[0111] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] In some embodiments, the memory 31 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 31 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 3. Further, the memory 31 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 31 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 31 may also be used to temporarily store data that has been sent or is to be sent.

[0113] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the functional units and modules is used as an example. In practical applications, the function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0114] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the method embodiments when executing the computer program.

[0115] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the various method embodiments can be implemented.

[0116] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the various method embodiments when executing the computer program product.

[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0118] In the embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0119] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0120] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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 application, and should all be included in the protection scope of the present application.

Claims

1. A file scanning method, characterized in that: Applied to a data processing system including a central processing unit and a data processing unit, the file scanning method comprises: Utilize the central processing unit to perform snapshot processing on the file to be scanned to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned; The snapshot file is scanned using the data processing unit.

2. The document scanning method according to claim 1, characterized in that: Before the central processor is used to perform snapshot processing on the scanned file, the method further includes: Acquire a scanning task; the scanning task includes first location information, and the first location information is used to indicate the location of the file to be scanned; The file to be scanned is determined according to the first location information.

3. The document scanning method according to claim 2, characterized in that: The method of using the central processor to perform snapshot processing on the scanned file to obtain a snapshot file includes: Determining second position information of the file to be scanned by using the central processor; the second position information is used to indicate the position of data in the file to be scanned; The snapshot file is constructed according to the second location information and data corresponding to the second location information.

4. The document scanning method according to claim 3, characterized in that: The scanning the snapshot file by using the data processing unit includes: Detecting whether the central processor performs a data writing operation on the file to be scanned; the data writing operation includes one or more of a data adding operation, a data deleting operation and a data modifying operation; When it is determined that the central processor has not performed a data writing operation on the file to be scanned, the data processing unit is used to parse out the root directory of the snapshot file; Using the data processing unit to open the file corresponding to the root directory; Using the data processing unit to read the content of the file; The read file is closed by using the data processing unit.

5. The document scanning method according to claim 4, characterized in that: Also includes: When it is determined that the central processor performs a data writing operation on the file to be scanned, the file to be scanned is backed up according to the snapshot file.

6. The document scanning method according to claim 5, characterized in that: After backing up the file to be scanned according to the snapshot file, the method further includes: Obtaining a data recovery instruction; the data recovery instruction includes a data recovery time point, and the data recovery time point is used to indicate the time to which the to-be-scanned file needs to be recovered; The file to be scanned at the data recovery point in time is obtained by using the snapshot file corresponding to the data recovery point in time.

7. The document scanning method according to any one of claims 1 to 6, characterized in that: Also includes: Multi-version control is performed on the file to be scanned according to the snapshot file. The multi-version control refers to using the snapshot files at different points in time to switch and / or compare the files to be scanned at different points in time, wherein the snapshot file at one point in time corresponds to the file to be scanned at one point in time.

8. A document scanning device, characterized in that: Applicable to a data processing system including a central processing unit and a data processing unit, including: A file snapshot module, used for performing snapshot processing on the file to be scanned by the central processor to obtain a snapshot file; the snapshot file is a read-only file of the data in the file to be scanned; The file scanning module is used to scan the snapshot file using the data processing unit.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.