A data processing method, device and medium based on large language model

Through the data processing method based on the large language model, encryption algorithms are dynamically generated and encrypted, the problem that existing encryption methods cannot adjust encryption policies according to data content and security needs is solved, and high-security data protection and fine-grained permission control are achieved.

CN119484169BActive Publication Date: 2025-05-02CHINA TRANSPORT INFORMATION TECH GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510072752.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-02
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

The existing encryption methods have limitations, and it is impossible to dynamically adjust the encryption policy according to the specific content of the data and security needs, and the permission control is insufficient, making it difficult to achieve fine-grained access control.

Method used

The data processing method based on the large language model is adopted to obtain user requests and file information, determine whether the file has been encrypted, and the preset encryption algorithm library is called according to the file content feature value list to generate the target encryption algorithm, perform dynamic encryption, and associate the storage key information.

Benefits of technology

It realizes dynamic adjustment of encryption policies based on file characteristics and security needs, improves data security, reduces the risk of data leakage, and supports fine-grained permission control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484169B_ABST
    Figure CN119484169B_ABST
Patent Text Reader

Abstract

The present invention provides a data processing method, device and medium based on a large language model, which relates to the field of data processing technology. The method includes: obtaining user request information, identifying user request information and obtaining user request intention, if the file to be processed is encrypted and the user request intention is to decrypt the file to be processed, then obtaining user authority and obtaining the decryption result based on the authority and returning it to the user. If the user request intention is to encrypt the file to be processed and the file to be processed is not encrypted, then obtaining a preset file content feature list and a target file content feature value list, using a target large language model to call a preset encryption algorithm library to generate an initial encryption algorithm list and a corresponding score list for the file to be processed, combining the target random value list to obtain the final score of each initial encryption algorithm, and selecting the optimal encryption algorithm based on the score sorting to encrypt the file to be processed, thereby improving the security of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device and medium based on a large language model. Background Art

[0002] With the rapid development of information technology, data security has become the focus of attention for enterprises and individual users. In order to protect data from unauthorized access, encryption technology has become one of the key technologies to ensure information security. Existing encryption methods mainly include symmetric encryption, asymmetric encryption and hash algorithms. Users can choose the corresponding encryption method to encrypt data, which ensures data security to a certain extent.

[0003] However, this implementation has some defects. First, there are limitations in the pre-set encryption algorithms. Although these algorithms have been verified for a long time, with the improvement of computing power and the development of cryptanalysis technology, fixed algorithms may gradually expose security vulnerabilities. Second, there is a lack of adaptive capabilities. The existing encryption methods cannot dynamically adjust the encryption strategy according to the specific content and security requirements of the data, which means that when facing different types of data and changing security threats, the encryption method may not be optimal. Finally, the authority control is insufficient. The existing encryption system is usually extensive in authority control, and it is difficult to achieve fine-grained access control, thus failing to meet the high requirements of complex systems for data security. Summary of the invention

[0004] In view of the above technical problems, the technical solution adopted by the present invention is: a data processing method based on a large language model, the data processing method includes a data encryption method and a data decryption method, and the data processing method includes the following steps:

[0005] Obtaining user request information, identifying the user request information, and obtaining the user request intention and information about the file to be processed, wherein the user request intention is to encrypt or decrypt the file to be processed;

[0006] Based on the information of the file to be processed, determining whether the file to be processed has been encrypted;

[0007] If the user's request is intended to decrypt the file to be processed and the file to be processed has been encrypted, obtain the user's authority, obtain the decryption result based on the user's authority, and return the decryption result to the user;

[0008] If the user request intends to encrypt the to-be-processed file and the to-be-processed file is not encrypted, obtain a preset file content feature list, and obtain a target file content feature value list corresponding to the to-be-processed file based on the to-be-processed file, wherein the preset file content feature list includes a plurality of preset file content features, and the target file content feature value list includes feature values ​​corresponding to the plurality of preset file content features corresponding to the to-be-processed file;

[0009] Based on the target file content feature value list, the target large language model is used to call the preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list, wherein the initial encryption algorithm list includes several initial encryption algorithms, and the initial score list includes the initial score corresponding to each initial encryption algorithm;

[0010] Obtain a target random value list, wherein the target random value list includes a target random value corresponding to each initial encryption algorithm;

