Text desensitization processing method and apparatus

By segmenting the target text and matching sensitive words, and using hash values ​​and lengths to determine de-sensitized words to replace sensitive words, the problem of low reliability in data management is solved, and data security and traceability are improved.

CN116484420BActive Publication Date: 2025-12-09中国邮政储蓄银行股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310423810.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2025-12-09
Estimated Expiration
2043-04-19

AI Technical Summary

Technical Problem

Existing data management methods have low reliability and are prone to leakage of sensitive data.

Method used

By segmenting the target text, matching sensitive words using a sensitive information thesaurus, and determining desensitized words based on the hash value of the user identification code and the length of the sensitive words, the desensitized words are replaced and watermarks can be added to trace the source of the data.

Benefits of technology

It improves data security, reduces the risk of sensitive data leakage, and achieves reliability and traceability in data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484420B_ABST
    Figure CN116484420B_ABST
Patent Text Reader

Abstract

The application discloses a text desensitization processing method and device. The method comprises the following steps: performing word segmentation processing on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; matching the plurality of words with a sensitive information library to obtain at least one sensitive word in the plurality of words; determining the identification code of at least one user in the target text, wherein the identification code is used for uniquely identifying the user; determining the hash value of the identification code of the user, and taking the hash value as the key of the at least one sensitive word; determining the desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; and replacing the at least one sensitive word with the desensitization word to desensitize the target text. The application solves the technical problem in the related art that the data management method has low reliability and is prone to data leakage.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data security protection, in particular to a text desensitization processing method and device. BACKGROUND

[0002] At present, various industries have accumulated a large number of documents containing bank card numbers, customer names, mobile phone numbers, and address sensitive information. In addition, the requirement for data security is also increasing. However, there are security risks in the management and preservation of data, for example, some sensitive data are at risk of leakage, and the related art does not provide safe and reliable measures.

[0003] In view of the problem in the prior art that the method for data management is not reliable and is prone to data leakage, no effective solution has been proposed so far. SUMMARY

[0004] The embodiments of the present application provide a text desensitization processing method and device to at least solve the technical problem that the method for data management in the related art is not reliable and is prone to data leakage.

[0005] According to an aspect of the embodiments of the present application, a text desensitization processing method is provided, comprising: performing word segmentation processing on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; matching the plurality of words with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the domain corresponding to the plurality of sample texts is the same as the domain corresponding to the target text; determining an identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user; determining a hash value of the identification code of the user, and taking the hash value as a key of the at least one sensitive word; determining a desensitized word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; and replacing the at least one sensitive word with the desensitized word to desensitize the target text.

[0006] Optionally, before performing word segmentation processing on the target text, the method further comprises: performing cleaning processing on the target text, wherein the cleaning processing comprises at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

[0007] Optionally, the word segmentation processing on the target text comprises one of the following: performing word segmentation processing on the target text by using a bidirectional maximum matching method; performing word segmentation processing on the target text by using a hidden Markov algorithm; and performing word segmentation processing on the target text by using a conditional random field method.

[0008] Optionally, the matching the plurality of words with the sensitive information library to obtain at least one sensitive word in the plurality of words comprises: performing part-of-speech tagging on each of the plurality of words by a predetermined manner to obtain the plurality of words after tagging, wherein the predetermined manner comprises one of the following: a hidden Markov algorithm, a conditional random field manner; determining a part of speech of a sensitive word in the target text; determining a part of speech of the plurality of words after tagging that is the same as the part of speech; and matching the part of speech of the plurality of words after tagging with the sensitive information library to obtain the at least one sensitive word in the plurality of words.

[0009] Optionally, the determining the desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word comprises: selecting at least one character based on the length of each of the at least one sensitive word; performing symmetric encryption on the at least one sensitive word according to the key and the at least one character to obtain the at least one sensitive word after symmetric encryption; determining a zero-width character of the hash value; and adding the zero-width character to the at least one sensitive word after symmetric encryption to obtain the desensitization word of the at least one sensitive word.

[0010] Optionally, the adding the zero-width character to the at least one sensitive word after symmetric encryption to obtain the desensitization word of the at least one sensitive word comprises: after adding the zero-width character to the at least one sensitive word after symmetric encryption to obtain an initial desensitization word of the at least one sensitive word, adding a watermark to the initial desensitization word to obtain the desensitization word of the at least one sensitive word.

