File desensitization method, device and storage medium

By performing incremental desensitization on the files to be read through storage devices and combining offline and online desensitization, the problems of time-consuming and low efficiency of file desensitization processing are solved, efficient file desensitization is achieved, and the smooth progress of product development or testing is ensured.

CN114491612BActive Publication Date: 2025-09-09HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011166187.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2025-09-09
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

Existing file desensitization processing is time-consuming and inefficient, affecting input and output efficiency during product development or testing, and may lead to unnecessary multiple desensitization processes.

Method used

The storage device receives the host's file read command, obtains the partially desensitized file to be read, and performs incremental desensitization on the data blocks that have not yet been desensitized. It combines offline and online desensitization and uses previous desensitization results to improve processing efficiency.

Benefits of technology

Through the incremental desensitization method, the efficiency of file desensitization processing is improved, unnecessary multiple desensitization is reduced, and the impact of online desensitization on IO efficiency during development or testing is reduced, ensuring that product development or testing activities can be carried out at any time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491612B_ABST
    Figure CN114491612B_ABST
Patent Text Reader

Abstract

The present application relates to a file desensitization method, apparatus, and storage medium, wherein the method is executed by a storage device and comprises: receiving a read file command sent by a host, the read file command being used to request a file to be read; in response to the read file command, obtaining the file to be read, wherein at least a portion of data blocks in the file to be read have been desensitized; desensitizing data blocks of the file to be read that have not yet been desensitized; and sending the desensitized file to be read to the host. Embodiments of the present application can perform incremental desensitization on the file to be read, thereby making full use of previous desensitization results and improving the processing efficiency of file desensitization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file desensitization method, device, and storage medium. Background Art

[0002] During product development or testing, files often need to be retrieved from storage devices for processing. Because these files may contain sensitive information that could potentially impact user privacy, they must be desensitized before use in product development or testing. However, current desensitization processes are time-consuming and inefficient. Furthermore, inefficient desensitization can impact input and output (IO) efficiency during development or testing. Summary of the Invention

[0003] In view of this, the present application proposes a file desensitization method, device and storage medium.

[0004] In a first aspect, an embodiment of the present application provides a file desensitization method, which is executed by a storage device, and the method includes: receiving a read file command sent by a host, the read file command being used to request a file to be read; in response to the read file command, obtaining the file to be read, at least a portion of the data blocks in the file to be read having completed desensitization processing; desensitizing the data blocks of the file to be read that have not yet been desensitized; and sending the desensitized file to be read to the host.

[0005] The file desensitization method of this embodiment is executed by a storage device. The storage device can receive a read file command sent by a host, and in response to the read file command, obtain a file to be read, wherein at least a portion of the data blocks in the file to be read have completed desensitization processing, and then perform desensitization processing on the data blocks of the file to be read that have not yet been desensitized, and send the desensitized file to be read to the host, so that the file to be read can be incrementally desensitized. Not only can the previous desensitization results be fully utilized to improve the processing efficiency of file desensitization, but online desensitization can also be combined with offline desensitization, so that product development or testing activities can be carried out at any time.

[0006] According to the first aspect, in a first possible implementation of the file desensitization method, the method further includes: saving the desensitized file to be read in the hard disk of the storage device.

[0007] In this embodiment, the storage device can save the desensitization results of each time (i.e., the files to be read that have completed the desensitization process) on the hard disk. As incremental desensitization continues, a purified backup can be gradually formed, which includes files that have completed the desensitization process and non-sensitive files. Subsequent development or testing activities can be carried out based on the purified backup, which can not only reduce unnecessary multiple desensitizations, but also reduce the impact of online desensitization on IO efficiency during the development or testing process, and improve the reading efficiency of files.

[0008] According to the first aspect, in a second possible implementation of the file desensitization method, the method further includes: obtaining a bitmap of the file to be read, the bitmap being used to indicate whether each data block contained in the file to be read has completed desensitization processing; and identifying the data blocks in the file to be read that have not yet been desensitized based on the bitmap.

[0009] In this embodiment, a bitmap can be set for the file to be processed, and by identifying the bitmap of the file to be read, the data blocks in the file to be read that have not been desensitized can be determined. This is simple and fast, thereby improving processing efficiency.

[0010] According to the first aspect, in a third possible implementation of the file desensitization method, the file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed desensitization processing.

[0011] The method further includes: before desensitizing the data blocks of the file to be read that have not been desensitized, determining, based on the desensitization mark, that the file to be read is a file that has not yet completed desensitization.

[0012] In this embodiment, the file to be read has a desensitization mark, and the desensitization status of the file to be read can be determined according to the desensitization mark, thereby realizing the management and identification of the desensitization status of the file to be read.

[0013] According to the second possible implementation of the first aspect, in a fourth possible implementation of the file desensitization method, the method further includes: modifying the flag bit in the bitmap corresponding to the data block that has completed the desensitization processing to indicate that the corresponding data block has completed the desensitization processing.

[0014] In this embodiment, for data blocks in the file to be read that have completed desensitization processing, the flag bit in the bitmap corresponding to the data block that has completed desensitization processing can be modified to indicate that the data block has completed desensitization processing. In this way, the bitmap can be updated in a timely manner according to the changes in the desensitization status of the data block in the file to be read, thereby improving the accuracy of the bitmap of the file to be read.

[0015] According to the third possible implementation of the first aspect, in a fifth possible implementation of the file desensitization method, the method further includes: modifying the desensitization mark of the file to be read that has completed the desensitization processing to indicate that the file to be read has completed the desensitization processing.

[0016] In this embodiment, when the desensitization processing of the file to be read has been completed, that is, when the bitmap of the image to be processed indicates that all data blocks contained therein have completed the desensitization processing, the desensitization mark of the file to be read can be modified to indicate that the desensitization processing has been completed. In this way, the desensitization mark of the file to be read can be updated in a timely manner according to the changes in the desensitization status of the file to be read, thereby improving the accuracy of the desensitization mark of the file to be read.

[0017] According to the first aspect, in a sixth possible implementation of the file desensitization method, at least a portion of the data blocks in the to-be-read file are desensitized by offline desensitization.

[0018] In this way, online desensitization can be performed on the basis of offline desensitization, so that offline desensitization and online desensitization can jointly maintain a desensitization result.

[0019] According to the first aspect or one or more of the multiple possible implementations of the first aspect, in a seventh possible implementation of the file desensitization method, the file to be read includes at least one of a text file, a report file, a picture file, an audio file, and a video file.

[0020] In this embodiment, the file to be read may include at least one of a text file, a report file, an image file, an audio file, and a video file, and may also include other unstructured data such as office documents, XML (Extensible Markup Language) files, and HTML (HyperText Markup Language) files. Thus, various unstructured data can be desensitized using the above method.

[0021] In the second aspect, an embodiment of the present application provides a file desensitizing device, which is applied to a storage device, and the device includes: a command receiving module, which is used to receive a read file command sent by a host, and the read file command is used to request a file to be read; a file acquisition module, which obtains the file to be read in response to the read file command, and at least a part of the data blocks in the file to be read have completed desensitization processing; a desensitization processing module, which is used to desensitize the data blocks of the file to be read that have not yet been desensitized; and a file sending module, which is used to send the file to be read that has completed desensitization processing to the host.