[0011] Add the target random value and the initial score accordingly to obtain the final score of each initial encryption algorithm;

[0012] Sort the final scores from large to small, and use the initial encryption algorithm corresponding to the largest final score as the target encryption algorithm for the file to be processed;

[0013] The file to be processed is encrypted based on a target encryption algorithm, and a target encrypted file and target key information corresponding to the target encrypted file are obtained; and the target key information and the encrypted file are associated and stored.

[0014] According to another aspect of the present invention, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the aforementioned method.

[0015] According to yet another aspect of the present invention, an electronic device is provided, comprising a processor and the aforementioned non-transitory computer-readable storage medium.

[0016] The present invention has at least the following beneficial effects: obtaining user request information, identifying the user request information, obtaining the user request intention and the information of the file to be processed, judging whether the file to be processed is encrypted based on the information of the file to be processed, if the user request intention is to decrypt the file to be processed and the file to be processed is encrypted, obtaining user authority, and obtaining the decryption result based on the user authority, and returning the decryption result to the user, if the user request intention is to encrypt the file to be processed and the file to be processed is not encrypted, obtaining a preset file content feature list, and obtaining a target file content feature value list corresponding to the file to be processed based on the file to be processed, based on the target file content feature value list, using the target large language model to call the preset encryption algorithm library to generate the target encryption algorithm for the file to be processed, encrypting the file to be processed based on the target encryption algorithm, obtaining the target encrypted file and the target key information corresponding to the target encrypted file; and storing the target key information and the encrypted file in association. The system can customize the most suitable encryption method for different types of files, greatly improving the security of data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 A flowchart of a data processing method based on a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0020] The embodiment of the present invention provides a data processing method based on a large language model. Figure 1 As shown, the data processing method includes a data encryption method and a data decryption method, and the data processing method includes the following steps:

[0021] S100, obtaining user request information, identifying the user request information, obtaining the user request intention and information about the file to be processed, wherein the user request intention is to encrypt or decrypt the file to be processed.

[0022] Specifically, those skilled in the art know that any method in the prior art for identifying user request information and obtaining user request intentions falls within the protection scope of the present invention and will not be described in detail here.

[0023] S200: Based on the information of the file to be processed, determine whether the file to be processed has been encrypted.

[0024] Specifically, the file to be processed is obtained through the file name of the file to be processed, and it is determined whether the file to be processed is encrypted. Specifically, any method for determining whether a file is encrypted in the prior art belongs to the protection scope of the present invention and will not be described in detail here.

[0025] S300: If the user request intends to decrypt the file to be processed and the file to be processed has been encrypted, obtain the user authority, obtain the decryption result based on the user authority, and return the decryption result to the user.

[0026] S400, if the user request intends to encrypt the file to be processed and the file to be processed is not encrypted, obtain a preset file content feature list, and obtain a target file content feature value list corresponding to the file to be processed based on the file to be processed, the preset file content feature list includes several preset file content features, and the target file content feature value list includes feature values ​​corresponding to several preset file content features corresponding to the file to be processed.

[0027] S500, based on the target file content feature value list, uses the target large language model to call the preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list, wherein the initial encryption algorithm list includes several initial encryption algorithms, and the initial score list includes an initial score corresponding to each initial encryption algorithm.

[0028] Specifically, the preset encryption algorithm library includes symmetric encryption algorithms, asymmetric encryption algorithms, and hash algorithms. The symmetric encryption algorithms include DES algorithms, 3DES algorithms, and AES algorithms, the asymmetric encryption algorithms include RSA algorithms, ECC algorithms, and DSA algorithms, and the hash algorithms include MD5 algorithms and SHA algorithms.

[0029] DES algorithm (Data Encryption Standard): symmetric algorithm, data encryption standard, fast speed, suitable for encrypting large amounts of data; 3DES algorithm (Triple DES): a symmetric algorithm based on DES, a block of data is encrypted three times with three different keys, with higher strength; AES (Advanced Encryption Standard): Advanced Encryption Standard, symmetric algorithm, is the next generation of encryption algorithm standard, fast speed, high security level, in the 21st century, one of the implementations of the AES standard is the Rijndael algorithm; RSA algorithm: invented by RSA, is a public key algorithm that supports variable-length keys, the length of the file block to be encrypted is also variable, and it is an asymmetric algorithm; ECC algorithm (Elliptic curve cryptography, abbreviated as elliptic curve cryptography), an algorithm for establishing public key encryption, based on elliptic curve mathematics; DSA algorithm (Digital Signature Algorithm): digital signature algorithm, is a standard DSS (Digital Signature Standard); MD5 algorithm is called MD5 message digest algorithm, is a widely used cryptographic hash function; SHA algorithm (Secure Hash Algorithm, Secure Hash Algorithm) is a family of cryptographic hash functions and is a secure hash algorithm certified by FIPS.

