General text desensitization method and device based on large language model and thought chain technology

Through the combination of large language model and thought chain technology, the automated text desensitization process is realized, solving the problems of insufficient flexibility and generalization ability of sensitive word processing in the existing technology, and improving the robustness and generalization ability of text desensitization. efficiency, reducing operation and maintenance costs.

CN118133348BActive Publication Date: 2024-10-22GUANGZHOU YUTONG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410339742.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-10-22
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

In existing technology, in text processing, the filtering of sensitive words relies on manual annotation and machine learning methods, which has problems such as insufficient flexibility, large data requirements, poor generalization ability, and potential leakage risks.

Method used

A universal text desensitization method based on large language models and thought chain technology is used to automatically infer different types of text through trained desensitization rule tables, identify and process sensitive information, and combine pre-trained models for context understanding and shielding operations. Dynamically update the rule base to adapt to changes in language and information.

Benefits of technology

It improves the robustness and efficiency of text desensitization, expands the scope of application, reduces manual participation, reduces operation and maintenance costs, avoids literal matching errors, and enhances the accuracy of sensitive information identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118133348B_ABST
    Figure CN118133348B_ABST
Patent Text Reader

Abstract

The present invention discloses a general text desensitization method and device based on a large language model and thought chain technology, the method comprising: calling a preset desensitization rule table from a desensitization database, reading and segmenting desensitized text; roughly identifying the sliced ​​desensitized text according to the desensitization rule table, and obtaining suspected sensitive words; inputting the suspected sensitive words and their context into a pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type; for each sensitive type of sensitive words, desensitizing the sensitive words that need to be desensitized according to the desensitization rule table according to the desensitization method; saving the original sensitive words and the corresponding desensitization method as a desensitization word table. The present invention improves the robustness and efficiency of text desensitization, and improves the versatility and scope of application of text desensitization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of text desensitization, and in particular relates to a general text desensitization method and device based on a large language model and thought chain technology. Background Art

[0002] In current text processing practices, the filtering of sensitive words mainly relies on two methods: manual annotation and machine learning.

[0003] Manual labeling identifies sensitive information by applying pre-defined rules. However, this method has the limitation of being difficult to adapt to all types of sensitive information. Moreover, as time goes by, the rules need to be continuously updated to correspond to newly emerging sensitive information, so it lacks the necessary flexibility.

[0004] On the other hand, the machine learning method builds a neural network model by training large-scale sensitive text data in a specific field. The limitation of this method is that it requires a large amount of labeled data. Not only does the collection and labeling process consume time and resources, but there is also a risk of indirect leakage caused by potential sensitive information in the training data. At the same time, the model may show insufficient generalization ability when dealing with data that has never been encountered or new types of sensitive information.

[0005] Therefore, there is a need to provide a system and method for desensitizing general text. Summary of the invention

[0006] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and to provide a general text desensitization method and device based on a large language model and thought chain technology. Through the trained desensitization rule table, the method is adapted to different types of texts and a variety of sensitive information and performs automatic reasoning desensitization. On the one hand, the robustness and efficiency of text desensitization are improved, and on the other hand, the universality and scope of application of text desensitization are improved.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] In a first aspect, the present invention provides a general text desensitization method based on a large language model and thought chain technology, comprising the following steps: calling a preset desensitization rule table and a desensitization word table from a desensitization database, reading and segmenting the desensitized text;

[0009] Roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words;

[0010] Input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type;

[0011] For each sensitive type of sensitive words, desensitize the sensitive words that need to be desensitized according to the desensitization rule table and the desensitization method;

[0012] The original sensitive words and the corresponding shielded characters or shielded relationships are updated to the desensitized word list.

[0013] As a preferred technical solution, the rough identification is specifically as follows:

[0014] According to the pre-trained desensitization rule table, the segmented text is quickly scanned to identify sensitive words that may belong to the sensitive types in the desensitization rule table.

[0015] As a preferred technical solution, the desensitization rule table includes sensitive types, desensitization methods and execution decisions;

[0016] The sensitive type corresponds to the corresponding sensitive word list;