[0022] The file desensitization device of this embodiment is applied to a storage device, can receive a file read command sent by a host, and obtain a file to be read in response to the file read command, wherein at least a portion of the data blocks in the file to be read have completed the desensitization processing, and then perform desensitization processing on the data blocks of the file to be read that have not yet been desensitized, and send the desensitized file to be read to the host, so that the file to be read can be incrementally desensitized, which can not only make full use of the previous desensitization results and improve the processing efficiency of file desensitization, but also combine online desensitization with offline desensitization, so that product development or testing activities can be carried out at any time.

[0023] According to the second aspect, in a first possible implementation of the file desensitization apparatus, the apparatus further includes: a file storage module for storing the desensitized file to be read in the hard disk of the storage device.

[0024] In this embodiment, the storage device can save the desensitization results of each time (i.e., the files to be read that have completed the desensitization process) on the hard disk. As incremental desensitization continues, a purified backup can be gradually formed, which includes files that have completed the desensitization process and non-sensitive files. Subsequent development or testing activities can be carried out based on the purified backup, which can not only reduce unnecessary multiple desensitizations, but also reduce the impact of online desensitization on IO efficiency during the development or testing process, and improve the reading efficiency of files.

[0025] According to the second aspect, in a second possible implementation of the file desensitization device, the device further includes: a bitmap acquisition module, used to acquire a bitmap of the file to be read, the bitmap being used to indicate whether each data block contained in the file to be read has completed desensitization processing; and a data block identification module, used to identify the data blocks in the file to be read that have not yet been desensitized based on the bitmap.

[0026] In this embodiment, a bitmap can be set for the file to be processed, and by identifying the bitmap of the file to be read, the data blocks in the file to be read that have not been desensitized can be determined. This is simple and fast, thereby improving processing efficiency.

[0027] According to the second aspect, in a third possible implementation of the file desensitization device, the file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed desensitization processing.

[0028] The device also includes: a file desensitization identification module, which is used to determine whether the file to be read is a file that has not yet completed desensitization processing based on the desensitization mark before desensitizing the data blocks of the file to be read that have not yet been desensitized.

[0029] In this embodiment, the file to be read has a desensitization mark, and the desensitization status of the file to be read can be determined according to the desensitization mark, thereby realizing the management and identification of the desensitization status of the file to be read.

[0030] According to a second possible implementation manner of the second aspect, in a fourth possible implementation manner of the file desensitization device, the device further includes: a bitmap modification module, configured to modify a flag bit in the bitmap corresponding to a data block that has completed desensitization processing, to indicate that the corresponding data block has completed desensitization processing.

[0031] In this embodiment, for data blocks in the file to be read that have completed desensitization processing, the flag bit in the bitmap corresponding to the data block that has completed desensitization processing can be modified to indicate that the data block has completed desensitization processing. In this way, the bitmap can be updated in a timely manner according to the changes in the desensitization status of the data block in the file to be read, thereby improving the accuracy of the bitmap of the file to be read.

[0032] According to a third possible implementation manner of the second aspect, in a fifth possible implementation manner of the file desensitization device, the device further includes: a desensitization mark modification module, configured to modify the desensitization mark of the file to be read that has completed the desensitization process to indicate that the file to be read has completed the desensitization process.

[0033] In this embodiment, when the desensitization processing of the file to be read has been completed, that is, when the bitmap of the image to be processed indicates that all data blocks contained therein have completed the desensitization processing, the desensitization mark of the file to be read can be modified to indicate that the desensitization processing has been completed. In this way, the desensitization mark of the file to be read can be updated in a timely manner according to the changes in the desensitization status of the file to be read, thereby improving the accuracy of the desensitization mark of the file to be read.

[0034] According to the second aspect, in a sixth possible implementation of the file desensitization device, at least a portion of the data blocks in the to-be-read file are desensitized by offline desensitization.

[0035] In this way, online desensitization can be performed on the basis of offline desensitization, so that offline desensitization and online desensitization can jointly maintain a desensitization result.

[0036] According to the second aspect or one or more of the multiple possible implementations of the second aspect, in a seventh possible implementation of the file desensitizing device, the file to be read includes at least one of a text file, a report file, a picture file, an audio file, and a video file.

[0037] In this embodiment, the file to be read may include at least one of a text file, a report file, an image file, an audio file, and a video file, and may also include other unstructured data such as office documents, XML (Extensible Markup Language) files, and HTML (HyperText Markup Language) files. Thus, various unstructured data can be desensitized using the above method.

[0038] In a third aspect, an embodiment of the present application provides a file desensitization device, comprising a processor and a memory for storing processor-executable instructions, wherein the processor is configured to implement the file desensitization method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect when executing the instructions.

[0039] The file desensitization device of this embodiment is applied to a storage device, can receive a file read command sent by a host, and obtain a file to be read in response to the file read command, wherein at least a portion of the data blocks in the file to be read have completed the desensitization processing, and then perform desensitization processing on the data blocks of the file to be read that have not yet been desensitized, and send the desensitized file to be read to the host, so that the file to be read can be incrementally desensitized, which can not only make full use of the previous desensitization results and improve the processing efficiency of file desensitization, but also combine online desensitization with offline desensitization, so that product development or testing activities can be carried out at any time.

[0040] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the file desensitization method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

[0041] According to an embodiment of the present application, by receiving a read file command sent by a host and responding to the read file command, a file to be read is obtained, wherein at least a portion of the data blocks in the file to be read have completed desensitization processing, and then the data blocks of the file to be read that have not yet been desensitized are desensitized, and the file to be read that has completed the desensitization processing is sent to the host, so that the file to be read can be incrementally desensitized, which can not only make full use of the previous desensitization results and improve the processing efficiency of file desensitization, but also combine online desensitization with offline desensitization, so that product development or testing activities can be carried out at any time.

[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes the file desensitization method of the above-mentioned first aspect or one or more of the multiple possible implementations of the first aspect.

[0043] According to an embodiment of the present application, by receiving a read file command sent by a host and responding to the read file command, a file to be read is obtained, wherein at least a portion of the data blocks in the file to be read have completed desensitization processing, and then the data blocks of the file to be read that have not yet been desensitized are desensitized, and the file to be read that has completed the desensitization processing is sent to the host, so that the file to be read can be incrementally desensitized, which can not only make full use of the previous desensitization results and improve the processing efficiency of file desensitization, but also combine online desensitization with offline desensitization, so that product development or testing activities can be carried out at any time.

[0044] These and other aspects of the present application will become more readily apparent from the following description of the embodiment(s). BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the application and, together with the description, serve to explain the principles of the application.

[0046] Figure 1 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown.

[0047] Figure 2 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown.

[0048] Figure 3 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown.

[0049] Figure 4 A flowchart of a file desensitization method according to an embodiment of the present application is shown.

[0050] Figure 5 A schematic diagram illustrating an application of a file desensitization method according to an embodiment of the present application is shown.

[0051] Figure 6 A schematic diagram illustrating an application of a file desensitization method according to an embodiment of the present application is shown.

[0052] Figure 7 A schematic diagram showing the processing process of a file desensitization method according to an embodiment of the present application.

[0053] Figure 8 A block diagram of a file desensitization device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0054] Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0055] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0056] In addition, numerous specific details are provided in the following detailed description to better illustrate the present application. Those skilled in the art will appreciate that the present application can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.