[0030] The target large language model will combine the advantages and disadvantages of these encryption methods and the preset file content features to adaptively select the most effective encryption method, thereby obtaining the target encryption algorithm for the file to be processed.

[0031] Specifically, the initial encryption algorithm is one or several encryption methods in a preset encryption algorithm library.

[0032] S600: Obtain a target random value list, where the target random value list includes a target random value corresponding to each initial encryption algorithm.

[0033] S700, adding the target random value and the initial score correspondingly to obtain the final score of each initial encryption algorithm.

[0034] S800, sort the final scores from large to small, and use the initial encryption algorithm corresponding to the largest final score as the target encryption algorithm for the file to be processed.

[0035] S900, encrypt the file to be processed based on the target encryption algorithm, obtain the target encrypted file and the target key information corresponding to the target encrypted file; and store the target key information and the encrypted file in association.

[0036] In summary, the user request information is obtained, and the user request information is identified, the user request intention and the information of the file to be processed are obtained, and based on the information of the file to be processed, it is determined whether the file to be processed is encrypted. If the user request intention is to decrypt the file to be processed and the file to be processed is encrypted, the user authority is obtained, and the decryption result is obtained based on the user authority, and the decryption result is returned to the user. If the user request intention is to encrypt the file to be processed and the file to be processed is not encrypted, a preset file content feature list is obtained, and a target file content feature value list corresponding to the file to be processed is obtained based on the file to be processed. Based on the target file content feature value list, a preset encryption algorithm library is called using a target large language model to generate a target encryption algorithm for the file to be processed, the file to be processed is encrypted based on the target encryption algorithm, and the target encrypted file and the target key information corresponding to the target encrypted file are obtained; and the target key information and the encrypted file are associated and stored. The present invention uses a large language model to deeply understand the file content. The present invention can customize the most suitable encryption method for different types of files, greatly improves the security of data, and reduces the risk of data leakage. The adaptive encryption module can dynamically adjust the encryption strategy according to file characteristics and security requirements, so that the encryption process is more flexible and can quickly adapt to changing security threats.

[0037] In addition, based on the target file content feature value list, the present invention uses a large language model to call a preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list, obtains a target random value list, adds the target random value and the initial score accordingly, obtains the final score of each initial encryption algorithm, sorts the final scores from large to small, and uses the initial encryption algorithm corresponding to the largest final score as the target encryption algorithm for the file to be processed. By scoring the initial encryption algorithm and adding the target random value, the randomness of the target encryption algorithm is made stronger, thereby improving the security of the target encryption algorithm.

[0038] Furthermore, the decryption method of the present invention combines user rights and access requests to achieve refined management of user rights, ensuring that only users with corresponding rights can access specific files, effectively preventing unauthorized access.

[0039] The steps of obtaining user permissions, obtaining decryption results based on the user permissions, and returning the decryption results to the user include the following:

[0040] Gets the user's permission level.

[0041] If the user authority level meets the preset decryption requirements corresponding to the file to be processed, the decryption key of the file to be processed is obtained, and the decryption key of the file to be processed is used to decrypt the file to be processed, the decryption result is obtained, and the decryption result is returned to the user.

[0042] If the user's authority level does not meet the preset decryption requirements corresponding to the file to be processed, a decryption rejection prompt word sentence is generated, and the decryption rejection prompt word sentence is returned to the user as the decryption result.

[0043] Specifically, by combining the user's permissions and the preset decryption requirements of the file to be processed, analyze whether the user meets the permission qualifications to read the file to be processed. If the requirements are met, call the decryption tool to decrypt the file. Integrate the decryption request and the user's permission level into the decryption prompt word to form a decryption prompt word structure similar to the following: "Please verify the user's permissions based on the following permission information: '[user permission level]'. If the permission verification passes, call '[decryption tool]' in the tool library to decrypt the file." Specifically, if the user's permission level does not meet the preset decryption requirements corresponding to the file to be processed, reject the decryption request and return it to the customer.

