Sensitive information identification method, system and device, storage medium and program product
By combining the integration solution of large-scale pre-trained language models and RAG technology, the accurate identification and classification of massive sensitive data in the power industry is achieved, and the problem of insufficient recognition accuracy and grading accuracy of traditional methods is solved, and data security and compliance are improved.
Patent Information
- Application Number
- CN202510065175.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional rules and keyword-based sensitive information recognition methods cannot effectively meet the diversity and complexity of massive sensitive data in the power industry, resulting in insufficient recognition accuracy and grading accuracy.
A fusion scheme combining large-scale pre-trained language models and RAG technology is adopted to achieve accurate identification and classification and grading of sensitive information through similarity calculation and multi-dimensional feature extraction. The specific steps include obtaining the text to be analyzed, calculating the similarity of the knowledge database, combining the text data, and inputting the hierarchical classification model to output the classification hierarchical results of sensitive information.
It improves the classification and grading accuracy of sensitive information, provides an efficient and intelligent solution, suitable for sensitive data protection of power information systems, and enhances data security and compliance.
Smart Images

Figure CN119513231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a sensitive information identification method, system, device, storage medium and program product. Background Art
[0002] In some industries, personal information, equipment parameter information, configuration information, etc. are all sensitive information. The leakage of this information may have a significant impact on personal privacy, security, and the operation and reputation of the enterprise.
[0003] Taking the power industry as an example, in the operation and management of power information systems, the identification and hierarchical management of sensitive information has gradually become an important part of ensuring data security and compliance. With the acceleration of the digital transformation of the power industry, massive amounts of sensitive data are constantly generated in scenarios such as power dispatching, equipment monitoring, and customer management. The diversity and complexity of these data make traditional rules- and keywords-based sensitive information identification methods unable to fully meet actual needs. Summary of the invention
[0004] In view of this, the present invention provides a sensitive information identification method, system, device, storage medium and program product to achieve accurate identification of sensitive information and classification and stratification of sensitive information.
[0005] In a first aspect, the present invention provides a sensitive information identification method, the method comprising: Get the text to be analyzed; Calculate the similarity between the text to be analyzed and the pre-built knowledge database, and determine a preset number of knowledge sub-databases with the highest similarity rankings in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information; Combining the text to be analyzed with the knowledge sub-database to obtain text data; Input the text data into the pre-built hierarchical classification model, and output the sensitive information classification and grading results corresponding to the text to be analyzed.
[0006] The present invention is a fusion solution combining large pre-trained language models and RAG technology. RAG technology combines the generation capability of large pre-trained language models with the precise positioning advantage of information retrieval systems to achieve more detailed block processing and multi-dimensional feature extraction of sensitive data. This method can not only improve the depth of context understanding through fine-grained text block strategies, but also provide flexible and intelligent responses for different business needs, providing an efficient and intelligent solution for sensitive data protection in power information systems, and further improving the classification and grading accuracy of sensitive information.
[0007] In an optional implementation, the knowledge database is established by the following steps: Collect classified and graded data sets; The classified and graded data set is divided into blocks using a preset block strategy to obtain block data; Convert the block data into vectors, and store the converted block data into a vector database; Use the vector database as a knowledge database.
[0008] In this implementation, a RAG search vector database based on Embedding is established, which can provide background knowledge dependency for the output of the large model, making it convenient for the large model to obtain and input the most similar Top K background knowledge through RAG retrieval.
[0009] In an optional implementation, a preset block strategy is used to block the classified and graded data set, including: Divide the classification and grading data set into blocks based on a preset number of characters; and / or, partitioning the classified and graded data set into blocks based on a preset sliding window size; And / or, dividing the classified and graded data set into blocks based on a file type data extraction strategy; the file type data extraction strategy includes: determining the text type in the classified and graded data set; calling a text parsing tool corresponding to the text type; and extracting information from the classified and graded data set using the text parsing tool; And / or, the classification and grading dataset is partitioned based on a recursive calling strategy.
[0010] In this implementation, a multi-dimensional text segmentation strategy can be adopted to achieve accurate and flexible RAG retrieval and question-answer response in massive and complex data, thereby achieving accurate classification and grading of sensitive information, and providing more intelligent and reliable technical support for the security protection of the power information system.
[0011] In an optional embodiment, the hierarchical classification model is established by the following steps: Get the base model; Obtain a pre-built text classification hierarchical fine-tuning dataset, which is extracted from generalized text; The base model is fine-tuned based on the text classification hierarchical fine-tuning dataset to obtain a fine-tuned hierarchical classification large model.
[0012] In this implementation, targeted fine-tuning is performed in conjunction with the large model, which effectively improves the large model's ability to identify and understand sensitive data, and is conducive to improving the accuracy of sensitive information classification and grading.
[0013] In an optional implementation, fine-tuning the base model based on the text classification hierarchical fine-tuning dataset includes: The LoRA architecture is used to fine-tune the base model; the LoRA architecture is: ; in, is the input vector with dimension ; is the weight matrix, with dimension ; is a low-rank matrix with dimension ; is a low-rank matrix with dimension ; is the output matrix with dimension ; is the rank of LoRA, is a constant.
[0014] In this implementation, LoRA significantly reduces computational and storage overheads by only adjusting the parameters of the low-rank matrix, improving the efficiency of the fine-tuning process. In addition, the LoRA architecture enables the base model to quickly adapt to different tasks and retains most of the pre-trained knowledge, enhancing the task migration capability of the large model, which can effectively improve the recognition accuracy of the large model.
[0015] In an optional implementation, a similarity function is used to calculate the similarity between the text to be analyzed and the knowledge database, and the similarity function is: ; in, The input data after the text vector is converted to be analyzed; is any vector data in the knowledge database; For vector The modulus and vector The product of the modulos.
[0016] In this implementation, the top K most similar knowledge sub-databases are calculated through cosine similarity, which can provide relevant contextual information for the large model, improve the accuracy and contextual understanding ability of the large model when processing the text to be analyzed, and further improve the accuracy of classification and grading of sensitive information.
[0017] In a second aspect, the present invention provides a sensitive information identification system, the system comprising: The acquisition module is used to obtain the text to be analyzed; A calculation module is used to calculate the similarity between the text to be analyzed and a pre-built knowledge database, and determine a preset number of knowledge sub-databases with the highest similarity rankings in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information; A combination module is used to combine the text to be analyzed with the knowledge sub-database to obtain text data; The recognition module is used to input text data into a pre-built hierarchical classification model and output sensitive information classification and grading results corresponding to the text to be analyzed.
[0018] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the sensitive information identification method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0019] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer instructions for enabling a computer to execute the sensitive information identification method of the first aspect or any corresponding embodiment thereof.
[0020] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the sensitive information identification method of the first aspect or any corresponding embodiment thereof.
[0021] It should be noted that the sensitive information identification system, computer device, computer readable storage medium and computer program product provided by the present invention correspond to the above-mentioned sensitive information identification method. Therefore, for the beneficial effects of the sensitive information identification system, computer device, computer readable storage medium and computer program product, please refer to the description of the corresponding beneficial effects of the sensitive information identification method above, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 is a flowchart of a sensitive information identification method according to an embodiment of the present invention; Figure 2 is a flowchart of another sensitive information identification method according to an embodiment of the present invention; Figure 3 is a schematic diagram of a fine-tuning framework according to an embodiment of the present invention; Figure 4 is a structural block diagram of a sensitive information identification system according to an embodiment of the present invention; Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0025] In recent years, with the development of large-scale pre-trained models (such as GPT, BERT, etc.) and their widespread application in text understanding and natural language processing, efficient identification, classification and grading of sensitive information through intelligent means based on large models has become a cutting-edge research direction.
[0026] In view of this, according to an embodiment of the present invention, a method embodiment of sensitive information identification is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] In this embodiment, a sensitive information identification method is provided, which can be executed by a server, a terminal, a mobile terminal and other devices. Figure 1 is a flow chart of a sensitive information identification method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101, obtaining a text to be analyzed. The text to be analyzed may be a file, a plain text, etc., for example, an electric power text, personal information, etc.
[0028] Step S102, calculate the similarity between the text to be analyzed and the pre-built knowledge database, and determine a preset number of knowledge sub-databases with the highest similarity ranking in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information. The data in the knowledge database in this embodiment may be a classified and graded data set related to the power information system, including sensitive information, information related to sensitive information classification, and information related to sensitive information grading, and the knowledge database is a RAG (Retrieval-Augmented Generation) search vector database based on Embedding (embedding is a process of converting to a low-dimensional vector).
[0029] In the similarity calculation process, the most similar Top K knowledge sub-databases can be found through a preset similarity threshold, such as threshold Z, that is, the similarity values of the K RAG data and the input data are all greater than the threshold Z. If there is no value greater than the threshold Z, the most similar data can be selected.
[0030] Step S103, combining the text to be analyzed with the knowledge sub-database to obtain text data.
[0031] Step S104: Input the text data into the pre-built classification model, and output the sensitive information classification and grading results corresponding to the text to be analyzed. After the unknown file or related text is sent to the system, the sensitive information classification and grading results are output using RAG retrieval and classification and grading models. The entire process framework is as follows: Figure 2 shown.
[0032] In this embodiment, based on performance effects and graphics card computing resources, the chatglm4-9b (a large pre-trained language model) base model is selected, and the hierarchical classification large model is obtained after fine-tuning through lora fine-tuning technology. In the process of using the fine-tuned large model to output the results of text classification and grading, it is necessary to use the RAG search results and the text to be analyzed to form new input information and send it to the large model for its output.
[0033] The following is a simple example of the input of a new large model composed of the RAG knowledge sub-database and the text to be analyzed, where System represents the system prompt word, Input is the input data, and Output is the output data.
[0034] {System: You are a data classification and grading expert who focuses on data security and is responsible for classifying and grading data security. Your task is to read the classification and grading standards of the document in depth. Answer the user's questions based on the classification and grading standards in the document content, and indicate which content in the document is referenced when answering the questions.
[0035] Input:Use <data>< / data> Mark the content as your knowledge: <data> | Communications | General personal contact information | Email address, personal information subject account (social account, QQ, WeChat, Alipay), unified portal account, fax number, etc. | Level 2 data (general personal information) | | Important personal contact and communication information | Family relationship, address (contact address), contact number (mobile, landline), Personal calls, text messages, address books, friend lists, group lists, email content, and records and content describing personal communications. | Level 3 Data (Personal Sensitive Information) | | Personal network security information | Login password, personal digital certificate, key, etc. | Level 4 data (important personal information) | < / data> Answer requirements: - If you are not clear about the answer, you need clarification.
[0036] - Avoid mentioning where you are from <data>< / data> Acquired knowledge.
[0037] - Keep the answer with <data>< / data> The same as described in .
[0038] - Use Markdown syntax to optimize answer format.
[0039] - Answer using the same language as the question.
[0040] Question: "Zhang San, 6222 1111 1111 1111 1111, 11123456789, password is password, and @123"XXX city XXX district" Output: The information you provided contains several different types of data, among which password information belongs to personal network security information and is important data that needs to be desensitized.
[0041] The specific password information is as follows: "The password is password": This is obvious login password information.
[0042] “and @123”: This could also be a password or related personal identification information.
[0043] According to the classification and grading standards in the document, it falls into the "personal network security information" category. Personal network security information belongs to Level 4 data (important personal information) and needs to be strictly protected.
[0044] Desensitization treatment method: "The password is ,besides "} In the Input section of the above data <data>< / data> That is, the data is retrieved through RAG retrieval, and the user enters only the question part.
[0045] In this embodiment, a fusion solution combining a large pre-trained language model and RAG technology is used. RAG technology combines the generation capability of a large pre-trained language model with the precise positioning advantage of the information retrieval system to achieve more detailed block processing and multi-dimensional feature extraction of sensitive data. This method can not only improve the depth of context understanding through a fine-grained text block strategy, but also provide flexible and intelligent responses for different business needs, providing an efficient and intelligent solution for the protection of sensitive data in the power information system, and further improving the classification and grading accuracy of sensitive information.
[0046] In some optional implementations, the knowledge database is established by the following steps: Step a1, collect classified and graded data sets. For example, collect classified and graded data sets related to the power information system. In this embodiment, an intelligent power information system sensitive information identification and classification and grading system based on retrieval enhancement generation and large models can also be designed. Through this system, it is possible to efficiently collect, organize and construct sensitive information data sets specific to the power industry, that is, classified and graded data sets.
[0047] Step a2, using a preset block strategy to block the classification and grading data set to obtain block data. In this embodiment, a multi-dimensional text block strategy can be used to block the classification and grading data set, and embedding of the block data and construction of a large model fine-tuning data set are performed.
[0048] Step a3, converting the block data into vectors, and storing the vector-converted block data into a vector database.
[0049] Step a4, using the vector database as a knowledge database.
[0050] The following is an example of a text segmentation strategy provided in this embodiment (assuming that a pure txt file is uploaded). By recursively segmenting the text according to the specified length, the following long text describes the importance of classification and grading of sensitive data in the power information system and its implementation method.
[0051] "In the power information system, sensitive information includes user personal information, equipment operation data, system configuration parameters, etc. In order to ensure the security of the system and the compliance of data, power companies usually classify and grade data according to its sensitivity. The purpose of data classification is to clarify the data protection level and ensure that data of different levels are appropriately protected during transmission, storage, and use. For example, user personal information is classified as highly sensitive data and requires the highest level of protection; while some system operation logs may be classified as low-sensitivity data and only require appropriate protection. Based on such a classification mechanism, power companies can reasonably allocate resources and improve the effectiveness and accuracy of data security management." Implementation steps include: (1) Check whether the current text is within the specified length. If so, return directly.
[0052] (2) If the text exceeds the specified length, search for suitable punctuation marks (such as periods, commas, semicolons, etc.) near the target length and use them as cutting points.
[0053] (3) Split the text into two parts, and recursively call the cutting function.
[0054] (4) Return all small paragraphs that match the length.
[0055] The results of the chunking are as follows: Paragraph 1: In the power information system, sensitive information includes user personal information, equipment operation data, system configuration parameters, etc.
[0056] Paragraph 2: To ensure system security and data compliance, power companies usually classify and grade data based on its sensitivity.
[0057] Paragraph 3: The purpose of data classification is to clarify the data protection level and ensure that data of different levels are given corresponding security protection during transmission, storage, use and other links.
[0058] Paragraph 4: For example, user personal information is classified as highly sensitive data and requires the highest level of protection.
[0059] Paragraph 5: Some system operation logs may be classified as low-sensitivity data and only require appropriate protection.
[0060] Paragraph 6: Based on such a hierarchical mechanism, power companies can rationally allocate resources and improve the effectiveness and accuracy of data security management.
[0061] After the text is segmented, it is necessary to embed the segmented text into a vector database, so as to calculate the top K databases most relevant to the input text through cosine similarity in the subsequent retrieval process. After considering the vector dimension, computational consumption and effect of the Embedding model, the preferred Embedding model in this embodiment is the M3E model, and the results obtained after segmentation are stored in a vector database, such as pgvector.
[0062] In this embodiment, a RAG search vector database based on Embedding is established, which can provide background knowledge dependency for the output of the large model, making it convenient for the large model to obtain and input the most similar Top K background knowledge through RAG retrieval.
[0063] In some optional implementations, a preset block strategy is used to block the classified and graded data set, including: The classification and grading dataset is divided into blocks based on the preset number of characters. That is, block strategy 1, blocks are divided according to the preset number of specified characters. For example, if the dimension of the Embedding model is 1024, the preset number of characters can be less than 1024, such as dividing into blocks according to 500 characters, that is, dividing the text every 500 characters.
[0064] And / or, the classified and graded data set is divided into blocks based on a preset sliding window size. That is, block strategy 2. In block strategy 1, it is possible that the text to be divided is closely related to each other but will be cut apart. Based on this, a text block strategy with a sliding window is proposed: for example, in a block strategy with a preset 500-character block size, the sliding window size is set to 10. For a text of 2,000 characters, the text indexes that are divided quickly are [1,500], [490,990], [980,1480], [1470,1970], [1960,2000]. In this way, text blocks with a certain amount of context coverage are achieved.
[0065] And / or, the classified and graded data set is divided into blocks based on the file type data extraction strategy; the file type data extraction strategy includes: determining the text type in the classified and graded data set; calling the text parsing tool corresponding to the text type; and using the text parsing tool to extract information from the classified and graded data set. That is, block strategy 3, a block strategy based on file type data extraction, for some special text types, such as docx, xlsx, pdf, and md files, the related text parsing tools can be used to parse out the titles and related contents more conveniently. For example, for md files, the markdown library in python can parse out titles with a certain level.
[0066] And / or, the classified and graded data set is divided into blocks based on a recursive call strategy. That is, block strategy 4, which combines the above three block strategies, and divides the text into blocks based on a block strategy based on specified characters and recursive calls. Block strategy 4 comprehensively considers the above three block strategies, and on its basis, adds a block strategy based on recursive calls, and can customize the characters for text cutting. The following is an example of a preset cutting character: ["\n\n","\n",".|!|?","\.\s|\!\s|\?\s",";|;\s",",|,\s",]. By recursion, on the one hand, it can ensure that the length of each block after text segmentation is as close to the preset character as possible, and on the other hand, it can ensure that there will be no large incoherence between the texts after segmentation.
[0067] In this embodiment, a multi-dimensional text segmentation strategy can be adopted to realize accurate and flexible RAG retrieval and question-and-answer response in massive and complex data, thereby realizing accurate classification and grading of sensitive information, and providing more intelligent and reliable technical support for the security protection of the power information system.
[0068] In some optional implementations, the hierarchical classification model is established by the following steps: Step b1, obtaining a base model. In this embodiment, the chatglm4-9b model is preferably selected as the base model, which has a large scale and a strong ability to generate and understand natural language.
[0069] Step b2: obtaining a pre-built text classification and grading fine-tuning dataset, where the text classification and grading fine-tuning dataset is extracted from generalized text.
[0070] The text classification and grading fine-tuning dataset is the dataset required for large model fine-tuning, which can be constructed through AI plus manual verification. On the one hand, the generalized text (without strict question-answer content) of large models such as kimi, chatglm, and qwen is used to extract the dataset for large model fine-tuning, and the fine-tuning dataset is obtained through manual verification. The following is an example of a fine-tuning dataset extracted from the document "Guidelines for Data Classification and Grading of a Certain Company": {“system”:” # Role: Data classification and grading expert ## Profile - Language: Chinese - description: Focusing on the field of data security, responsible for data security classification and classification according to the classification and grading standards of documents. Help users understand and apply data classification and grading standards, and provide accurate answers based on document standards.
[0071] Skills 1. Deeply understand the standards and processes for data classification and grading.
[0072] 2. Be proficient in interpreting data security standards, especially the classification and grading items involved in the documents.
[0073] 3. Be able to provide explanations based on document standards to user questions and accurately quote relevant content.
[0074] 4. Have the ability to analyze data sensitivity and be able to flexibly apply classification rules and practical cases.
[0075] ## Background In the field of data security, data classification and categorization determine the storage, access and protection strategies of information. Clear classification and categorization standards can effectively ensure data security and compliance, and avoid leakage and risks caused by improper handling.
[0076] Goals 1. Read in depth and be familiar with the document standards for data classification and grading.
[0077] 2. Provide users with accurate and safe recommendations based on classification and grading standards.
[0078] 3. According to user needs, indicate the document content cited in the answer to ensure the accuracy and traceability of the answer.
[0079] ## Rules 1. When answering user questions, strictly follow the classification and grading standards in the document.
[0080] 2. In each answer, indicate the content of the cited document to enhance the accuracy and authority of the answer.
[0081] 3. When explaining the classification and grading criteria, present them in a concise and easy to understand manner.
[0082] ## Workflows 1. In-depth reading and analysis of data classification and grading standard documents.
[0083] 2. Design clear classification and grading procedures and strategies based on document standards.
[0084] 3. When answering questions, cite specific items from the document to enhance the credibility of your answer.
[0085] 4. If the user has further questions, provide more detailed standard terms in the reference document.
[0086] ## Init Welcome to the Data Classification and Grading Expert Assistant. Please describe the specific data classification and grading content you want to know so that I can provide you with answers based on document standards.
[0087] "instruction":"Zhang San's password is password, and does "@123" contain password information, what is it specifically, how to desensitize it, ""input":",""output":" According to the information you provided, the sentence "Zhang San's password is password, and @123" does contain password information. The specific password information is "password" and "@123".
[0088] To desensitize, we need to replace the password information with unrecognizable information. The usual practice is to use asterisks (*), underscores (_) or other symbols to replace the actual password characters. The following is an example after desensitization: "Zhang San's password is ,besides " Here, I replaced "password" with eight asterisks and "@123" with three asterisks to hide the real password information. This processing can prevent the password information from being identified and used by unauthorized personnel. ”} Step b3, fine-tune the base model based on the text classification hierarchical fine-tuning dataset to obtain a fine-tuned hierarchical classification large model.
[0089] In this embodiment, targeted fine-tuning is performed in combination with the large model, which effectively improves the large model's ability to identify and understand sensitive data, and is conducive to improving the accuracy of sensitive information classification and grading.
[0090] In some optional implementations, fine-tuning the base model based on the text classification hierarchical fine-tuning dataset includes: The chatglm4-9b base model is fine-tuned using the LoRA (Low-Rank Adaptation, LoRA for short, a technology used for fine-tuning deep learning models) architecture; the LoRA architecture is: ; in, is the input vector, that is, the data in the text classification and grading fine-tuning dataset is used as the input vector, with a dimension of ; is the weight matrix, with dimension ; is a low-rank matrix with dimension ; is a low-rank matrix with dimension ; is the output matrix with dimension ; is the rank of LoRA, is a constant, that is, the input vector Dimension.
[0091] In this embodiment, the constructed fine-tuning dataset is used to fine-tune the large model. The fine-tuning technology selected is the LoRA framework. The technical principle of LoRA is referenced Figure 3 As shown. The parameter matrix W∈R of the base model dxd , where R represents the parameter matrix of the model; the low-rank matrix A∈N(0,σ 2 ), where N is the sign of the Gaussian distribution.
[0092] In the above formula, Get one A vector of dimension, Also get a dimension vector, since is much smaller than The data, that is, the matrix and matrix The product of the parameters: , is much smaller than The number of parameters By adding , The matrix approach can not only keep the original chatglm4-9b parameter values unchanged, but also significantly reduce the amount of model training parameters. The initial value of is a Gaussian distribution with a mean of 0. The initial value of the matrix is 0, which ensures that the training starts from the original parameters of chatlgm4-9b. Using llamda-factory as the technical framework for fine-tuning training, a satisfactory effect can be achieved when the loss value is around 0.7.
[0093] The following is an example explanation of two key parameters: The rank of the matrix in the LoRA fine-tuning parameters. In the above formula, the parameters That is the rank of lora. The larger the parameter is, the more parameters need to be trained. The larger the value, the better the generalization of the expression on the fine-tuning data, but the easier it is to overfit and the greater the resource consumption; the smaller the value, the less obvious the fine-tuning effect and the smaller the resource consumption. The value of is selected between 2 and 8. Through experiments, when the parameter value is 4, a better loss curve and a low loss value can be obtained.
[0094] LoRA scaling factor: In the formula: , after adding the scaling factor, it becomes: ; in, is the scaling factor of the matrix. It can be seen from the formula that The bigger, The larger the weight of the part, the better the expression of the fine-tuned model on the data set, but it also makes the training more prone to overfitting. The smaller the parameter, the worse the generalization performance on the fine-tuning dataset. In this embodiment, it is set to a parameter between 3 and 10. Through experiments, a relatively stable loss curve and a relatively low loss value (at 0.69) are obtained, which is in line with the expectation of being able to perform text classification and grading reasoning.
[0095] In this embodiment, LoRA significantly reduces the computational and storage overhead by only adjusting the parameters of the low-rank matrix, thereby improving the efficiency of the fine-tuning process. In addition, the LoRA architecture enables the base model to quickly adapt to different tasks and retains most of the pre-trained knowledge, enhancing the task migration capability of the large model, thereby effectively improving the recognition accuracy of the large model.
[0096] In some optional implementations, a similarity function is used to calculate the similarity between the text to be analyzed and the knowledge database, and the similarity function is: ; in, The input data after the text vector is converted to be analyzed; is any vector data in the knowledge database; For vector The modulus and vector The product of the modulos.
[0097] In the process of calculating text similarity, the M3E model is used to calculate the similarity of the incoming file or input text, and the cosine similarity is selected as the calculation method. It represents the embedding vector of the input data. represents a vector in the RAG database. represents the dot product of the two, It represents the vector The magnitude (i.e., the length of the vector) and the vector The product of the moduli of It is a data between [-1,1]. By selecting the Top K most similar RAG data, new background knowledge is formed and sent to the large model together with the input text. The output result can be obtained by using the text classification and grading data. After verification of the results, the accuracy of the text classification and grading of this system is greater than 95%, and the effect is good.
[0098] In this embodiment, the top K most similar knowledge sub-databases are calculated through cosine similarity, which can provide relevant contextual information for the large model, improve the accuracy and contextual understanding ability of the large model when processing the text to be analyzed, and further improve the accuracy of classification and grading of sensitive information.
[0099] In this embodiment, a sensitive information identification system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0100] This embodiment provides a sensitive information identification system, such as Figure 4 As shown, the system includes: An acquisition module 201 is used to acquire the text to be analyzed; A calculation module 202 is used to calculate the similarity between the text to be analyzed and a pre-built knowledge database, and determine a preset number of knowledge sub-databases with the highest similarity rankings in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information; A combining module 203 is used to combine the text to be analyzed with the knowledge sub-database to obtain text data; The identification module 304 is used to input text data into a pre-built classification model and output a sensitive information classification result corresponding to the text to be analyzed.
[0101] In some optional embodiments, the system includes: The knowledge database construction module is used to collect classified and graded data sets; use a preset segmentation strategy to segment the classified and graded data sets to obtain segmented data; perform vector conversion on the segmented data, and store the segmented data after vector conversion into a vector database; and use the vector database as a knowledge database. The classified and graded data sets are segmented based on a preset number of characters; and / or, the classified and graded data sets are segmented based on a preset sliding window size; and / or, the classified and graded data sets are segmented based on a file type data extraction strategy; the file type data extraction strategy includes: determining the text type in the classified and graded data sets; calling a text parsing tool corresponding to the text type; using the text parsing tool to extract information from the classified and graded data sets; and / or, segmenting the classified and graded data sets based on a recursive calling strategy.
[0102] The large model construction module is used to obtain the base model; obtain a pre-built text classification hierarchical fine-tuning dataset, where the text classification hierarchical fine-tuning dataset is extracted from generalized text; fine-tune the base model based on the text classification hierarchical fine-tuning dataset to obtain a fine-tuned hierarchical classification large model.
[0103] The sensitive information identification system in this embodiment is presented in the form of functional units, where the units refer to ASIC circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0104] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0105] The embodiment of the present invention also provides a computer device having the above Figure 4 The sensitive information identification system shown.
[0106] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0107] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0108] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0109] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0110] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0111] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0112] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0113] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0114] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A sensitive information identification method, characterized in that: The method comprises: Get the text to be analyzed; Calculate the similarity between the text to be analyzed and a pre-built knowledge database, and determine a preset number of knowledge sub-databases with top similarity rankings in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information; Combining the text to be analyzed with the knowledge sub-database to obtain text data; The text data is input into a pre-built hierarchical classification model, and a sensitive information classification result corresponding to the text to be analyzed is output.
2. The method according to claim 1, characterized in that: The knowledge database is established by the following steps: Collect classified and graded data sets; Using a preset block strategy to block the classified and graded data set to obtain block data; Performing vector conversion on the block data, and storing the vector-converted block data in a vector database; The vector database is used as the knowledge database.
3. The method according to claim 2, characterized in that The adopting a preset block strategy to block the classified and graded data set includes: Dividing the classified and graded data set into blocks based on a preset number of characters; and / or, dividing the classified and graded data set into blocks based on a preset sliding window size; And / or, dividing the classified and graded data set into blocks based on a file type data extraction strategy; the file type data extraction strategy includes: determining the text type in the classified and graded data set; calling a text parsing tool corresponding to the text type; and extracting information from the classified and graded data set using the text parsing tool; And / or, the classified and graded data set is divided into blocks based on a recursive calling strategy.
4. The method according to claim 1, characterized in that The hierarchical classification model is established by the following steps: Get the base model; Obtain a pre-constructed text classification hierarchical fine-tuning dataset, where the text classification hierarchical fine-tuning dataset is extracted from generalized text; The base model is fine-tuned based on the text classification hierarchical fine-tuning dataset to obtain the fine-tuned hierarchical classification large model.
5. The method according to claim 4, characterized in that The fine-tuning of the base model based on the text classification and grading fine-tuning dataset includes: The base model is fine-tuned using the LoRA architecture; wherein the LoRA architecture is: ; in, is the input vector with dimension ; is the weight matrix, with dimension ; is a low-rank matrix with dimension ; is a low-rank matrix with dimension ; is the output matrix with dimension ; is the rank of LoRA, is a constant.
6. The method according to claim 1, characterized in that A similarity function is used to calculate the similarity between the text to be analyzed and the knowledge database, and the similarity function is: ; in, The input data after the text vector to be analyzed is converted; is any vector data in the knowledge database; For vector The modulus and vector The product of the modulos.
7. A sensitive information identification system, characterized in that: The system comprises: The acquisition module is used to obtain the text to be analyzed; A calculation module, used to calculate the similarity between the text to be analyzed and a pre-built knowledge database, and determine a preset number of knowledge sub-databases with top similarity rankings in the knowledge database; wherein the knowledge database includes sensitive information, sensitive information classification information, and sensitive information grading information; A combining module, used for combining the text to be analyzed with the knowledge sub-database to obtain text data; The identification module is used to input the text data into a pre-built hierarchical classification model and output a sensitive information classification result corresponding to the text to be analyzed.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the sensitive information identification method described in any one of claims 1-6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the sensitive information identification method described in any one of claims 1-6.
10. A computer program product, characterized in that It includes computer instructions, and the computer instructions are used to enable a computer to execute the sensitive information identification method described in any one of claims 1-6.
Citation Information
Patent Citations
Method and device for marking sensitive data, medium and program product
CN115659396A
Sensitive information discovery and automatic classification and grading method based on multi-modal fusion
CN116049397A
Project data security information grading processing method
CN117236334A
Sensitive information analysis and identification method, system and device and readable storage medium
CN118779458A
Data classification and grading system and data classification and grading method thereof
CN118820468A
Cited By
Sensitive information identification method and device, equipment, storage medium and program product
CN120337938A
Knowledge base construction and use method and device of trusted data space, equipment and medium
CN120338085A