[0057] In related technologies, desensitization processing refers to identifying sensitive information in the object to be desensitized (such as data, files, etc.), and modifying the sensitive information through blocking, obfuscation, etc. to hide the sensitive information and achieve reliable protection of sensitive information.

[0058] Desensitization processing may include online desensitization and offline desensitization. During product development or testing, online desensitization means that when the host reads or accesses a file, the desensitization engine (used to perform desensitization processing) can identify the sensitive information in the read or accessed file in real time, desensitize the sensitive information, and send the desensitized file to the host for use. In other words, during online desensitization, the desensitization engine needs to perform a desensitization process for each file read or accessed by the host. The processing efficiency is low and there may be unnecessary multiple desensitization processes. For example, when the file read by the host multiple times is the same file, the desensitization engine will perform multiple desensitization processes on the file. In addition, during online desensitization, the desensitization engine needs to intercept the IO file and send the file to the host only after completing the desensitization process. This method will significantly affect the IO efficiency during development or testing.

[0059] Offline desensitization means that before product development or testing, the desensitization engine desensitizes all files used in the development or testing process through enumeration and traversal, and saves the desensitized files. After offline desensitization is completed, product development or testing activities will be carried out based on the saved desensitized files, and online desensitization will no longer be required during the development or testing process.

[0060] For example, for backup data used during product development or testing that includes multiple files, such as a backup LUN (Logical Unit Number, where the backup data is stored on the device corresponding to the LUN), when performing offline desensitization, a desensitized image can be created based on the backup LUN, and the desensitized files can be written to the desensitized image. After offline desensitization is completed, the desensitized image is a cleansed image that does not contain sensitive information, and development or testing activities will be carried out based on the cleansed image.

[0061] However, the limitation of offline desensitization is that development or testing activities can only begin after offline desensitization is completed, which results in a long waiting time. Moreover, if offline desensitization is not performed, development or testing activities cannot be carried out.

[0062] In order to solve the above technical problems, the present application provides a file desensitization method. The file desensitization method of the embodiment of the present application can be applied to a storage device. The storage device can receive a read file command sent by a host, and in response to the read file command, obtain a file to be read, wherein at least a part of the data blocks in the file to be read have completed desensitization processing, and then desensitize the data blocks of the file to be read that have not yet been desensitized, and send the desensitized file to be read to the host, so that the file to be read can be incrementally desensitized, which can not only make full use of the previous desensitization results and improve the processing efficiency of file desensitization, but also combine online desensitization with offline desensitization, so that product development or testing activities can be carried out at any time.

[0063] Figure 1 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown. Figure 1 The application scenario shown provides a desensitization system, including a production device 10, a storage device 20 and a host 30. The file desensitization method of this embodiment is applied to the storage device 20 and can be executed by the desensitization engine 21 in the storage device 20.

[0064] The production equipment 10 can be any form of electronic device, such as a server, a desktop computer, a mainframe computer, and any other type of computing device containing a processor and a memory. The production equipment 10 stores the production data in the storage device 40. The production data is an original file from the user, which may contain information involving the user's privacy. In order to prevent the leakage of user privacy, the production data needs to be desensitized. The storage device 40 can be a memory located inside the production equipment 10, or a memory located outside the production equipment 10. The external device can communicate with the production equipment 10 and is used to store the production data from the production equipment 10. The external device can be any form of electronic device, such as a server, a desktop computer, a mainframe computer, a storage array, and any other type of computing device containing a processor and a memory.

[0065] Host 30 primarily refers to a development / testing server. Developers / testers use host 30 to retrieve files from storage device 20 for product development or testing. In this embodiment, the files provided by storage device 20 to host 30 are desensitized to protect user privacy. In terms of product form, host 30 can be any electronic device, such as a server, desktop computer, mobile device, or any other computing device containing a processor and memory.

[0066] The storage device 20 may be a Network Attached Storage (NAS) device. A NAS device is a dedicated, high-performance file storage device that provides file data for user access via a network and file sharing protocol. The protocols used between it and the host 30 include the TCP / IP protocol for data transmission, and the CIFS and NFS protocols for network file services. In this case, the host 30 is configured with an NFS / CIFS client, which accesses a file by specifying the file name, location, or other attributes in a read command through the NFS / CIFS client. Correspondingly, the storage device 20 is configured with an NFS / CIFS server, which parses the read command. Since the file system records the location of the file on the hard disk, the storage device 20 can convert the file name and location in the received read command into the file address to obtain the file.

[0067] The storage device 20 may also be a storage area network (SAN) device, which communicates with the host 30 via a fiber channel network. The SAN device in this embodiment has a file system that allows file access. In addition to NAS devices and SAN devices, the storage device 20 may also be other devices with storage functions, and the number of storage devices 20 included in the desensitization system may be one or more. This embodiment does not limit the number of storage devices 20.

[0068] Since the production data stored in the production equipment 10 is original data, if the original data is directly desensitized, the data will be destroyed and difficult to recover. Figure 1 In the application scenario shown, the production data is sent to the storage device 20 and saved as a copy. The storage device 20 performs desensitization processing on the copy rather than the original data itself.

[0069] Figure 2 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown. Figure 2 The application scenario shown is similar to Figure 1 The difference is that the production device 10 can directly store the production data in the storage device 20. In order to prevent the original production data from being destroyed, the storage device 20 creates a copy of the production data and performs desensitization processing on the copy. Figure 2 In the illustrated scenario, both the production data and the production data replica are located in the storage device 20. There are many ways to create replicas, such as copying, snapshotting, cloning, etc., which are not described in detail here.

[0070] Figure 3 A schematic diagram of an application scenario of a file desensitization method according to an embodiment of the present application is shown. Figure 3 The application scenario shown provides a desensitization system, including a production device 10, a storage device 20, a host 30 and a desensitization device 50. Figure 1 The difference between the application scenarios shown is that Figure 3 The application scenario shown provides an independent desensitization device 50 for desensitizing files read by a host 30. The desensitization device 50 includes a desensitization engine 21.

[0071] In terms of product form, the desensitizing device 50 can be any form of electronic device, such as a server, a desktop computer, a mobile device, and any other type of computing device that includes a processor and a memory. Figure 3 The production equipment 10, storage device 20 (excluding the desensitization engine), and host 30 in the application scenario shown are all Figure 1 Similar, I will not go into details here.

[0072] In other possible application scenarios, the desensitization system may include at least two desensitization engines. For example, assuming that the desensitization system includes two desensitization engines, namely a first desensitization engine located in a desensitization device and a second desensitization engine located in a storage device, the two desensitization engines can be used to perform different desensitization processes, for example, the first desensitization engine is used to perform online desensitization, and the second desensitization engine is used to perform offline desensitization, or the first desensitization engine is used to perform offline desensitization, and the second desensitization engine is used to perform online desensitization; the two desensitization engines can also perform the same desensitization process, for example, both desensitization engines can perform online desensitization and offline desensitization. It should be noted that those skilled in the art can set the number of desensitization engines in the desensitization system and the desensitization processes performed by each desensitization engine according to actual conditions, and this embodiment does not limit this.

