A method and device for identifying sensitive information

By combining rule matching and pre-trained sensitive information recognition model to identify sensitive information in text, the lack of recognition in traditional methods under language diversity and complexity is solved, and higher recognition accuracy is achieved.

CN118520116BActive Publication Date: 2024-12-17湖州智慧城市研究院有限公司 +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410986060.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-17
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

When identifying and protecting sensitive information, it is difficult for the prior art to adapt to the diversity and complexity of language, and it is prone to misjudgment or omissions. Traditional rule matching methods cannot effectively identify semantically complex or fuzzy sensitive information.

Method used

Combining rule matching and pre-trained sensitive information recognition model, use feature extraction layer, classification layer and probability output layer to segment and binary classification of the recognized text, output sensitive probability, determine whether the text is sensitive text, and avoid relying solely on traditional rule matching .

Benefits of technology

It improves the accuracy of sensitive information recognition, avoids misjudgment and misjudgment, and can identify known sensitive words and specific content, improving the accuracy of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520116B_ABST
    Figure CN118520116B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a sensitive information identification method and device. The method includes: obtaining a text to be identified, and matching each data line of the text to be identified according to each rule in the rule library; when each data line in the text to be identified does not hit the rule stored in the rule library, inputting the text to be identified into a pre-trained sensitive information identification model; the sensitive information identification model includes: a feature extraction layer, a classification layer, and a probability output layer, the feature extraction layer is used to segment the text to be identified, and extract the text vectors of the separated fields to be identified, the classification layer is used to perform binary classification on the text vectors of each field to be identified according to a neural network, and the probability output layer is used to output the sensitive probability of the text to be identified according to an activation function; when the sensitive probability output by the sensitive information identification model exceeds a preset threshold, the text to be identified is determined to be sensitive text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of information security technology, and specifically to a method and device for identifying sensitive information. Background Art

[0002] In the information age, data security and privacy protection have become key issues around the world. With the development of Internet technology and the advent of the big data era, the storage and transmission of sensitive personal and corporate information such as personal identity information, financial data and business secrets in digital form has increased dramatically. In this context, how to effectively identify and protect this sensitive information and avoid risks caused by illegal access, leakage or abuse has become a technical problem that urgently needs to be solved.

[0003] In related technologies, the identification and protection of sensitive information mainly rely on predefined rules and pattern matching techniques. These methods usually involve comparing clearly defined sensitive keywords or patterns with text data. However, these traditional methods have limitations: first, they often cannot effectively adapt to the diversity and complexity of languages ​​and tend to ignore sensitive information in context; second, this method is not effective when dealing with semantically complex or ambiguous sensitive information, and is prone to misjudgment or omission. Summary of the invention

[0004] The embodiments of this specification provide a sensitive information identification method, device, electronic device, and storage medium, and the technical solutions are as follows:

[0005] In a first aspect, an embodiment of this specification provides a sensitive information identification method, including:

[0006] Acquire the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words;

[0007] In the case that each data row in the text to be recognized does not hit the rule stored in the rule library, the text to be recognized is input into a pre-trained sensitive information recognition model; wherein the sensitive information recognition model comprises: a feature extraction layer, a classification layer, and a probability output layer, wherein the feature extraction layer is used to segment the text to be recognized and extract the text vectors of the separated fields to be recognized, the classification layer is used to perform binary classification on the text vectors of each field to be recognized according to a neural network, and the probability output layer is used to output the sensitivity probability of the text to be recognized according to an activation function;

[0008] When the sensitivity probability output by the sensitive information identification model exceeds a preset threshold, the text to be identified is determined to be sensitive text.

[0009] In a second aspect, an embodiment of the present specification provides a sensitive information identification device, including:

[0010] A matching unit, used to obtain the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words;

[0011] A first input unit, used for inputting the text to be identified into a pre-trained sensitive information identification model when each data row in the text to be identified does not hit the rule stored in the rule library; wherein the sensitive information identification model comprises: a feature extraction layer, a classification layer, and a probability output layer, wherein the feature extraction layer is used for segmenting the text to be identified and extracting the text vectors of the separated fields to be identified, the classification layer is used for binary classification of the text vectors of each field to be identified according to a neural network, and the probability output layer is used for outputting the sensitivity probability of the text to be identified according to an activation function;