[0017] The sensitive type includes a custom sensitive type;

[0018] The execution strategy includes execution instructions "0" and "1", which are used to indicate whether the desensitization method corresponding to the sensitive word is executed.

[0019] As a preferred technical solution, the desensitization method comprises:

[0020] Use the inferred shielding text to replace the sensitive words that need to be desensitized;

[0021] Use the inferred shielding pseudocode, symbol or image symbol to replace the sensitive words that need to be desensitized;

[0022] Use the inferred masked image to replace the sensitive words that need to be desensitized;

[0023] Change the offset of the numerical information related to sensitive words;

[0024] Partially hide desensitized words.

[0025] As a preferred technical solution, it also includes fine-tuning of the desensitization rule table, specifically: users customize and adjust sensitive words and sensitive types according to their needs.

[0026] As a preferred technical solution, the step of training a desensitization rule table is also included, including:

[0027] When the desensitization rule table fails to be read, a new desensitization rule table is created, the sample text is sliced ​​and prompt words are constructed;

[0028] Use the pre-trained large language model to filter prompt words and obtain sensitive types; return the sensitive types in a structured form;

[0029] De-duplicate sensitive types and save or merge them into the desensitization rule table;

[0030] Infer the desensitization methods corresponding to the newly added sensitive types.

[0031] As a preferred technical solution, the deduplication of sensitive types includes:

[0032] Compare and check the returned sensitive strings for duplicates;

[0033] Perform semantic duplication check on the returned sensitive types and retain the optimal expression form.

[0034] In a second aspect, the present invention further provides a general text desensitization system based on a large language model and thought chain technology, which is applied to the general text desensitization method based on a large language model and thought chain technology, including a file management module, a training module, a reasoning module and a visualization module;

[0035] The file management module is used to support the reading, writing and modification of various files and to divide the texts reasonably;

[0036] The training module is used to use the pre-trained large language model to filter prompt words and obtain sensitive types; return the sensitive types in a structured form; remove duplicate sensitive types, save or merge them into the original desensitization rule table; and infer the desensitization method corresponding to the newly added sensitive types;

[0037] The inference module is used to roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words; input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type; for each sensitive type of sensitive words, derive the corresponding desensitization method according to the sensitive type, infer the execution decision according to the desensitization method, and desensitize the sensitive words using the desensitization method according to the execution decision; update the original sensitive words and the corresponding shielding characters or shielding relationships to the desensitization word table;

[0038] The visualization module is used to provide users with an interface for customizing desensitization rules and verifying desensitization results, and to display parallel views of the original text and the desensitized text.

[0039] In a third aspect, the present invention provides an electronic device, the electronic device comprising:

[0040] at least one processor; and,

[0041] a memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the general text desensitization method based on the large language model and thought chain technology.

[0043] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0044] (1) The present invention can improve the robustness and efficiency of text desensitization and the versatility and scope of application of text desensitization by adaptively adapting to different types of text and various sensitive information based on the trained desensitization rule table.

[0045] (2) The present invention realizes a fully automated process from recognition to processing by combining a large language model and thought chain technology, reduces the need for human participation, and significantly improves the efficiency of the desensitization process.

[0046] (3) The desensitization rule table of the present invention is dynamically updated and can update and expand the rule base by continuously learning new text samples, which enables the system to adapt to the timeliness changes of language and information.

[0047] (4) The present invention can better understand the context when identifying sensitive information through a large language model, avoiding literal matching errors in traditional methods and improving the accuracy of sensitive information identification; at the same time, it reduces the need for manual labeling and data collection, and reduces long-term operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 1 It is a flow chart of a general text desensitization method based on a large language model and thought chain technology according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of the steps of training a desensitization rule table according to an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of the structure of a general text desensitization system based on a large language model and thought chain technology according to an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a desensitized database according to an embodiment of the present invention;