[0011] Optionally, the text desensitization processing method further comprises: when data is traced back, extracting watermark information in the target text after desensitization processing to obtain the target text after removing the watermark; and decoding the zero-width character from the target text after removing the watermark to restore the identification code.

[0012] Optionally, the text desensitization processing method further comprises: when data is traced back, parsing the at least one sensitive word after desensitization using the key; and comparing the at least one sensitive word after desensitization with the at least one sensitive word before desensitization to restore the identification code.

[0013] Optionally, the replacing the at least one sensitive word with the desensitization word comprises: determining a position of the at least one sensitive word in the target text; locating the at least one sensitive word in the target text according to the position; and replacing the located at least one sensitive word with the desensitization word based on an original text format of the target text.

[0014] According to another aspect of the embodiments of the present application, there is also provided a text desensitization processing apparatus, comprising: a word segmentation unit configured to perform word segmentation processing on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; a matching unit configured to match the plurality of words with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the domain corresponding to the sample texts is the same as the domain corresponding to the target text; a first determination unit configured to determine an identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user; a second determination unit configured to determine a hash value of the identification code of the user and use the hash value as a key of the at least one sensitive word; a third determination unit configured to determine a desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; and a desensitization unit configured to replace the at least one sensitive word with the desensitization word to desensitize the target text.

[0015] Optionally, before performing word segmentation processing on the target text, the text desensitization processing apparatus further comprises a cleaning unit configured to perform cleaning processing on the target text, wherein the cleaning processing comprises at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

[0016] Optionally, the word segmentation unit comprises one of the following: a first word segmentation module configured to perform word segmentation processing on the target text by using a bidirectional maximum matching method; a second word segmentation module configured to perform word segmentation processing on the target text by using a hidden Markov algorithm; and a third word segmentation module configured to perform word segmentation processing on the target text by using a conditional random field method.

[0017] Optionally, the matching unit comprises: a labeling module configured to perform part-of-speech labeling on each of the plurality of words by using a predetermined method to obtain labeled plurality of words, wherein the predetermined method comprises one of the following: a hidden Markov algorithm and a conditional random field method; a first determination module configured to determine the part-of-speech of the sensitive word in the target text; a second determination module configured to determine a partial word in the labeled plurality of words that has the same part-of-speech; and a matching module configured to match the partial word with the sensitive information word library to obtain the at least one sensitive word in the plurality of words.

[0018] Optionally, the third determining unit comprises: a selection module, configured to select at least one character based on the length of each of the at least one sensitive word; an encryption module, configured to perform symmetric encryption on the at least one sensitive word according to the key and the at least one character, to obtain symmetrically encrypted at least one sensitive word; a third determining module, configured to determine a zero-width character of the hash value; and an acquisition module, configured to add the zero-width character to the symmetrically encrypted at least one sensitive word, to obtain a desensitized word of the at least one sensitive word.

[0019] Optionally, the acquisition module comprises an adding sub-module, configured to add a watermark to an initial desensitized word of the at least one sensitive word after adding the zero-width character to the symmetrically encrypted at least one sensitive word, to obtain the desensitized word of the at least one sensitive word.

[0020] Optionally, the text desensitization processing apparatus further comprises: an extraction module, configured to extract watermark information in the target text after desensitization processing when data is traced back, to obtain the target text after removing the watermark; and a decoding module, configured to decode the zero-width character from the target text after removing the watermark, to restore the identification code.

[0021] Optionally, the text desensitization processing apparatus further comprises: an analysis module, configured to analyze the at least one sensitive word after desensitization using the key when data is traced back; and a comparison module, configured to compare the at least one sensitive word after desensitization with the at least one sensitive word before desensitization, to restore the identification code.

[0022] Optionally, the desensitization unit comprises: a fourth determining module, configured to determine the position of the at least one sensitive word in the target text; a positioning module, configured to position the at least one sensitive word in the target text according to the position; and a replacement module, configured to replace the positioned at least one sensitive word with the desensitized word based on the original text format of the target text.

[0023] According to another aspect of the embodiments of the present application, a computer readable storage medium is provided, which comprises a stored program, wherein the program performs the text desensitization processing method in any of the above embodiments.