[0012] The first determination unit is used to determine that the text to be identified is sensitive text when the sensitivity probability output by the sensitive information identification model exceeds a preset threshold.

[0013] In a third aspect, an embodiment of this specification provides an electronic device, comprising a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method described in the first aspect of the above embodiment.

[0014] In a fourth aspect, an embodiment of this specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the method described in the first aspect of the above embodiment.

[0015] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:

[0016] On the one hand, it is no longer limited to using traditional rule matching methods to identify sensitive information in texts, but instead combines rule matching and model recognition to improve the accuracy of sensitive information recognition. On the other hand, sensitive information in texts is identified based on a pre-trained sensitive information recognition model, which not only analyzes known sensitive words, but also the specific content of the identified fields, thereby avoiding misjudgment and omission of sensitive information, further improving the accuracy of sensitive information recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is an architecture diagram of a sensitive information identification system provided in an embodiment of this specification.

[0019] Figure 2 It is a flowchart of a sensitive information identification method provided in an embodiment of this specification.

[0020] Figure 3 It is a schematic diagram of a sensitive information identification model provided in an embodiment of this specification.

[0021] Figure 4 It is a schematic diagram of a sensitive information identification model training provided in an embodiment of this specification.

[0022] Figure 5 It is a schematic diagram of a desensitization treatment provided in an embodiment of this specification.

[0023] Figure 6 It is a block diagram of a sensitive information identification device provided in an embodiment of this specification.

[0024] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of this specification will be described clearly and completely below in conjunction with the drawings in the embodiments of this specification.

[0026] The terms "first", "second", etc. in the description and claims of this specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0027] In the information age, data security and privacy protection have become key issues around the world. With the development of Internet technology and the advent of the big data era, the storage and transmission of sensitive personal and corporate information such as personal identity information, financial data and business secrets in digital form has increased dramatically. In this context, how to effectively identify and protect this sensitive information and avoid risks caused by illegal access, leakage or abuse has become a technical problem that urgently needs to be solved.

[0028] In related technologies, the identification and protection of sensitive information mainly rely on predefined rules and pattern matching techniques. These methods usually involve comparing clearly defined sensitive keywords or patterns with text data. However, these traditional methods have limitations: first, they often cannot effectively adapt to the diversity and complexity of languages ​​and tend to ignore sensitive information in context; second, this method is not effective when dealing with semantically complex or ambiguous sensitive information, and is prone to misjudgment or omission.

[0029] In recent years, natural language processing (NLP) technology has made significant progress, especially in text analysis and understanding. NLP methods based on machine learning can learn deep language patterns and features from large-scale text data, which provides new possibilities for automatic identification of sensitive information.

[0030] In the existing machine learning-based sensitive information identification methods, most of them first use the rule library to match the field. If sensitive information cannot be matched, the machine learning model is used to predict the probability that the field is sensitive information, and the threshold is used to determine whether the field is a sensitive field. For the identification results, the results are manually judged, and the accurately identified samples and labels are stored in the database to achieve self-learning. At the same time, the identified sensitive fields are desensitized. However, this method has the following disadvantages: (1) For the identification results to be stored in the database, only the sensitive data set is added, and the specific content of the sensitive information is not used; (2) For sensitive fields after desensitization, there is no clear detection method to determine whether there is a risk of leakage in the subsequent use process. For example, whether the results obtained by joint calculation can be used to infer the data of sensitive fields, because even if the data is desensitized, there is still a risk of leakage.

[0031] In order to address the deficiencies in the related art, this specification proposes a new sensitive information identification method.

[0032] See also Figure 1 , Figure 1 FIG. 1 is an architecture diagram of a sensitive information identification system provided by an exemplary embodiment. Figure 1 As shown, a mobile phone 11 and a server 12 may be included.

[0033] The mobile phone 11 is a type of electronic device that can be used by the user. Of course, the electronic devices used by the user are not limited to this. For example, they can also include: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc. This specification does not limit this. During operation, the client program of the sensitive information identification system runs on the mobile phone 11, so that the mobile phone 11 is configured as the client of the sensitive information identification system. The client program can receive the text to be identified input by the user, and forward the text to be identified to the server 12, so that the server 12 processes the text to be identified.