[0053] Figure 5 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0055] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0056] Chain-of-Thought refers to connecting multiple concepts or information points according to certain rules or logic to form a complete thinking structure. In the field of artificial intelligence, the concept of chain of thought has also been widely used. Especially with the development of natural language processing and knowledge graph technology, computers can understand and process language and knowledge to form a structure similar to the human chain of thought. In this embodiment, the chain of thought is mainly reflected in "finding text sensitive types-deriving desensitization methods for sensitive types-inferring desensitization strategies based on desensitization methods-finding sensitive words based on sensitive types-deriving shielding words based on sensitive words".

[0057] See also Figure 1 In this embodiment, a general text desensitization method based on a large language model and thought chain technology is provided, including the following steps:

[0058] S11. Call the preset desensitization rule table from the desensitization database to read and segment the desensitized text.

[0059] In this embodiment, the desensitization database includes a trained desensitization rule table and a desensitization word table. When text desensitization is required, the file reading and writing module calls the trained desensitization rule table according to the instruction, and reads the text to be desensitized. Among them, the desensitization rule table includes the rules used by the system to identify and process sensitive information, which is stored in csv format for easy updating and maintenance; the desensitization word table is stored in json format, listing all known sensitive words and their desensitization words for a certain text, and the system will perform accurate text matching and desensitization processing according to these word tables; the desensitized text is in a readable format or a decrypted readable document, including files of doc, txt type, etc.

[0060] The desensitization rule table itself includes sensitive types, desensitization methods and execution decisions, where the sensitive types correspond to the corresponding sensitive word tables; the sensitive types include custom sensitive types; the execution strategy includes execution instructions "0" and "1", which are used to indicate whether the desensitization method corresponding to the sensitive word is executed.

[0061] It should be noted that the execution strategy is set to save computing resources. The more sensitive word types are inferred, the longer the system takes and the more resources are occupied. The inference module only looks for possible sensitive word types in the document and derives the shielding method for this type, but the user can choose whether to shield this type.

[0062] Before the desensitized text is recognized, in order to ensure computational efficiency and context processing, the desensitized text needs to be sliced. Slicing requires not to destroy the integrity and coherence of semantics. Generally, it is sliced ​​according to periods or paragraphs. It should not be too long to cause hallucination effects in large models, nor too short to make the sentence meaning incomplete. The length of the slice is generally 100-200 words.

[0063] S12. Roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words.

[0064] In particular, according to the pre-trained desensitization rule table, the fragmented text is quickly scanned to identify sensitive words that may belong to the sensitive types in the desensitization rule table.

[0065] S13, inputting the suspected sensitive word and its context into the pre-trained large language model to determine whether the suspected sensitive word belongs to the corresponding sensitive type;

[0066] For words that are initially identified as potentially sensitive, the system will use a large language model for in-depth analysis. By combining the word and its context into a prompt word and inputting it into the model, the model can understand the meaning of the word in the context and determine whether it is truly a sensitive word.

[0067] S14. For each sensitive word of a sensitive type, derive a corresponding desensitization method according to the sensitive type, reason an execution decision according to the desensitization method, and desensitize the sensitive word using the desensitization method according to the execution decision.

[0068] Once the sensitive words are confirmed, the system will execute the appropriate desensitization method according to the rules defined in the desensitization rule table. The original sensitive words are shielded by the corresponding desensitization method, and all shielding correspondences are saved in the desensitization word table for future reference and modification, such as step S15.

[0069] In particular, the desensitization method in this embodiment includes:

[0070] Use the inferred shielding text to replace the sensitive words that need to be desensitized;

[0071] Use the inferred shielding pseudocode, symbol or image symbol to replace the sensitive words that need to be desensitized;

[0072] Use the inferred masked image to replace the sensitive words that need to be desensitized;

[0073] Change the offset of the numerical information related to sensitive words;

[0074] Partially hide desensitized words.

[0075] S15. Update the original sensitive words and the corresponding shielding characters or shielding relationships to the desensitizing word list.