[0024] According to another aspect of the embodiments of the present application, a processor is provided, which is configured to run a program, wherein the program performs the text desensitization processing method in any of the above embodiments when running.

[0025] In the embodiment of the present application, the target text is subjected to word segmentation processing to obtain a plurality of words, wherein the target text is text that needs to be subjected to desensitization processing; the plurality of words are matched with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the domain corresponding to the plurality of sample texts is the same as the domain corresponding to the target text; the identification code of at least one user in the target text is determined, wherein the identification code is used to uniquely identify the user; the hash value of the identification code of the user is determined, and the hash value is used as the key of the at least one sensitive word; the desensitization word of the at least one sensitive word is determined based on the key of the at least one sensitive word and the length of the at least one sensitive word; and the desensitization word is used to replace the at least one sensitive word to perform desensitization processing on the target text. Through the technical scheme provided in the embodiment of the present application, the desensitization word is determined according to the hash value of the identification code of the user extracted from the target text and the length of the sensitive word in the target text, so as to perform desensitization processing on the sensitive word in the target text by using the desensitization word, thereby improving the data security, and further solving the technical problem that the data management method in the related art has low reliability and is prone to data leakage. BRIEF DESCRIPTION OF DRAWINGS

[0026] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0027] Figure 1 is a flowchart of a text desensitization processing method according to an embodiment of the present application;

[0028] Figure 2 is a flowchart of an optional text desensitization processing method according to an embodiment of the present application;

[0029] Figure 3 is a schematic diagram of a text desensitization processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of the present application.

[0031] It should be noted that the terms "first", "second", and the like in the description of the application and claims and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0032] For the convenience of understanding, the following explains some nouns or terms appearing in the embodiments of the application:

[0033] Natural language processing (NLP) is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that can realize effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science and mathematics. Through natural language processing, text files can be segmented and specified types of words can be extracted.

[0034] Data watermarking: is to embed specific digital signals into digital products to protect the copyright, integrity, prevent copying or tracking of digital products.

[0035] To further improve the security and availability of data and reduce the risk of sensitive data leakage, the present application performs desensitization processing on text files to reduce the risk of sensitive data leakage. In addition, the present application can track files through special watermark information formed by desensitization, effectively trace the source of data leakage, improve the standardization and compliance level of data use management, and prevent sensitive data leakage and other security risks. The text desensitization processing method will be described below in conjunction with specific embodiments.

[0036] According to the embodiments of the present application, a method embodiment of a text desensitization processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0037] Figure 1 is a flowchart of a text desensitization processing method according to an embodiment of the present application, as shown in Figure 1 The text desensitization processing method includes the following steps:

[0038] In step S102, the target text is segmented to obtain a plurality of words, wherein the target text is a text that needs to be desensitized.

[0039] Optionally, the target text is a text that needs to be desensitized.

[0040] In step S104, the plurality of words are matched with a sensitive information library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information library is a library that contains a plurality of reference sensitive words and is constructed in advance based on a plurality of sample texts, and the domain corresponding to the plurality of sample texts is the same as the domain corresponding to the target text.

[0041] Optionally, the sensitive information library can be constructed in advance according to a plurality of sample texts. The sensitive information library includes a plurality of reference sensitive words. The plurality of samples herein are texts in the same domain as the target text. By searching in the sensitive words in the same domain, the accuracy and efficiency of the sensitive word matching can be improved.

[0042] For example, a dictionary (i.e., a sensitive information library) for discovering sensitive words can be constructed by using regular expressions or manual annotation, etc., to identify sensitive words in a document, such as bank card numbers, customer names, mobile phone numbers, addresses, etc.

[0043] In step S106, an identification code of at least one user in the target text is determined, wherein the identification code is used to uniquely identify the user.

[0044] Optionally, the identification code herein is information extracted from the target text to uniquely identify the user, such as the user's ID number, the user's code, etc.

[0045] In step S108, a hash value of the user's identification code is determined, and the hash value is used as a key of the at least one sensitive word.

[0046] In this embodiment, a hash value can be generated according to the user's identification code, and the generated hash value is used as the key of the at least one sensitive word.

[0047] In step S110, a desensitized word of the at least one sensitive word is determined based on the key of the at least one sensitive word and the length of the at least one sensitive word.