[0034] The server 12 may be a physical server including an independent host, or the server 12 may be a virtual server carried by a host cluster. A rule base 121 and a sensitive information identification model 122 are deployed on the server 12. A server program of a sensitive information identification system is running on the server 12, so that the server 12 is configured as a server of the sensitive information identification system. The server program may cooperate with the above-mentioned client, for example, it may receive the text to be identified sent by the client, and match the text to be identified according to the rules stored in the rule base 121; for example, it may input the received text to be identified into the sensitive information identification model 122 deployed by itself for processing.

[0035] like Figure 1 As shown, the above-mentioned rule base 121 and sensitive information identification model 122 can be deployed on the same device. In this case, the text to be identified does not need to be transmitted multiple times between devices, which can improve the recognition efficiency of sensitive information; or, the above-mentioned rule base 121 and sensitive information identification model 122 can also be deployed on different devices, for example, on two servers belonging to the sensitive information identification system. In this case, sensitive information identification of the text to be identified can be performed simultaneously on different devices based on different methods. On the one hand, it can improve the system operation efficiency, and on the other hand, it can avoid excessive load on a single server, thereby extending the service life of the equipment.

[0036] The interaction between the mobile phone 11 and the server 12 may include various types of wired or wireless interactions, which are not limited in this specification.

[0037] Based on the above-mentioned sensitive information identification system, on the one hand, it is no longer limited to using the traditional rule matching method to identify sensitive information in the text, but combines the two methods of rule matching and model recognition to improve the accuracy of sensitive information recognition; on the other hand, based on the pre-trained sensitive information recognition model, sensitive information in the text is identified, not only for known sensitive words, but also for the specific content of the identified fields. Analyze, thereby avoiding misjudgment and omission of sensitive information, and further improve the accuracy of sensitive information recognition.

[0038] See also Figure 2 , Figure 2 A schematic diagram of a sensitive information identification method provided in an embodiment of this specification is shown. Figure 2 As shown, the sensitive information identification method is applied to a die-casting machine, wherein the die-casting machine is equipped with a pressure sensor, and may at least include the following steps:

[0039] Step 202: Obtain the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words.

[0040] A regular expression (RegEx or RegExp for short) is a pattern used to match character combinations in a string. If a word in the text to be recognized matches the regular expression of sensitive words stored in the rule base, it means that the word is a sensitive word, and thus the text to be recognized is sensitive text.

[0041] Of course, other matching rules can also be stored in the rule table, for example: when a certain character (such as "@") exists in the text to be identified, the text is determined to be sensitive text; or, the text with "XX" as the title is forcibly limited to sensitive text; or, the text containing numbers is limited to sensitive text. This specification does not limit the specific rules stored in the rule table.

[0042] In one embodiment, it further includes: when any data line in the text to be recognized hits a rule stored in the rule base, determining the text to be recognized as sensitive text.

[0043] Step 204: When each data row in the text to be recognized does not hit the rule stored in the rule base, the text to be recognized is input into a pre-trained sensitive information recognition model; wherein the sensitive information recognition model includes: a feature extraction layer, a classification layer, and a probability output layer, the feature extraction layer is used to segment the text to be recognized and extract the text vectors of the separated fields to be recognized, the classification layer is used to perform binary classification on the text vectors of each field to be recognized according to a neural network, and the probability output layer is used to output the sensitivity probability of the text to be recognized according to an activation function.

[0044] In one embodiment, the segmentation is implemented based on jieba, and the extraction of the text vector is implemented based on a bidirectional transformer model.

[0045] Jieba is a Chinese word segmentation tool widely used in Python environment. It supports three word segmentation modes: precise mode, full mode and search engine mode. Precise mode: tries to segment the sentence most accurately, suitable for text analysis; full mode: scans all possible words in the sentence, which is very fast, but cannot guarantee the accuracy of word segmentation; search engine mode: based on the precise mode, long words are segmented again to provide more keywords, which is suitable for word segmentation used in search engine indexing. Any mode can be used for segmentation in this manual.

[0046] The Bidirectional Encoder Representations from Transformers (BERT) model is a pre-trained language representation model that uses the Transformer architecture to capture bidirectional dependencies in text.

[0047] In this embodiment, a more traditional word segmentation method and model are used for feature extraction, which not only reduces the complexity of the model structure and avoids a higher risk of overfitting, but also reduces training costs and improves training efficiency.