[0073] Figure 4 A flowchart of a file desensitization method according to an embodiment of the present application is shown. Figure 4 As shown, the file desensitization method is executed by the storage device 20, and the method includes steps S11 to S14.

[0074] In step S11 , a file read command sent by a host is received, where the file read command is used to request a file to be read.

[0075] In this embodiment, when the developer / tester obtains a file from the storage device through the host, the host can send a read file command to the storage device through the IO path, and the storage device can receive the read file command sent by the host, where the read file command is used to request the file to be read.

[0076] In one possible implementation, the file to be read may include at least one of a text file, a report file, an image file, an audio file, and a video file. The file to be read may also include other unstructured data such as office documents, XML (Extensible Markup Language) files, and HTML (HyperText Markup Language) files. This embodiment does not limit the specific type of the file to be read.

[0077] In step S12, in response to the file read command, the file to be read is obtained, and at least a portion of the data blocks in the file to be read have completed the desensitization processing.

[0078] In this embodiment, after receiving a read file command sent by the host, the storage device can respond to the read file command, determine the storage address of the file to be read based on the file name, location and other information in the read file command, and obtain the file to be read based on the storage address.

[0079] Among them, at least a portion of the data blocks in the file to be read have completed the desensitization process. In other words, the file to be read can be divided into multiple data blocks, and a portion of the data blocks have completed the desensitization process.

[0080] In a possible implementation, at least a portion of the data blocks in the file to be read can be desensitized by offline desensitization.

[0081] For example, when product development or testing is not being carried out, the file to be read can be desensitized by offline desensitization. Specifically, the file to be read can be divided into multiple data blocks of a certain size (for example, 4KB). For example, the file to be read can be divided into 5 data blocks, and the file to be read can be desensitized by offline desensitization. When 3 of the data blocks have completed the desensitization process, that is, when the number of data blocks that have completed the desensitization process is 3, product development or testing is required. In this case, the offline desensitization can be stopped, and the 3 data blocks that have completed the desensitization process can be saved in the hard disk of the storage device, and the desensitization status of each data block can be recorded through bitmaps, arrays, matrices, etc., and then the desensitization process is switched to online desensitization, that is, during the development or testing process, the 2 data blocks of the file to be read that have not yet been desensitized are desensitized by online desensitization.

[0082] In this way, online desensitization can be performed on the basis of offline desensitization, so that offline desensitization and online desensitization can jointly maintain a desensitization result.

[0083] In a possible implementation, at least a portion of the data blocks in the file to be read can be desensitized through online desensitization.

[0084] For example, assuming that the host and the storage device support both overall access to the file to be read and independent access to each data block in the file to be read, the file to be read includes 5 data blocks, and the file to be read has not been desensitized offline. When the host reads the file for the first time, it reads the first data block of the file to be read. The storage device can perform online desensitization on the first data block of the file to be read, and send the first data block that has completed the desensitization processing to the host, and at the same time save the first data block that has completed the desensitization processing in the hard disk of the storage device, and record its desensitization status; when the host reads the file again, it reads the file to be read. The storage device can respond to the file read command, obtain the file to be read, and perform online desensitization, wherein one data block of the file to be read (i.e., the first data block) has completed the desensitization processing.

[0085] In this way, incremental desensitization can be continued through online desensitization based on the previous online desensitization, so that multiple online desensitizations can also jointly maintain a desensitization result.

[0086] In step S13, desensitization processing is performed on the data blocks of the file to be read that have not been desensitized.

[0087] In this embodiment, the storage device can identify data blocks of the to-be-read file that have not been desensitized, and perform desensitization on the data blocks of the to-be-read file that have not been desensitized.

[0088] In one possible implementation, desensitization can be performed by replacing values ​​or strings, invalidating, randomizing, offsetting and rounding, masking, etc. The following will illustrate the specific methods of desensitization with reference to specific examples.

[0089] Example 1: Desensitization through value / string replacement.

[0090] Numeric / string replacement involves replacing a real numeric value or string with a fixed, fictitious value. For example, the file before desensitization is shown in Table 1 below. For the mobile phone numbers in Table 1, the function "mobile=13800013800" can be used to assign the mobile phone number field to 13800013800. The file after desensitization of the mobile phone numbers through numeric replacement is shown in Table 2 below. In Table 2, the desensitized mobile phone numbers are all displayed as 13800013800, with their actual values ​​hidden.

[0091] Table 1 Files before desensitization

[0092] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San City A, Sichuan Province 138####8611 51132119######0672 2020-5-30 15:01:56 2 100001 Li Si City A, Sichuan Province 133####6953 51132119######0611 2020-6-30 16:56:03 3 100002 Wang Wu Shenzhen District B 186####9898 51121019######5582 2020-4-30 16:01:50 4 100003 Zhao Liu Shenzhen District C 180####9465 46003319######0651 2020-7-30 16:15:03 5 100004 Qian Qi District D, Shenzhen 181####7898 46003119######0818 2020-9-30 17:20:50

[0093] Table 2 Files after desensitizing mobile phone numbers

[0094] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San City A, Sichuan Province 13800138000 51132119######0672 2020-5-30 15:01:56 2 100001 Li Si City A, Sichuan Province 13800138000 51132119######0611 2020-6-30 16:56:03 3 100002 Wang Wu Shenzhen District B 13800138000 51121019######5582 2020-4-30 16:01:50 4 100003 Zhao Liu Shenzhen District C 13800138000 46003319######0651 2020-7-30 16:15:03 5 100004 Qian Qi District D, Shenzhen 13800138000 46003119######0818 2020-9-30 17:20:50

[0095] Here, # represents any number from 0 to 9.

[0096] Example 2: Desensitization through invalidation.

[0097] Desensitization through invalidation refers to desensitizing sensitive data by truncation, encryption, or hiding, rendering it useless. For example, replacing the actual address with ******. Data invalidation and data replacement achieve similar effects. For example, the addresses in Table 1 can be desensitized using a hidden method. Specifically, the address field can be hidden using the address="*******" function to achieve the desired desensitization effect. The file after this hidden desensitization is shown in Table 3.

[0098] Table 3 Files after address desensitization

[0099] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San ******* 138####8611 51132119######0672 2020-5-30 15:01:56 2 100001 Li Si ******* 133####6953 51132119######0611 2020-6-30 16:56:03 3 100002 Wang Wu ******* 186####9898 51121019######5582 2020-4-30 16:01:50 4 100003 Zhao Liu ******* 180####9465 46003319######0651 2020-7-30 16:15:03 5 100004 Qian Qi ******* 181####7898 46003119######0818 2020-9-30 17:20:50

[0100] Optionally, in the above example, the address field can be truncated to hide only part of the information. Specifically, the address = left(address, 3) + "******" function can be used to add ****** to the left three digits of the source address string. The file after truncated address masking is shown in Table 4 below.

[0101] Table 4 Files after address desensitization

[0102] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San Sichuan Province*** 138####8611 51132119######0672 2020-5-30 15:01:56 2 100001 Li Si Sichuan Province*** 133####6953 51132119######0611 2020-6-30 16:56:03 3 100002 Wang Wu Shenzhen*** 186####9898 51121019######5582 2020-4-30 16:01:50 4 100003 Zhao Liu Shenzhen*** 180####9465 46003319######0651 2020-7-30 16:15:03 5 100004 Qian Qi Shenzhen*** 181####7898 46003119######0818 2020-9-30 17:20:50

