Data processing method and device based on large language model and medium

Through the data processing method based on the large language model, the encryption policy is dynamically adjusted and encrypted or decrypted, the limitations of the existing encryption methods and insufficient permission control are solved, and high-security data processing is achieved.

CN119484169AActive Publication Date: 2025-02-18CHINA TRANSPORT INFORMATION TECH GRP CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing encryption methods have limitations, and cannot dynamically adjust the encryption policy, and lack of permission control, making it difficult to meet the high requirements of complex systems for data security.

Method used

Using a data processing method based on a large language model, by obtaining user requests and file information, we can determine whether the file has been encrypted, and call the preset encryption algorithm library based on the file content feature value list to generate the target encryption algorithm, encrypt or decrypt, and associate 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 access control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484169A_ABST
    Figure CN119484169A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device based on a large language model and a medium, and relates to the technical field of data processing.The method comprises the steps that user request information is obtained, the user request information is recognized, a user request intention is obtained, and if a to-be-processed file is encrypted and the user request intention is to decrypt the to-be-processed file, the to-be-processed file is decrypted; and if yes, obtaining the user permission and returning a decryption result to the user based on the permission. If the user request intention is to encrypt a to-be-processed file and the to-be-processed file is not encrypted, acquiring a preset file content feature list and a target file content feature value list, and calling a preset encryption algorithm library by using a target large language model to generate an initial encryption algorithm list and a corresponding score list of the to-be-processed file; and the final score of each initial encryption algorithm is obtained in combination with the target random numerical value list, and the optimal encryption algorithm is selected based on score sorting to encrypt the to-be-processed file, so that the data security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This 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 Technology

[0002] With the rapid development of information technology, data security has become a focal point for both businesses and individual users. To protect data from unauthorized access, encryption technology has become one of the key technologies for ensuring information security. Existing encryption methods mainly include symmetric encryption, asymmetric encryption, and hash algorithms. Users can choose the appropriate encryption method to encrypt their data, thus ensuring data security to a certain extent.

[0003] However, this approach has several drawbacks. First, pre-set encryption algorithms have limitations. While these algorithms have undergone long-term security verification, with the improvement of computing power and the development of cryptanalysis techniques, fixed algorithms may gradually expose security vulnerabilities. Second, they lack adaptability. Existing encryption methods cannot dynamically adjust encryption strategies based on the specific content of the data and security requirements. This means that the encryption method may not be optimal when facing different types of data and constantly changing security threats. Finally, access control is insufficient. Existing encryption systems are usually rather coarse in terms of access control, making it difficult to achieve fine-grained access control, thus failing to meet the high data security requirements of complex systems. Summary of the Invention

[0004] To address the aforementioned technical problems, the present invention adopts the following technical solution: a data processing method based on a large language model, the data processing method comprising a data encryption method and a data decryption method, the data processing method comprising the following steps:

[0005] Obtain user request information and identify the user request information to obtain the user request intent and the information of the file to be processed, wherein the user request intent is to encrypt or decrypt the file to be processed.

[0006] Based on the information of the file to be processed, determine whether the file to be processed is encrypted;

[0007] If the user's request is intended to decrypt a file that is already encrypted, obtain the user's permissions, retrieve the decryption result based on the user's permissions, and return the decryption result to the user.

[0008] If the user's request is intended to encrypt a file to be processed but 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. The preset file content feature list includes several preset file content features, and the target file content feature value list includes the feature values ​​corresponding to several preset file content features of the file to be processed.

[0009] Based on the target file content feature value list, the target large language model calls the preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list. 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, which includes the target random value corresponding to each initial encryption algorithm;

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

[0012] Sort the final scores from largest to smallest, 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 the target encryption algorithm, 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.

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

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

