Long text sensitive data governance method and system based on large model interaction
By combining large language model and nifi data synchronization tool, the custom processor realizes the decoupling of desensitization rules and code, solving the problem of identification and processing of multiple sensitive information in long text, supporting data desensitization in one-to-one and one-to-many mapping relationships, improving processing flexibility and accuracy.
Patent Information
- Application Number
- CN202510554112.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the desensitization rules are highly coupled with the desensitization code, making it difficult to identify multiple sensitive information in long texts, and the scenario where fields and sensitive data are one-to-many mapping relationships are not processed.
It uses a large language model and nifi data synchronization tool to customize the nifi processor, and recognize sensitive data through process orchestration and perform desensitization, supporting data processing of one-to-one and one-to-many mapping relationships.
It realizes decoupling of desensitization rules and code, improves the accuracy and flexibility of long text sensitive data recognition, supports the identification and processing of a variety of sensitive information, and meets the needs of different users.
Smart Images

Figure CN120408715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data governance and large model technology, and specifically to a method and system for long-text sensitive data governance based on large model interaction. Background Art
[0002] Current data desensitization methods mostly focus on desensitizing sensitive data by writing code to manipulate database files. For example, they first determine in the database whether the target data column is a sensitive data column. Based on the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function, they determine the target desensitization rule for the target field. Based on the target desensitization rule, they generate the target desensitization configuration information corresponding to the target field. Analysis of the current research status of sensitive data desensitization methods reveals that most studies have the following two limitations:
[0003] ① Desensitization rules and desensitization codes are highly coupled. Different sensitive information requires different desensitization rules, which increases the difficulty for users when desensitizing data. Different sensitive information generally corresponds to different desensitization rules. Common sensitive information types include names, mobile phone numbers, ID card numbers, etc. There are more than a dozen types. Users need to select corresponding desensitization rules when faced with multiple sensitive information, which is cumbersome.
[0004] ② When reading sensitive data from database tables, the system is limited to a one-to-one mapping relationship between fields and sensitive data, making it impossible to identify sensitive information in long text data within the table. This means that it fails to account for a one-to-many mapping relationship between fields and sensitive data. Conventional desensitization methods struggle to identify the multiple sensitive information contained in long text data.
[0005] Therefore, how to decouple desensitization rules from desensitization codes and identify sensitive data in long texts is a technical problem that needs to be solved urgently. Summary of the Invention
[0006] The technical task of the present invention is to provide a long text sensitive data governance method and system based on large model interaction to solve the problem of how to decouple desensitization rules from desensitization codes and identify sensitive data in long texts.
[0007] The technical task of the present invention is achieved in the following way: a long text sensitive data governance method based on large model interaction, which is to deploy the NiFi data synchronization tool and the large language model locally or integrate the NiFi data synchronization tool and the large language model on a platform, implement the orchestration and operation of the overall desensitization process based on the NiFi data synchronization tool, implement sensitive data identification of long text data based on the large language model, customize the NiFi processor based on the NiFi data synchronization tool, and write the data desensitization process in the process orchestration interface of the NiFi data synchronization tool, as follows:
[0008] Data input: Read the data in the database through the data input processor QueryJdbcTableByCursor provided by the NiFi data synchronization tool, configure the information required to read the database, and set the database type, URL, user name, password, table name and field name;
[0009] Integrate sensitive information: Through a custom NiFi processor, connect it to the data input component in the process orchestration interface;
[0010] Identify sensitive data: By calling a large language model to analyze long text data containing sensitive data, identify the sensitive data in the data, and establish a mapping relationship between sensitive information types and sensitive information and store it in FlowFile;
[0011] Desensitizing sensitive data: Desensitizing data is performed through the desensitizing rules set in the custom NiFi processor;
[0012] Data output: Output the desensitized data to the specified database and configure the relevant information of the output database.
[0013] Preferably, the processing logic of the custom nifi processor is written in the onTrigger method of the corresponding custom nifi processor code. The onTrigger method is called when a FlowFile is passed into the custom nifi processor. The data transfer format between custom nifi processors is FlowFile, which associates a piece of data with a set of attributes about the corresponding data.
[0014] Among them, the result routing of the custom NiFi processor is set to at least two results: success and failure, so that the custom NiFi processor logic can be adjusted during the test process.
[0015] Preferably, the custom NiFi processor includes a sensitive data integration processor, a sensitive data identification processor, and a sensitive data desensitization processor;
[0016] Among them, the sensitive data integration processor is used to receive the database data read by the reading processor, convert each piece of data into JSON format data, and convert each converted JSON format data into a FlowFile format data and pass it to the sensitive data recognition processor; among them, the key in the JSON format data is the field name, and the value is the field content;
[0017] The sensitive data recognition processor is used to receive the FlowFile format data passed by the sensitive data integration processor, parse the sensitive data in JSON format from the FlowFile format data, call the large language model interface deployed locally, and merge the sensitive data and the required prompt words as the parameters passed to the large language model. The sensitive information result recognized by the large language model is returned in JSON format. At this time, the key in the JSON format is the sensitive information type, and the value is the sensitive information;
[0018] The sensitive data desensitization processor is used to receive the sensitive information recognition result passed by the sensitive data recognition processor and perform desensitization processing according to the edited desensitization rules.
[0019] More preferably, when integrating sensitive information, add an attribute in the FlowFile to identify the mapping relationship between sensitive fields and sensitive information types to prevent the loss of field mapping when outputting desensitized data.
[0020] More preferably, when identifying sensitive data, set the prompt words of the large language model to improve the recognition accuracy of the large language model; among them, the filling of the prompt words includes the description of the function to be implemented and the result description; the result description includes the result format, result constraints, and result examples. Clear result constraints and result examples help the large language model understand the intention; the function description to be implemented refers to the function that the large language model needs to implement; the result description refers to the result format that the large language model needs to return; the result constraint refers to the constraint that the large language model generates unwanted descriptions; the result example refers to adding an example of the data to be returned in the prompt words.
[0021] More preferably, when outputting data, the output methods of desensitized data include only identifying sensitive data, desensitizing data and replacing sensitive data, and desensitizing data and retaining the original sensitive data;
[0022] Among them, only identifying sensitive data means outputting the identified sensitive data to a specified table, creating a new field to store the corresponding sensitive information, and not storing the desensitized data;
[0023] Desensitizing data and replacing sensitive data means that after desensitizing the sensitive data, storing the desensitized data in the original field of the specified table, that is, not retaining the original sensitive information;
[0024] Data desensitization and retention of original sensitive data means that after desensitizing sensitive data, the desensitized data is stored in a newly created field of a specified table, that is, the original sensitive information is retained, and the new field is based on the field name of the original data and is identified by adding prefixes and suffixes.
[0025] More preferably, the desensitization rule refers to setting a hierarchical desensitization mechanism according to the length of sensitive data; among them, the basic rule of the hierarchical desensitization mechanism is to hide the middle data and display the first and last data, while protecting the sensitive information, retaining the identifiability of the sensitive information; specifically as follows:
[0026] If the data length L = 1, all are replaced with *;
[0027] If the data length L = 2, the last character is replaced with *;
[0028] If the data length 2 < L ≤ 8, one character is retained at the beginning and end, and the rest are replaced with *;
[0029] If the data length 8 < L ≤ 16, three characters are retained at the beginning and end, and the rest are replaced with *;
[0030] If the data length L > 16, five characters are retained at the beginning and end, and the rest are replaced with *;
[0031] More preferably, the desensitization process of the custom nifi processor is specifically as follows:
[0032] When reading data from the database table of the sensitive data to be recognized, establish the mapping relationship between the sensitive fields in the database table and the sensitive data types, and the mapping relationship between the sensitive fields and the sensitive types in the database table will be stored and transmitted in the FlowFile format data throughout the desensitization process;
[0033] During the process of the large language model for sensitive data recognition, establish the mapping relationship between the sensitive data types and the sensitive data, and the mapping relationship between the sensitive data types and the sensitive data will be stored and transmitted in the FlowFile format data;
[0034] Until the sensitive data is completely desensitized, when outputting the desensitized data to the target database table, read and combine the two mapping relationships of the mapping relationship between the sensitive fields and the sensitive data types and the mapping relationship between the sensitive data types and the sensitive data in the FlowFile format data, obtain the mapping relationship between the sensitive fields and the sensitive data, and store the sensitive data in the correct desensitized field;
[0035] Among them, different mapping relationships between sensitive fields and sensitive data are distinguished, including two categories: the one-to-one mapping relationship between sensitive fields and sensitive data and the one-to-many mapping relationship between sensitive fields and sensitive data.
[0036] An electronic device, comprising: a memory and at least one processor;
[0037] Wherein, a computer program is stored on the memory;
[0038] The at least one processor executes the computer program stored in the memory, such that the at least one processor executes the long text sensitive data governance method based on large model interaction as described above.
[0039] A computer-readable storage medium, in which a computer program is stored, and the computer program can be executed by a processor to implement the long text sensitive data governance method based on large model interaction as described above.
[0040] The long text sensitive data governance method and system of the present invention have the following advantages:
[0041] (1) The present invention utilizes the significant advantages of large language models in analyzing long text data to identify sensitive information in long text, expanding the limitations of identifying long text sensitive data based on cumbersome code; in addition, the desensitization method implemented based on the nifi data integration tool realizes the process orchestration of desensitization processing through simple operations such as dragging and dropping, and the data processing results of each step are observable;
[0042] (2) After the nifi process is orchestrated, the present invention starts the data desensitization process, based on the data processing process of nifi. It can achieve the segmented execution of the process, that is, start and execute the processors one by one, reduce the coupling of the overall process, and ensure the accuracy of the data processing results; at the same time, the data transmitted between the custom nifi processors can be viewed through the queue, achieving the purpose of viewing the results of each processor;
[0043] (3) The present invention decouples the desensitization rules and desensitization code by customizing the data desensitization processor in the nifi data integration tool; in addition, the custom sensitive data recognition processor is used to call the locally deployed large language model to identify the long text data in the database, achieving the purpose of identifying sensitive data in the long text;
[0044] (4) The present invention designs different desensitization methods for sensitive data in the process of government affairs data processing to meet different processing needs of users; in the case of a one-to-many mapping relationship between fields and sensitive data, a large language model is used to identify the sensitive data existing in the long text, providing conditions for subsequent data desensitization;
[0045] (5) The present invention is based on the open-source data integration tool Apache Nifi for local deployment, and customizes three data processing processors, namely: a sensitive data integration processor, an identification processor, and a desensitization processor; and based on the sensitive data integration processor, the identification processor, and the desensitization processor, a process is written in the nifi process orchestration interface, and the process steps are: start, read data, sensitive data integration, identification, desensitization, desensitization result output, and end; in addition, combined with the actual processing requirements, three desensitization methods for sensitive data are designed, namely: only identify sensitive data, desensitize data and replace sensitive data, and desensitize data and retain the original sensitive data;
[0046] (6) The present invention not only supports the desensitization processing of common one-to-one mapping relationship scenarios, but also supports the desensitization processing of long text data with a one-to-many mapping relationship between fields and sensitive data;
[0047] (7) The present invention customizes the desensitization process of long text data, differentiates different desensitization methods for sensitive fields and sensitive data under different mapping relationships, and realizes the orchestration of the overall data desensitization process based on the open-source data integration tool nifi. Sensitive data identification and desensitization are achieved by customizing three nifi processors. Universal desensitization rules are customized to decouple sensitive information types and desensitization rules, and different output methods of desensitized data are preset to meet different user requirements for the display methods of desensitized data. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The present invention will be further described below with reference to the accompanying drawings.
[0049] Attached Figure 1 is a flowchart of a long text sensitive data governance method based on large model interaction;
[0050] Attached Figure 2 is a schematic diagram of desensitization rules. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] The long text sensitive data governance method and system of the present invention will be described in detail below with reference to the accompanying drawings of the specification and specific embodiments.
[0052] Example 1:
[0053] As attached Figure 1As shown, this embodiment provides a long text sensitive data governance method based on large model interaction. The method is to deploy the NiFi data synchronization tool and the large language model locally or integrate the NiFi data synchronization tool and the large language model on a platform, implement the orchestration and operation of the overall desensitization process based on the NiFi data synchronization tool, implement sensitive data identification of long text data based on the large language model, customize the NiFi processor based on the NiFi data synchronization tool, and write the data desensitization process in the process orchestration interface of the NiFi data synchronization tool, as follows:
[0054] S1. Data input: Read the data in the database through the data input processor QueryJdbcTableByCursor that comes with the NiFi data synchronization tool, configure the information required to read the database, and set the database type, URL, user name, password, table name, and field name;
[0055] S2. Integrate sensitive information: Connect the process orchestration interface with the data input component through a custom NiFi processor;
[0056] S3, Identify sensitive data: By calling the large language model to analyze long text data containing sensitive data, identify the sensitive data in the data, and establish a mapping relationship between sensitive information type and sensitive information and store it in FlowFile;
[0057] S4. Desensitize sensitive data: Desensitize the data using the desensitization rules set in the custom NiFi processor;
[0058] S5. Data output: Output the desensitized data to the specified database and configure the relevant information of the output database.
[0059] The processing logic of the custom nifi processor in this embodiment is written in the onTrigger method of the corresponding custom nifi processor code. The onTrigger method is called when a FlowFile is passed into the custom nifi processor. The data transfer format between custom nifi processors is FlowFile, which associates a piece of data with a set of attributes about the corresponding data;
[0060] Among them, the result routing of the custom NiFi processor is set to at least two results: success and failure, so that the custom NiFi processor logic can be adjusted during the test process.
[0061] The custom NiFi processor in this embodiment includes a sensitive data integration processor, a sensitive data identification processor, and a sensitive data desensitization processor;
[0062] Among them, the sensitive data integration processor is used to receive the database data read by the reading processor, convert each piece of data into JSON format data, convert each converted JSON format data into a FlowFile format data, and pass it to the sensitive data recognition processor; among them, the key in the JSON format data is the field name, and the value is the field content;
[0063] The sensitive data recognition processor is used to receive the FlowFile format data passed from the sensitive data integration processor, parse the sensitive data in JSON format from the FlowFile format data, call the large language model interface deployed locally, merge the sensitive data and the compliant prompt words as the parameters passed to the large language model, and the sensitive information result recognized by the large language model is returned in JSON format. At this time, the key in the JSON format is the sensitive information type, and the value is the sensitive information;
[0064] The sensitive data desensitization processor is used to receive the sensitive information recognition result passed from the sensitive data recognition processor and perform desensitization processing according to the edited desensitization rules.
[0065] When integrating sensitive information in step S2 of this embodiment, add an attribute to the FlowFile by itself to identify the mapping relationship between the sensitive field and the sensitive information type, and prevent the loss of field mapping when the desensitized data is output, such as {name: name}.
[0066] When identifying sensitive data in step S3 of this embodiment, set the prompt words of the large language model to improve the recognition accuracy of the large language model; among them, the filling of the prompt words includes the description of the function to be implemented and the result description; the result description includes the result format, result constraints, and result examples. Clear result constraints and result examples help the large language model understand the intention; the description of the function to be implemented refers to the function that the large language model needs to implement, such as "identifying sensitive information, name, mobile phone number, and ID card number"; the result description refers to the result format that the large language model needs to return, such as "returning sensitive information in JSON format"; the result constraint refers to restricting the large language model from generating unnecessary descriptions, such as "the result does not need to be explained, only the identified sensitive data is returned"; the result example refers to adding an example of the data to be returned in the prompt words.
[0067] When the data is output in step S5 of this embodiment, the output methods of the desensitized data include only identifying sensitive data, desensitizing the data and replacing the sensitive data, and desensitizing the data and retaining the original sensitive data;
[0068] Among them, only identifying sensitive data means outputting the identified sensitive data to a specified table, creating a new field to store the corresponding sensitive information, and not storing the desensitized data;
[0069] Data desensitization and replacement of sensitive data means that after desensitizing sensitive data, the desensitized data is stored in the original field of the specified table, that is, the original sensitive information is not retained;
[0070] Data desensitization and retention of original sensitive data means that after desensitizing sensitive data, the desensitized data is stored in a newly created field of the specified table, that is, the original sensitive information is retained, and the new field is identified by adding prefixes and suffixes based on the field name of the original data.
[0071] As attached Figure 2 As shown, the desensitization rule in this embodiment refers to setting a hierarchical desensitization mechanism according to the length of sensitive data; among them, the basic rule of the hierarchical desensitization mechanism is to hide the middle data and display the head and tail data, while protecting the sensitive information, retaining the identifiability of the sensitive information; specifically as follows:
[0072] If the data length L = 1, all are replaced with *;
[0073] If the data length L = 2, the last character is replaced with *;
[0074] If the data length 2 < L ≤ 8, one character at the head and tail is retained, and the rest are replaced with *;
[0075] If the data length 8 < L ≤ 16, three characters at the head and tail are retained, and the rest are replaced with *;
[0076] If the data length L > 16, five characters at the head and tail are retained, and the rest are replaced with *;
[0077] The desensitization process of the custom nifi processor in this embodiment is specifically as follows:
[0078] (1) When reading data from the database table of the sensitive data to be identified, establish the mapping relationship between the sensitive fields in the database table and the sensitive data types, and the mapping relationship between the sensitive fields and the sensitive types in the database table will be stored and passed in the FlowFile format data during the desensitization process;
[0079] (2) During the process of identifying sensitive data by the large language model, establish the mapping relationship between the sensitive data types and the sensitive data, and the mapping relationship between the sensitive data types and the sensitive data will be stored and passed in the FlowFile format data;
[0080] (3) Until the sensitive data is completely desensitized, when outputting the desensitized data to the target database table, read and combine the two mapping relationships of the mapping relationship between the sensitive fields in the database table and the sensitive data types and the mapping relationship between the sensitive data types and the sensitive data in the FlowFile format data, obtain the mapping relationship between the sensitive fields and the sensitive data, and store the sensitive data in the correct desensitized field;
[0081] Among them, different mapping relationships between sensitive fields and sensitive data are distinguished, which are divided into two categories: one-to-one mapping relationship between sensitive fields and sensitive data and one-to-many mapping relationship between sensitive fields and sensitive data.
[0082] Embodiment 2:
[0083] This embodiment also provides an electronic device, including: a memory and at least one processor;
[0084] Among them, the memory stores computer execution instructions;
[0085] The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the long text sensitive data governance method based on large model interaction according to any one of the present invention.
[0086] The processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0087] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, memory, plug-in hard disks, smart media cards (SMCs), secure digital (SD) cards, flash memory cards, at least one magnetic disk storage period, flash memory devices, or other volatile solid-state storage devices.
[0088] Embodiment 3:
[0089] This embodiment also provides a computer-readable storage medium, in which multiple instructions are stored. The instructions are loaded by the processor to make the processor execute the long text sensitive data governance method based on large model interaction in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided. Software program codes for realizing the functions of any one of the above embodiments are stored on the storage medium, and the computer (or CPU or MPU) of the system or device reads and executes the program codes stored in the storage medium.
[0090] In this case, the program code read from the storage medium itself can implement the functions of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present invention.
[0091] Examples of the storage medium for providing the program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, the program code can be downloaded from a server computer via a communication network.
[0092] In addition, it should be clear that not only can the functions of any one of the above embodiments be realized by executing the program code read by the computer, but also by making the operating system or the like operating on the computer based on the instructions of the program code to complete part or all of the actual operations.
[0093] In addition, it can be understood that the program code read from the storage medium is written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then based on the instructions of the program code, the CPU or the like installed on the expansion board or the expansion unit is made to execute part or all of the actual operations, thereby realizing the functions of any one of the above embodiments.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for governing long-text sensitive data based on large model interaction, characterized in that, This method is to deploy the NiFi data synchronization tool and the large language model locally or on a platform that integrates the NiFi data synchronization tool and the large language model, implement the orchestration and operation of the overall desensitization process based on the NiFi data synchronization tool, implement sensitive data identification of long text data based on the large language model, customize the NiFi processor based on the NiFi data synchronization tool, and write the data desensitization process in the process orchestration interface of the NiFi data synchronization tool. The details are as follows: Data input: Read the data in the database through the data input processor QueryJdbcTableByCursor provided by the NiFi data synchronization tool, configure the information required to read the database, and set the database type, URL, user name, password, table name and field name; Integrate sensitive information: Through a custom NiFi processor, connect it to the data input component in the process orchestration interface; Identify sensitive data: By calling a large language model to analyze long text data containing sensitive data, identify the sensitive data in the data, and establish a mapping relationship between sensitive information types and sensitive information and store it in FlowFile; Desensitizing sensitive data: Desensitizing data is performed through the desensitizing rules set in the custom NiFi processor; Data output: Output the desensitized data to the specified database and configure the relevant information of the output database.
2. The long text sensitive data governance method based on large model interaction according to claim 1, wherein The processing logic of the custom nifi processor is written in the onTrigger method of the corresponding custom nifi processor code. The onTrigger method is called when a FlowFile is passed into the custom nifi processor. The data transfer format between custom nifi processors is FlowFile, which associates a piece of data with a set of attributes about the corresponding data. Among them, the result routing of the custom NiFi processor is set to at least two results: success and failure, so that the custom NiFi processor logic can be adjusted during the test process.
3. The long text sensitive data governance method based on large model interaction according to claim 1 or 2, characterized in that, Customized NiFi processors include sensitive data integration processor, sensitive data identification processor and sensitive data desensitization processor; Among them, the sensitive data integration processor is used to receive the database data read from the reading processor, and convert each data into json format data, convert each converted json format data into a FlowFile format data and pass it to the sensitive data identification processor; among them, the key in the json format data is the field name, and the value is the field content; The sensitive data identification processor is used to receive the FlowFile format data delivered by the sensitive data integration processor, parse the sensitive data in json format from the FlowFile format data, call the locally deployed large language model interface, merge the sensitive data and the prompt words that meet the requirements as parameters passed to the large language model, and the sensitive information results identified by the large language model are returned in json format. At this time, the key in the json format is the sensitive information type, and the value is the sensitive information; The sensitive data desensitization processor is used to receive the sensitive information recognition results passed from the sensitive data recognition processor and perform desensitization processing according to the edited desensitization rules.
4. The long text sensitive data governance method based on large model interaction according to claim 3, characterized in that, When integrating sensitive information, add an attribute to the FlowFile by itself to identify the mapping relationship between sensitive fields and sensitive information types, preventing the loss of field mapping when desensitized data is output.
5. The method for governing long-text sensitive data based on large model interaction according to claim 4, wherein, When identifying sensitive data, set the prompt words of the large language model to improve the recognition accuracy of the large language model; among them, the filling of the prompt words includes the description of the function to be implemented and the result description; the result description includes the result format, result constraints, and result examples; the description of the function to be implemented refers to the function that the large language model needs to implement; the result description refers to the result format that the large language model needs to return; the result constraints refer to the constraints to prevent the large language model from generating unnecessary descriptions; the result examples refer to adding examples of the data to be returned in the prompt words.
6. The long text sensitive data governance method based on large model interaction according to claim 5, characterized in that When data is output, the output methods of desensitized data include only identifying sensitive data, desensitizing data and replacing sensitive data, and desensitizing data and retaining the original sensitive data; Among them, only identifying sensitive data means outputting the identified sensitive data to the specified table, creating a new field to store the corresponding sensitive information, and not storing the desensitized data; Desensitizing data and replacing sensitive data means that after desensitizing the sensitive data, storing the desensitized data in the original field of the specified table, that is, not retaining the original sensitive information; Desensitizing data and retaining the original sensitive data means that after desensitizing the sensitive data, storing the desensitized data in the newly created field of the specified table, that is, retaining the original sensitive information, and the new field is identified by adding prefixes and suffixes based on the field name of the original data.
7. The method for governing long-text sensitive data based on large model interaction according to claim 6, wherein, The desensitization rule refers to setting a hierarchical desensitization mechanism according to the length of sensitive data; among them, the basic rule of the hierarchical desensitization mechanism is to hide the middle data and display the head and tail data, while ensuring the masking of sensitive information and retaining the identifiability of sensitive information; specifically as follows: If the data length L = 1, all are replaced with *; If the data length L = 2, the last character is replaced with *; If the data length 2 < L ≤ 8, one character is retained at the head and tail, and the rest are replaced with *; If the data length 8 < L ≤ 16, three characters are retained at the head and tail, and the rest are replaced with *; If the data length L > 16, five characters are retained at the head and tail, and the rest are replaced with *; 8. The method for governing long-text sensitive data based on large model interaction according to claim 3, wherein The desensitization process of the custom nifi processor is specifically as follows: When reading data from the database table of sensitive data to be identified, establish the mapping relationship between sensitive fields and sensitive data types in the database table, and the mapping relationship between sensitive fields and sensitive types in the database table will be stored and transmitted in the FlowFile format data during the desensitization process; During the process of the large language model identifying sensitive data, establish the mapping relationship between sensitive data types and sensitive data, and the mapping relationship between sensitive data types and sensitive data will be stored and transmitted in the FlowFile format data; After the sensitive data is completely desensitized, when outputting the desensitized data to the target database table, read and combine the two mapping relationships of the mapping relationship between the sensitive fields and sensitive data types in the database table in the FlowFile format data and the mapping relationship between the sensitive data types and sensitive data to obtain the mapping relationship between the sensitive fields and sensitive data, and store the sensitive data in the correct desensitized fields; Among them, different mapping relationships between sensitive fields and sensitive data are distinguished, including two categories: one-to-one mapping relationship between sensitive fields and sensitive data and one-to-many mapping relationship between sensitive fields and sensitive data.
9. An electronic device, characterized in that, Including: A memory and at least one processor; Wherein, a computer program is stored on the memory; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the long-text sensitive data governance method based on large model interaction according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and the computer program can be executed by a processor to implement the long-text sensitive data governance method based on large model interaction according to any one of claims 1 to 8.