[0048] In this embodiment, the desensitized word of the at least one sensitive word can be determined according to the key of the at least one sensitive word and the length of the at least one sensitive word, to improve the security of the sensitive word desensitization.

[0049] In step S112, the desensitized word is used to replace the at least one sensitive word to desensitize the target text.

[0050] It can be known from the above that in the embodiment of the application, the target text can be subjected to word segmentation processing to obtain a plurality of words, wherein the target text is text that needs to be subjected to desensitization processing; the plurality of words are matched with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the domain corresponding to the plurality of sample texts is the same as the domain corresponding to the target text; the identification code of at least one user in the target text is determined, wherein the identification code is used to uniquely identify the user; the hash value of the identification code of the user is determined, and the hash value is used as the key of the at least one sensitive word; the desensitization word of the at least one sensitive word is determined based on the key of the at least one sensitive word and the length of the at least one sensitive word; and the desensitization word is used to replace the at least one sensitive word to perform desensitization processing on the target text, so that the desensitization word is determined according to the hash value of the identification code of the user extracted from the target text and the length of the sensitive word in the target text to perform desensitization processing on the sensitive word in the target text by using the desensitization word, and the data security is improved.

[0051] Therefore, the text desensitization processing method provided in the embodiment of the application solves the technical problem in the related art that the way for data management has low reliability and is easy to cause data leakage.

[0052] According to the above embodiment of the application, before the target text is subjected to word segmentation processing, the text desensitization processing method further comprises: performing cleaning processing on the target text, wherein the cleaning processing comprises at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

[0053] In this embodiment, the target text, i.e., the text to be desensitized, can be imported into a computer for file cleaning, mainly to process special symbols, spelling correction, case conversion, punctuation symbol conversion, etc., to provide accurate text for text desensitization.

[0054] According to the above embodiment of the application, the target text is subjected to word segmentation processing, which comprises one of the following: the target text is subjected to word segmentation processing by using a bidirectional maximum matching method; the target text is subjected to word segmentation processing by using a hidden Markov algorithm; and the target text is subjected to word segmentation processing by using a conditional random field method.

[0055] In this embodiment, the cleaned file can be subjected to word segmentation, for example, a Chinese word segmentation tool such as jieba can be used, and a rule-based word segmentation method such as a bidirectional maximum matching method or a machine learning-based HMM, CRF, etc. method can be used to segment the text.

[0056] According to the above embodiment of the present application, the matching of the plurality of words with the sensitive information library to obtain at least one sensitive word in the plurality of words comprises: performing part-of-speech tagging on each of the plurality of words by a predetermined manner to obtain the plurality of tagged words, wherein the predetermined manner comprises one of the following: a hidden Markov algorithm, a conditional random field manner; determining the part-of-speech of the sensitive word in the target text; determining the partial words with the same part-of-speech in the plurality of tagged words; and matching the partial words with the sensitive information library to obtain at least one sensitive word in the plurality of words.

[0057] In this embodiment, the plurality of words obtained by word segmentation can be tagged with part-of-speech, for example, a rule-based or statistical-based method such as HMM, CRF, LSTM+CRF, etc. can be used to tag the words with part-of-speech. Since the fields related to personal sensitive information are all nouns, only the nouns are tagged during part-of-speech tagging. Here, by only tagging the nouns, that is, only the nouns are located during subsequent sensitive word desensitization, the efficiency of text desensitization is improved.

[0058] According to the above embodiment of the present application, the determination of the desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word can comprise: selecting at least one character based on the length of each of the at least one sensitive word; performing symmetric encryption on the at least one sensitive word according to the key and the at least one character to obtain the symmetrically encrypted at least one sensitive word; determining a zero-width character of a hash value; and adding the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitization word of the at least one sensitive word.

[0059] In this embodiment, at least one character can be selected according to the length of each of the at least one sensitive word, so that symmetric encryption can be performed on the at least one sensitive word by using the key and the at least one character to obtain the symmetrically encrypted at least one sensitive word; after the zero-width character of the hash value is determined, the zero-width character is added to the symmetrically encrypted at least one sensitive word to obtain the desensitization word of the at least one sensitive word.