[0076] The original words and the corresponding desensitization methods are saved as a desensitized word list, in order to facilitate the modification and preservation of the text in the subsequent processing process. Unlike traditional word lists, this embodiment can utilize the capabilities of a large language model to optimize the desensitization of various conflicts or those that affect understanding. For example, in the legal field, for two similar names: Zhang Sanfeng and Zhang Sifeng, we will not uniformly mask them as "Zhang Moumou". The large model can take into account the conflict in understanding and mask them as "Zhang Mou A" and "Zhang Mou B". For example, in the financial field, for amounts and currency units of different units, this embodiment will choose whether to retain the unit or currency type according to different shielding strengths to ensure a balance between readability and shielding strength, and finally obtain a "desensitized word list".

[0077] S16. Users can customize and adjust sensitive words and sensitive types according to their needs.

[0078] Finally, a visual interface is provided, allowing users to customize the vocabulary and the types that need to be blocked according to their needs, while displaying parallel views of the original text and the desensitized text for easy comparison.

[0079] See also Figure 2When the desensitization rule table is missing in the desensitization database or the file reading and writing module cannot read the desensitization rule table, this embodiment can create a new desensitization rule table and perform training, as follows:

[0080] S21, creating a desensitization rule table, slicing the sample text and constructing prompt words;

[0081] In order to facilitate the understanding and processing of the pre-trained large language model, the sample text is sliced ​​and prompt words are constructed. These prompt words can be words, phrases or sentences, which represent different sensitive types or topics.

[0082] S22. Use the pre-trained large language model to filter the prompt words and obtain sensitive types; return the sensitive types in a structured form;

[0083] The so-called structured form is to organize the information into a format that is easy to understand, has clear levels, and is easy to query and manage. In text or data, structured form usually means that the information is broken down into a series of fields, attributes, or entries, each of which has a clearly defined label or name, and they are organized according to a fixed logical order or hierarchical relationship. In this embodiment, the screened sensitive types are returned in a structured form. This usually means organizing the results into a format that is easy to query and understand, such as JSON or XML. Each sensitive type can be used as a key, and the prompt word associated with it can be used as the value of the key.

[0084] S23. De-duplicate sensitive types and save or merge them into the desensitization rule table.

[0085] In particular, the sensitive information types returned from multiple slices are deduplicated. This step includes not only traditional string comparison checking, but also deeper semantic checking using large models. These deduplicated sensitive types are then saved or merged into the existing desensitization rule table.

[0086] Furthermore, the model supports further judging the possible "synonyms" of the screening results. For example, the model can recognize that "Tsinghua University and Peking University" and "Qingbei" belong to the same sensitive type. At the same time, under the traditional word list method, "Zhang San" and "Zhang Si" will be desensitized to "Zhang Mou", but this embodiment can realize the semantic ambiguity problem caused by it and use "Zhang Mou A" and "Zhang Mou B" for desensitization.

[0087] S24. Infer the corresponding desensitization methods for the newly added sensitive types.

[0088] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.

[0089] Based on the same idea as the general text desensitization method based on the large language model and thought chain technology in the above-mentioned embodiment, the present invention also provides a general text desensitization system based on the large language model and thought chain technology, which can be used to execute the general text desensitization method based on the large language model and thought chain technology. For ease of explanation, the structural schematic diagram of the embodiment of the general text desensitization system based on the large language model and thought chain technology only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than the illustrated structure, or combine certain components, or arrange the components differently.

[0090] See also Figure 3 In another embodiment of the present application, a general text desensitization system 10 based on a large language model and thought chain technology is provided, the system comprising a file management module 11, a training module 12, a reasoning module 13 and a visualization module 14;

[0091] The file management module 11 is used to support the reading, writing and modification of various files and to reasonably segment the text; the desensitization rule table includes sensitive types, desensitization methods and execution decisions;

[0092] The training module 12 is used to screen the prompt words using the pre-trained large language model to obtain sensitive types; return the sensitive types in a structured form; remove duplicate sensitive types, save or merge them into the original desensitization rule table; and infer the desensitization method corresponding to the newly added sensitive types;

[0093] The reasoning module 13 is used to roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words; input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type; for each sensitive type of sensitive word, derive the corresponding desensitization method according to the sensitive type, reason and execute the decision according to the desensitization method, and desensitize the sensitive words using the desensitization method according to the execution decision; update the original sensitive words and the corresponding shielding characters or shielding relationships to the desensitization word table;

