A method and device for adaptive sensitive information extraction
By classifying rich text and using different methods to identify sensitive information in code and plain text files, the limitations of existing technologies in identifying and extracting sensitive information are solved, achieving more comprehensive identification and extraction of sensitive information.
Patent Information
- Application Number
- CN202411392344.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing technologies have limitations in identifying and extracting sensitive information, especially in processing rich text and in the detailed classification of sensitive information types.
An adaptive sensitive information extraction method is adopted. By classifying rich text, code files and non-code files are distinguished. Sensitive information is extracted from code files and plain text files respectively using large model code understanding method, rule matching method and multi-granularity association sensitive information recognition method.
It achieves comprehensive identification of different types of files and sensitive information, improves the accuracy and comprehensiveness of sensitive information extraction, and solves the limitations of existing technologies.
Smart Images

Figure CN119416887B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to an adaptive sensitive information extraction method and apparatus. Background Technology
[0002] Information technology is a major trend in current economic and social development, and electronic documents are gradually becoming the primary form of data storage and transmission. With the continuous advancement of information technology, information security faces increasingly severe challenges. The leakage of sensitive information can cause varying degrees of loss to relevant individuals or organizations. Therefore, identifying sensitive information in various documents is crucial for the healthy development of the internet.
[0003] Currently, existing sensitive information identification schemes can be mainly divided into two categories: 1. Matching-based methods. This method uses sensitive word detection to find whether a text contains sensitive information. However, this requires pre-constructing a sensitive word list, and the maintenance cost is high. 2. Deep learning-based methods. This method uses deep learning models to automatically learn relevant features to identify potential sensitive information and its types in the text. However, this method often cannot classify the types of sensitive information in detail.
[0004] With increasing demands for detection, traditional methods have certain limitations. In practical applications, sensitive information is often found within various rich text formats, not just plain text, and the types of this sensitive information are also diverse. Furthermore, identifying the relationships between sensitive information—that is, which pieces of sensitive information belong to the same entity—will aid in further analysis, thereby obtaining more comprehensive identification results.
[0005] There is currently no effective solution to the problem of limitations in the extraction of sensitive information in existing technologies. Summary of the Invention
[0006] This invention provides an adaptive sensitive information extraction method and apparatus to address the limitations of existing technologies in sensitive information extraction.
[0007] In a first aspect, the present invention provides an adaptive sensitive information extraction method, comprising:
[0008] Obtain rich text and classify it; the rich text includes code files and non-code files;
[0009] The non-code file is processed to convert it into a plain text file;
[0010] Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from the code file and the plain text file to obtain the target sensitive information; the information identification method includes a large model code understanding method, a rule matching method, and a multi-granularity associated sensitive information identification method.
[0011] According to an adaptive sensitive information extraction method provided by the present invention, data processing is performed on the non-code file to convert the non-code file into a plain text file, including:
[0012] The non-code file is converted into a plain text file by recognizing text in the image file using optical character recognition (OCR) and by recognizing text information in the non-code file using an open-source library.
[0013] According to an adaptive sensitive information extraction method provided by the present invention, an information identification method is selected based on the type of sensitive information to be identified, and sensitive information is extracted from the code file and the plain text file, including:
[0014] Sensitive information is extracted from the code file using a large model code understanding method;
[0015] For rule-sensitive information in the plain text file, a rule matching method is used to extract sensitive information;
[0016] For irregular sensitive information in the plain text file, a multi-granularity association sensitive information identification method is used to extract sensitive information.
[0017] An adaptive sensitive information extraction method provided by the present invention extracts sensitive information from the code file using a large model code understanding method, including:
[0018] Using pre-trained code to understand large language models;
[0019] The code file is used as input to the large language model for code understanding, and the target sensitive information in the code file is output.
[0020] According to an adaptive sensitive information extraction method provided by the present invention, training the code understanding large language model includes:
[0021] Obtain code training data and manually annotate sensitive information segments in the code training data;
[0022] Using the sensitive information segment as a label, the code understanding large language model is trained and fine-tuned using the code training data.
[0023] An adaptive sensitive information extraction method provided by the present invention employs a multi-granularity associated sensitive information identification method for sensitive information extraction, including:
[0024] The plain text files are evaluated for importance and filtered to obtain the filtered text.
[0025] The selected text is encoded using a language representation model, and word representations are generated using a bidirectional long short-term memory network.
[0026] A two-dimensional vocabulary representation for the plain text file is generated based on the word representation; the two-dimensional vocabulary representation contains several word pairs.
[0027] The interaction between word pairs at different distances in the two-dimensional vocabulary representation is captured by two-dimensional dilated convolution, resulting in a word pair grid representation;
[0028] The relation distribution of each word pair in the word pair grid representation is determined by a classifier, and the relation distribution result is obtained.
[0029] Based on the relationship distribution results, predict the relationships between word pairs, determine sensitive information clusters, and extract sensitive information based on the sensitive information clusters.
[0030] According to an adaptive sensitive information extraction method provided by the present invention, the plain text file is evaluated for importance and filtered to obtain filtered text, including:
[0031] The trained extractive summarization model is invoked, and the plain text file is used as input to output the filtered text; the filtered text consists of sentences and surrounding sentences in the plain text file that contain sensitive information.
[0032] According to an adaptive sensitive information extraction method provided by the present invention, training the extractive summarization model includes:
[0033] Acquire sensitive open-source information and generate unstructured data through a large language model to build a training dataset;
[0034] With the goal of minimizing the model loss of the extractive summarization model, the extractive summarization model is fine-tuned using the training dataset.
[0035] An adaptive sensitive information extraction method provided by the present invention, which performs data augmentation through a large language model, includes:
[0036] Given a task description, candidate suggestions for the task description are generated using a large language model;
[0037] The candidate suggestions are evaluated and optimized to obtain alternative suggestions;
[0038] The prompt learning template is input into the large language model, and unstructured data is generated based on the optional prompts.
[0039] Secondly, the present invention also provides an adaptive sensitive information extraction device, comprising:
[0040] An acquisition module is used to acquire rich text and classify the rich text; the rich text includes code files and non-code files;
[0041] The processing module is used to process the non-code file and convert it into a plain text file.
[0042] The identification module is used to select an information identification method based on the type of sensitive information to be identified, and to extract sensitive information from the code file and the plain text file to obtain the target sensitive information; the information identification method includes a large model code understanding method, a rule matching method, and a multi-granularity associated sensitive information identification method.
[0043] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the adaptive sensitive information extraction method as described in the first aspect above.
[0044] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the adaptive sensitive information extraction method as described in the first aspect above.
[0045] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the adaptive sensitive information extraction method as described in the first aspect above.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The adaptive sensitive information extraction method provided by this invention distinguishes between rich text types, filtering out code files and non-code files. To more fully understand and identify sensitive information in non-code files, data processing is performed on the non-code files to understand the text information in the images, converting the non-code files into plain text files. Finally, based on the type of sensitive information to be identified and the file type, the corresponding information recognition method is selected to extract sensitive information from both the code files and plain text files, obtaining the target sensitive information. In the above process, different information recognition methods are designed according to different file types and sensitive information types, thereby obtaining more comprehensive recognition results and solving the problem of limitations in sensitive information extraction in existing technologies. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0049] Figure 1 This is a flowchart of the adaptive sensitive information extraction method provided by the present invention;
[0050] Figure 2 This is a flowchart of the process of extracting sensitive information from rich text in an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of the prompt word structure of a large language model code understanding method in an embodiment of the present invention;
[0052] Figure 4 This is a flowchart of large language model data augmentation in an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of a method for simultaneously modeling sensitive information, type, and the correlation between sensitive information in an embodiment of the present invention;
[0054] Figure 6 This is a flowchart of the sensitive information extraction method using a multi-granularity associated sensitive information identification method in an embodiment of the present invention;
[0055] Figure 7 This is a structural block diagram of the adaptive sensitive information extraction device provided by the present invention;
[0056] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0058] This invention provides an adaptive sensitive information extraction method. Figure 1 This is a flowchart of the adaptive sensitive information extraction method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0059] Step S101: Obtain rich text and classify it; rich text includes code files and non-code files.
[0060] Step S102: Perform data processing on the non-code file to convert it into a plain text file.
[0061] Step S103: Select an information identification method based on the type of sensitive information to be identified, and extract sensitive information from the code file and plain text file to obtain the target sensitive information; the information identification methods include large model code understanding method, rule matching method and multi-granularity associated sensitive information identification method.
[0062] In this method, firstly, rich text for which sensitive information extraction is required is obtained, and the rich text is differentiated by type, filtering out code files and non-code files. Since non-code files may contain not only text content but also images, this method performs data processing on the non-code files to understand the text information in the images and convert them into plain text files in order to more fully understand and identify the sensitive information. Finally, based on the type of sensitive information to be identified and the file type, the corresponding information recognition method is selected to extract sensitive information from both the code files and plain text files, obtaining the target sensitive information. In this process, different information recognition methods are designed according to different file types and sensitive information types, thereby obtaining more comprehensive recognition results and solving the problem of limitations in sensitive information extraction in existing technologies.
[0063] In some embodiments, step S102 involves data processing of the non-code file to convert it into a plain text file. This includes: recognizing text in image files within the non-code file using Optical Character Recognition (OCR) and recognizing text information within the non-code file using an open-source library, thereby converting the non-code file into a plain text file. In this embodiment, converting the non-code file into a plain text file allows for a full understanding of the information content within the non-code file, preventing information omissions and improving the comprehensiveness and accuracy of sensitive information extraction.
[0064] Figure 2 This is a flowchart of the process for extracting sensitive information from rich text in an embodiment of the present invention, such as... Figure 2As shown, in some embodiments, step S103 involves selecting an information identification method based on the type of sensitive information to be identified, and extracting sensitive information from code files and plain text files. This includes: extracting sensitive information from code files using a large model code understanding method; extracting sensitive information from plain text files using a rule matching method for rule-based sensitive information; and extracting sensitive information from plain text files using a multi-granularity association sensitive information identification method for non-rule-based sensitive information.
[0065] Specifically, sensitive information is extracted from code files using a large-scale model code understanding method, including: calling a pre-trained code understanding large language model; using the code file as input to the code understanding large language model, and outputting the target sensitive information in the code file.
[0066] In this implementation plan, training the code understanding large language model includes: acquiring code training data and manually annotating sensitive information segments in the code training data; using the sensitive information segments as labels, training and fine-tuning the code understanding large language model through the code training data.
[0067] For example, using a large language model like Llama2, which has code understanding capabilities and includes a large amount of code training data during pre-training, we manually annotate sections containing sensitive information. We then select several high-quality, manually generated data examples as input examples to form a list of input-output pairs. The code text to be extracted is added to the end of the prompts, allowing the large language model to determine the input distribution, output distribution, input-output mapping, and format. Figure 3 As shown, Figure 3 This is a schematic diagram of the prompt word structure of a large language model code understanding method in an embodiment of the present invention.
[0068] For rule-sensitive information in plain text files, rule-sensitive information usually has a clear paradigm, such as regular expressions corresponding to IP addresses and email addresses. Therefore, in this method, predefined templates and rules are used to extract sensitive information, which can improve the accuracy of sensitive information extraction.
[0069] A multi-granularity association-based sensitive information identification method is employed for sensitive information extraction, including: assessing and filtering the importance of plain text files to obtain filtered text; encoding the filtered text using a language representation model and generating word representations through a bidirectional long short-term memory network; generating a two-dimensional vocabulary representation for the plain text files based on the word representations; the two-dimensional vocabulary representation containing several word pairs; capturing the interactions between word pairs at different distances in the two-dimensional vocabulary representation through two-dimensional dilated convolution to obtain a word pair grid representation; determining the relation distribution of each word pair in the word pair grid representation using a classifier to obtain the relation distribution results; predicting the relationships between word pairs based on the relation distribution results to determine sensitive information clusters, and extracting sensitive information based on these clusters.
[0070] More specifically, the importance assessment and filtering of plain text files are performed to obtain filtered text, including: calling the trained extractive summarization model, taking the plain text file as input, and outputting the filtered text; the filtered text consists of sentences in the plain text file that contain sensitive information, as well as sentences before and after them.
[0071] The training of the extractive summarization model includes: acquiring open-source sensitive information data and generating unstructured data through a large language model to construct a training dataset; and fine-tuning the extractive summarization model using the training dataset with the goal of minimizing the model loss.
[0072] In this implementation scheme, data augmentation is performed using a large language model, including: given a task description, generating candidate prompts for the task description using a large language model; evaluating and optimizing the candidate prompts to obtain optional prompts; inputting the prompt learning template into the large language model, and generating unstructured data based on the optional prompts.
[0073] For example, to support the training and testing of large language models, and considering the limitations of open-source data such as insufficient information, inconsistent data quality, relatively simple data structure, and insufficient data volume, a training dataset is established by crawling open-source sensitive information data and utilizing large model data augmentation. For instance... Figure 4 As shown, Figure 4 This is a flowchart of data augmentation for a large language model in this embodiment of the invention. Given a task description, dynamic prompts and a self-checking mechanism are used to generate prompts. The large language model generates multiple candidate prompts at once, and in the next round, it is required to evaluate the candidate prompts, select the best prompt, and provide a reason. In each call, the best prompt evaluated by humans is added to the examples to improve in-context capabilities. After obtaining the possible prompts, unstructured data generated by open-source tools is integrated, and data augmentation is achieved using the large language model.
[0074] To simultaneously identify sensitive information and its relevance, the task of extracting associated sensitive information tuples is treated as a word-pairs relationship classification task. A method is proposed that utilizes a two-dimensional word-pairs table and three types of word-pair relationships to model associated sensitive information tuples. The three types of word-pair relationships are:
[0075] Next-Neighboring-information- (NNI- This indicates that two words are adjacent in the same information cluster, and the sub-relation " "Indicates the type of sensitive information;
[0076] Tail-Head-information- (THI- ), indicating that a cycle is formed, representing a cluster, and the subrelation " "Indicates the type of sensitive information;
[0077] None indicates that the two sensitive information items are not in the same cluster or do not belong to sensitive information.
[0078] Figure 5 This is a schematic diagram of a method for simultaneously modeling sensitive information, type, and the correlation between sensitive information in an embodiment of the present invention, as shown below. Figure 5 As shown, the example contains two clusters of related sensitive information: "{Account: zhangs, Password: 000}" and "{Name: Wang Wu, Phone Number: 223800}". To avoid sparsity of relation instances, NNI (N) and THI (T) relations are marked in the upper and lower triangular regions, respectively. In the figure, based on the NNI relation, (zhangs -> 000), (Wang -> Wu), and (Wu -> 223800) can be easily obtained. The THI relation indicates the start and end positions of the related information clusters, resulting in (000 -> zhangs) and (223800 -> Wang). Combining these with the sensitive information type sub-relation, the two related sensitive information clusters {Account: zhangs, Password: 000} and {Name: Wang Wu, Phone Number: 223800} can be decoded.
[0079] Figure 6 This is a flowchart illustrating the sensitive information extraction process using a multi-granularity associated sensitive information identification method in an embodiment of the present invention, such as... Figure 6As shown, firstly, sentence importance is evaluated, filtering out sentences that directly contain sensitive information or contextual semantics. Using a pre-built training dataset, the original text is input, and the expected output is constructed as sentences containing sensitive information and their preceding and following sentences. An extractive summarization model is trained to achieve data processing efficiency and prevent excessive computational complexity in subsequent steps. Then, the filtered sentences are encoded using a Bidirectional Encoder Representations from Transformers (BERT), which has proven to be one of the most state-of-the-art models for representation learning relation classification. To further enhance contextual modeling, a Bidirectional Long Short-Term Memory (LSTM) network is used to generate the final word representations. The input to BERT consists of three parts: token embeddings, position embeddings, and segment embeddings, which model word, position, and sentence information, respectively. Inspired by BERT, a similar approach is used to enrich the word-pair grid representation. Then, the three embeddings are concatenated and dimensionality is reduced using a Multilayer Perceptron (MLP) to obtain a positional region-aware representation of the word-pair grid. The entire process can be formulated as follows:
[0080]
[0081] Where C represents the word pair grid, the feature vector V represents word information, obtained using a conditional normalization layer, and the feature vector E d The feature vector E represents the relative positional information between word pairs. t This indicates the area information used to distinguish between the lower triangular area and the upper triangular area in the table.
[0082] Then, multiple two-dimensional dilated convolutions (DConv) with different dilation rates were used to capture the interaction between word pairs at different distances, as shown in the following formula:
[0083]
[0084] Among them, Q l This represents the output of a dilated convolution with a dilation rate of 1. Let C represent the GELU activation function and C represent the word pair grid. Through the above process, the formula for the word pair grid representation is obtained as follows:
[0085]
[0086] Where Q represents the word pair grid representation, Q l Q represents the output of a dilated convolution with a dilation rate of 1. 2 Q represents the output of a dilated convolution with a dilation rate of 2. 3This represents the output of a dilated convolution with a dilation rate of 3. Then, a classifier is used to compute the output of each word pair (x) in the word pair grid representation. i ,x j The model calculates the loss of the relationship distribution between word pairs using the cross-entropy loss function during the training phase, and selects the relationship with the highest probability as the predicted relationship between each word pair during the prediction phase. Finally, the relationships between word pairs are decoded. The goal of the model is to predict the relationships between word pairs, which can be considered as a directed vocabulary. The purpose of decoding is to use Neural Network Intelligence (NNI) relations to find specific paths from one word to another in the graph. Each path corresponds to a sensitive information cluster, and the THI relation indicates the start and end positions of the path, helping to determine the boundaries of the clusters and obtain the sensitive information clusters.
[0087] Furthermore, in this method, for the same sensitive file, the multi-granularity associated sensitive information identification method and the rule-based matching method extract sensitive information for different types of sensitive information. The former can identify the correlation, that is, it can identify sensitive information clusters, while the latter can only identify independent sensitive information. In order to perform information fusion, a threshold is set. If a piece of information is within this threshold, it is added to the cluster. If it exceeds this threshold, it is formed into a separate cluster. Common sense knowledge, such as IP and port, and account and password usually appear together, is also added to further improve the fusion effect.
[0088] The present invention also provides an adaptive sensitive information extraction device. The adaptive sensitive information extraction device provided by the present invention will be described below. The adaptive sensitive information extraction device described below can be referred to in correspondence with the adaptive sensitive information extraction method described above. Figure 7 This is a structural block diagram of the adaptive sensitive information extraction device provided by the present invention, as shown below. Figure 7 As shown, the device includes:
[0089] The acquisition module 701 is used to acquire rich text and classify it; the rich text includes code files and non-code files.
[0090] Processing module 702 is used to process non-code files and convert them into plain text files;
[0091] The identification module 703 is used to select an information identification method based on the type of sensitive information to be identified, and to extract sensitive information from code files and plain text files to obtain the target sensitive information. The information identification methods include large model code understanding method, rule matching method and multi-granularity associated sensitive information identification method.
[0092] In use, this device first acquires the rich text from which sensitive information needs to be extracted, and then distinguishes between code files and non-code files based on the type of rich text. Since non-code files may contain not only text content but also images, the processing module 702 processes the data in the non-code files to understand the text information in the images and convert the non-code files into plain text files. Finally, the recognition module 703 selects the appropriate information recognition method based on the type of sensitive information and the file type to extract sensitive information from both the code files and plain text files, obtaining the target sensitive information. In this process, different information recognition methods are designed according to different file types and sensitive information types, thereby obtaining more comprehensive recognition results and solving the problem of limitations in sensitive information extraction in existing technologies.
[0093] Figure 8 An example of a physical structure diagram of an electronic device is shown below. Figure 8 As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other via the communication bus 804. The processor 801 can call logical instructions in the memory 803 to execute an adaptive sensitive information extraction method, which includes:
[0094] Retrieve rich text and categorize it; rich text includes code files and non-code files;
[0095] Perform data processing on non-code files, converting them into plain text files;
[0096] Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from code files and plain text files to obtain the target sensitive information. The information identification methods include large model code understanding methods, rule matching methods, and multi-granularity associated sensitive information identification methods.
[0097] Furthermore, the logical instructions in the aforementioned memory 803 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0098] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the adaptive sensitive information extraction method provided by the above methods, the method including:
[0099] Retrieve rich text and categorize it; rich text includes code files and non-code files;
[0100] Perform data processing on non-code files, converting them into plain text files;
[0101] Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from code files and plain text files to obtain the target sensitive information. The information identification methods include large model code understanding methods, rule matching methods, and multi-granularity associated sensitive information identification methods.
[0102] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the adaptive sensitive information extraction method provided by the methods described above, the method comprising:
[0103] Retrieve rich text and categorize it; rich text includes code files and non-code files;
[0104] Perform data processing on non-code files, converting them into plain text files;
[0105] Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from code files and plain text files to obtain the target sensitive information. The information identification methods include large model code understanding methods, rule matching methods, and multi-granularity associated sensitive information identification methods.
[0106] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0107] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An adaptive sensitive information extraction method, characterized in that, include: Obtain rich text and classify the rich text; The rich text includes code files and non-code files; The non-code file is processed to convert it into a plain text file; Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from the code file and the plain text file to obtain the target sensitive information; The information recognition methods include large model code understanding methods, rule matching methods, and multi-granularity associated sensitive information recognition methods; Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from the code file and the plain text file, including: Sensitive information is extracted from the code file using a large model code understanding method; For rule-sensitive information in the plain text file, a rule matching method is used to extract sensitive information; For irregular sensitive information in the plain text file, a multi-granularity association sensitive information identification method is used to extract sensitive information. Sensitive information extraction is performed using a multi-granularity correlation-based sensitive information identification method, including: The plain text files are evaluated for importance and filtered to obtain the filtered text. The selected text is encoded using a language representation model, and word representations are generated using a bidirectional long short-term memory network. A two-dimensional vocabulary representation for the plain text file is generated based on the word representation; the two-dimensional vocabulary representation contains several word pairs. The interaction between word pairs at different distances in the two-dimensional vocabulary representation is captured by two-dimensional dilated convolution, resulting in a word pair grid representation; The relation distribution of each word pair in the word pair grid representation is determined by a classifier, and the relation distribution result is obtained. Based on the relationship distribution results, predict the relationships between word pairs, determine sensitive information clusters, and extract sensitive information based on the sensitive information clusters.
2. The adaptive sensitive information extraction method according to claim 1, characterized in that, Data processing is performed on the non-code file to convert it into a plain text file, including: The non-code file is converted into a plain text file by recognizing text in the image file using optical character recognition (OCR) and by recognizing text information in the non-code file using an open-source library.
3. The adaptive sensitive information extraction method according to claim 1, characterized in that, Sensitive information is extracted from the code file using a large model code understanding method, including: Using pre-trained code to understand large language models; The code file is used as input to the large language model for code understanding, and the target sensitive information in the code file is output.
4. The adaptive sensitive information extraction method according to claim 3, characterized in that, Training the large language model for code understanding includes: Obtain code training data and manually annotate sensitive information segments in the code training data; Using the sensitive information segment as a label, the code understanding large language model is trained and fine-tuned using the code training data.
5. The adaptive sensitive information extraction method according to claim 4, characterized in that, The plain text files are evaluated for importance and filtered to obtain filtered text, including: The trained extractive summarization model is invoked, and the plain text file is used as input to output the filtered text; the filtered text consists of sentences and surrounding sentences in the plain text file that contain sensitive information.
6. The adaptive sensitive information extraction method according to claim 5, characterized in that, Training the extractive summarization model includes: Acquire sensitive open-source information and generate unstructured data through a large language model to build a training dataset; With the goal of minimizing the model loss of the extractive summarization model, the extractive summarization model is fine-tuned using the training dataset.
7. The adaptive sensitive information extraction method according to claim 6, characterized in that, Data augmentation through large language models includes: Given a task description, candidate suggestions for the task description are generated using a large language model; The candidate suggestions are evaluated and optimized to obtain alternative suggestions; The prompt learning template is input into the large language model, and unstructured data is generated based on the optional prompts.
8. An adaptive sensitive information extraction device, characterized in that, include: The acquisition module is used to acquire rich text and classify the rich text. The rich text includes code files and non-code files; The processing module is used to process the non-code file and convert it into a plain text file. The identification module is used to select an information identification method according to the type of sensitive information to be identified, and to extract sensitive information from the code file and the plain text file to obtain the target sensitive information; The information recognition methods include large model code understanding methods, rule matching methods, and multi-granularity associated sensitive information recognition methods; Based on the type of sensitive information to be identified, an information identification method is selected, and sensitive information is extracted from the code file and the plain text file, including: Sensitive information is extracted from the code file using a large model code understanding method; For rule-sensitive information in the plain text file, a rule matching method is used to extract sensitive information; For irregular sensitive information in the plain text file, a multi-granularity association sensitive information identification method is used to extract sensitive information. Sensitive information extraction is performed using a multi-granularity correlation-based sensitive information identification method, including: The plain text files are evaluated for importance and filtered to obtain the filtered text. The selected text is encoded using a language representation model, and word representations are generated using a bidirectional long short-term memory network. A two-dimensional vocabulary representation for the plain text file is generated based on the word representation; the two-dimensional vocabulary representation contains several word pairs. The interaction between word pairs at different distances in the two-dimensional vocabulary representation is captured by two-dimensional dilated convolution, resulting in a word pair grid representation; The relation distribution of each word pair in the word pair grid representation is determined by a classifier, and the relation distribution result is obtained. Based on the relationship distribution results, predict the relationships between word pairs, determine sensitive information clusters, and extract sensitive information based on the sensitive information clusters.
Citation Information
Patent Citations
Power system communication sensitive information identification method and system, and storage medium
CN115204164A
General text desensitization method and device based on large language model and thinking chain technology
CN118133348A