[0060] In an alternative embodiment, the adding of the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitization word of the at least one sensitive word comprises: after the adding of the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the initial desensitization word of the at least one sensitive word, adding a watermark to the initial desensitization word to obtain the desensitization word of the at least one sensitive word.

[0061] In this embodiment, after the zero-width character is added to the symmetrically encrypted key to obtain the initial desensitization word of the at least one desensitization word, a watermark is added to the initial desensitization word to obtain the desensitization word of the at least one sensitive word in order to further improve data security.

[0062] As an optional embodiment, the text desensitization processing method can further include: extracting the watermark information in the target text after desensitization processing when data tracing is performed, to obtain a target text with removed watermark; and decoding the zero-width character from the target text with removed watermark to restore the identification code.

[0063] In this embodiment, the watermark of the target text after desensitization processing can be extracted when data tracing is performed to obtain a target text with removed watermark; and the zero-width character can be decoded from the target text with removed watermark to restore the identification code.

[0064] As another optional embodiment, the text desensitization processing method further includes: using a key to analyze at least one sensitive word after desensitization when data tracing is performed; and comparing the at least one sensitive word after desensitization with the at least one sensitive word before desensitization to restore the identification code.

[0065] In this embodiment, the key can be used to analyze at least one sensitive word after desensitization when data tracing is performed, so as to compare the at least one sensitive word after desensitization with the original desensitization word to obtain the identification code.

[0066] According to the above embodiments of the present application, the at least one sensitive word is replaced by a desensitization word, including: determining the position of the at least one sensitive word in the target text; locating the at least one sensitive word in the target text according to the position; and replacing the located at least one sensitive word by a desensitization word on the basis of the original text format of the target text.

[0067] In this embodiment, the position of the at least one sensitive word in the target text can be determined first, and then the at least one sensitive word can be located in the target text according to the determined position, and the located at least one sensitive word can be replaced by a desensitization word on the basis of the original text format of the target text.

[0068] Figure 2 is a flowchart of an optional text desensitization processing method according to an embodiment of the present application, as shown in Figure 2 Firstly, text preprocessing can be performed, specifically, the file to be desensitized can be imported into a computer; file cleaning, mainly processing, special symbols, spelling correction, case conversion, punctuation conversion; the cleaned file is segmented, using jieba and other Chinese segmentation tools, using rule-based segmentation methods such as bidirectional maximum matching method or machine learning-based HMM, CRF, etc. to segment the text; the word is tagged, using rule-based or statistical-based methods such as HMM, CRF, LSTM + CRF, etc. to tag the word. Since the fields involving personal sensitive information are all nouns, only the nouns are tagged during part-of-speech tagging.

[0069] Then, text desensitization is performed; specifically, a dictionary for discovering sensitive words is constructed by a regular expression or manual marking, etc., for identifying sensitive words in a document, such as a bank card number, a customer name, a mobile phone number, an address, etc. The location of the sensitive words in the document is marked; different users generate different identification codes and are persistently saved; the identification code uniquely indicates that the sensitive words marked by the user are desensitized by data replacement, and in data replacement, the hash value of the identification code of different users is used as a key, one or more characters are selected for symmetric encryption according to the length of the sensitive word, in addition, the hash value of the identification code of different users is increased by a zero-width character, the original format of the document is maintained, and the desensitized word containing the data watermark is replaced by the sensitive word. Finally, data tracing can be performed, specifically, if data leakage occurs, the watermark information in the document can be extracted, and the zero-width character is decoded; or, the identification code of the user is restored by comparing the desensitized sensitive word with the original sensitive word using the keys of all users.

[0070] The text desensitization processing method provided by the embodiment of the application desensitizes the natural language text file and uses the identification code of the user as a tracing code to realize data tracing, and the whole process is smooth, which makes the management more standardized and greatly improves the security of the data.

[0071] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0072] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a necessary general hardware platform, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.

[0073] According to the embodiment of the application, a text desensitization processing device for implementing the above-mentioned text desensitization processing method is also provided, Figure 3 is a schematic diagram of a text desensitization processing device according to the embodiment of the application, like Figure 3As shown, the text desensitization processing apparatus includes a word segmentation unit 301, a matching unit 303, a first determination unit 305, a second determination unit 307, a third determination unit 309, and a desensitization unit 311. The text desensitization processing apparatus will be described below.

