Privacy information shielding method and device based on version identification and key field positioning
By splitting and identifying electronic files, using OCR technology and privacy field matching, fast and efficient privacy information blocking is achieved, solving the problems of low efficiency, low accuracy and high cost in the existing technology, and supporting the processing of custom privacy scope.
Patent Information
- Application Number
- CN202411469248.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-10-21
AI Technical Summary
In the prior art, the personal privacy information blocking processing method is low, the accuracy is low and the cost is high, which is mainly due to the need for a large amount of data to train the model.
By obtaining electronic files and splitting them into single-page image data, OCR technology is used to identify coordinates and text information, perform structural encapsulation, match privacy field names, conduct line vertical data grouping and privacy area determination, and finally intercept or cover hidden privacy content on the electronic files.
It realizes fast and efficient personal privacy information processing, reduces costs, and supports privacy information blocking in a customized privacy scope.
Smart Images

Figure CN119227138B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for shielding privacy information based on version identification and key field positioning. Background Art
[0002] Personal privacy is an indispensable and fundamental right in modern society. It not only concerns the protection of personal information but also directly impacts everyone's freedom and security. In the digital age, personal data is often collected, stored, and analyzed by businesses and institutions. There are concerns that this information could be leaked or misused without authorization. Therefore, safeguarding personal privacy is particularly important. Protecting privacy is not only a defense of one's own rights but also the foundation of social trust.
[0003] To protect personal privacy, many businesses and organizations have adopted information shielding technology. By desensitizing, encrypting, or anonymizing sensitive data, this technology ensures that personally identifiable information is not disclosed when the data is used or shared. This technology not only effectively prevents data leakage and misuse, but also protects user privacy in areas such as big data analysis and artificial intelligence applications.
[0004] Currently, personal privacy information shielding primarily involves identifying personal information through information extraction and semantic understanding, followed by data smearing to remove privacy. Information extraction primarily involves optical character recognition (OCR), while semantic understanding aims to identify key personal information, extracting textual content that pertains to the individual, such as name, ID number, address, and phone number, before smearing the extracted content. However, this approach requires extensive data for model training to achieve semantic understanding, resulting in a long conversion cycle, low efficiency, and high costs. Furthermore, its effectiveness can be limited by the type of training material, leading to low accuracy. Summary of the Invention
[0005] To this end, the present application provides a privacy information shielding method and device based on version identification and key field positioning to solve the problems of low efficiency and accuracy and high cost in the existing technology for shielding personal privacy information.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] In a first aspect, a privacy information shielding method based on version identification and key field positioning includes:
[0008] Step 1: Obtain an electronic file containing personal privacy information and split the electronic file into single-page image data;
[0009] Step 2: Identify the single-page image data, obtain identification coordinates and text information, and structurally encapsulate the identification coordinates and text information by region to obtain a recognition result;
[0010] Step 3: Perform a field name matching search on the recognition result according to the pre-set privacy field name and privacy key field to obtain the privacy keyword recognition result;
[0011] Step 4: grouping the row and vertical data according to the privacy keyword identification result to obtain a row and vertical grouping result;
[0012] Step 5: Determine the privacy area based on the row vertical grouping result and matching search to obtain a privacy area determination result;
[0013] Step 6: Based on the privacy area determination result, a blank area is intercepted or covered on the electronic document to hide the privacy content.
[0014] Furthermore, in step 1, the electronic file is in pdf format or jpg format.
[0015] Furthermore, in step 2, OCR technology is used to identify the single-page image data.
[0016] Furthermore, step 4 is specifically as follows: using the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result to merge the rectangular areas, and then calculating the ratio of the area of the recognition result area and the shadow overlapping part of the rectangular merged area to determine whether they belong to the same row; then sorting the X coordinates of the recognition result areas in order to complete the acquisition of row and vertical information and obtain the row and vertical grouping results.
[0017] Furthermore, the method further includes: outputting the electronic file with hidden privacy content according to a required file format.
[0018] In a second aspect, a privacy information shielding device based on version identification and key field positioning includes:
[0019] A data acquisition module, configured to acquire electronic files containing personal privacy information and split the electronic files into single-page image data;
[0020] A data recognition module is used to recognize the single-page image data, obtain recognition coordinates and text information, and structurally encapsulate the recognition coordinates and text information by region to obtain a recognition result;
[0021] A matching and searching module is used to perform a field name matching and searching on the identification results according to pre-set privacy field names and privacy key fields to obtain privacy keyword identification results;
[0022] A row and vertical grouping module, configured to group row and vertical data according to the privacy keyword identification result to obtain a row and vertical grouping result;
[0023] a privacy area determination module, configured to determine the privacy area based on the row and vertical grouping results and the matching search, and obtain a privacy area determination result;
[0024] The privacy content hiding module is used to intercept or cover a blank area on the electronic file according to the privacy area determination result, so as to hide the privacy content.
[0025] Furthermore, the row and vertical grouping module is specifically used to: use the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result to merge the rectangular areas, then calculate the ratio of the area of the recognition result area and the shadow overlapping part of the rectangular merged area to determine whether they belong to the same row; then sort the X coordinates of the recognition result area in order, thereby completing the row and vertical information acquisition and obtaining the row and vertical grouping result.
[0026] In a third aspect, a computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the privacy information shielding method based on version identification and key field positioning are implemented.
[0027] In a fourth aspect, a computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a privacy information shielding method based on version identification and key field positioning.
[0028] In a fifth aspect, a computer program product includes a computer program or instructions, which, when executed by a processor, implement the steps of a privacy information shielding method based on version identification and key field positioning.
[0029] Compared with the prior art, this application has at least the following beneficial effects:
[0030] The present application provides a privacy information shielding method and device based on version identification and key field positioning, which obtains an electronic file containing personal privacy information and splits the electronic file into single-page image data; identifies the single-page image data and obtains identification coordinates and text information, and structurally encapsulates the identification coordinates and text information by region to obtain an identification result; performs a field name matching search on the identification result according to the pre-set privacy field name and privacy key field to obtain a privacy keyword identification result; groups the row and vertical data according to the privacy keyword identification result to obtain a row and vertical grouping result; determines the privacy area according to the row and vertical grouping result and the matching search to obtain a privacy area determination result; and intercepts or covers a blank area on the electronic file according to the privacy area determination result, thereby hiding the private content. The privacy information shielding method and device based on version identification and key field positioning provided by the present application are easy to deploy, can quickly and efficiently realize personal privacy information processing, and are low-cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] To more intuitively illustrate the prior art and the present application, exemplary drawings are provided below. It should be understood that the specific shapes and structures shown in the drawings should not generally be considered as limiting conditions for implementing the present application; for example, based on the technical concepts disclosed in this application and the exemplary drawings, those skilled in the art are capable of easily making routine adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components).
[0032] Figure 1 This is a flow chart of a privacy information shielding method based on version identification and key field positioning provided in Example 1 of the present application. DETAILED DESCRIPTION
[0033] The present application will be further described below in detail through specific embodiments in conjunction with the accompanying drawings.
[0034] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to and do not have any special meaning in terms of technical connotation (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).
[0035] The terms such as "upper", "lower", "left", "right", "middle", etc. cited in this application are usually used to indicate the general relative position relationship for the convenience of intuitive understanding by referring to the drawings, and are not absolute limitations on the position relationship in the actual product.
[0036] Example 1
[0037] See also Figure 1 This embodiment provides a privacy information shielding method based on version identification and key field positioning, including:
[0038] S1: Obtain electronic files containing personal privacy information and split the electronic files into single-page image data;
[0039] Specifically, in this step, the electronic file containing personal privacy information can be obtained by scanning, uploading, or extracting from a database, etc. The electronic file format can be PDF or JPG.
[0040] When splitting electronic files, you can use image processing or document processing tools to split the entire electronic file into individual pages of image data. For PDF files, you can use specialized PDF splitting tools; for image files, you can split them based on preset resolutions or page numbers, ensuring that each page of data can be processed independently while maintaining its original format and quality.
[0041] S2: Identify single-page image data, obtain recognition coordinates and text information, and encapsulate the recognition coordinates and text information into structures according to regions to obtain recognition results;
[0042] Specifically, this step uses optical character recognition (OCR) technology to perform text recognition on each page of image data, converting the text information in the image into an editable digital format. During the recognition process, the coordinate position of each recognized text (for example, the coordinates of the upper left and lower right corners) is recorded for subsequent processing. Finally, the recognized text information and its corresponding coordinates are structured and packaged, for example, in JSON or XML format, to facilitate subsequent parsing and processing. Structured data should include text content, coordinate information, and possibly other metadata (such as font, size, color, etc.).
[0043] S3: Perform field name matching on the recognition results based on the pre-set privacy field names and privacy key fields to obtain the privacy keyword recognition results;
[0044] Specifically, this step performs a field name matching search on the recognition results based on the privacy field configuration to find out whether there is an area with the same name as the privacy field. The matching search mode can be based on the containment, equality, and name-starting patterns.
[0045] This embodiment supports pre-setting privacy field names and privacy key fields. For example, you can add a privacy field of ID number as the privacy type and set the ID number field name to "ID Number." If you do not set a name for the privacy field, that type of privacy field will be skipped during processing. Depending on the material being processed, you can set multiple names for the same type of privacy field, separated by commas. For example, the ID number privacy information name can be set to: "ID Number, ID Number, ID Card."
[0046] S4: Grouping the row and vertical data according to the privacy keyword identification result to obtain the row and vertical grouping result;
[0047] During OCR recognition, the text layout coordinates are extracted simultaneously. The row and vertical information of the recognized content is calculated using the threshold of the shaded area of the coordinate rectangle. This calculation takes into account factors such as the tilt angle during image acquisition. When summarizing the layout, the row and vertical coordinate points of the recognition results are used to calculate the shaded area ratio of the area, and then the row and vertical information is classified based on the threshold.
[0048] Therefore, this step specifically includes: polling the recognition result area, using the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result to merge the rectangular areas, and then determining whether they belong to the same row by calculating the ratio of the area of the recognition result area and the shadow overlap of the rectangular merged area; after the row information is calculated, the X coordinates of the areas are sorted in order to complete the acquisition of the row vertical information.
[0049] S5: Determine the privacy area based on the row vertical grouping result and matching search to obtain the privacy area determination result;
[0050] Specifically, the privacy area is determined based on the row grouping results and the matching search pattern. During the matching search, the inclusion relationship of the content is verified to be either containment, equality, or beginning or end. For example, if the search mode is equal to, the next area of the row information is the content of the privacy field; if the search mode is starts with field, the current field area is the content of the privacy field.
[0051] S6: Based on the privacy area determination result, a blank area is intercepted or covered on the electronic document to hide the privacy content.
[0052] Specifically, the blank area on the image file is intercepted or covered based on the area determination result, thereby hiding the private content. The private area can be modified and deleted before the data is output.
[0053] The privacy information shielding method based on version identification and key field positioning provided in this embodiment also includes: exporting data according to the file format required for output, processing the target image when generating the file according to the information shielding mode, and outputting the image format into PDF or JPG, and setting a watermark at the same time.
[0054] The privacy information shielding method based on version identification and key field location provided in this embodiment uses OCR technology and original layout information to compare personal information and locate private content based on key field data. The data is then redacted based on the layout identification coordinates, achieving the purpose of personal data shielding. The entire method is easy to deploy and can quickly and efficiently shield personal privacy information. It also supports the customization of key privacy content and can tailor the privacy scope according to actual application scenarios and needs, thereby reducing costs. It has the advantages of lightweight technology and low cost investment.
[0055] Example 2
[0056] This embodiment provides a privacy information shielding device based on version identification and key field positioning, including:
[0057] A data acquisition module, configured to acquire electronic files containing personal privacy information and split the electronic files into single-page image data;
[0058] A data recognition module is used to recognize the single-page image data, obtain recognition coordinates and text information, and structurally encapsulate the recognition coordinates and text information by region to obtain a recognition result;
[0059] A matching and searching module is used to perform a field name matching and searching on the identification results according to pre-set privacy field names and privacy key fields to obtain privacy keyword identification results;
[0060] A row and vertical grouping module, configured to group row and vertical data according to the privacy keyword identification result to obtain a row and vertical grouping result;
[0061] a privacy area determination module, configured to determine the privacy area based on the row and vertical grouping results and the matching search, and obtain a privacy area determination result;
[0062] The privacy content hiding module is used to intercept or cover a blank area on the electronic file according to the privacy area determination result, so as to hide the privacy content.
[0063] Furthermore, the row and vertical grouping module is specifically used to: use the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result to merge the rectangular areas, and then calculate the ratio of the area of the recognition result area and the shadow overlapping part of the rectangular merged area to determine whether they belong to the same row; then sort the X coordinates of the recognition result area in order, thereby completing the row and vertical information acquisition and obtaining the row and vertical grouping result.
[0064] Regarding the specific implementation content of each module in the privacy information shielding device based on version identification and key field positioning, please refer to the above definition of the privacy information shielding method based on version identification and key field positioning, which will not be repeated here.
[0065] Example 3
[0066] This embodiment provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a privacy information shielding method based on version identification and key field positioning are implemented.
[0067] Example 4
[0068] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of a privacy information shielding method based on version identification and key field positioning are implemented.
[0069] Example 5
[0070] This embodiment provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of a privacy information shielding method based on version identification and key field positioning.
[0071] The technical features of the above embodiments can be combined arbitrarily (as long as there is no contradiction in the combination of these technical features). In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope of this specification.
Claims
1. A privacy information shielding method based on version identification and key field positioning, characterized in that: include: Step 1: Obtain an electronic file containing personal privacy information and split the electronic file into single-page image data; Step 2: Identify the single-page image data, obtain identification coordinates and text information, and structurally encapsulate the identification coordinates and text information by region to obtain a recognition result; OCR technology is used to identify the single-page image data; Step 3: Perform a field name matching search on the recognition result according to the pre-set privacy field name and privacy key field to obtain the privacy keyword recognition result; Step 4: Grouping the row and vertical data based on the privacy keyword recognition result to obtain a row and vertical grouping result. Specifically, the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result are used to merge the rectangular areas. The ratio of the area of the recognition result area to the shadow overlap of the merged rectangular area is then calculated to determine whether the areas belong to the same row. Then, the X coordinates of the recognition result areas are sorted sequentially, thereby completing the acquisition of row and vertical information and obtaining the row and vertical grouping results; Step 5: Determine the privacy area based on the row vertical grouping result and matching search to obtain a privacy area determination result; Step 6: Based on the privacy area determination result, a blank area is intercepted or covered on the electronic file to hide the privacy content; and the electronic file with the hidden privacy content is output according to the required file format.
2. The privacy information shielding method based on version identification and key field positioning according to claim 1 is characterized in that: In step 1, the electronic file is in pdf format or jpg format.
3. A privacy information shielding device based on version identification and key field positioning, characterized in that: include: A data acquisition module, configured to acquire electronic files containing personal privacy information and split the electronic files into single-page image data; a data recognition module, configured to recognize the single-page image data, obtain recognition coordinates and text information, and structurally encapsulate the recognition coordinates and text information by region to obtain a recognition result; and employing OCR technology when recognizing the single-page image data; A matching and searching module is used to perform a field name matching and searching on the identification results according to pre-set privacy field names and privacy key fields to obtain privacy keyword identification results; A row and vertical grouping module is configured to group row and vertical data based on the privacy keyword recognition result to obtain a row and vertical grouping result. Specifically, the module combines rectangular regions using the four corner coordinates of the recognition result and the four corner coordinates of the privacy keyword recognition result, and then calculates the ratio of the area of the recognition result region to the shadow overlap of the combined rectangular region to determine whether the regions belong to the same row. Then, the X coordinates of the recognition result areas are sorted sequentially, thereby completing the acquisition of row and vertical information and obtaining the row and vertical grouping results; a privacy area determination module, configured to determine the privacy area based on the row and vertical grouping results and the matching search, and obtain a privacy area determination result; The privacy content hiding module is used to intercept or cover the blank area on the electronic file according to the privacy area determination result, so as to hide the privacy content; and output the electronic file with the hidden privacy content according to the required file format.
4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
6. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Method and device for desensitizing document image, electronic equipment and medium
CN112380566A
Underwriting text data generation method, intelligent underwriting method and related device
CN117592439A