[0103] Example 3: Desensitization through randomization

[0104] Desensitization through randomization involves replacing real numbers or strings with random data, maintaining the randomness of the replacement value to simulate the authenticity of the sample. For example, randomly generated names can be used instead of real names, or random numbers within a specified range can be used instead of real numbers.

[0105] Specifically, the A1(rand(A1.len())+1)+B1(rand(B1.len())+1) function can be used to randomize names (generating names by randomly combining the external dictionary tables "surname.txt" in A1 and "firstname.txt" in B1). The resulting file after randomization and name desensitization is shown in Table 5 below.

[0106] Table 5 Files after name desensitization

[0107] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang Yi City A, Sichuan Province 138####8611 51132119######0672 2020-5-30 15:01:56 2 100001 Li Er City A, Sichuan Province 133####6953 51132119######0611 2020-6-30 16:56:03 3 100002 Wang San Shenzhen District B 186####9898 51121019######5582 2020-4-30 16:01:50 4 100003 Zhao Si Shenzhen District C 180####9465 46003319######0651 2020-7-30 16:15:03 5 100004 Qian Wu District D, Shenzhen 181####7898 46003119######0818 2020-9-30 17:20:50

[0108] Example 4: Desensitization by offsetting and rounding

[0109] Offset and rounding refers to changing digital data by randomly shifting it. For example, the date 2018-01-02 8:12:25 is changed to 2018-01-02 8:00:00. Offset and rounding maintain the security of the data while ensuring the approximate authenticity of the range. This function is of great value in big data utilization environments.

[0110] Specifically, use the string(operatetime,"yyyy-MM-dd HH:00:00") function to format the data into the "yyyy-MM-dd HH:00:00" format using offset and rounding rules. The file after desensitizing the operation time using offset and rounding is shown in Table 6.

[0111] Table 6 Files after desensitization of operation time

[0112] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San City A, Sichuan Province 138####8611 51132119######0672 2020-5-30 15:00:00 2 100001 Li Si City A, Sichuan Province 133####6953 51132119######0611 2020-6-30 16:00:00 3 100002 Wang Wu Shenzhen District B 186####9898 51121019######5582 2020-4-30 16:00:00 4 100003 Zhao Liu Shenzhen District C 180####9465 46003319######0651 2020-7-30 16:00:00 5 100004 Qian Qi District D, Shenzhen 181####7898 46003119######0818 2020-9-30 17:00:00

[0113] Example 5: Desensitization through masking

[0114] Masking is a powerful tool for desensitizing partial information in account data, such as bank card numbers or ID numbers. You can specify whether to mask all or part of the information (e.g., the last X digits, the middle X digits, etc.). For example, masking the date of birth from an ID number can be desensitized.

[0115] Specifically, you can use the left(string(idnumber),6)+"********"+right(string(idnumber),4) function to mask the ID number. The file after masking the ID number is desensitized, as shown in Table 7 below.

[0116] Table 7 Files after desensitization of ID card numbers

[0117] Serial number Code Name address phone number ID number Operation time 1 100000 Zhang San City A, Sichuan Province 138####8611 511321********0672 2020-5-30 15:01:56 2 100001 Li Si City A, Sichuan Province 133####6953 511321********0611 2020-6-30 16:56:03 3 100002 Wang Wu Shenzhen District B 186####9898 511210********5582 2020-4-30 16:01:50 4 100003 Zhao Liu Shenzhen District C 180####9465 460033********0651 2020-7-30 16:15:03 5 100004 Qian Qi District D, Shenzhen 181####7898 460031********0818 2020-9-30 17:20:50

[0118] It should be noted that, although the above examples are used to illustrate the specific methods of desensitization, those skilled in the art should understand that the specific methods of desensitization are not limited to these, and may also include other methods. During the desensitization process, those skilled in the art may select one or more specific methods according to actual circumstances, and this embodiment does not limit this.

[0119] In step S14, the file to be read that has completed the desensitization processing is sent to the host.

[0120] In this embodiment, when all data blocks in the file to be read have completed desensitization processing, the file to be read that has completed desensitization processing can be obtained, and the storage device can send the file to be read that has completed desensitization processing to the host for product development or testing.

[0121] The file desensitization method of this embodiment is executed by a storage device. The storage device can receive a read file command sent by a host, and in response to the read file command, obtain a file to be read, wherein at least a portion of the data blocks in the file to be read have completed desensitization processing, and then perform desensitization processing on the data blocks of the file to be read that have not yet been desensitized, and send the desensitized file to be read to the host, so that the file to be read can be incrementally desensitized. Not only can the previous desensitization results be fully utilized to improve the processing efficiency of file desensitization, but online desensitization can also be combined with offline desensitization, so that product development or testing activities can be carried out at any time.

[0122] In a possible implementation, the method may further include: saving the desensitizing-processed file to be read in the hard disk of the storage device.

[0123] In this embodiment, the storage device can save the desensitization results of each time (i.e., the files to be read that have completed the desensitization process) in the hard disk. For example, a specific location can be selected to store the files that have completed the desensitization process. As the incremental desensitization continues, a purified backup can be gradually formed, which includes files that have completed the desensitization process and non-sensitive files. Subsequent development or testing activities can be carried out based on the purified backup, which can not only reduce unnecessary multiple desensitizations, but also reduce the impact of online desensitization on the IO efficiency during the development or testing process, and improve the reading efficiency of files.

[0124] In a possible implementation, the file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed desensitization processing.

[0125] The method may further include: before performing desensitization processing on the data blocks of the file to be read that have not yet been desensitized, determining, based on the desensitization mark, that the file to be read is a file that has not yet completed desensitization processing.

[0126] In this embodiment, the file to be read has a desensitization mark, which can be used to indicate whether the file to be read has completed the desensitization process. For example, the desensitization mark can be set to 1 or 0. The desensitization mark is 1, indicating that the file to be read has completed the desensitization process, that is, all data blocks of the file to be read have completed the desensitization process; the desensitization mark is 0, indicating that the file to be read has not completed the desensitization process, that is, at least one data block in the file to be read has not completed the desensitization process. Alternatively, the desensitization mark is 1, indicating that the file to be read has not completed the desensitization process, and the desensitization mark is 0, indicating that the file to be read has completed the desensitization process.

[0127] It should be noted that the desensitization mark can also be set to other values. Those skilled in the art can set the value of the desensitization mark and the desensitization state corresponding to each value according to actual conditions, and this application does not limit this.

[0128] When the file to be read has a desensitization mark, before desensitizing the data blocks of the file to be read that have not yet been desensitized, it can be determined based on the desensitization mark that the file to be read is a file that has not yet completed the desensitization process. For example, the desensitization mark can be set to 1 (indicating that the desensitization process has been completed) or 0 (indicating that the desensitization process has not yet been completed), and it can be determined whether the desensitization mark of the file to be read is 0. When the desensitization mark of the file to be read is 0, it can be determined that the file to be read is a file that has not yet completed the desensitization process, and then step S13 can be executed to desensitize the data blocks of the file to be read that have not yet been desensitized; when the desensitization mark of the file to be read is 1, no desensitization process is required, and the file to be read can be directly sent to the host.