[0094] The visualization module 14 is used to provide an interface for users to customize desensitization rules and verify desensitization results, and to display parallel views of the original text and the desensitized text.

[0095] Further, see Figure 4, the file management module 11 includes a file reading and writing module 111 and a desensitizing database 112, and the file reading and writing module 111 is closely connected with the desensitizing database 112;

[0096] The file reading and writing module 111 is used to manage the storage, reading, updating and deletion operations of files, and to access and apply any desensitization rule table and desensitization word table in real time according to instructions;

[0097] The desensitization database 112 includes a desensitization rule table and a desensitization word table.

[0098] It should be noted that the universal text desensitization system based on a large language model and thought chain technology of the present invention corresponds one to one with the universal text desensitization method based on a large language model and thought chain technology of the present invention. The technical features and beneficial effects described in the above-mentioned embodiment of the universal text desensitization method based on a large language model and thought chain technology are applicable to the embodiment of the universal text desensitization method based on a large language model and thought chain technology. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.

[0099] In addition, in the implementation of the general text desensitization system based on the large language model and thought chain technology in the above-mentioned embodiment, the logical division of each program module is only an example. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, for example, for the convenience of corresponding hardware configuration requirements or software implementation. That is, the internal structure of the general text desensitization system based on the large language model and thought chain technology is divided into different program modules to complete all or part of the functions described above.

[0100] See also Figure 5 In one embodiment, an electronic device for implementing a general text desensitization method based on a large language model and thought chain technology is provided. The electronic device 20 may include a first processor 21, a first memory 22 and a bus, and may also include a computer program stored in the first memory 22 and executable on the first processor 21, such as a general text desensitization program 23 based on a large language model and thought chain technology.

[0101] Among them, the first memory 22 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 22 can be an internal storage unit of the electronic device 20, such as a mobile hard disk of the electronic device 20. In other embodiments, the first memory 22 can also be an external storage device of the electronic device 20, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 20. Further, the first memory 22 can also include both an internal storage unit of the electronic device 20 and an external storage device. The first memory 22 can not only be used to store application software and various types of data installed in the electronic device 20, such as the code of the general text desensitization program 23 based on the large language model and the thinking chain technology, but also can be used to temporarily store data that has been output or is to be output.

[0102] In some embodiments, the first processor 21 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The first processor 21 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device 20 by running or executing programs or modules stored in the first memory 22, and calling data stored in the first memory 22.

[0103] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 20 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0104] The general text desensitization program 23 based on the large language model and thought chain technology stored in the first memory 22 of the electronic device 20 is a combination of multiple instructions. When running in the first processor 21, it can at least achieve:

[0105] Calling a preset desensitization rule table and a desensitization word table from a desensitization database, reading and segmenting the desensitized text; the desensitization rule table includes sensitive types, desensitization methods, and execution decisions;

[0106] Roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words;

[0107] Input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type;

[0108] For each sensitive word of each sensitive type, deduce the corresponding desensitization method according to the sensitive type, infer the execution decision according to the desensitization method, and desensitize the sensitive word using the desensitization method according to the execution decision;

[0109] The original sensitive words and the corresponding shielding characters or shielding relationships are updated to the desensitized word list; users can check the original sensitive words and the corresponding shielding characters or shielding relationships according to their needs, and customize the sensitive words and sensitive types.

[0110] Furthermore, if the module / unit integrated in the electronic device 20 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0112] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0113] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. General text desensitization method based on large language model and thought chain technology, It is characterized in that The following steps are involved: Call the preset desensitization rule table and desensitization word table from the desensitization database to read and segment the desensitized text; The desensitization rule table includes sensitive types, desensitization methods and execution decisions; Roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words; Input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type; For each sensitive word of each sensitive type, deduce the corresponding desensitization method according to the sensitive type, infer the execution decision according to the desensitization method, and desensitize the sensitive word using the desensitization method according to the execution decision; Update the original sensitive words and the corresponding shielding characters or shielding relationships to the desensitized word table; Users can check the original sensitive words and corresponding blocked characters or blocked relationships according to their needs, and customize the sensitive words and sensitive types.