[0044] Specifically, before using the target large language model to call the preset encryption algorithm library to generate the target encryption algorithm of the file to be processed, the following steps are also included:

[0045] A plurality of historically processed files and a historical encryption method corresponding to each historically processed file are obtained, wherein the historically processed files and the files to be processed belong to the same scenario.

[0046] Based on the historical processing files, a historical file content feature value list corresponding to the historical processing files is obtained, wherein the historical file content feature value list includes feature values ​​corresponding to a plurality of preset file content features corresponding to the historical processing files.

[0047] The preset large language model is trained using the historical file content feature value list and the historical encryption method to obtain the target large language model. Specifically, the present invention also includes: fine-tuning the preset large language model according to the business logic requirements in the information security scenario, and selecting a suitable open source pre-trained large language model as a base, including ChatGLM, Llama, etc. In combination with text data related to the field of information security, the Lora fine-tuning technology is used to perform scenario-based fine-tuning on the preset large language model, and finally the large language model that can handle the field of information security is saved as the target large language model.

[0048] Specifically, based on the target file content feature value list, the target large language model is used to call the preset encryption algorithm library to generate the target encryption algorithm of the file to be processed, which also includes:

[0049] Based on the target file content feature value list, a target prompt word sentence is generated, and the target prompt word sentence is: please generate a target encryption algorithm according to the target file content feature value list.

[0050] The target prompt word sentence is input into the target large language model, and the target large language model calls the preset encryption algorithm library to generate the target encryption algorithm for the file to be processed.

[0051] Furthermore, obtaining the target random value list also includes the following steps:

[0052] Based on the initial score list, an initial interval value between any two initial scores is obtained, thereby obtaining an initial interval value list, wherein the initial interval value list includes a plurality of initial interval values. The initial interval value between the two initial scores is the difference between the two initial scores.

[0053] An average value of the initial interval values ​​is obtained as a first interval value, and a maximum value of the initial interval values ​​is obtained as a second interval value.

[0054] The interval formed by the first interval value to the second interval value is used as the value range of the target random value.

[0055] In summary, based on the initial score list, the initial interval value of any two initial scores is obtained, thereby obtaining the initial interval value list, the average value of the initial interval values ​​is obtained as the first interval value, and the maximum value of the initial interval values ​​is obtained as the second interval value, and the interval formed by the first interval value to the second interval value is used as the value range of the target random value. By stipulating the value range of the target random value, the target random value can affect the final score, making the value of the target random value more reasonable.

[0056] Furthermore, obtaining the target random value list also includes the following steps:

[0057] A preset random number range list is obtained, wherein the preset random number range list includes a plurality of preset random number ranges, and the preset random number range is a preset interval.

[0058] Based on the preset random number range list, random extraction is performed to obtain a target random number range, where the target random number range is a preset random number range in the preset random number range list.

[0059] Based on the target random number range, perform random sampling to obtain a list of target random number values.

[0060] In summary, a preset random number range list is obtained, and random drawing is performed based on the preset random number range list to obtain a target random number range. Based on the target random number range, random drawing is performed to obtain a target random value list. Through the process of two random value taking, the target random value is obtained more randomly, and the random selection is performed within the preset random value range, so that the selection of the target random value is controllable.

[0061] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0062] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.

[0063] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are only for illustration, not for limiting the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention.

Claims