[0048] like Figure 3 As shown, the "field to be detected f" corresponds to the aforementioned text to be identified, and the "model" corresponds to the sensitive information identification model. After the rule matching method fails to detect that the text to be identified is sensitive text, the model identification method can be used for re-detection.

[0049] The neural network used in this manual is TextCNN (Convolutional Neural Networks for Text Classification), which is a deep learning model for text classification tasks. It is inspired by the convolutional neural network (CNN) in image processing and applies the convolutional network to text data to capture local features and patterns.

[0050] The main components of TextCNN include: Embedding Layer: Converts words or characters in the text into vector representations in a high-dimensional space, which is the feature extraction layer implemented by the BERT model mentioned above. These vectors can capture the semantic information of words or characters. Convolutional Layer: Similar to the convolution operation in image processing, the convolutional layer slides a window (usually a fixed-size filter) over the output of the embedding layer to extract local features. Each filter can capture features of different lengths and contents. Pooling Layer: Used to reduce the size of the feature map while retaining important information. Common pooling methods include maximum pooling and average pooling. Fully Connected Layer: Converts the output of the convolutional layer and the pooling layer into a single vector, which is then classified through the sigmoid activation function. The characteristics of TextCNN are that its model structure is simple, the training speed is fast, and it can adapt to text inputs of different lengths. In addition, by using filters of different sizes and numbers, TextCNN is able to capture features of different lengths and semantic levels.

[0051] Specifically, the text to be recognized can be segmented. Here, the traditional Jieba word segmentation is used, and stop words are removed. The Bert algorithm is used to extract text features and obtain the word vector matrix:

[0052] ;

[0053] Among them, m is the maximum length L of all texts after text segmentation, and the text vector of the i-th sample is obtained according to the word vector matrix: , the dimension is (L, 768). After obtaining the text vector, the TextCNN algorithm is used to build a binary classification model. The data dimension of the input TextCNN model is: (batch_size, L, 768). After the convolution layer, pooling layer, and fully connected layer + sigmoid, the output vector dimension is (batch_size, 1), and the sensitive information recognition model model is obtained;

[0054] Step 206: When the sensitivity probability output by the sensitive information identification model exceeds a preset threshold, determine that the text to be identified is sensitive text.

[0055] For the field f to be detected, select the first n samples (i.e. the first n fields) in the database table of the field. For these n samples, first use the rule library to match the field name and sample content. If the match is successful, the field is judged to be a sensitive field. If the match fails, use the model model to predict. Assume that the probability value of the prediction of these n samples is , then the final sensitivity probability of the text to be recognized is:

[0056] ;

[0057] Use the preset threshold t for truncation. , then the text to be identified is sensitive text.

[0058] Of course, the method of calculating sensitive probability is not limited to mean calculation. For example, variance can also be used, or directly limiting that "when any probability value exceeds a certain threshold, the text to be identified is sensitive text". This manual does not limit this.

[0059] In this embodiment, on the one hand, it is no longer limited to using the traditional rule matching method to identify sensitive information in the text, but combines the two methods of rule matching and model recognition to improve the accuracy of sensitive information recognition; on the other hand, sensitive information in the text is identified based on a pre-trained sensitive information recognition model, which not only analyzes known sensitive words, but also analyzes the specific content of the identified fields, thereby avoiding misjudgment and omission of sensitive information, further improving the accuracy of sensitive information recognition.

[0060] In one embodiment, a training sample set and a test sample set are obtained, each sample in the training sample set includes a text to be trained and a sensitive identifier corresponding to the text to be trained, and the sensitive identifier is used to identify whether the corresponding sample to be trained is a sensitive text; the training sample set is input into a model to be trained, so that the model to be trained performs the following processing on the sample to be trained: the text to be trained is segmented, and text vectors of the separated fields are extracted; the text vectors of each field are binary classified according to a convolutional neural network for text classification, and the probability value of each field in the training sample being a sensitive field is determined according to an activation function; the sensitive probability of the text to be trained is calculated according to the probability value of the field; the sensitive result corresponding to the text to be trained is determined according to the sensitive probability output by the model to be trained, and the sensitive result is compared with the corresponding sensitive identifier; the model to be trained is optimized according to the comparison result until the model to be trained passes the test of the test sample set; wherein the model to be trained that passes the test is the sensitive information identification model.

