Unstructured data dynamic desensitization method and device based on layer mask
By using layer masking technology and image recognition technology in unstructured data processing, identifying and covering sensitive fields, the problems of efficiency and flexibility of unstructured data desensitization processing in the prior art are solved, and efficient and accurate desensitization processing and data security are achieved.
Patent Information
- Application Number
- CN202411966781.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art is difficult to achieve efficient and accurate dynamic desensitization processing of unstructured data while ensuring data consistency and effectiveness.
Using a layer mask-based method, sensitive fields are identified through image recognition technology, and corresponding layer masks are generated to cover sensitive fields to achieve desensitization.
It realizes fast and accurate desensitization processing of unstructured data, improves the efficiency and flexibility of data desensitization, while retaining the original characteristics and business rules of the data, enhancing the security of the data.
Smart Images

Figure CN119783161A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of nuclear power technology, and in particular relates to a method and device for dynamic desensitization of unstructured data based on layer mask. Background Art
[0002] With the rapid development of information technology, enterprise business systems have accumulated a large amount of personal privacy data and high-value corporate information. In addition to internal circulation, these data also need to be "shared" externally, which is the demand and premise of the national big data development strategy planning. How to ensure the security and availability of data in scenarios such as generation, exchange, sharing, development and testing has become a key issue that customers urgently need to solve. Data desensitization technology is one of the important means to solve this problem. By processing sensitive fields in the original data, it reduces data sensitivity and reduces personal privacy risks.
[0003] Existing data desensitization technologies are mainly divided into static data desensitization and dynamic data desensitization. Static data desensitization is suitable for batch desensitization of data, such as test data for model training, or data export for offline data analysis. Dynamic data desensitization is mainly used in production environments, and desensitization is performed in real time when sensitive data is accessed to meet the desensitization needs of different roles and permissions. However, the existing technology still has certain limitations for the desensitization of unstructured data, and it is difficult to achieve efficient and accurate desensitization while ensuring data consistency and validity. Summary of the invention
[0004] In order to overcome the problems existing in the related art, a method and device for dynamic desensitization of unstructured data based on layer mask are provided.
[0005] According to one aspect of an embodiment of the present disclosure, a method for dynamic desensitization of unstructured data based on layer mask is provided, the method comprising:
[0006] Step 1, data preprocessing, parsing the unstructured data to be processed, and identifying sensitive fields from the unstructured data according to preset sensitive words;
[0007] Step 2: Generate a layer mask. Generate a corresponding layer mask based on the identified sensitive fields.
[0008] Step 3: Data desensitization: Apply the generated layer mask to the unstructured data to cover the sensitive fields and form the desensitized unstructured data.
[0009] Step 4: Data output: The desensitized unstructured data is used in multiple scenarios such as sharing, transmission, and testing environments.
[0010] In a possible implementation, step 1 includes:
[0011] Step 11, using image recognition technology to fully scan the image data, convert the text part in the image into editable text content, and locate the position coordinates of the text content in the image data;
[0012] Step 12: traverse the text content according to the preset sensitive word set to perform fuzzy matching, and take the text fields whose similarity with the sensitive words in the sensitive word set is greater than a preset threshold as potential sensitive fields;
[0013] Step 13: According to the preset sensitive word set, regular expressions and keyword matching are used to perform secondary matching and identification on the screened potential sensitive fields to obtain the final sensitive fields;
[0014] Step 14, record the position coordinates of each sensitive field according to the position coordinates of the text content in the image data; these coordinate information are crucial for the subsequent layer mask generation, because they will determine the specific area that the mask needs to cover;
[0015] Step 15: Mark each sensitive field in the image data according to the position coordinates of each sensitive field for subsequent processing.
[0016] In a possible implementation, step 2 includes:
[0017] Step 21, determine the shape, color, transparency, and border of the mask according to the type and position of the sensitive field, generate an irregularly shaped layer mask according to the outline of the field, and generate an irregularly shaped layer mask according to the outline of the field; the color of the mask can be adjusted according to the desensitization requirements, and the transparency of the mask can be adjusted according to the desensitization requirements; for image data, the texture or blur effect of the mask can be set.
[0018] In a possible implementation, step 3 includes:
[0019] Step 31, applying the generated layer mask to the image data, covering the sensitive fields, and compositing the mask layer with the original image;
[0020] Step 32, dynamically adjust the parameters of the mask according to the requirements of different scenes to achieve different levels of desensitization processing.
[0021] According to another aspect of the present disclosure, a device for dynamic desensitization of unstructured data based on layer mask is provided, the device comprising:
[0022] The data preprocessing module is used to parse the unstructured data to be processed and identify sensitive fields from the unstructured data according to preset sensitive words;
[0023] Generate layer mask module, used to generate corresponding layer mask according to the identified sensitive fields;
[0024] The data desensitization processing module is used to apply the generated layer mask to the unstructured data, cover the sensitive fields, and form the desensitized unstructured data;
[0025] The data output module is used to use the desensitized unstructured data for multiple scenarios such as sharing, transmission, and testing environments.
[0026] In a possible implementation, the data preprocessing module includes:
[0027] The recognition module is used to use image recognition technology to comprehensively scan the image data, convert the text part in the image into editable text content, and locate the position coordinates of the text content in the image data; this step requires not only recognizing the text content, but also accurately determining the position coordinates of the text in the image to provide accurate spatial information for subsequent processing;
[0028] A fuzzy matching module is used to traverse the text content according to a preset sensitive word set for fuzzy matching, and to use text fields whose similarity with sensitive words in the sensitive word set is greater than a preset threshold as potential sensitive fields; the sensitive word set includes text blocks of common sensitive fields such as name, ID card number, mobile phone number, bank card number, etc. In this way, the present disclosure can perform similarity matching according to the preset sensitive word set and quickly lock potential sensitive fields and corresponding areas;
[0029] The secondary matching module is used to perform secondary matching and identification on the selected potential sensitive fields according to the preset sensitive word set by using regular expressions and keyword matching to obtain the final sensitive fields;
[0030] The coordinate determination module is used to record the position coordinates of each sensitive field according to the position coordinates of the text content in the image data; these coordinate information are crucial for the subsequent layer mask generation because they will determine the specific area that the mask needs to cover;
[0031] The marking module is used to mark each sensitive field in the image data according to the position coordinates of each sensitive field for subsequent processing.
[0032] In a possible implementation, generating a layer mask module includes:
[0033] The contour determination module is used to determine the shape of the mask according to the type and position of the sensitive field, and to generate an irregularly shaped layer mask according to the contour of the field.
[0034] In a possible implementation, the data desensitization processing module includes:
[0035] A compositing module that applies the generated layer mask to the image data, covers the sensitive fields, and composites the mask layer with the original image;
[0036] The adjustment module is used to dynamically adjust the parameters of the mask according to the needs of different scenes to achieve different levels of desensitization processing.
[0037] According to another aspect of the present disclosure, a device for dynamic desensitization of unstructured data based on layer mask is provided, the device comprising:
[0038] processor;
[0039] a memory for storing processor-executable instructions;
[0040] Wherein, the processor is configured to execute the above method.
[0041] According to another aspect of an embodiment of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0042] The beneficial effects of the present disclosure are as follows: the present disclosure adopts layer mask technology and realizes the rapid positioning of sensitive words in images through image recognition technology, thereby realizing the rapid and accurate desensitization processing of unstructured data, and improving the efficiency of data desensitization. And by dynamically adjusting the parameters of the layer mask, the present invention can adapt to the desensitization requirements under different conditions, and enhance the flexibility of data desensitization. Finally, in the desensitization process, the original characteristics, business rules and data relevance of the data are retained, and at the same time, the effective shielding of sensitive information is realized, and the security of the data is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of a method for dynamic desensitization of unstructured data based on layer mask according to an exemplary embodiment.
[0044] Figure 2 It is a block diagram of a device for dynamic desensitization of unstructured data based on layer mask according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] Figure 11 is a diagram showing a method for dynamic desensitization of unstructured data based on layer mask according to an exemplary embodiment. The method can be executed by a terminal device, wherein the terminal device can be a computer, for example, the terminal device can be a server, a desktop computer, a laptop computer, etc. The embodiment of the present disclosure does not limit the type of the terminal device. Figure 1 As shown, the method includes:
[0047] Step 1, the data preprocessing, parses the unstructured data to be processed, and identifies sensitive fields from the unstructured data according to preset sensitive words.
[0048] As an example of this embodiment, in step 1, the sensitive word set may include text blocks of common sensitive fields such as name, ID number, mobile phone number, bank card number, etc. Step 1 may include the following steps.
[0049] Step 11, using image recognition technology (such as optical character recognition technology) to comprehensively scan the image data, convert the text portion in the image into editable text content, and locate the position coordinates of the text content in the image data; this step requires not only the recognition of the text content, but also the accurate determination of the position coordinates of the text in the image to provide precise spatial information for subsequent processing.
[0050] Step 12, traversing the text content according to the preset sensitive word set to perform fuzzy matching, and taking the text field whose similarity with the sensitive word in the sensitive word set is greater than the preset threshold as a potential sensitive field; in this way, the present disclosure can perform fuzzy matching according to the preset sensitive word set to quickly lock the potential sensitive field and the corresponding area;
[0051] Step 13, according to the preset sensitive word set, regular expressions and keyword matching are used to perform secondary matching and identification on the screened potential sensitive fields to obtain the final sensitive fields; thereby accurately screening out the sensitive fields that need to be covered on the basis of rapid positioning.
[0052] Step 14, record the position coordinates of each sensitive field according to the position coordinates of the text content in the image data; these coordinate information are crucial for the subsequent layer mask generation, because they will determine the specific area that the mask needs to cover;
[0053] Step 15: Mark each sensitive field in the image data according to the position coordinates of each sensitive field for subsequent processing.
[0054] Step 2, generate a layer mask, and generate a corresponding layer mask according to the identified sensitive fields. For example, step 2 may include: step 21, determine the shape, color, transparency, and border of the mask according to the type and position of the sensitive field, and generate an irregularly shaped layer mask according to the outline of the field. The mask color can be selected to be close to the background color according to the desensitization requirements to reduce the visual difference, and the mask transparency can be adjusted according to the desensitization requirements; for image data, the texture or blur effect of the mask can be set to further hide sensitive information. Image processing software or programming libraries (such as OpenCV, Pillow, etc.) can be used to generate a layer mask according to the determined shape and parameters.
[0055] Step 3: Data desensitization: Apply the generated layer mask to the unstructured data to cover the sensitive fields and form the desensitized unstructured data.
[0056] As an example of this embodiment, step 3 may include the following steps.
[0057] Step 31, applying the generated layer mask to the image data, covering the sensitive fields, and compositing the mask layer with the original image;
[0058] Step 32, dynamically adjust the parameters of the mask (such as transparency, color, etc.) according to the requirements of different scenes to achieve different levels of desensitization processing.
[0059] Step 4, data output, the desensitized unstructured data is used in multiple scenarios such as sharing, transmission, and test environment. The desensitized data can be saved to a specified storage location, which can be a database, file system, or cloud storage, etc. The desensitized data can be safely used in multiple scenarios such as sharing, transmission, and test environment.
[0060] The present disclosure adopts layer mask technology and image recognition technology to realize the rapid positioning of sensitive words in images, thereby realizing the rapid and accurate desensitization of unstructured data and improving the efficiency of data desensitization. And by dynamically adjusting the parameters of the layer mask, the present invention can adapt to the desensitization requirements under different conditions and enhance the flexibility of data desensitization. Finally, in the desensitization process, the original characteristics, business rules and data relevance of the data are retained, while the effective shielding of sensitive information is realized, thereby improving the security of the data.
[0061] Figure 2 1 is a block diagram of a device for dynamically desensitizing unstructured data based on layer masks according to an exemplary embodiment. For example, the device 1900 may be provided as a server. Figure 2, the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0062] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or the like.
[0063] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the device 1900 to perform the above method.
[0064] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0065] A computer-readable storage medium may be a tangible device that can hold and store instructions used 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 of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) 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 disk read-only memory (CD-ROM), a digital versatile disk (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 of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0066] The computer-readable program instructions 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, optical fiber transmissions, wireless transmissions, 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 for storage in the computer-readable storage medium in each computing / processing device.
[0067] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related 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++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely 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., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0068] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0069] 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 that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0070] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating 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 boxes in the flowchart and / or block diagram.
[0071] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0072] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for dynamic desensitization of unstructured data based on layer mask, characterized in that: The method comprises: Step 1, data preprocessing, parsing the unstructured data to be processed, and identifying sensitive fields from the unstructured data according to preset sensitive words; Step 2: Generate a layer mask. Generate a corresponding layer mask based on the identified sensitive fields. Step 3: Data desensitization: Apply the generated layer mask to the unstructured data to cover the sensitive fields and form desensitized unstructured data; Step 4: Data output: The desensitized unstructured data is used in multiple scenarios such as sharing, transmission, and testing environments.
2. The method according to claim 1, characterized in that Step 1 includes: Step 11, using image recognition technology to fully scan the image data, convert the text part in the image into editable text content, and locate the position coordinates of the text content in the image data; Step 12: traverse the text content according to the preset sensitive word set to perform fuzzy matching, and take the text fields whose similarity with the sensitive words in the sensitive word set is greater than a preset threshold as potential sensitive fields; Step 13: According to the preset sensitive word set, regular expressions and keyword matching are used to perform secondary matching and identification on the screened potential sensitive fields to obtain the final sensitive fields; Step 14, record the position coordinates of each sensitive field according to the position coordinates of the text content in the image data; these coordinate information are crucial for the subsequent layer mask generation, because they will determine the specific area that the mask needs to cover; Step 15, marking each sensitive field in the image data according to the position coordinates of each sensitive field for subsequent processing.
3. The method according to claim 1, characterized in that Step 2 includes: Step 21, determine the shape, color, transparency, and border of the mask according to the type and position of the sensitive field, generate an irregularly shaped layer mask according to the outline of the field, and generate an irregularly shaped layer mask according to the outline of the field; the color of the mask can be adjusted according to the desensitization requirements, and the transparency of the mask can be adjusted according to the desensitization requirements; for image data, the texture or blur effect of the mask can be set.
4. The method according to claim 1, characterized in that: Step 3 includes: Step 31, applying the generated layer mask to the image data, covering the sensitive fields, and compositing the mask layer with the original image; Step 32, dynamically adjust the parameters of the mask according to the requirements of different scenes to achieve different levels of desensitization processing.
5. A dynamic desensitization device for unstructured data based on layer mask, characterized in that: The device comprises: The data preprocessing module is used to parse the unstructured data to be processed and identify sensitive fields from the unstructured data according to preset sensitive words; Generate layer mask module, used to generate corresponding layer mask according to the identified sensitive fields; The data desensitization processing module is used to apply the generated layer mask to the unstructured data, cover the sensitive fields, and form the desensitized unstructured data; The data output module is used to use the desensitized unstructured data for multiple scenarios such as sharing, transmission, and testing environments.
6. The device according to claim 5, characterized in that The data preprocessing module includes: The recognition module is used to use image recognition technology to comprehensively scan the image data, convert the text part in the image into editable text content, and locate the position coordinates of the text content in the image data; this step requires not only recognizing the text content, but also accurately determining the position coordinates of the text in the image to provide accurate spatial information for subsequent processing; A fuzzy matching module is used to traverse the text content according to a preset sensitive word set for fuzzy matching, and to use text fields whose similarity with sensitive words in the sensitive word set is greater than a preset threshold as potential sensitive fields; the sensitive word set includes text blocks of common sensitive fields such as name, ID card number, mobile phone number, bank card number, etc. In this way, the present disclosure can perform similarity matching according to the preset sensitive word set and quickly lock potential sensitive fields and corresponding areas; The secondary matching module is used to perform secondary matching and identification on the selected potential sensitive fields according to the preset sensitive word set by using regular expressions and keyword matching to obtain the final sensitive fields; The coordinate determination module is used to record the position coordinates of each sensitive field according to the position coordinates of the text content in the image data; these coordinate information are crucial for the subsequent layer mask generation because they will determine the specific area that the mask needs to cover; The marking module is used to mark each sensitive field in the image data according to the position coordinates of each sensitive field for subsequent processing.
7. The device according to claim 1, characterized in that Generate layer mask module includes: The contour determination module is used to determine the shape of the mask according to the type and position of the sensitive field, and to generate an irregularly shaped layer mask according to the contour of the field.
8. The device according to claim 1, characterized in that The data desensitization processing module includes: A compositing module that applies the generated layer mask to the image data, covers the sensitive fields, and composites the mask layer with the original image; The adjustment module is used to dynamically adjust the parameters of the mask according to the needs of different scenes to achieve different levels of desensitization processing.
9. A dynamic desensitization device for unstructured data based on layer mask, characterized in that: The device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 3.
10. 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 3 is implemented.
Citation Information
Patent Citations
Masking type data desensitization method and related equipment
CN106295400A
Picture processing method and device
CN108153468A
Privacy-protected cloud data security sharing method, system and device
CN118540161A