1. A data processing method based on a large language model, characterized in that: The data processing method includes a data encryption method and a data decryption method, and the data processing method includes the following steps: Obtaining user request information, identifying the user request information, and obtaining the user request intention and information about the file to be processed, wherein the user request intention is to encrypt or decrypt the file to be processed; Based on the information of the file to be processed, determining whether the file to be processed has been encrypted; If the user's request is intended to decrypt the file to be processed and the file to be processed has been encrypted, obtain the user's authority, obtain the decryption result based on the user's authority, and return the decryption result to the user; If the user request intends to encrypt the to-be-processed file and the to-be-processed file is not encrypted, obtain a preset file content feature list, and obtain a target file content feature value list corresponding to the to-be-processed file based on the to-be-processed file, wherein the preset file content feature list includes a plurality of preset file content features, and the target file content feature value list includes feature values ​​corresponding to the plurality of preset file content features corresponding to the to-be-processed file; Based on the target file content feature value list, the target large language model is used to call the preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list, wherein the initial encryption algorithm list includes several initial encryption algorithms, and the initial score list includes the initial score corresponding to each initial encryption algorithm; Obtain a target random value list, wherein the target random value list includes a target random value corresponding to each initial encryption algorithm; Add the target random value and the initial score accordingly to obtain the final score of each initial encryption algorithm; Sort the final scores from large to small, and use the initial encryption algorithm corresponding to the largest final score as the target encryption algorithm for the file to be processed; The file to be processed is encrypted based on a target encryption algorithm, and a target encrypted file and target key information corresponding to the target encrypted file are obtained; and the target key information and the encrypted file are associated and stored.

2. The data processing method based on a large language model according to claim 1, characterized in that: Before using the target large language model to call the preset encryption algorithm library to generate the target encryption algorithm for the file to be processed, the following steps are also included: Obtaining a number of historical processing files and a historical encryption method corresponding to each historical processing file, wherein the historical processing files and the to-be-processed files belong to the same scenario; Based on the historical processing files, obtaining a historical file content feature value list corresponding to the historical processing files, wherein the historical file content feature value list includes feature values ​​corresponding to a plurality of preset file content features corresponding to the historical processing files; Use the historical file content feature value list and the historical encryption method to train the preset large language model to obtain the target large language model.

3. The data processing method based on a large language model according to claim 1, characterized in that: The preset encryption algorithm library includes at least a symmetric encryption algorithm, an asymmetric encryption algorithm, and a hash algorithm.

4. The data processing method based on a large language model according to claim 3, characterized in that: The symmetric encryption algorithms include DES algorithm, 3DES algorithm and AES algorithm, the asymmetric encryption algorithms include RSA algorithm, ECC algorithm and DSA algorithm, and the hash algorithms include MD5 algorithm and SHA algorithm.

5. The data processing method based on a large language model according to claim 1, characterized in that: Based on the target file content feature value list, the target large language model is used to call the preset encryption algorithm library to generate the target encryption algorithm for the file to be processed, which also includes: Based on the target file content feature value list, a target prompt word sentence is generated, wherein the target prompt word sentence is: please generate a target encryption algorithm according to the target file content feature value list; The target prompt word sentence is input into the target large language model, and the target large language model calls the preset encryption algorithm library to generate the target encryption algorithm for the file to be processed.

6. The data processing method based on a large language model according to claim 1, characterized in that: Obtain user permissions, obtain decryption results based on user permissions, and return the decryption results to the user, including: Get user permission level; If the user authority level meets the preset decryption requirements corresponding to the to-be-processed file, the decryption key of the to-be-processed file is obtained, and the to-be-processed file is decrypted using the decryption key of the to-be-processed file, the decryption result is obtained, and the decryption result is returned to the user; If the user's authority level does not meet the preset decryption requirements corresponding to the file to be processed, a decryption rejection prompt word sentence is generated, and the decryption rejection prompt word sentence is returned to the user as the decryption result.

7. The data processing method based on a large language model according to claim 1, characterized in that: Obtaining the target random value list also includes the following steps: Based on the initial score list, an initial interval value between any two initial scores is obtained, thereby obtaining an initial interval value list, wherein the initial interval value list includes a plurality of initial interval values; Obtaining an average value of the initial interval values ​​as a first interval value, and obtaining a maximum value of the initial interval values ​​as a second interval value; The interval formed by the first interval value to the second interval value is used as the value range of the target random value.

8. The data processing method based on a large language model according to claim 1, characterized in that: Obtaining the target random value list also includes the following steps: Obtaining a preset random number range list, wherein the preset random number range list includes a plurality of preset random number ranges, and the preset random number range is a preset interval; Based on the preset random number range list, a random draw is performed to obtain a target random number range, where the target random number range is a preset random number range in the preset random number range list; Based on the target random number range, perform random sampling to obtain a list of target random number values.

9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the data processing method based on a large language model as described in any one of claims 1-8.

10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.

Citation Information

Patent Citations

  • Data processing method

    CN113987593A

  • Large language model privacy information protection method

    CN117521116A