[0074] The word segmentation unit 301 is configured to perform word segmentation processing on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized.

[0075] The matching unit 303 is configured to match the plurality of words with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the fields corresponding to the plurality of sample texts are the same as the field corresponding to the target text.

[0076] The first determination unit 305 is configured to determine the identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user.

[0077] The second determination unit 307 is configured to determine the hash value of the identification code of the user and use the hash value as the key of the at least one sensitive word.

[0078] The third determination unit 309 is configured to determine the desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word.

[0079] The desensitization unit 311 is configured to replace the at least one sensitive word with the desensitization word to desensitize the target text.

[0080] It should be noted that the above word segmentation unit 301, matching unit 303, first determination unit 305, second determination unit 307, third determination unit 309, and desensitization unit 311 correspond to steps S102 to S112 in the above embodiment, and the six units have the same instances and application scenarios as the corresponding steps, but are not limited to the contents disclosed in the above embodiment.

[0081] According to the scheme described in the above embodiment, the target text can be segmented by the segmentation unit to obtain a plurality of words, wherein the target text is the text that needs to be desensitized; then the plurality of words are matched with the sensitive information word library by the matching unit to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is constructed in advance based on a plurality of sample texts and contains a plurality of reference sensitive words, and the fields corresponding to the plurality of sample texts are the same as the field corresponding to the target text; then the identification code of at least one user in the target text is determined by the first determination unit, wherein the identification code is used to uniquely identify the user; the hash value of the identification code of the user is determined by the second determination unit, and the hash value is used as the key of the at least one sensitive word; the desensitization word of the at least one sensitive word is determined based on the key of the at least one sensitive word and the length of the at least one sensitive word by the third determination unit; and the desensitization unit replaces the at least one sensitive word with the desensitization word to desensitize the target text, which realizes the purpose of determining the desensitization word according to the hash value of the identification code of the user extracted from the target text and the length of the sensitive word in the target text, and desensitizing the sensitive word in the target text with the desensitization word, thereby improving the data security. The text desensitization processing device provided in the embodiment of the application solves the technical problem that the data management method in the related art has low reliability and is prone to data leakage.

[0082] In an alternative embodiment, before the target text is segmented, the text desensitization processing device further comprises a cleaning unit configured to clean the target text, wherein the cleaning process comprises at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

[0083] In an alternative embodiment, the segmentation unit comprises one of the following: a first segmentation module configured to segment the target text by using a bidirectional maximum matching method; a second segmentation module configured to segment the target text by using a hidden Markov algorithm; and a third segmentation module configured to segment the target text by using a conditional random field method.

[0084] In an alternative embodiment, the matching unit comprises: a labeling module configured to label each of the plurality of words by a predetermined method to obtain a plurality of labeled words, wherein the predetermined method comprises one of the following: a hidden Markov algorithm and a conditional random field method; a first determination module configured to determine the part of speech of the sensitive word in the target text; a second determination module configured to determine the part of speech of the plurality of labeled words; and a matching module configured to match the part of speech with the sensitive information word library to obtain at least one sensitive word in the plurality of words.

[0085] In an alternative embodiment, the third determining unit comprises: a selection module configured to select the at least one character based on the length of each of the at least one sensitive word; an encryption module configured to perform symmetric encryption on the at least one sensitive word according to the key and the at least one character to obtain symmetrically encrypted at least one sensitive word; a third determining module configured to determine the zero-width character of the hash value; and an acquisition module configured to add the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitized word of the at least one sensitive word.

[0086] In an alternative embodiment, the acquisition module comprises: an adding sub-module configured to add a watermark to the initial desensitized word of the at least one sensitive word after adding the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the initial desensitized word of the at least one sensitive word, to obtain the desensitized word of the at least one sensitive word.

[0087] In an alternative embodiment, the text desensitization processing apparatus further comprises: an extraction module configured to extract the watermark information in the target text after desensitization processing when data is traced back, to obtain the target text after removing the watermark; and a decoding module configured to decode the zero-width character from the target text after removing the watermark to restore the identification code.

[0088] In an alternative embodiment, the text desensitization processing apparatus further comprises: an analysis module configured to analyze the at least one sensitive word after desensitization using the key when data is traced back; and a comparison module configured to compare the at least one sensitive word after desensitization with the at least one sensitive word before desensitization to restore the identification code.