[0016] This invention has at least the following beneficial effects: It acquires and identifies user request information, obtains the user's request intent and information about the file to be processed, determines whether the file is encrypted based on the file's information, and if the user's request intent is to decrypt the file and the file is encrypted, it acquires user permissions and obtains the decryption result based on those permissions, returning the result to the user. If the user's request intent is to encrypt the file and the file is not encrypted, it acquires a preset list of file content features and obtains a list of target file content feature values ​​corresponding to the file to be processed. Based on the target file content feature value list, it uses a target large language model to call a preset encryption algorithm library to generate a target encryption algorithm for the file to be processed. It then encrypts the file based on the target encryption algorithm, acquires the target encrypted file and its corresponding target key information, and associates and stores the target key information with the encrypted file. This system can customize the most suitable encryption method for different types of files, greatly improving data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

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

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] This invention provides a data processing method based on a large language model, such as... 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: Obtain user request information and identify the user request information to obtain the user request intent and the information of the file to be processed. The user request intent is to encrypt or decrypt the file to be processed.

[0022] Specifically, as those skilled in the art will know, any method in the prior art for identifying user request information and obtaining user request intent falls within the protection scope of this invention, and will not be elaborated here.

[0023] S200 determines whether the file to be processed is encrypted based on the information of the file to be processed.

[0024] Specifically, the file to be processed is obtained through its filename, and it is then determined whether the file is encrypted. Furthermore, any existing method for determining file encryption falls within the scope of this invention, and will not be elaborated upon here.

[0025] S300: If the user's request is intended to decrypt a file to be processed and the file to be processed is already encrypted, obtain the user's permissions, obtain the decryption result based on the user's permissions, and return the decryption result to the user.

[0026] S400, if the user's request is intended 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 the 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, the target large language model calls the preset encryption algorithm library to generate an initial encryption algorithm list and an initial score list. 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.

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

[0029] DES (Data Encryption Standard): A symmetric algorithm, a data encryption standard, relatively fast, suitable for encrypting large amounts of data; 3DES (Triple DES): A symmetric algorithm based on DES, encrypting a block of data three times with three different keys, providing higher strength; AES (Advanced Encryption Standard): A symmetric algorithm, the next-generation encryption standard, fast and with a high level of security. One implementation of the AES standard in the 21st century is the Rijndael algorithm; RSA (Relative Key Synthesis): Invented by RSA Corporation, it is a public-key algorithm that supports variable-length keys, meaning the length of the data block to be encrypted is also variable, making it an asymmetric algorithm; ECC (Elliptic Curve Cryptography): An algorithm for establishing public-key encryption based on elliptic curve mathematics; DSA (Digital Signature Algorithm): A standard DSS (Digital Signature Standard); MD5 (MD5 Digest): A widely used cryptographic hash function; SHA (Secure Hash) algorithm. Algorithm (secure hash algorithm) is a family of cryptographic hash functions and is a FIPS-certified secure hash algorithm.

[0030] The target large language model will combine the advantages and disadvantages of these encryption methods with the preset file content characteristics 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 more encryption methods from a preset encryption algorithm library.

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

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

[0034] S800 sorts the final scores from largest to smallest and uses the initial encryption algorithm corresponding to the largest final score as the target encryption algorithm for the file to be processed.

[0035] S900 encrypts the file to be processed based on the target encryption algorithm, obtains the target encrypted file and the target key information corresponding to the target encrypted file, and stores the target key information and the encrypted file together.

[0036] In summary, this invention acquires and identifies user request information, obtaining the user's request intent and information about the file to be processed. Based on the information about the file to be processed, it determines whether the file is encrypted. If the user's request intent is to decrypt the file and it is already encrypted, user permissions are granted, and the decryption result is obtained and returned to the user. If the user's request intent is to encrypt the file and it is not, a preset list of file content features is acquired, and a list of target file content feature values ​​corresponding to the file to be processed is obtained. Based on the target file content feature value list, a target large language model is used to call a preset encryption algorithm library 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 its corresponding target key information are obtained. The target key information and the encrypted file are then associated and stored. This invention, through a deep understanding of file content using a large language model, can customize the most suitable encryption method for different types of files, greatly improving data security and reducing the risk of data leakage. Furthermore, the adaptive encryption module can dynamically adjust the encryption strategy according to file characteristics and security requirements, making the encryption process more flexible and able to quickly adapt to constantly changing security threats.

[0037] Furthermore, based on the target file content feature value list, this 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 values ​​and initial scores accordingly to obtain the final score of each initial encryption algorithm, sorts the final scores from largest to smallest, 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 algorithms and adding the target random values, the randomness of the target encryption algorithms is strengthened, thereby improving the security of the target encryption algorithms.

