File desensitization method, device, electronic device and storage medium
By identifying and classifying picture information and determining the location of sensitive information for data deformation, it solves the problem of existing technology being unable to process picture information, achieves efficient file desensitization, improves accuracy and efficiency, and ensures user information security.
Patent Information
- Application Number
- CN202210645565.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-06-08
AI Technical Summary
Existing desensitization technology cannot effectively process image information, resulting in the leakage of users' personal information and reducing the work efficiency of business personnel.
By identifying image information, classifying types according to preset document types, determining sensitive information and locations, and performing data deformation, image desensitization is achieved; for text format files, vectorization processing and frequent item set analysis are used for text desensitization.
It improves the accuracy and efficiency of file desensitization, reduces manual participation, enhances the intelligence of picture desensitization, and ensures the security of user information.
Smart Images

Figure CN114898373B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent decision-making, and in particular to a file desensitization method, device, electronic device and readable storage medium. Background Art
[0002] Desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data. For example, sensitive information in personal text information entered by users is replaced with "*".
[0003] Currently, common desensitizing technologies can usually only be used in text information. When users upload image information such as ID cards, bank cards, and driver's licenses, common desensitizing technologies cannot desensitize these image information, resulting in the leakage of user personal information when business personnel display the images, leading to the theft of user personal information. Therefore, business personnel can only rely on personal judgment to block user personal information, reducing their work efficiency. Summary of the invention
[0004] The present invention provides a file desensitization method, device, electronic device and readable storage medium, the purpose of which is to improve the accuracy and efficiency of file desensitization.
[0005] To achieve the above object, the present invention provides a file desensitization method, the method comprising:
[0006] Receive files uploaded by users;
[0007] When the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file;
[0008] Classify the document according to the image information and the preset document type information to obtain the document type of the document;
[0009] Classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification;
[0010] According to the location of the sensitive information, data deformation is performed on the sensitive information on the file to obtain desensitized information;
[0011] When the file format of the file is a text format, the file is desensitized to obtain a desensitized text.
[0012] Optionally, classifying the file by type according to the image information and preset certificate type information to obtain the certificate type of the file includes:
[0013] Using the certificate type information to perform model training to obtain a certificate type classification model;
[0014] Input the image information into the document type classification model to obtain a classification result;
[0015] The document type of the document is determined according to the classification result.
[0016] Optionally, inputting the image information into the document type classification model to obtain a classification result includes:
[0017] Using the encoding layer in the certificate type classification model to perform character encoding on the image information to obtain a character vector;
[0018] Using the decoding layer in the certificate type classification model to perform matrix concatenation on the character vectors to obtain a picture information character matrix;
[0019] Using the attention mechanism layer in the certificate type classification model to extract keywords from the image information character matrix, obtaining image information keywords;
[0020] According to the picture information keywords, the classification result of the picture information is outputted using the fully connected layer in the certificate type classification model.
[0021] Optionally, classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification includes:
[0022] Obtain the information that needs to be desensitized in the certificate type;
[0023] Matching the image information with the information to be desensitized, and using the successfully matched information as the sensitive information of the file;
[0024] The location of the sensitive information in the image information is traced back to obtain the location of the sensitive information.
[0025] Optionally, performing text desensitization on the file to obtain the desensitized text includes:
[0026] Performing vectorization processing on the file to obtain a word vector for the file;
[0027] Annotating the word vector according to preset text features;
[0028] According to the corresponding word units in the file, the annotated word vectors are combined to obtain a word unit set;
[0029] Creating a frequent item set according to the support of the word units included in the word unit set;
[0030] Calculating the lift of the frequent items contained in the frequent item set;
[0031] The word units corresponding to the frequent items in the frequent item set whose lifting degree is greater than a preset threshold are used as sensitive word units;
[0032] The file is desensitized according to the sensitive word units to obtain a desensitized text.
[0033] Optionally, the performing image information recognition on the file to obtain the image information of the file includes:
[0034] Performing digital image processing on the file to obtain a target contour area;
[0035] Performing character segmentation on the target contour area to obtain a character contour area;
[0036] Recognizing the character outline area to obtain character information;
[0037] The character information is spliced to obtain picture information.
[0038] Optionally, performing traditional digital image processing on the file to obtain a contour area containing text information includes:
[0039] Performing grayscale processing on the file to obtain a pixel matrix;
[0040] Binarizing the pixel matrix to obtain a binary pixel matrix;
[0041] Performing expansion processing on the binary pixel matrix to obtain an expanded pixel matrix;
[0042] Selecting clustered pixels in the expanded pixel matrix to obtain multiple target object matrices to be screened;
[0043] According to preset rules, screening is performed from the target object matrix to obtain a target object matrix;
[0044] The area corresponding to the target matrix is extracted to obtain the target contour area.
[0045] In order to solve the above problems, the present invention also provides a file desensitization device, the device comprising:
[0046] A picture information recognition module, used for receiving a file uploaded by a user, and when the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file;
[0047] a sensitive information identification module, configured to classify the file by type according to the image information and preset certificate type information, obtain the certificate type of the file, classify the image information according to the certificate type, and determine the sensitive information of the file and the location of the sensitive information according to the information classification; classify the file by type according to the image information and preset certificate type information, obtain the certificate type of the file, classify the image information according to the certificate type, and determine the sensitive information of the file and the location of the sensitive information according to the information classification;
[0048] The sensitive information desensitization module is used to perform data deformation on the sensitive information on the file according to the location of the sensitive information to obtain desensitized information. When the file format of the file is a text format, the file is desensitized to obtain desensitized text.
[0049] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0050] a memory storing at least one computer program; and
[0051] The processor executes the computer program stored in the memory to implement the file desensitization method described above.
[0052] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned file desensitization method.
[0053] The embodiment of the present invention determines the desensitization method to be performed according to the file format of the file, thereby improving the efficiency and accuracy of file desensitization; when the file format of the file is a picture format, the file is classified according to the picture information of the file and the preset certificate type information to obtain the certificate type of the file, thereby facilitating the confirmation of the key information that needs to be desensitized, and improving the accuracy and intelligence of the picture desensitization. Therefore, the file desensitization method, device, electronic device and readable storage medium proposed in the embodiment of the present invention can improve the intelligence, accuracy and efficiency of file desensitization. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a process flow of a file desensitization method provided by an embodiment of the present invention;
[0055] Figures 2 to 7 A detailed implementation flow chart of one of the steps in the file desensitization method provided in one embodiment of the present invention;
[0056] Figure 8 A schematic diagram of a module of a file desensitization device provided by an embodiment of the present invention;
[0057] Fig. 9 A schematic diagram of the internal structure of an electronic device for implementing a file desensitization method provided by an embodiment of the present invention;
[0058] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0059] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0060] The embodiment of the present invention provides a method for desensitizing a file. The execution subject of the method for desensitizing a file includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for desensitizing a file can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server may include an independent server, or may include a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0061] Reference Figure 1 FIG. 1 is a flow chart of a file desensitization method provided by an embodiment of the present invention. In the embodiment of the present invention, the file desensitization method includes the following steps S1-S6:
[0062] S1. Receive files uploaded by users.
[0063] In the embodiment of the present invention, the user may be a customer who is handling a business, for example, a customer who is applying for a credit card at a bank. The file may be user information required by the corresponding business, for example, when handling a credit card business at a bank, the user is required to provide corresponding identity documents and other information.
[0064] In an optional embodiment of the present invention, files uploaded by users are received through a business processing page without being processed by business personnel, thereby ensuring the information security of users and improving the security of users' private information.
[0065] S2. Determine the file format of the file.
[0066] The file format refers to a special encoding method used to store information, which is used to identify the internally stored data. In an embodiment of the present invention, the file format may include a text format and a picture format. In an optional embodiment of the present invention, the file format of the file is determined by reading the suffix format information of the file.
[0067] Among them, when the suffix format information is bmp, jpg, png, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp, avif, apng, it can be determined that the file format of the file is a picture format.
[0068] When the suffix format information of the file is txt, rtf, doc, xls, ppt, htm, html, wpd, pdf, etc., it can be determined that the file format of the file is a text format.
[0069] S3. When the file format of the file is a picture format, perform picture information recognition on the file to obtain the picture information of the file.
[0070] The embodiment of the present invention obtains the image information of the file by performing image information recognition on the file, which facilitates the determination of the type of the file, thereby improving the accuracy of image desensitization.
[0071] Further, see Figure 2 As shown, as an optional embodiment of the present invention, the step of performing image information recognition on the file to obtain the image information of the file includes steps S31-S34:
[0072] S31, performing digital image processing on the file to obtain a target contour area;
[0073] S32, performing character segmentation on the target contour area to obtain a character contour area;
[0074] S33, identifying the character outline area to obtain character information;
[0075] S34, splicing the character information to obtain picture information.
[0076] In the embodiment of the present invention, the target contour area may be an area containing text information, wherein the text information includes recognizable Chinese characters, English, Arabic numerals, etc.
[0077] Further, see Figure 3 As shown, the conventional digital image processing is performed on the file to obtain the contour area containing text information, including steps S311-S316:
[0078] S311, grayscale the file to obtain a pixel matrix;
[0079] S312, performing binarization processing on the pixel matrix to obtain a binary pixel matrix;
[0080] S313, performing expansion processing on the binary pixel matrix to obtain an expanded pixel matrix;
[0081] S314, selecting clustered pixels in the expanded pixel matrix to obtain multiple target object matrices to be screened;
[0082] S315, screening from the target object matrix to be screened according to a preset rule to obtain a target object matrix;
[0083] S316: Extract the area corresponding to the target matrix to obtain the target contour area.
[0084] In the embodiment of the present invention, the preset rule may be a description of the characteristics of the target object. For example, when screening the names on the identity cards, the preset rule may be a rectangle with a large interval in the middle.
[0085] In an optional embodiment of the present invention, a target contour area is obtained by performing a series of traditional digital image processing on the file, thereby obtaining a contour area containing text information, thereby improving the accuracy of image information recognition and reducing the possibility of information loss.
[0086] In another optional embodiment of the present invention, the image information of the file can be obtained by inputting the file into a convolutional neural network and performing a convolution pooling operation.
[0087] S4. Classify the file according to the image information and preset certificate type information to obtain the certificate type of the file.
[0088] In an embodiment of the present invention, the document type information may be information contained in a document type image, for example, the document type information of an ID card may include name, gender, ethnicity, date of birth, etc. The document types include ID cards, business licenses, vehicle registration certificates, driver's licenses, property certificates, etc.
[0089] The embodiment of the present invention classifies the file type according to the image information and preset certificate type information to obtain the certificate type of the file, thereby achieving precise control of files in image format, thereby improving the accuracy of image desensitization and reducing the risk factor of user information leakage due to inadequate information masking.
[0090] Further, see Figure 4As shown, as an optional embodiment of the present invention, the file is classified according to the image information and the preset certificate type information to obtain the certificate type of the file, including steps S41-S43:
[0091] S41, using the certificate type information to perform model training to obtain a certificate type classification model;
[0092] S42, inputting the image information into the document type classification model to obtain a classification result;
[0093] S43: Determine the document type of the document according to the classification result.
[0094] In an embodiment of the present invention, the certificate type classification model may be a multi-classification model based on deep learning.
[0095] In an optional embodiment of the present invention, a model training method is used to perform data training on the certificate type information to obtain a certificate type classification model, thereby improving the intelligence level of certificate type recognition and improving the efficiency of certificate type recognition.
[0096] Further, see Figure 5 As shown, the inputting of the image information into the certificate type classification model to obtain the classification result includes steps S421-S424:
[0097] S421, using the encoding layer in the certificate type classification model to perform character encoding on the image information to obtain a character vector;
[0098] S422, using the decoding layer in the certificate type classification model to perform matrix concatenation on the character vectors to obtain a picture information character matrix;
[0099] S423, using the attention mechanism layer in the certificate type classification model to extract keywords from the image information character matrix to obtain image information keywords;
[0100] S424. Based on the picture information keywords, use the fully connected layer in the certificate type classification model to output the classification result of the picture information.
[0101] In an embodiment of the present invention, the certificate type classification model is based on a neural network and may be a Bert model, wherein the certificate type classification model includes: an encoding layer, a decoding layer, an attention mechanism layer and a fully connected layer.
[0102] S5. Classify the image information according to the certificate type, and determine the sensitive information of the file and the location of the sensitive information according to the information classification.
[0103] In the embodiment of the present invention, the sensitive information may be the private confidential information of the user, such as ID number, bank card number, phone number, home address, name, etc. The location of the sensitive information may be the location where the sensitive information is displayed in the file.
[0104] The embodiment of the present invention classifies the image information according to the certificate type, eliminates the desensitization of unnecessary information, reduces the concealment of unnecessary information, and improves the efficiency of image desensitization.
[0105] The embodiment of the present invention determines the sensitive information of the file and the location of the sensitive information according to the information classification, which facilitates accurate positioning of the desensitization location of the sensitive information, improves the desensitization rate of the sensitive information, and improves the accuracy and efficiency of image desensitization.
[0106] Further, see Figure 6 As shown, as an optional embodiment of the present invention, the image information is classified according to the certificate type, and the sensitive information of the file and the location of the sensitive information are determined according to the information classification, including steps S51-S53:
[0107] S51, obtaining information that needs to be desensitized in the certificate type;
[0108] S52, matching the image information with the information to be desensitized, and using the successfully matched information as the sensitive information of the file;
[0109] S53: Trace back the position of the sensitive information in the image information to obtain the position of the sensitive information.
[0110] An optional embodiment of the present invention first obtains the information that needs to be desensitized in the certificate type to obtain the characteristics of the information that needs to be desensitized. Secondly, the image information is matched with the information that needs to be desensitized, and the successfully matched information is used as the sensitive information of the file, thereby ensuring the accuracy of the sensitive information and improving the accuracy of the image desensitization. Finally, the position of the sensitive information in the image information is traced back to obtain the position of the sensitive information, thereby achieving accurate image desensitization.
[0111] S6. According to the location of the sensitive information, data deformation is performed on the sensitive information in the file to obtain desensitized information.
[0112] In an embodiment of the present invention, the desensitized information may be hidden data. For example, sensitive information in the personal information input by the user is replaced with “*”, and the resulting “***” is the desensitized information.
[0113] The embodiment of the present invention performs data deformation on the sensitive information on the file according to the location of the sensitive information to obtain desensitized information, thereby achieving image desensitization, reducing the degree of manual participation, and improving the intelligence level of image desensitization.
[0114] In an optional embodiment of the present invention, by reading the encoding information of the sensitive information to obtain the sensitive code, the sensitive code is then modified using a preset code modifier to obtain a desensitized code, and finally the desensitized code is compiled to obtain desensitized information, thereby achieving information desensitization and ensuring the user's information security.
[0115] In the embodiment of the present invention, the coding information includes a coding sequence and coding characters. The preset coding modifier refers to a modifier that modifies normal coding information into coding information with non-sensitive characters such as "*" and "#".
[0116] S7. When the file format of the file is a text format, perform text desensitization on the file to obtain a desensitized text.
[0117] In the embodiment of the present invention, when the file format of the file is not a picture format, common text desensitization can be used to complete the desensitization of the file, thereby ensuring the information security of the user.
[0118] Further, see Figure 7 As shown, as an optional embodiment of the present invention, the text desensitization of the file to obtain the desensitized text includes steps S71-S77:
[0119] S71, performing vectorization processing on the file to obtain a word vector of the file;
[0120] S72, marking the word vector according to preset text features;
[0121] S73, combining the annotated word vectors according to the corresponding word units in the file to obtain a word unit set;
[0122] S74, creating a frequent item set according to the support of the word units included in the word unit set;
[0123] S75, calculating the lift of the frequent items included in the frequent item set;
[0124] S76, taking the word units corresponding to the frequent items in the frequent item set whose lifting degree is greater than a preset threshold as sensitive word units;
[0125] S77. Desensitizing the file according to the sensitive word units to obtain a desensitized text.
[0126] In the embodiment of the present invention, the preset text feature may be a text sensitive word feature set in advance by a user. The support degree may be a ratio of the word unit to the word unit set and the file.
[0127] In an optional embodiment of the present invention, candidate sensitive word units are first selected according to the text features of sensitive information, the sensitive information determination range is narrowed, and the efficiency of text desensitization is improved. Furthermore, by calculating the improvement degree of the candidate sensitive word units, sensitive word units are screened out, thereby improving the desensitization effect of sensitive information in the text format, thereby effectively protecting the sensitive information in the desensitized text and ensuring the information security of the user.
[0128] The embodiment of the present invention determines the desensitization method to be performed according to the file format of the file, thereby improving the efficiency and accuracy of file desensitization; when the file format of the file is a picture format, the file is classified according to the picture information of the file and the preset certificate type information to obtain the certificate type of the file, thereby facilitating the confirmation of the key information that needs to be desensitized, and improving the accuracy and intelligence of the picture desensitization. Therefore, the file desensitization method proposed in the embodiment of the present invention can improve the intelligence, accuracy and efficiency of file desensitization.
[0129] like Figure 8 The figure shows a functional module diagram of the document desensitization device of the present invention.
[0130] The file desensitization device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the file desensitization device 100 can include an image information recognition module 101, a sensitive information recognition module 102 and a sensitive information desensitization module 103. The module of the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0131] In this embodiment, the functions of each module / unit are as follows:
[0132] The picture information recognition module 101 is used to receive a file uploaded by a user, and when the file format of the file is a picture format, perform picture information recognition on the file to obtain the picture information of the file.
[0133] In the embodiment of the present invention, the user may be a customer who is handling a business, for example, a customer who is applying for a credit card at a bank. The file may be user information required by the corresponding business, for example, when handling a credit card business at a bank, the user is required to provide corresponding identity documents and other information.
[0134] In an optional embodiment of the present invention, files uploaded by users are received through a business processing page without being processed by business personnel, thereby ensuring the information security of users and improving the security of users' private information.
[0135] The file format refers to a special encoding method used to store information, which is used to identify the internally stored data. In an embodiment of the present invention, the file format may include a text format and a picture format. In an optional embodiment of the present invention, the file format of the file is determined by reading the suffix format information of the file.
[0136] Among them, when the suffix format information is bmp, jpg, png, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp, avif, apng, it can be determined that the file format of the file is a picture format.
[0137] When the suffix format information of the file is txt, rtf, doc, xls, ppt, htm, html, wpd, pdf, etc., it can be determined that the file format of the file is a text format.
[0138] The embodiment of the present invention obtains the image information of the file by performing image information recognition on the file, which facilitates the determination of the type of the file, thereby improving the accuracy of image desensitization.
[0139] Further, see Figure 2 As shown, as an optional embodiment of the present invention, the step of performing image information recognition on the file to obtain the image information of the file includes:
[0140] Performing digital image processing on the file to obtain a target contour area;
[0141] Performing character segmentation on the target contour area to obtain a character contour area;
[0142] Recognizing the character outline area to obtain character information;
[0143] The character information is spliced to obtain picture information.
[0144] In the embodiment of the present invention, the target contour area may be an area containing text information, wherein the text information includes recognizable Chinese characters, English, Arabic numerals, etc.
[0145] Further, see Figure 3 As shown, the document is subjected to traditional digital image processing to obtain a contour area containing text information, including:
[0146] Performing grayscale processing on the file to obtain a pixel matrix;
[0147] Binarizing the pixel matrix to obtain a binary pixel matrix;
[0148] Performing expansion processing on the binary pixel matrix to obtain an expanded pixel matrix;
[0149] Selecting clustered pixels in the expanded pixel matrix to obtain multiple target object matrices to be screened;
[0150] According to preset rules, screening is performed from the target object matrix to obtain a target object matrix;
[0151] The area corresponding to the target matrix is extracted to obtain the target contour area.
[0152] In the embodiment of the present invention, the preset rule may be a description of the characteristics of the target object. For example, when screening the names on the identity cards, the preset rule may be a rectangle with a large interval in the middle.
[0153] In an optional embodiment of the present invention, a target contour area is obtained by performing a series of traditional digital image processing on the file, thereby obtaining a contour area containing text information, thereby improving the accuracy of image information recognition and reducing the possibility of information loss.
[0154] In another optional embodiment of the present invention, the image information of the file can be obtained by inputting the file into a convolutional neural network and performing a convolution pooling operation.
[0155] The sensitive information identification module 102 is used to classify the file type according to the image information and the preset certificate type information to obtain the certificate type of the file, classify the image information according to the certificate type, and determine the sensitive information of the file and the location of the sensitive information according to the information classification. The file type is classified according to the image information and the preset certificate type information to obtain the certificate type of the file, classify the image information according to the certificate type, and determine the sensitive information of the file and the location of the sensitive information according to the information classification.
[0156] In an embodiment of the present invention, the document type information may be information contained in a document type image, for example, the document type information of an ID card may include name, gender, ethnicity, date of birth, etc. The document types include ID cards, business licenses, vehicle registration certificates, driver's licenses, property certificates, etc.
[0157] The embodiment of the present invention classifies the file type according to the image information and preset certificate type information to obtain the certificate type of the file, thereby achieving precise control of files in image format, thereby improving the accuracy of image desensitization and reducing the risk factor of user information leakage due to inadequate information masking.
[0158] Further, see Figure 4 As shown, as an optional embodiment of the present invention, the document type is classified according to the image information and the preset document type information to obtain the document type of the document, including:
[0159] Using the certificate type information to perform model training to obtain a certificate type classification model;
[0160] Input the image information into the document type classification model to obtain a classification result;
[0161] The document type of the document is determined according to the classification result.
[0162] In an embodiment of the present invention, the certificate type classification model may be a multi-classification model based on deep learning.
[0163] In an optional embodiment of the present invention, a model training method is used to perform data training on the certificate type information to obtain a certificate type classification model, thereby improving the intelligence level of certificate type recognition and improving the efficiency of certificate type recognition.
[0164] Further, see Figure 5 As shown, the image information is input into the document type classification model to obtain a classification result, including:
[0165] Using the encoding layer in the certificate type classification model to perform character encoding on the image information to obtain a character vector;
[0166] Using the decoding layer in the certificate type classification model to perform matrix concatenation on the character vectors to obtain a picture information character matrix;
[0167] Using the attention mechanism layer in the certificate type classification model to extract keywords from the image information character matrix, obtaining image information keywords;
[0168] According to the picture information keywords, the classification result of the picture information is outputted using the fully connected layer in the certificate type classification model.
[0169] In an embodiment of the present invention, the certificate type classification model is based on a neural network and may be a Bert model, wherein the certificate type classification model includes: an encoding layer, a decoding layer, an attention mechanism layer and a fully connected layer.
[0170] In the embodiment of the present invention, the sensitive information may be the private confidential information of the user, such as ID number, bank card number, phone number, home address, name, etc. The location of the sensitive information may be the location where the sensitive information is displayed in the file.
[0171] The embodiment of the present invention classifies the image information according to the certificate type, eliminates the desensitization of unnecessary information, reduces the concealment of unnecessary information, and improves the efficiency of image desensitization.
[0172] The embodiment of the present invention determines the sensitive information of the file and the location of the sensitive information according to the information classification, which facilitates accurate positioning of the desensitization location of the sensitive information, improves the desensitization rate of the sensitive information, and improves the accuracy and efficiency of image desensitization.
[0173] Further, see Figure 6 As shown, as an optional embodiment of the present invention, the image information is classified according to the certificate type, and the sensitive information of the file and the location of the sensitive information are determined according to the information classification, including:
[0174] Obtain the information that needs to be desensitized in the certificate type;
[0175] Matching the image information with the information to be desensitized, and using the successfully matched information as the sensitive information of the file;
[0176] The location of the sensitive information in the image information is traced back to obtain the location of the sensitive information.
[0177] An optional embodiment of the present invention first obtains the information that needs to be desensitized in the certificate type to obtain the characteristics of the information that needs to be desensitized. Secondly, the image information is matched with the information that needs to be desensitized, and the successfully matched information is used as the sensitive information of the file, thereby ensuring the accuracy of the sensitive information and improving the accuracy of the image desensitization. Finally, the position of the sensitive information in the image information is traced back to obtain the position of the sensitive information, thereby achieving accurate image desensitization.
[0178] The sensitive information desensitization module 103 is used to perform data deformation on the sensitive information on the file according to the location of the sensitive information to obtain desensitized information. When the file format of the file is a text format, the file is desensitized to obtain desensitized text.
[0179] In an embodiment of the present invention, the desensitized information may be hidden data. For example, sensitive information in the personal information input by the user is replaced with “*”, and the resulting “***” is the desensitized information.
[0180] The embodiment of the present invention performs data deformation on the sensitive information on the file according to the location of the sensitive information to obtain desensitized information, thereby achieving image desensitization, reducing the degree of manual participation, and improving the intelligence level of image desensitization.
[0181] In an optional embodiment of the present invention, by reading the encoding information of the sensitive information to obtain the sensitive code, the sensitive code is then modified using a preset code modifier to obtain a desensitized code, and finally the desensitized code is compiled to obtain desensitized information, thereby achieving information desensitization and ensuring the user's information security.
[0182] In the embodiment of the present invention, the coding information includes a coding sequence and coding characters. The preset coding modifier refers to a modifier that modifies normal coding information into coding information containing non-sensitive characters such as "*" and "#".
[0183] In the embodiment of the present invention, when the file format of the file is not a picture format, common text desensitization can be used to complete the desensitization of the file, thereby ensuring the information security of the user.
[0184] Further, see Figure 7 As shown, as an optional embodiment of the present invention, the text desensitization of the file to obtain the desensitized text includes:
[0185] Performing vectorization processing on the file to obtain a word vector for the file;
[0186] Annotating the word vector according to preset text features;
[0187] According to the corresponding word units in the file, the annotated word vectors are combined to obtain a word unit set;
[0188] Creating a frequent item set according to the support of the word units included in the word unit set;
[0189] Calculating the lift of the frequent items contained in the frequent item set;
[0190] The word units corresponding to the frequent items in the frequent item set whose lifting degree is greater than a preset threshold are used as sensitive word units;
[0191] The file is desensitized according to the sensitive word units to obtain a desensitized text.
[0192] In the embodiment of the present invention, the preset text feature may be a text sensitive word feature set in advance by a user. The support degree may be a ratio of the word unit to the word unit set and the file.
[0193] In an optional embodiment of the present invention, candidate sensitive word units are first selected according to the text features of sensitive information, the sensitive information determination range is narrowed, and the efficiency of text desensitization is improved. Furthermore, by calculating the improvement degree of the candidate sensitive word units, sensitive word units are screened out, thereby improving the desensitization effect of sensitive information in the text format, thereby effectively protecting the sensitive information in the desensitized text and ensuring the information security of the user.
[0194] like Fig. 9 The figure is a schematic diagram of the structure of an electronic device for implementing the file desensitization method of the present invention.
[0195] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a file desensitization program.
[0196] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the file desensitization program, etc., but also be used to temporarily store data that has been output or is to be output.
[0197] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes programs or modules (such as file desensitization programs, etc.) stored in the memory 11, and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0198] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0199] Fig. 9 Only an electronic device with components is shown, and those skilled in the art will understand that Fig. 9 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0200] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0201] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
[0202] Optionally, the communication interface 13 may also include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0203] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0204] The file desensitization program stored in the memory 11 in the electronic device is a combination of multiple computer programs. When running in the processor 10, it can achieve:
[0205] Receive files uploaded by users;
[0206] When the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file;
[0207] Classify the document according to the image information and the preset document type information to obtain the document type of the document;
[0208] Classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification;
[0209] According to the location of the sensitive information, data deformation is performed on the sensitive information on the file to obtain desensitized information;
[0210] When the file format of the file is a text format, the file is desensitized to obtain a desensitized text.
[0211] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0212] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).
[0213] An embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
[0214] Receive files uploaded by users;
[0215] When the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file;
[0216] Classify the document according to the image information and the preset document type information to obtain the document type of the document;
[0217] Classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification;
[0218] According to the location of the sensitive information, data deformation is performed on the sensitive information on the file to obtain desensitized information;
[0219] When the file format of the file is a text format, the file is desensitized to obtain a desensitized text.
[0220] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0221] In the several embodiments provided by the present invention, it should be understood that the disclosed electronic device, apparatus and method can be implemented in other ways. For example, the apparatus embodiment described above is only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0222] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0223] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0224] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0225] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0226] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0227] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0228] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A file desensitization method, characterized in that: The method comprises: Receive files uploaded by users; When the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file; According to the picture information and the preset certificate type information, the file is classified into types to obtain the certificate type of the file, including: using the certificate type information to perform model training to obtain a certificate type classification model, using the encoding layer in the certificate type classification model to perform character encoding on the picture information to obtain a character vector, using the decoding layer in the certificate type classification model to perform matrix splicing on the character vector to obtain a picture information character matrix, using the attention mechanism layer in the certificate type classification model to extract keywords from the picture information character matrix to obtain picture information keywords, using the fully connected layer in the certificate type classification model to output the classification result of the picture information according to the picture information keywords, and judging the certificate type of the file according to the classification result; Classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification; According to the location of the sensitive information, the encoding information of the sensitive information is read to obtain a sensitive code, the sensitive code is modified by using a preset code modifier to obtain a desensitized code, and the desensitized code is compiled to obtain desensitized information; When the file format of the file is a text format, the file is desensitized to obtain a desensitized text.
2. The file desensitization method according to claim 1, characterized in that: The step of classifying the image information according to the certificate type and determining the sensitive information of the file and the location of the sensitive information according to the information classification includes: Obtaining information that needs to be desensitized in the certificate type; Matching the image information with the information to be desensitized, and using the successfully matched information as the sensitive information of the file; The location of the sensitive information in the image information is traced back to obtain the location of the sensitive information.
3. The file desensitization method according to claim 1, characterized in that: The step of performing text desensitization on the file to obtain the desensitized text includes: Performing vectorization processing on the file to obtain a word vector for the file; Annotating the word vector according to preset text features; According to the corresponding word units in the file, the annotated word vectors are combined to obtain a word unit set; Creating a frequent item set according to the support of the word units included in the word unit set; Calculating the lift of the frequent items contained in the frequent item set; The word units corresponding to the frequent items in the frequent item set whose lifting degree is greater than a preset threshold are used as sensitive word units; The file is desensitized according to the sensitive word units to obtain a desensitized text.
4. The file desensitization method according to claim 1, characterized in that: The step of performing image information recognition on the file to obtain the image information of the file includes: Performing digital image processing on the file to obtain a target contour area; Performing character segmentation on the target contour area to obtain a character contour area; Recognizing the character outline area to obtain character information; The character information is spliced to obtain picture information.
5. The file desensitization method according to claim 4, characterized in that: The step of performing digital image processing on the file to obtain a contour area containing text information includes: Gray-scale the file to obtain a pixel matrix; Binarizing the pixel matrix to obtain a binary pixel matrix; Performing expansion processing on the binary pixel matrix to obtain an expanded pixel matrix; Selecting clustered pixels in the expanded pixel matrix to obtain multiple target object matrices to be screened; According to preset rules, screening is performed from the target object matrix to obtain a target object matrix; The area corresponding to the target matrix is extracted to obtain the target contour area.
6. A document desensitization device, characterized in that: The device comprises: A picture information recognition module, used for receiving a file uploaded by a user, and when the file format of the file is a picture format, performing picture information recognition on the file to obtain the picture information of the file; A sensitive information identification module is used to classify the file according to the image information and preset certificate type information to obtain the certificate type of the file, including: using the certificate type information to perform model training to obtain a certificate type classification model, using the encoding layer in the certificate type classification model to perform character encoding on the image information to obtain a character vector, using the decoding layer in the certificate type classification model to perform matrix splicing on the character vector to obtain a picture information character matrix, using the attention mechanism layer in the certificate type classification model to extract keywords from the picture information character matrix to obtain picture information keywords, using the fully connected layer in the certificate type classification model to output the classification result of the picture information according to the picture information keywords, and judging the certificate type of the file according to the classification result; According to the certificate type, the image information is classified, and the sensitive information of the file and the location of the sensitive information are determined according to the information classification. According to the image information and the preset certificate type information, the file is classified into a type to obtain the certificate type of the file. Classifying the image information according to the document type, and determining the sensitive information of the file and the location of the sensitive information according to the information classification; The sensitive information desensitization module is used to read the encoding information of the sensitive information according to the location of the sensitive information to obtain the sensitive code, modify the sensitive code using a preset code modifier to obtain the desensitized code, compile the desensitized code to obtain desensitized information, and when the file format of the file is a text format, perform text desensitization on the file to obtain desensitized text.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to perform the file desensitization method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the file desensitization method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for online business handling based on face recognition and computer equipment
CN110110588A
Text desensitization method and device
CN110633577A
Electric power scientific and technological achievement data extraction method based on BERT model technology
CN111680169A
Pushing method and device based on user intention, electronic equipment and storage medium
CN111814058A
Digital image and image examination report data desensitization processing method
CN113254998A