[0089] In an alternative embodiment, the desensitization unit comprises: a fourth determining module configured to determine the position of the at least one sensitive word in the target text; a positioning module configured to position the at least one sensitive word in the target text according to the position; and a replacement module configured to replace the at least one sensitive word positioned in the target text with the desensitized word based on the original text format of the target text.

[0090] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which comprises a stored program, wherein the program performs the text desensitization processing method of any one of the above embodiments.

[0091] Optionally, in the present embodiment, the computer readable storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the communication devices in the communication device group.

[0092] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: performing word segmentation on the target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; matching the plurality of words with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that is pre-constructed based on a plurality of sample texts and contains a plurality of reference sensitive words, and the fields corresponding to the plurality of sample texts are the same as the field corresponding to the target text; determining an identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user; determining a hash value of the identification code of the user, and taking the hash value as a key of the at least one sensitive word; determining a desensitized word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; and replacing the at least one sensitive word with the desensitized word to desensitize the target text.

[0093] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: performing cleaning processing on the target text, wherein the cleaning processing includes at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

[0094] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: performing word segmentation on the target text by using a bidirectional maximum matching method; performing word segmentation on the target text by using a hidden Markov algorithm; and performing word segmentation on the target text by using a conditional random field method.

[0095] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: performing part-of-speech tagging on each of the plurality of words by using a predetermined method to obtain a plurality of tagged words, wherein the predetermined method includes one of the following: a hidden Markov algorithm and a conditional random field method; determining the part-of-speech of the sensitive word in the target text; determining a partial word in the plurality of tagged words that has the same part-of-speech; and matching the partial word with the sensitive information word library to obtain at least one sensitive word in the plurality of words.

[0096] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: selecting at least one character based on the length of each of the at least one sensitive word; performing symmetric encryption on the at least one sensitive word according to the key and the at least one character to obtain symmetrically encrypted at least one sensitive word; determining a zero-width character of the hash value; and adding the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitized word of the at least one sensitive word.

[0097] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: adding a zero-width character to the one less sensitive word after the symmetric encryption to obtain an initial desensitization word of the at least one sensitive word; and adding a watermark to the initial desensitization word to obtain a desensitization word of the at least one sensitive word.

[0098] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: extracting the watermark information in the target text after the desensitization processing to obtain a target text without the watermark; and decoding the zero-width character from the target text without the watermark to restore the identification code.

[0099] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: parsing the at least one sensitive word after the desensitization by using the key; and comparing the at least one sensitive word after the desensitization with the at least one sensitive word before the desensitization to restore the identification code.

[0100] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: determining the position of the at least one sensitive word in the target text; locating the at least one sensitive word in the target text according to the position; and replacing the located at least one sensitive word with the desensitization word based on the original text format of the target text.

[0101] According to another aspect of the embodiments of the present application, a processor is also provided, which is configured to run a program, wherein the program, when running, performs the text desensitization processing method of any one of the above embodiments.

[0102] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0103] In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0104] In the several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit division in the above- described device embodiment is only a logical function division, and there can be another division manner during actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, can be indirect couplings or communication connections through some interfaces, and can be electrical or other forms.

[0105] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0106] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0107] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various program code storage media.

[0108] The above is only the preferred embodiment of the present application, it should be noted that for those skilled in the art, without departing from the principles of the present application, can make a number of improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A text desensitization processing method, characterized in that, The method comprises the following steps: performing word segmentation on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; matching the plurality of words with a sensitive information library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information library is a library that contains a plurality of reference sensitive words and is pre-constructed based on a plurality of sample texts, and the domain corresponding to the sample texts is the same as the domain corresponding to the target text; determining an identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user; determining a hash value of the identification code of the user, and taking the hash value as a key of the at least one sensitive word; determining a desensitized word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; replacing the at least one sensitive word with the desensitized word to desensitize the target text; wherein determining the desensitized word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word comprises: selecting at least one character based on the length of each of the at least one sensitive word; performing symmetric encryption on the at least one sensitive word according to the key and the at least one character to obtain symmetrically encrypted at least one sensitive word; determining a zero-width character of the hash value; and adding the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitized word of the at least one sensitive word.