[0061] like Figure 4 As shown in the figure, we collect sensitive text dataset T1 and non-sensitive text dataset T2. T1 contains texts with various sensitive information. We select 50,000 samples from each of T1 and T2 and mix them to get the dataset. . Among them, y is a sensitive flag, 0 represents insensitive, and 1 represents sensitive. There are 100,000 data in total, 80% of which are selected as training sets and 20% as test sets.

[0062] The subsequent steps are similar to the above-mentioned steps for identifying sensitive information and will not be repeated here.

[0063] In this embodiment, a method for training a sensitive information recognition model is provided.

[0064] Furthermore, it also includes: when the text to be identified is determined to be sensitive text, the sensitive text is expanded into the training sample set. In this embodiment, by expanding the sensitive text identified by rules or model judgment into the training sample, the model can continuously self-learn based on the expanded training sample set, thereby optimizing the model and improving the accuracy of sensitive information identification.

[0065] Furthermore, it also includes: extracting keywords from the sensitive text according to the word frequency-inverse document frequency algorithm; obtaining the review results for the extracted keywords, and determining whether to determine the keywords as sensitive keywords according to the review results; and expanding the determined sensitive keywords into the rule library.

[0066] Term Frequency-Inverse Document Frequency (TF-IDF) is a weighting algorithm commonly used in text mining and natural language processing to evaluate the importance of a term to a text in a text collection. The TF-IDF algorithm combines two factors: the frequency of a term in a text (TermFrequency, TF), and the distribution of the term in the entire text collection (Inverse Document Frequency, IDF). TF (Term Frequency) refers to the number of times a term appears in a document, or more precisely, the frequency of a term divided by the total number of terms in the document. This avoids giving long documents too high a weight to a term. IDF (Inverse Document Frequency) is designed to penalize terms that appear too frequently in a text collection. If a term appears in many documents, its IDF value will be low, which means that its weight in any individual document will not be very high. IDF can be understood as a measure of the uniqueness of a term. The calculation formula for TF-IDF is usually as follows:

[0067] .

[0068] For texts that are judged to be sensitive, use the TF-IDF algorithm to extract keywords from their text data. Assuming the text is f, segment the text and remove stop words to obtain n words. After segmentation, calculate the TF-IDF value of each word, sort all the words according to the TF-IDF value, and select the top N (e.g. 10) words as potential keywords. Submit for manual review to determine which words should be included in the database as sensitive keywords and expand the rule library.

[0069] In this embodiment, sensitive text is segmented by a word frequency-inverse document frequency algorithm, and sensitive keywords that have been manually reviewed are further expanded to the rule base, thereby improving the accuracy of sensitive information identification.

[0070] In one embodiment, it also includes: desensitizing the sensitive text and performing joint calculation based on the desensitization result; performing correlation analysis on the calculation result of the joint calculation based on the Pearson correlation coefficient, and determining whether the desensitization result has the risk of information leakage based on the analysis result.

[0071] like Figure 5 As shown in the figure, after sensitive information identification is completed, the sensitive fields are desensitized and stored. When the desensitized results are used for joint computing, data leakage detection is performed. Here, it is assumed that the data will participate in multi-party secure computing tasks. By analyzing the correlation between the computing results and the features, it is determined whether the feature has a risk of leakage. Assuming there is a data set , where m is the number of texts, , a total of n words. Participate in multi-party secure computing to get the result , calculate res and x i Correlation coefficient:

[0072] ;

[0073] Where i={1,2,...,m}, when When x i Is it a sensitive word? If x i If it is a sensitive word, the task will be stopped immediately, the data will be locked, and the sensitive word will be protected (i.e. manual review will be performed).

[0074] See also Figure 6 , Figure 6 This is a block diagram of a sensitive information identification device provided in an embodiment of this specification. The device includes:

[0075] A matching unit 602 is used to obtain the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words;

[0076] The first input unit 604 is used to input the text to be recognized into a pre-trained sensitive information recognition model when each data row in the text to be recognized does not hit the rule stored in the rule library; wherein the sensitive information recognition model includes: a feature extraction layer, a classification layer, and a probability output layer, wherein the feature extraction layer is used to segment the text to be recognized and extract the text vectors of the separated fields to be recognized, the classification layer is used to perform binary classification on the text vectors of each field to be recognized according to a neural network, and the probability output layer is used to output the sensitivity probability of the text to be recognized according to an activation function;