[0129] According to this embodiment, the file to be read has a desensitization mark, and the desensitization status of the file to be read can be determined based on the desensitization mark, thereby realizing the management and identification of the desensitization status of the file to be read.

[0130] In one possible implementation, the method may further include: obtaining a bitmap of the file to be read, the bitmap being used to indicate whether each data block contained in the file to be read has completed desensitization processing; and identifying the data blocks in the file to be read that have not yet been desensitized based on the bitmap.

[0131] In this embodiment, a bitmap can be used to indicate whether each data block contained in the file to be read has completed the desensitization process. The bitmap may include a number of small squares, each of which corresponds to the address of a data block in the file to be read. Each small square records a flag bit with a value of 0 or 1. The flag bit can be used to indicate whether the data block stored at the address corresponding to the small square recording the flag bit has completed the desensitization process. The number of small squares in the bitmap of the file to be read is consistent with the number of data blocks contained in the file to be read.

[0132] Among them, the value of the flag bit in the bitmap can be 1 or 0, and 1 can be used to indicate that the corresponding data block has completed the desensitization processing, and 0 can be used to indicate that the corresponding data block has not completed the desensitization processing. Alternatively, 1 can be used to indicate that the corresponding data block has not completed the desensitization processing, and 0 can be used to indicate that the corresponding data block has completed the desensitization processing.

[0133] It should be noted that those skilled in the art can determine the values ​​of the flag bits in the bitmap and the desensitization status of the data blocks corresponding to each value according to actual conditions, and this application does not impose any restrictions on this.

[0134] In this embodiment, a bitmap of the file to be read can be obtained, and based on the bitmap, data blocks in the file to be read that have not yet been desensitized can be identified. For example, if the value of a flag bit in the bitmap of the file to be read is 1 (indicating that the corresponding data block has completed desensitization) or 0 (indicating that the corresponding data block has not yet completed desensitization), it can be determined whether the value of each flag bit in the bitmap is 0, and the data block corresponding to the flag bit with a value of 0 is determined to be a data block in the file to be read that has not yet been desensitized.

[0135] According to this embodiment, a bitmap can be set for the file to be read, and by identifying the bitmap of the file to be read, the data blocks in the file to be read that have not been desensitized can be determined. This is simple and fast, thereby improving processing efficiency.

[0136] In a possible implementation, the method may further include: modifying a flag bit in the bitmap corresponding to a data block that has completed desensitization processing to indicate that the corresponding data block has completed desensitization processing.

[0137] In this embodiment, for data blocks in the file to be read that have completed desensitization processing, the flag bit in the bitmap corresponding to the data block that has completed desensitization processing can be modified to indicate that the data block has completed desensitization processing. In this way, the bitmap can be updated in a timely manner according to the changes in the desensitization status of the data block in the file to be read, thereby improving the accuracy of the bitmap of the file to be read.

[0138] In a possible implementation, the method may further include: modifying the desensitization mark of the file to be read that has completed the desensitization process to indicate that the file to be read has completed the desensitization process.

[0139] In this embodiment, when the desensitization processing of the file to be read has been completed, that is, when the bitmap of the image to be processed indicates that all data blocks contained therein have completed the desensitization processing, the desensitization mark of the file to be read can be modified to indicate that the desensitization processing has been completed. In this way, the desensitization mark of the file to be read can be updated in a timely manner according to the changes in the desensitization status of the file to be read, thereby improving the accuracy of the desensitization mark of the file to be read.

[0140] In one possible implementation, a desensitizing metafile may be provided for the file to be read, for identifying the desensitizing status of the file to be read and the desensitizing status of each data block contained in the file to be read. There are many ways to represent a desensitizing metafile, such as a bitmap, array, matrix, tensor, etc., and this application does not limit the specific representation of the desensitizing metafile.

[0141] In a possible implementation, the desensitization metafile of the file to be read may include a desensitization mark and a bitmap. The desensitization mark and the bitmap are similar to those described above and are not described in detail here.

[0142] In one possible implementation, incremental desensitization can be performed by combining online desensitization with offline desensitization, or by combining multiple online desensitizations. The incremental desensitization combining online desensitization with offline desensitization can include first performing offline desensitization on the backup data and then performing online desensitization, first performing online desensitization on the backup data and then performing offline desensitization, or performing multiple online desensitizations and multiple offline desensitizations on the backup data, i.e., the desensitization processing of the backup data switches between offline desensitization and online desensitization multiple times.

[0143] Among them, the backup data is first desensitized offline and then desensitized online. The specific process is similar to the above processing process and will not be repeated here.

[0144] The backup data is first desensitized online and then desensitized offline. Before the product development or test starts, the backup data has not been desensitized. After the product development or test starts, when the host reads the file or the data block in the file, the file or data block to be read is desensitized online and sent to the host. At the same time, the desensitized files or data blocks are saved and their desensitization status is updated. Then, during the period when the product development or test is stopped, the files or data blocks in the backup data that have not been desensitized are desensitized offline.

[0145] Multiple online desensitization and multiple offline desensitization can be performed on backup data when product development or testing is not being carried out, such as before the start of product development or testing or during the suspension of product development or testing, etc., to perform offline desensitization on files or data blocks in the backup data that have not been desensitized, and save the files or data blocks that have completed the desensitization and update their desensitization status; when product development or testing is required, offline desensitization can be stopped at any time, and the files or data blocks read by the host that have not been desensitized can be desensitized online and sent to the host, while the files or data blocks that have completed the desensitization can be saved and their desensitization status can be updated. As a result, as product development or testing activities are stopped or carried out, the desensitization processing of the backup data can be switched between offline desensitization and online desensitization multiple times until all files in the backup data have been desensitized.

[0146] Incremental desensitization combined with multiple online desensitizations can be used during product development or testing. When the host reads files or data blocks from backup data multiple times, the files or data blocks read by the host can be desensitized online each time and sent to the host. The files or data blocks that have completed the desensitization processing are saved and their desensitization status is updated. When the host reads the file or data block next time, the desensitization status of the file or data block to be read can be determined according to the latest desensitization status, and the files or data blocks that have not been desensitized can be desensitized online. In this way, each online desensitization is performed on the basis of the last online desensitization, realizing incremental desensitization between multiple online desensitizations.

[0147] The following will use specific examples to illustrate the file desensitization method that combines online desensitization with offline desensitization and the file desensitization method that combines multiple online desensitizations.

[0148] Figure 5 The following is a schematic diagram showing an application of a file desensitization method according to an embodiment of the present application. Figure 5 As shown, the backup data before desensitization includes five files, namely F1, F2, F3, F4 and F5, which are used for product development or testing. When product development or testing has not yet begun, the backup data can be desensitized offline and the files that have completed the desensitization can be saved. When offline desensitization completes the desensitization of F1 and is desensitizing F2 (for example, F2 includes three data blocks, one data block has completed the desensitization, and the remaining two data blocks have not yet been desensitized), the development / testing personnel starts product development or testing. In this case, offline desensitization can be stopped, and F1 (i.e., F1′) that has completed the desensitization and F2 that has completed the desensitization can be saved, and the desensitization marks and bitmaps of F1 and F2 are updated, and the desensitization process is switched from offline desensitization to online desensitization. Among them, the storage paths or storage locations of the backup data, the files that have completed the desensitization (such as F1′) and the files that have partially completed the desensitization (such as F2) are all different.