2. According to the general text desensitization method based on large language model and thought chain technology as described in claim 1, It is characterized in that The rough identification is specifically as follows: According to the pre-trained desensitization rule table, the segmented text is quickly scanned to identify sensitive words that may belong to the sensitive types in the desensitization rule table.

3. According to the general text desensitization method based on large language model and thought chain technology as claimed in claim 1, It is characterized in that The sensitive type corresponds to the corresponding sensitive word list; The sensitive type includes a custom sensitive type; The execution decision includes execution instructions "0" and "1", which are used to indicate whether the desensitization method corresponding to the sensitive word is executed.

4. According to the general text desensitization method based on large language model and thought chain technology as claimed in claim 1, It is characterized in that The desensitization method comprises: Use the inferred shielding text to replace the sensitive words that need to be desensitized; Use the inferred shielding pseudocode, symbol or image symbol to replace the sensitive words that need to be desensitized; Use the inferred masked image to replace the sensitive words that need to be desensitized; Change the offset of the numerical information related to sensitive words; Partially hide desensitized words.

5. According to the general text desensitization method based on large language model and thought chain technology as claimed in claim 1, It is characterized in that It also includes fine-tuning of the desensitization rule table, specifically: users can customize and adjust sensitive words and sensitive types according to their needs.

6. According to the general text desensitization method based on large language model and thought chain technology as claimed in claim 1, It is characterized in that It also includes the steps of training the desensitization rule table, including: When the desensitization rule table fails to be read, a new desensitization rule table is created, the sample text is sliced ​​and prompt words are constructed; Use the pre-trained large language model to filter prompt words and obtain sensitive types; return the sensitive types in a structured form; De-duplicate sensitive types and save or merge them into the desensitization rule table; Infer the desensitization methods corresponding to the newly added sensitive types.

7. According to claim 6, the general text desensitization method based on the large language model and thought chain technology, It is characterized in that The deduplication of sensitive types includes: Compare and check the returned sensitive strings for duplicates; Perform semantic duplication check on the returned sensitive types and retain the optimal expression form.

8. General text desensitization system based on large language model and thought chain technology, It is characterized in that A general text desensitization method based on a large language model and thought chain technology applied to any one of claims 1-7, comprising a file management module, a training module, a reasoning module and a visualization module; The file management module is used to support the reading, writing and modification of various files and to divide the texts reasonably; The desensitization rule table includes sensitive types, desensitization methods and execution decisions; The training module is used to filter prompt words using a pre-trained large language model to obtain sensitive types; Return sensitive types in structured form; De-duplicate sensitive types and save or merge them into the original desensitization rule table; Reasoning about the desensitization methods corresponding to the newly added sensitive types; The inference module is used to roughly identify the sliced ​​desensitized text according to the desensitization rule table to obtain suspected sensitive words; Input the suspected sensitive words and their context into the pre-trained large language model to determine whether the suspected sensitive words belong to the corresponding sensitive type; For each sensitive word of each sensitive type, deduce the corresponding desensitization method according to the sensitive type, infer the execution decision according to the desensitization method, and desensitize the sensitive word using the desensitization method according to the execution decision; Update the original sensitive words and the corresponding shielding characters or shielding relationships to the desensitized word table; The visualization module is used to provide users with an interface for customizing desensitization rules and verifying desensitization results, and to display parallel views of the original text and the desensitized text.

9. According to claim 8, the universal text desensitization system based on the large language model and thought chain technology, It is characterized in that The file management module includes a file reading and writing module and a desensitizing database, and the file reading and writing module is closely connected with the desensitizing database; The file reading and writing module is used to manage the storage, reading, updating and deletion operations of files, and to access and apply any desensitization rule table and desensitization word table in real time according to instructions; The desensitization database includes a desensitization rule table and a desensitization word table.

10. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the general text desensitization method based on a large language model and thought chain technology as described in any one of claims 1-7.