[0077] The first determination unit 606 is used to determine that the text to be identified is a sensitive text when the sensitivity probability output by the sensitive information identification model exceeds a preset threshold.

[0078] Optionally, also include:

[0079] An acquisition unit 608 is used to acquire a training sample set and a test sample set, wherein each sample in the training sample set includes a text to be trained and a sensitive identifier corresponding to the text to be trained, and the sensitive identifier is used to identify whether the corresponding sample to be trained is a sensitive text;

[0080] The second input unit 610 is used to input the training sample set into the model to be trained, so that the model to be trained performs the following processing on the samples to be trained: segmenting the text to be trained and extracting the text vectors of the separated fields; performing binary classification on the text vectors of each field according to the convolutional neural network for text classification, and determining the probability value of each field in the training sample being a sensitive field according to the activation function; and calculating the sensitivity probability of the text to be trained according to the probability value of the field;

[0081] A comparison unit 612 is used to determine the sensitive result corresponding to the text to be trained according to the sensitive probability output by the model to be trained, and compare the sensitive result with the corresponding sensitive identifier;

[0082] The optimization unit 614 is used to optimize the model to be trained according to the comparison result until the model to be trained passes the test of the test sample set; wherein the model to be trained that passes the test is the sensitive information identification model.

[0083] Optionally, also include:

[0084] The second determination unit 616 is configured to determine the text to be identified as sensitive text if any data row in the text to be identified matches a rule stored in the rule base.

[0085] Optionally, also include:

[0086] The first expansion unit 618 is used to expand the sensitive text into the training sample set when the text to be identified is determined to be sensitive text.

[0087] Optionally, also include:

[0088] An extraction unit 620, configured to extract keywords from the sensitive text according to a word frequency-inverse document frequency algorithm;

[0089] The third determination unit 622 is used to obtain the review result for the extracted keyword, and determine whether to determine the keyword as a sensitive keyword according to the review result;

[0090] The second expansion unit 624 is used to expand the determined sensitive keywords into the rule base.

[0091] Optionally, also include:

[0092] A desensitization unit 626, configured to perform desensitization processing on the sensitive text and perform joint calculation based on the desensitization result;

[0093] The analysis unit 628 is used to perform a correlation analysis on the calculation result of the joint calculation based on the Pearson correlation coefficient, and determine whether the desensitization result has a risk of information leakage according to the analysis result.

[0094] Optionally, the segmentation is implemented based on jieba, and the extraction of the text vector is implemented based on the BERT model.

[0095] Based on the sensitive information identification device described in multiple embodiments of the present specification, on the one hand, it is no longer limited to using the traditional rule matching method to identify sensitive information in the text, but combines the two methods of rule matching and model recognition to improve the accuracy of sensitive information recognition; on the other hand, based on the pre-trained sensitive information recognition model to identify sensitive information in the text, not only for known sensitive words, but also for the specific content of the identified fields, so as to avoid misjudgment and omission of sensitive information, and further improve the accuracy of sensitive information recognition.

[0096] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the sensitive information identification device embodiment, since it is basically similar to the sensitive information identification method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0097] See also Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown.

[0098] like Figure 7 As shown, the electronic device 700 may include: at least one processor 701 , at least one network interface 704 , a user interface 703 , a memory 705 , and at least one communication bus 702 .

[0099] The communication bus 702 may be used to realize the connection and communication among the above-mentioned components.

[0100] The user interface 703 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0101] The network interface 704 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0102] Among them, the processor 701 may include one or more processing cores. The processor 701 uses various interfaces and lines to connect the various parts of the entire electronic device 700, and executes various functions and processes data of the electronic device 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 705, and calling data stored in the memory 705. Optionally, the processor 701 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 701 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 701, and it can be implemented separately through a chip.

[0103] Among them, the memory 705 may include RAM or ROM. Optionally, the memory 705 includes a non-transitory computer-readable medium. The memory 705 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 705 may also be at least one storage device located away from the aforementioned processor 701. The memory 705 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a sensitive information identification application. The processor 701 may be used to call the sensitive information identification application stored in the memory 705, and perform the steps of sensitive information identification and formulation mentioned in the above-mentioned embodiments.

[0104] The embodiment of the present specification also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes the above-mentioned Figure 2 ~ One or more steps in the embodiment shown in Figure 4. If the various component modules of the above electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).

