File desensitization method, computer program product, electronic equipment and storage medium
By performing type identification and analysis of file data, combined with sensitive information matching and positioning, efficient and accurate replacement of sensitive information during file desensitization is achieved, and the problem of low replacement accuracy in the prior art is solved, ensuring the security of file data.
Patent Information
- Application Number
- CN202411905754.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-15
AI Technical Summary
In the process of file desensitization in the prior art, the matching and replacement method of hash values is not accurate, resulting in omission or error replacement, reducing processing efficiency, and difficult to effectively ensure the security of file data.
By analyzing different types of file data in different ways, the parsed data is obtained to match pre-set sensitive information, and the sensitive information in the file is located and replaced to ensure the accuracy and efficiency of replacement.
Improve the accuracy of replacement during file desensitization, avoid omissions and misreplacement, improve processing efficiency, and ensure the security of file data.
Smart Images

Figure CN119830344A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and more specifically, to a file desensitization method, a computer program product, an electronic device, and a storage medium. Background Art
[0002] The security of file data is of vital importance. As a data carrier, files play an important role in transmitting information. Moreover, files are one of the core assets of enterprises and organizations. Since there may be a large amount of sensitive information in files, the safe storage and transmission of files is particularly important. In order to ensure data security, file desensitization technology has come into being. That is, by identifying, replacing or deleting sensitive information in files, the files can effectively reduce the risk of data leakage while retaining necessary information for analysis, testing or compliance review.
[0003] The prior art usually uses a method of matching and replacing sensitive content using hash values, which requires additional calculation of hash values. However, the matching and replacement method of hash values is not accurate and will reduce the efficiency of processing sensitive content. It is prone to omissions or erroneous replacements, resulting in poor desensitization effect on files. Summary of the invention
[0004] The purpose of this application is to provide a file desensitization method, computer program product, electronic device and storage medium, which can effectively replace sensitive content in a file, improve the accuracy of the replacement, avoid omissions, replacement errors, etc., improve replacement efficiency, and effectively ensure the security of file data.
[0005] In a first aspect, an embodiment of the present application provides a file desensitization method, the method comprising:
[0006] Get file data stream;
[0007] Parsing the file data stream to obtain parsed data;
[0008] Matching the parsed data with the first sensitive information to obtain a matching result;
[0009] The second sensitive information in the parsed data is replaced according to the matching result to obtain a desensitized document data stream.
[0010] In the above implementation process, by parsing different types of file data in different ways, matching the obtained parsed data with the first sensitive information, and then replacing the sensitive information, the sensitive content in the file can be effectively replaced, improving the accuracy of the replacement, avoiding omissions, replacement errors, etc., improving replacement efficiency, and effectively ensuring the security of file data.
[0011] Furthermore, the step of parsing the file data stream to obtain parsed data includes:
[0012] Identify the file type of the file data stream according to the file type identification engine to obtain multiple file types;
[0013] Parsing the multiple file types respectively according to data parsing methods corresponding to different file types to obtain multiple parsed file data;
[0014] The plurality of parsed file data are determined to be the parsed data.
[0015] In the above implementation process, different parsing methods are used for parsing according to different file types, which can improve the accuracy of the parsed data, so that the sensitive data in the file is fully reflected in the parsed data, and provide assistance for the replacement of sensitive data.
[0016] Furthermore, the step of matching the parsed data with the first sensitive information to obtain a matching result includes:
[0017] Get the first sensitive information;
[0018] The first sensitive information and the parsed data are passed as transfer parameters to a matching interface for matching to obtain the matching result.
[0019] In the above implementation process, the first sensitive information and the parsed data are input into the matching interface for matching, which can quickly and accurately match the first sensitive information, detect the first sensitive information contained in the parsed data in time, and improve data processing efficiency.
[0020] Furthermore, the step of obtaining the first sensitive information includes:
[0021] Obtaining pre-set third-party sensitive information;
[0022] Determine whether the regular expression of the third sensitive information meets the preset requirements;
[0023] If so, initialize the regular expression of the third sensitive information according to the preset configuration options to obtain the first sensitive information.
[0024] In the above implementation process, the regular expression of the third sensitive information is detected and initialized after it is determined to meet the preset requirements. This can ensure the accuracy of the first sensitive information and reduce the impact of the first sensitive information on the file.
[0025] Furthermore, the step of replacing the second sensitive information in the parsed data according to the matching result to obtain a desensitized document data stream includes:
[0026] If the matching result is a successful match, obtaining replacement information, replacing the second sensitive information in the parsed data with the replacement information, and obtaining the desensitized document data stream;
[0027] If the matching result is an unsuccessful match, there is no sensitive information in the parsed data.
[0028] In the above implementation process, if the matching result is a successful match, the second sensitive information in the parsed data is replaced, which can ensure the security of the parsed data, improve the parsed data, and make the parsed data quickly and reasonably desensitized.
[0029] Furthermore, the step of obtaining replacement information includes:
[0030] Determining whether the user provides pre-set replacement information;
[0031] If so, determining that the replacement information preset by the user is the replacement information;
[0032] If not, determining the first threshold is the replacement information.
[0033] In the above implementation process, different replacement information is selected according to different situations to ensure that sensitive information can be completely replaced. At the same time, data redundancy can be reduced, the probability of data errors can be avoided, and multiple options are provided for file desensitization.
[0034] Furthermore, the step of replacing the second sensitive information in the parsed data with the replacement information comprises:
[0035] Obtaining length data and starting position data of the second sensitive information according to the matching result;
[0036] Locating the second sensitive information according to the length data and the starting position data;
[0037] The located second sensitive information is replaced with the replacement information.
[0038] In the above implementation process, the second sensitive information is located according to its length data and starting position data, which can avoid the non-sensitive information in the file from being mistakenly replaced, reduce the error probability of the file, and improve the search efficiency for the second sensitive information.
[0039] In a second aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method as described in any one of the first aspects.
[0040] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first aspects when executing the computer program.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method as described in any one of the first aspects.
[0042] In a fifth aspect, an embodiment of the present application further provides a file desensitization device, the device comprising:
[0043] The acquisition module is used to obtain the file data stream;
[0044] A parsing module, used for parsing the file data stream to obtain parsed data;
[0045] A matching module, used for matching the parsed data with the first sensitive information to obtain a matching result;
[0046] A replacement module is used to replace the second sensitive information in the parsed data according to the matching result to obtain a desensitized document data stream.
[0047] In the above implementation process, by parsing different types of file data in different ways, matching the obtained parsed data with the first sensitive information, and then replacing the sensitive information, the sensitive content in the file can be effectively replaced, improving the accuracy of the replacement, avoiding omissions, replacement errors, etc., improving replacement efficiency, and effectively ensuring the security of file data.
[0048] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0049] And it can be implemented according to the contents of the specification. The following is a detailed description of the preferred embodiments of the present application with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the range values. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 A schematic diagram of a process for desensitizing a file provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the structure of the file desensitization device provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structural composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0055] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0056] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application, but are not used to limit the scope of the present application.
[0057] Embodiment 1
[0058] Figure 1 It is a flowchart of the file desensitization method provided in the embodiment of the present application, such as Figure 1 As shown, the method includes:
[0059] S1, obtain file data stream;
[0060] S2, parse the file data stream to obtain parsed data;
[0061] S3, matching the parsed data with the first sensitive information to obtain a matching result;
[0062] S4, replace the second sensitive information in the parsed data according to the matching result to obtain a desensitized document data stream.
[0063] In the above implementation process, by parsing different types of file data in different ways, matching the obtained parsed data with the first sensitive information, and then replacing the sensitive information, the sensitive content in the file can be effectively replaced, improving the accuracy of the replacement, avoiding omissions, replacement errors, etc., improving replacement efficiency, and effectively ensuring the security of file data.
[0064] Furthermore, S2 includes:
[0065] Identify the file type of the file data stream according to the file type identification engine to obtain multiple file types;
[0066] Parse the multiple file types respectively according to the data parsing methods corresponding to the different file types to obtain multiple parsed file data;
[0067] The plurality of parsed file data are determined to be parsed data.
[0068] In the above implementation process, different parsing methods are used for parsing according to different file types, which can improve the accuracy of the parsed data, so that the sensitive data in the file is fully reflected in the parsed data, and provide assistance for the replacement of sensitive data.
[0069] The embodiment of the present application identifies the file data stream through a file type identification engine, determines the file type of the file data stream, and then sends different types of file data to different file parsers, parses the text content in the file data according to the file characteristics, and obtains parsed data.
[0070] Furthermore, S3 includes:
[0071] Get the first sensitive information;
[0072] The first sensitive information and the parsed data are passed as transfer parameters to the matching interface for matching to obtain a matching result.
[0073] In the above implementation process, the first sensitive information and the parsed data are input into the matching interface for matching, which can quickly and accurately match the first sensitive information, detect the first sensitive information contained in the parsed data in time, and improve data processing efficiency.
[0074] The first sensitive information is multiple sensitive information preset by the user, including multiple types of sensitive information, or sensitive information related to the user's business. In the embodiment of the present application, the first sensitive information and the parsed data are respectively used as parameters and passed into the matching interface of pcre2 for matching.
[0075] Furthermore, the step of obtaining the first sensitive information includes:
[0076] Obtaining pre-set third-party sensitive information;
[0077] Determine whether the regular expression of the third sensitive information meets the preset requirements;
[0078] If so, initialize the regular expression of the third sensitive information according to the preset configuration options to obtain the first sensitive information.
[0079] In the above implementation process, the regular expression of the third sensitive information is detected and initialized after it is determined to meet the preset requirements. This can ensure the accuracy of the first sensitive information and reduce the impact of the first sensitive information on the file.
[0080] In an embodiment of the present application, the third sensitive information is the initial sensitive information to be matched configured by the user. The regular expression of the third sensitive information is tested to detect whether the regular expression is compliant. Then, according to the configuration options, the regular expression of the third sensitive information is initialized to obtain the first sensitive information.
[0081] Furthermore, S4 includes:
[0082] If the matching result is a successful match, the replacement information is obtained, and the second sensitive information in the parsed data is replaced with the replacement information to obtain a desensitized document data stream;
[0083] If the matching result is unsuccessful, there is no sensitive information in the parsed data.
[0084] In the above implementation process, if the matching result is a successful match, the second sensitive information in the parsed data is replaced, which can ensure the security of the parsed data, improve the parsed data, and make the parsed data quickly and reasonably desensitized.
[0085] Furthermore, the step of obtaining replacement information includes:
[0086] Determining whether the user provides pre-set replacement information;
[0087] If so, determining that the replacement information preset by the user is the replacement information;
[0088] If not, the first threshold is determined to be replacement information.
[0089] In the above implementation process, different replacement information is selected according to different situations to ensure that sensitive information can be completely replaced. At the same time, data redundancy can be reduced, the probability of data errors can be avoided, and multiple options are provided for file desensitization.
[0090] If there is replacement information (or replacement content) pre-set by the user, the second sensitive information will be replaced; if the user has not pre-set sensitive content, the second sensitive information will be replaced with “*” (first threshold).
[0091] Furthermore, the step of replacing the second sensitive information in the parsed data with the replacement information includes:
[0092] Obtaining length data and starting position data of the second sensitive information according to the matching result;
[0093] Locating the second sensitive information according to the length data and the starting position data;
[0094] The located second sensitive information is replaced with the replacement information.
[0095] In the above implementation process, the second sensitive information is located according to its length data and starting position data, which can avoid the non-sensitive information in the file from being mistakenly replaced, reduce the error probability of the file, and improve the search efficiency for the second sensitive information.
[0096] If the match is successful, the pcre2 matching interface can return the length data of the second sensitive information and the starting position data of the second sensitive information. According to the length data and the starting position data, the second sensitive information can be accurately located.
[0097] The desensitized file data stream can be used for processing by other modules, or saved as a file for users to download.
[0098] The present application embodiment is described with reference to a docx type file.
[0099] The system reads the sensitive information (third sensitive information) set by the user, initializes the sensitive information (third sensitive information), and obtains the first sensitive information. It can support case sensitivity, single-line and multi-line matching, and lazy and greedy matching according to the configuration options.
[0100] The file type of the file data is determined through the incoming file data stream, and the file data stream is parsed in different ways according to the file type. For docx type files, the file is decompressed using a decompression tool, and then the obtained specified xml file is parsed.
[0101] The parsed data parsed in the previous step is matched with the first sensitive information through pcre2. If the match is successful, the specific location of the sensitive information (the second sensitive information) in the file can be obtained, and the sensitive information (the second sensitive information) can be replaced with *, or replaced with the content specified by the user.
[0102] The desensitized data can be retransmitted as a file data stream, or saved as a docx file for users to download. The embodiment of the present application ensures the integrity of the document while achieving file desensitization, and uses a more efficient pcre2 for data matching, which improves the accuracy and matching efficiency, and can effectively protect the security of the data in the document.
[0103] Embodiment 2
[0104] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes any method of the first embodiment.
[0105] Embodiment 3
[0106] In order to execute the method corresponding to the above embodiment 1 to achieve the corresponding functions and technical effects, a file desensitization device is provided below, such as Figure 2 As shown, the device comprises:
[0107] Acquisition module 1, used to acquire file data stream;
[0108] Parsing module 2, used for parsing the file data stream to obtain parsed data;
[0109] Matching module 3, used to match the parsed data with the first sensitive information to obtain a matching result;
[0110] The replacement module 4 is used to replace the second sensitive information in the parsed data according to the matching result to obtain a desensitized document data stream.
[0111] In the above implementation process, by parsing different types of file data in different ways, matching the obtained parsed data with the first sensitive information, and then replacing the sensitive information, the sensitive content in the file can be effectively replaced, improving the accuracy of the replacement, avoiding omissions, replacement errors, etc., improving replacement efficiency, and effectively ensuring the security of file data.
[0112] Furthermore, the parsing module 2 is also used for:
[0113] Identify the file type of the file data stream according to the file type identification engine to obtain multiple file types;
[0114] Parse the multiple file types respectively according to the data parsing methods corresponding to the different file types to obtain multiple parsed file data;
[0115] The plurality of parsed file data are determined to be parsed data.
[0116] In the above implementation process, different parsing methods are used for parsing according to different file types, which can improve the accuracy of the parsed data, so that the sensitive data in the file is fully reflected in the parsed data, and provide assistance for the replacement of sensitive data.
[0117] Furthermore, the matching module 3 is also used for:
[0118] Get the first sensitive information;
[0119] The first sensitive information and the parsed data are passed as transfer parameters to the matching interface for matching to obtain a matching result.
[0120] In the above implementation process, the first sensitive information and the parsed data are input into the matching interface for matching, which can quickly and accurately match the first sensitive information, detect the first sensitive information contained in the parsed data in time, and improve data processing efficiency.
[0121] Furthermore, the matching module 3 is also used for:
[0122] Obtaining pre-set third-party sensitive information;
[0123] Determine whether the regular expression of the third sensitive information meets the preset requirements;
[0124] If so, initialize the regular expression of the third sensitive information according to the preset configuration options to obtain the first sensitive information.
[0125] In the above implementation process, the regular expression of the third sensitive information is detected and initialized after it is determined to meet the preset requirements. This can ensure the accuracy of the first sensitive information and reduce the impact of the first sensitive information on the file.
[0126] Furthermore, the replacement module 4 is also used for:
[0127] If the matching result is a successful match, the replacement information is obtained, and the second sensitive information in the parsed data is replaced with the replacement information to obtain a desensitized document data stream;
[0128] If the matching result is unsuccessful, there is no sensitive information in the parsed data.
[0129] In the above implementation process, if the matching result is a successful match, the second sensitive information in the parsed data is replaced, which can ensure the security of the parsed data, improve the parsed data, and make the parsed data quickly and reasonably desensitized.
[0130] Furthermore, the replacement module 4 is also used for:
[0131] Determining whether the user provides pre-set replacement information;
[0132] If so, determining that the replacement information preset by the user is the replacement information;
[0133] If not, the first threshold is determined to be replacement information.
[0134] In the above implementation process, different replacement information is selected according to different situations to ensure that sensitive information can be completely replaced. At the same time, data redundancy can be reduced, the probability of data errors can be avoided, and multiple options are provided for file desensitization.
[0135] Furthermore, the replacement module 4 is also used for:
[0136] Obtaining length data and starting position data of the second sensitive information according to the matching result;
[0137] Locating the second sensitive information according to the length data and the starting position data;
[0138] The located second sensitive information is replaced with the replacement information.
[0139] In the above implementation process, the second sensitive information is located according to its length data and starting position data, which can avoid the non-sensitive information in the file from being mistakenly replaced, reduce the error probability of the file, and improve the search efficiency for the second sensitive information.
[0140] The above-mentioned file desensitization device can implement the method of the above-mentioned embodiment 1. The options in the above-mentioned embodiment 1 are also applicable to this embodiment and will not be described in detail here.
[0141] The rest of the contents of the embodiments of the present application can refer to the contents of the above-mentioned embodiment 1, and will not be repeated in this embodiment.
[0142] Embodiment 4
[0143] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the file desensitization method of embodiment one.
[0144] Optionally, the above-mentioned electronic device may be a server.
[0145] See also Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 31, a communication interface 32, a memory 33 and at least one communication bus 34. The communication bus 34 is used to realize direct connection and communication between these components. The communication interface 32 of the device in the embodiment of the present application is used to communicate signaling or data with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.
[0146] The processor 31 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor 31 can also be any conventional processor, etc.
[0147] The memory 33 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 33 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 31, the device can execute the above-mentioned Figure 1 The method embodiment involves various steps.
[0148] Optionally, the electronic device may further include a storage controller and an input / output unit. The memory 33, the storage controller, the processor 31, the peripheral interface, and the input / output unit are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via a communication bus 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the device.
[0149] The input and output unit is used to provide users with the task creation and to create an optional time period or preset execution time for the task to enable interaction between the user and the server. The input and output unit can be, but is not limited to, a mouse and a keyboard.
[0150] Understandably, Figure 3 The structure shown is for illustration only. The electronic device may also include Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown. Figure 3 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0151] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the file desensitization method of embodiment one is implemented.
[0152] The embodiment of the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the method described in the method embodiment.
[0153] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based device that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0155] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0156] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0157] The above is only a specific implementation of the present application, but the protection range of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical range disclosed in the present application, which should be included in the protection range of the present application. Therefore, the protection range of the present application should be based on the protection range of the claims.
[0158] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A file desensitization method, characterized in that: The method comprises: Get file data stream; Parsing the file data stream to obtain parsed data; Matching the parsed data with the first sensitive information to obtain a matching result; The second sensitive information in the parsed data is replaced according to the matching result to obtain a desensitized document data stream.
2. The file desensitization method according to claim 1, characterized in that: The step of parsing the file data stream to obtain parsed data includes: Identify the file type of the file data stream according to the file type identification engine to obtain multiple file types; Parsing the multiple file types respectively according to data parsing methods corresponding to different file types to obtain multiple parsed file data; The plurality of parsed file data are determined to be the parsed data.
3. The file desensitization method according to claim 1, characterized in that: The step of matching the parsed data with the first sensitive information to obtain a matching result includes: Get the first sensitive information; The first sensitive information and the parsed data are passed as transfer parameters to a matching interface for matching to obtain the matching result.
4. The file desensitization method according to claim 3, characterized in that: The step of obtaining the first sensitive information comprises: Obtaining pre-set third-party sensitive information; Determine whether the regular expression of the third sensitive information meets the preset requirements; If so, initialize the regular expression of the third sensitive information according to the preset configuration options to obtain the first sensitive information.
5. The file desensitization method according to claim 1, characterized in that: The step of replacing the second sensitive information in the parsed data according to the matching result to obtain a desensitized document data stream includes: If the matching result is a successful match, obtaining replacement information, replacing the second sensitive information in the parsed data with the replacement information, and obtaining the desensitized document data stream; If the matching result is an unsuccessful match, there is no sensitive information in the parsed data.
6. The file desensitization method according to claim 5, characterized in that: The step of obtaining replacement information comprises: Determining whether the user provides pre-set replacement information; If so, determining that the replacement information preset by the user is the replacement information; If not, determining the first threshold is the replacement information.
7. The file desensitization method according to claim 5, characterized in that: The step of replacing the second sensitive information in the parsed data with the replacement information comprises: Obtaining length data and starting position data of the second sensitive information according to the matching result; Locating the second sensitive information according to the length data and the starting position data; The located second sensitive information is replaced with the replacement information.
8. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to perform the method according to any one of claims 1 to 7.
9. An electronic device, characterized in that: It includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the file desensitization method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the file desensitization method as described in any one of claims 1 to 7.