2. The text desensitization processing method of claim 1, wherein, Before performing word segmentation on the target text, the method further comprises performing cleaning processing on the target text, wherein the cleaning processing comprises at least one of the following operations: splicing error correction processing, character case conversion processing, punctuation symbol conversion processing, and special symbol identification processing.

3. The text desensitization processing method of claim 1, wherein, The word segmentation on the target text comprises one of the following: performing word segmentation on the target text by using a bidirectional maximum matching method; performing word segmentation on the target text by using a hidden Markov algorithm; performing word segmentation on the target text by using a conditional random field method.

4. The text desensitization processing method of claim 1, wherein, The matching of the plurality of words with the sensitive information library to obtain at least one sensitive word in the plurality of words comprises: performing part-of-speech tagging on each of the plurality of words by using a predetermined method to obtain tagged plurality of words, wherein the predetermined method comprises one of the following: a hidden Markov algorithm and a conditional random field method; determining the part-of-speech of the sensitive word in the target text; determining part of the tagged plurality of words that has the same part-of-speech as the sensitive word; matching the part of the words with the sensitive information library to obtain the at least one sensitive word in the plurality of words.

5. The text desensitization processing method of claim 1, wherein, The adding of the zero-width character to the symmetrically encrypted at least one sensitive word to obtain the desensitized word of the at least one sensitive word comprises: after adding the zero-width character to the symmetrically encrypted at least one sensitive word to obtain an initial desensitized word of the at least one sensitive word, adding a watermark to the initial desensitized word to obtain the desensitized word of the at least one sensitive word.

6. The text desensitization processing method of claim 5, wherein, The method further comprises: In data tracing, the watermark information in the target text after desensitization processing is extracted to obtain the target text without watermark; The zero-width character is decoded from the target text without watermark to restore the identification code.

7. The text desensitization processing method of claim 5, wherein, Further comprising: In data tracing, the at least one sensitive word after desensitization is parsed using the key; The at least one sensitive word after desensitization is compared with the at least one sensitive word before desensitization to restore the identification code.

8. The text de-sensitization processing method of any one of claims 1 to 7, wherein, The at least one sensitive word is replaced by the desensitization word, including: The position of the at least one sensitive word in the target text is determined; The at least one sensitive word is located in the target text according to the position; The at least one sensitive word located is replaced by the desensitization word based on the original text format of the target text.

9. A text de-sensitization processing apparatus characterized by comprising: Comprising: The tokenization unit is configured to perform tokenization processing on a target text to obtain a plurality of words, wherein the target text is a text that needs to be desensitized; The matching unit is configured to match the plurality of words with a sensitive information word library to obtain at least one sensitive word in the plurality of words, wherein the sensitive information word library is a word library that contains a plurality of reference sensitive words and is pre-constructed based on a plurality of sample texts, and the domain corresponding to the sample texts is the same as the domain corresponding to the target text; The first determination unit is configured to determine an identification code of at least one user in the target text, wherein the identification code is used to uniquely identify the user; The second determination unit is configured to determine a hash value of the identification code of the user, and use the hash value as a key of the at least one sensitive word; The third determination unit is configured to determine a desensitization word of the at least one sensitive word based on the key of the at least one sensitive word and the length of the at least one sensitive word; The desensitization unit is configured to replace the at least one sensitive word with the desensitization word to desensitize the target text; The third determination unit comprises: a selection module configured to select at least one character based on the length of each of the at least one sensitive word; an encryption module configured to symmetrically encrypt the at least one sensitive word according to the key and the at least one character to obtain the at least one sensitive word after symmetric encryption; a third determination module configured to determine a zero-width character of the hash value; and an acquisition module configured to add the zero-width character to the at least one sensitive word after symmetric encryption to obtain the desensitization word of the at least one sensitive word.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program executes the text desensitization processing method of any one of claims 1 to 8.

11. A processor, comprising: The processor is configured to run a program, wherein the program executes the text desensitization processing method of any one of claims 1 to 8 when running.

Citation Information

Patent Citations

  • Name data desensitization device and method and readable storage medium

    CN111008399A

  • Big data-oriented security data desensitization output method

    CN113065163A

  • Data desensitization method and device, electronic equipment and storage medium

    CN115062338A