[0149] During product development or testing, the host reads F2, and the storage device reads a saved data block F2 that has completed the desensitization processing, and performs online desensitization on the two data blocks in F2 that have not yet completed the desensitization processing; after the desensitization processing is completed, the storage device can send the desensitized F2 (i.e., F2′) to the host, and at the same time update the desensitization mark and bitmap of F2 and save F2′.

[0150] After reading F2, product development or testing is suspended, and the backup data can continue to be desensitized offline. When offline desensitization completes the desensitization of F3 and is desensitizing F4 (for example, F4 includes four data blocks, three of which have been desensitized, and the remaining one has not yet been desensitized), the development / testing personnel restarts product development or testing. In this case, offline desensitization can be stopped, and F3 (i.e., F3′) that has been desensitized and F4 with three data blocks that have been desensitized can be saved. The desensitization marks and bitmaps of F3 and F4 are updated, and the desensitization process is switched from offline desensitization to online desensitization.

[0151] During product development or testing, the host reads F4, and the storage device reads the three stored data blocks of F4 that have completed desensitization. It also performs online desensitization on the one data block in F4 that has not yet completed desensitization. After the desensitization process is complete, the desensitized F4 (i.e., F4') can be sent to the host, and the desensitization tag and bitmap of F4 can be updated and saved. After that, the host reads F5, and the storage device reads F5 from the backup data, performs online desensitization on F5, and then sends the desensitized F5 (i.e., F5') to the host, updates the desensitization tag and bitmap of F5, and saves F5'.

[0152] The file desensitization processing in this embodiment can combine online desensitization with offline desensitization, save the results of each desensitization processing, and update the desensitization status of the file at the same time, so that online desensitization can utilize the processing results of offline desensitization without having to wait for the completion of offline desensitization before starting product development or testing. It also allows offline desensitization to utilize the processing results of online desensitization, and incrementally desensitize files to gradually form a purified backup until all files have completed desensitization processing.

[0153] Figure 6 The following is a schematic diagram showing an application of a file desensitization method according to an embodiment of the present application. Figure 6 As shown, the backup data before desensitization includes five files, namely F1, F2, F3, F4 and F5. The backup data is used for product development or testing. Offline desensitization is not performed before product development or testing. During product development or testing, when the host reads the file for the first time, it reads F1, and the storage device reads F1 from the backup data and performs online desensitization on F1. It then sends the desensitized F1 (i.e., F1′) to the host, and at the same time updates the desensitization mark and bitmap of F1 and saves F1′;

[0154] When the host reads the file for the second time, it reads files F2 and F3. The storage device reads F2 and F3 from the backup data and performs online desensitization on F2 and F3 respectively. Then, it sends the desensitized F2 (i.e., F2′) and the desensitized F3 (i.e., F3′) to the host, updates the desensitization flags and bitmaps of F2 and F3, and saves F2′ and F3′.

[0155] When the host reads the file for the third time, it reads files F4 and F5. The storage device reads F4 and F5 from the backup data and performs online desensitization on F4 and F5 respectively. Then, it sends the desensitized F4 (i.e., F4′) and the desensitized F5 (i.e., F5′) to the host, and at the same time updates the desensitization marks and bitmaps of F4 and F5 and saves F4′ and F5′.

[0156] In this embodiment, when the file desensitization process is only online desensitization, the files after each desensitization are completed can also be saved, so that multiple online desensitizations can also be performed incrementally.

[0157] Figure 7 A schematic diagram showing the processing process of the file desensitization method according to an embodiment of the present application is shown. Figure 7 As shown, during product development or testing, the host can read a file from the storage device through the IO path. The storage device can receive a read file command sent by the host in step S701. In step S702, in response to the read file command, the storage device obtains the file to be read, wherein at least a portion of the data blocks in the file to be read have completed desensitization processing. In step S703, the desensitization mark of the file to be read is obtained, and in step S704, it is determined whether the desensitization mark is 1. The value of the desensitization mark is 1 or 0. When the desensitization mark is 1, it indicates that the file to be read has completed desensitization processing. When the desensitization mark is 0, it indicates that the file to be read has not completed desensitization processing.

[0158] When the desensitization flag is 1, the file to be read has been desensitized, and the storage device does not need to perform desensitization again. In step S709, the desensitized file to be read can be directly sent to the host.

[0159] When the desensitization flag is not 1 (i.e., the desensitization flag is 0), the file to be read has not yet completed the desensitization process, and the storage setting may execute step S705 to obtain a bitmap of the file to be read, and in step S706, identify data blocks in the file to be read that have not yet been desensitized based on the bitmap, and in step S707, perform desensitization on the data blocks in the file to be read that have not yet been desensitized;

[0160] When all data blocks of the file to be read have completed the desensitization processing, it can be considered that the file to be processed has completed the desensitization processing, and the storage setting can execute step S708 to send the desensitized file to be read to the host for product development or testing.

[0161] After step S707, step S709 may be further executed to update the desensitization mark and bitmap of the to-be-read file that has completed the desensitization process, and save them in the hard disk of the storage device.

[0162] In this embodiment, online desensitization can identify the desensitization status of the file to be read and the desensitization status of each data block contained in the file to be read in real time through the desensitization mark and bitmap of the file to be read, thereby reducing unnecessary or repeated desensitization processing and reducing the impact on the user's production environment (such as product development or testing environment).

[0163] In one possible implementation, when the host and the storage device support independent access to the data block in the file to be read, it can be determined whether the data block has completed the desensitization process based on the flag bit corresponding to the data block to be accessed in the bitmap of the file to be read. If the flag bit indicates that the data block has completed the desensitization process (for example, the flag bit is 1), the storage device can directly send the data block to the host without performing the desensitization process again; if the flag bit indicates that the data block has not completed the desensitization process (for example, the flag bit is 0), the storage device can perform the desensitization process on the data block and send the desensitized data block to the host. At the same time, the storage device can also save the desensitized data block in the hard disk and update the corresponding flag bit in the bitmap.

[0164] In one possible implementation, when a storage device saves a desensitized file or data block to a hard disk, it may also save the attribute information of the desensitized file or data block to the hard disk. The attribute information of the file or data block may include the name, size (e.g., size, length, etc.), location, etc. of the file or data block. This application does not limit the specific attribute information of the file or data block.

[0165] According to the file desensitization method described in the embodiments of the present application, online desensitization can be combined with offline desensitization, and the files or data blocks that have completed the desensitization processing can be saved. This not only enables incremental desensitization of backup data used in product development or testing, improves the processing efficiency of file desensitization, and reduces the impact of online desensitization on the user's production environment (such as the user's development environment or test environment), but also allows the desensitization processing to be switched between online desensitization and offline desensitization at any time, thereby allowing product development or testing activities to be carried out at any time.

[0166] Figure 8 FIG. 1 shows a block diagram of a file desensitization device according to an embodiment of the present application. Figure 8 As shown, the file desensitization device is applied to a storage device and can be implemented by a desensitization engine. The device includes:

[0167] A command receiving module 81 is configured to receive a file read command sent by a host, wherein the file read command is used to request a file to be read;

[0168] The file acquisition module 82 acquires the file to be read in response to the file read command, wherein at least a portion of the data blocks in the file to be read have been desensitized;

[0169] A desensitization processing module 83 is used to perform desensitization processing on the data blocks of the file to be read that have not been desensitized;

[0170] The file sending module 84 is used to send the desensitized file to be read to the host.

[0171] In one possible implementation, the file desensitization device may be located inside a storage device and may be implemented by hardware, software, or a combination of hardware and software. The file desensitization device may also be located outside a storage device and may be implemented as an independent desensitization device, wherein the desensitization device may be any form of electronic device, such as a server, a desktop computer, a mobile device, or any other type of computing device containing a processor and a memory. This application does not limit the location and specific implementation of the file desensitization device.

[0172] In a possible implementation, the apparatus may further include: a file storage module configured to store the desensitizing-processed file to be read in the hard disk of the storage device.

[0173] In one possible implementation, the device may further include: a bitmap acquisition module, used to obtain a bitmap of the file to be read, the bitmap being used to indicate whether each data block contained in the file to be read has completed desensitization processing; and a data block identification module, used to identify the data blocks in the file to be read that have not yet been desensitized based on the bitmap.

[0174] In a possible implementation, the file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed desensitization processing.

[0175] The device may further include: a file desensitization identification module for determining, based on the desensitization mark, whether the file to be read is a file that has not yet completed the desensitization process before desensitizing the data blocks of the file to be read that have not yet been desensitized.

[0176] In a possible implementation, the device may further include: a desensitization mark modification module, configured to modify the desensitization mark of the file to be read that has completed the desensitization process, to indicate that the file to be read has completed the desensitization process.

[0177] In a possible implementation, the device may further include: a bitmap modification module, configured to modify a flag bit in the bitmap corresponding to a data block that has completed desensitization processing, to indicate that the corresponding data block has completed desensitization processing.

[0178] In a possible implementation, at least a portion of the data blocks in the file to be read are desensitized by offline desensitization.

[0179] In a possible implementation, the file to be read includes at least one of a text file, a report file, a picture file, an audio file, and a video file.

[0180] In one possible implementation, each of the above modules in the file desensitization device can be implemented by the CPU calling program instructions.

[0181] It should be noted that the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. Its specific implementation can refer to the description of the above method embodiments. For the sake of brevity, they will not be described one by one here.

[0182] An embodiment of the present application provides a file desensitization device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.

[0183] An embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above method when executed by a processor.

[0184] An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0185] A computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof.

[0186] The computer-readable program instructions or code described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0187] The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions, thereby implementing various aspects of the present application.

[0188] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0189] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0190] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0191] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a part for a module, program segment or instruction, and the part for the module, program segment or instruction comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be performed substantially in parallel, and they can sometimes also be performed in the opposite order, depending on the function involved.

[0192] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware that performs the corresponding function or action (such as a circuit or ASIC (Application Specific Integrated Circuit)), or can be implemented by a combination of hardware and software, such as firmware.

[0193] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0194] The embodiments of the present application have been described above. The above description is illustrative and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A file desensitization method, characterized in that: The method is executed by a storage device, and includes: receiving a file read command sent by a host, wherein the file read command is used to request a file to be read; In response to the file read command, the file to be read is obtained, where the file to be read includes a first portion of data blocks that have undergone desensitization processing and a second portion of data blocks that have not undergone desensitization processing; Performing desensitization processing on the second portion of data blocks that have not yet been desensitized; Send the desensitized file to be read to the host.

2. The method according to claim 1, characterized in that Also includes: The desensitized file to be read is stored in the hard disk of the storage device.

3. The method according to claim 1, characterized in that Also includes: Obtaining a bitmap of the file to be read, the bitmap being used to indicate whether each data block contained in the file to be read has completed desensitization processing; According to the bitmap, the second part of the data blocks in the file to be read that have not been desensitized are identified.

4. The method according to claim 1, wherein The file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed the desensitization process. The method further comprises: Before performing desensitization processing on the second part of the data blocks that have not yet been desensitized, it is determined based on the desensitization mark that the file to be read is a file that has not yet completed the desensitization processing.

5. The method according to claim 3, characterized in that Also includes: Modify the flag bit in the bitmap corresponding to the data block that has completed the desensitization processing to indicate that the corresponding data block has completed the desensitization processing.

6. The method according to claim 4, characterized in that Also includes: The desensitization mark of the file to be read that has completed the desensitization processing is modified to indicate that the file to be read has completed the desensitization processing.

7. The method according to claim 1, characterized in that The first part of the data blocks that have completed the desensitization processing is desensitized through offline desensitization.

8. The method according to any one of claims 1 to 7, characterized in that The file to be read includes at least one of a text file, a report file, a picture file, an audio file, and a video file.

9. A document desensitization device, characterized in that: The device is applied to a storage device, and includes: A command receiving module, configured to receive a file read command sent by a host, wherein the file read command is used to request a file to be read; A file acquisition module, in response to the file read command, acquires the file to be read, wherein the file to be read includes a first portion of data blocks that have undergone desensitization processing and a second portion of data blocks that have not undergone desensitization processing; a desensitization processing module, configured to perform desensitization processing on the second portion of data blocks that have not yet been desensitized; The file sending module is used to send the desensitized file to be read to the host.

10. The device according to claim 9, characterized in that Also includes: The file storage module is used to save the desensitizing-processed file to be read in the hard disk of the storage device.

11. The device according to claim 9, characterized in that Also includes: A bitmap acquisition module is used to obtain a bitmap of the file to be read, and the bitmap is used to indicate whether each data block contained in the file to be read has completed the desensitization process; A data block identification module is used to identify the second part of data blocks in the file to be read that have not been desensitized according to the bitmap.

12. The device according to claim 9, characterized in that The file to be read has a desensitization mark, and the desensitization mark is used to indicate whether the file to be read has completed the desensitization process. The device further comprises: The file desensitization identification module is used to determine whether the file to be read is a file that has not yet completed the desensitization processing based on the desensitization mark before desensitizing the second part of the data blocks of the file to be read that have not yet been desensitized.

13. The device according to claim 11, characterized in that Also includes: The bitmap modification module is used to modify the flag bit in the bitmap corresponding to the data block that has completed the desensitization processing to indicate that the corresponding data block has completed the desensitization processing.

14. The device according to claim 12, characterized in that Also includes: The desensitization mark modification module is used to modify the desensitization mark of the file to be read that has completed the desensitization process to indicate that the file to be read has completed the desensitization process.

15. The device according to claim 9, characterized in that The first part of the data blocks that have completed the desensitization processing is desensitized through offline desensitization.

16. The device according to any one of claims 9 to 15, characterized in that The file to be read includes at least one of a text file, a report file, a picture file, an audio file, and a video file.

17. A document desensitization device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method according to any one of claims 1 to 8 when executing the instructions.

18. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Data acquisition method, device and equipment and computer readable storage medium

    CN110502515A

  • Automatic desensitization data acquisition and distribution system and method

    CN111460512A