[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0107] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Without departing from the design spirit of this specification, various modifications and improvements made to the technical solutions of this specification by ordinary technicians in this field should fall within the scope of protection determined by the claims of this specification.

Claims

1. A method for identifying sensitive information, comprising: Acquire the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words; In the case where any data line in the text to be identified hits the rule stored in the rule base, the text to be identified is determined as sensitive text, and keywords are extracted from the sensitive text according to a word frequency-inverse document frequency algorithm; Obtaining a review result for the extracted keyword, and determining whether to determine the keyword as a sensitive keyword according to the review result; Expanding the determined sensitive keywords into the rule base; In the case that each data row in the text to be recognized does not hit the rule stored in the rule library, the text to be recognized is input into a pre-trained sensitive information recognition model; wherein the sensitive information recognition model comprises: a feature extraction layer, a classification layer, and a probability output layer, wherein the feature extraction layer is used to segment the text to be recognized and extract the text vectors of the separated fields to be recognized, the classification layer is used to perform binary classification on the text vectors of each field to be recognized according to a neural network, and the probability output layer is used to output the sensitivity probability of the text to be recognized according to an activation function; When the sensitivity probability output by the sensitive information identification model exceeds a preset threshold, determining that the text to be identified is sensitive text; Desensitizing the sensitive text, and performing joint calculation based on the desensitization result; A correlation analysis is performed on the calculation results of the joint calculation based on the Pearson correlation coefficient, and it is determined whether the desensitized results have a risk of information leakage based on the analysis results.

2. A sensitive information identification method according to claim 1, further comprising: Acquire a training sample set and a test sample set, wherein each sample in the training sample set includes a text to be trained and a sensitive identifier corresponding to the text to be trained, and the sensitive identifier is used to identify whether the corresponding sample to be trained is a sensitive text; The training sample set is input into the model to be trained, so that the model to be trained performs the following processing on the samples to be trained: the text to be trained is segmented, and the text vectors of the separated fields are extracted; the text vectors of each field are binary classified according to the convolutional neural network for text classification, and the probability value of each field in the training sample being a sensitive field is determined according to the activation function; the sensitivity probability of the text to be trained is calculated according to the probability value of the field; Determine the sensitive result corresponding to the text to be trained according to the sensitive probability output by the model to be trained, and compare the sensitive result with the corresponding sensitive identifier; The model to be trained is optimized according to the comparison result until the model to be trained passes the test of the test sample set; wherein the model to be trained that passes the test is the sensitive information identification model.

3. According to the sensitive information identification method described in claim 1, the segmentation is implemented based on Jieba, and the extraction of the text vector is implemented based on a bidirectional transformer model.

4. A sensitive information identification device, comprising: A matching unit, used to obtain the text to be recognized, and match each data line of the text to be recognized according to each rule in a rule base, wherein the rule base stores regular expressions of multiple sensitive words; An extraction unit, configured to determine the text to be identified as sensitive text when any data row in the text to be identified hits a rule stored in the rule base, and to extract keywords from the sensitive text according to a word frequency-inverse document frequency algorithm; A second determination unit, configured to obtain a review result for the extracted keyword, and determine whether to determine the keyword as a sensitive keyword according to the review result; An expansion unit, used to expand the determined sensitive keywords into the rule base; A first input unit, used for inputting the text to be identified into a pre-trained sensitive information identification model when each data row in the text to be identified does not hit a rule stored in the rule library; wherein the sensitive information identification model comprises: a feature extraction layer, a classification layer, and a probability output layer, wherein the feature extraction layer is used for segmenting the text to be identified and extracting text vectors of the separated fields to be identified, the classification layer is used for binary classification of the text vectors of each field to be identified according to a neural network, and the probability output layer is used for outputting the sensitivity probability of the text to be identified according to an activation function; A first determination unit, configured to determine that the text to be identified is a sensitive text when the sensitivity probability output by the sensitive information identification model exceeds a preset threshold; A desensitization unit, used for desensitizing the sensitive text and performing joint calculation according to the desensitization result; An analysis unit is used to perform a correlation analysis on the calculation results of the joint calculation based on the Pearson correlation coefficient, and determine whether there is a risk of information leakage in the desensitization result according to the analysis result.

5. An electronic device comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.