[0038] Furthermore, the decryption method of this invention combines user permissions and access requests to achieve fine-grained management of user permissions, ensuring that only users with the corresponding permissions can access specific files, effectively preventing unauthorized access.

[0039] The process of obtaining user permissions, retrieving the decryption result based on those permissions, and returning the decryption result to the user includes the following steps:

[0040] Obtain user permission levels.

[0041] If the user's permission level meets the preset decryption requirements for the file to be processed, obtain the decryption key for the file to be processed, use the decryption key to decrypt the file to be processed, obtain the decryption result, and return the decryption result to the user.

[0042] If the user's permission level does not meet the preset decryption requirements for the file to be processed, a decryption refusal message is generated and returned to the user as the decryption result.

[0043] Specifically, by combining user permissions and the preset decryption requirements of the file to be processed, the system analyzes whether the user has the necessary permissions to read the file. If the requirements are met, the decryption tool is invoked to decrypt the file. The decryption request and user permission level are integrated into the decryption prompt, forming a structure similar to the following: "Please verify user permissions based on the following permission information: '[User Permission Level]'. If the permission verification passes, the '[Decryption Tool]' in the tool library is invoked to decrypt the file." Conversely, if the user's permission level does not meet the preset decryption requirements for the file to be processed, the decryption request is rejected and returned to the client.

[0044] Specifically, 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:

[0045] Obtain several historical processing files and the corresponding historical encryption method for each historical processing file, wherein the historical processing files and the files to be processed belong to the same scenario.

[0046] Based on historical processed files, a list of historical file content feature values ​​corresponding to the historical processed files is obtained. The list of historical file content feature values ​​includes feature values ​​corresponding to several preset file content features of the historical processed files.

[0047] Using a list of historical file content feature values ​​and historical encryption methods, a pre-defined large language model is trained to obtain a target large language model. Specifically, this invention also includes: fine-tuning the pre-defined large language model according to the business logic requirements of information security scenarios, selecting a suitable open-source pre-trained large language model as a base, including ChatGLM, Llama, etc. Combining relevant text data in the information security field, the pre-defined large language model is fine-tuned in a scenario-specific manner using LoRa fine-tuning technology, and finally saving the resulting large language model capable of handling information security issues, thus serving 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 a preset encryption algorithm library to generate the target encryption algorithm for the file to be processed, which also includes:

[0049] Based on the target file content feature value list, a target prompt statement is generated, which is: Please generate the target encryption algorithm based on the target file content feature value list.

[0050] Input the target prompt word statement 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, the initial interval value between any two initial scores is obtained, thereby obtaining an initial interval value list, which includes several initial interval values. The initial interval value between two initial scores is the difference between the two initial scores.

[0053] The average value of the initial interval is taken as the first interval value, and the maximum value among the initial interval values ​​is taken as the second interval value.

[0054] The interval formed by the first interval value and the second interval value is taken as the range of values ​​for 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 taken as the first interval value, and the maximum value among the initial interval values ​​is taken as the second interval value. The interval formed by the first interval value and the second interval value is taken as the range of the target random value. By specifying the range of the target random value, the target random value can affect the final score, making the selection of the target random value more reasonable.

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

[0057] Obtain a preset random number range list, which includes several preset random number ranges, and the preset random number range is a preset interval.

[0058] Based on a preset list of random number ranges, a target random number range is obtained by random sampling, where the target random number range is a preset random number range from the preset list of random number ranges.

[0059] Based on the target random number range, a random number is randomly selected to obtain a list of target random values.

[0060] In summary, the process involves obtaining a preset random number range list, randomly selecting from the preset random number range list to obtain a target random number range, and then randomly selecting from the target random number range to obtain a target random value list. Through these two random value selection processes, the target random values ​​are obtained more randomly, and the selection is made within the preset random value range, thus making the selection of the target random values ​​controllable.

[0061] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein 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 embodiments.

[0062] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0063] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the 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

  • Video encryption method, decryption method and device based on large model

    CN119277127A

  • Contextual knowledge summarization with large language models

    US20240346255A1

Cited By

  • Joint factoring data security protection method and system based on block chain

    CN120342653A