Large model authority management method and device
Through the combination of external backend knowledge base and vector database, the problem of sensitive data leakage in large model permission management is solved, and the permission management method with good confidentiality effect is realized, without user experience.
Patent Information
- Application Number
- CN202510511677.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-25
AI Technical Summary
Large models are difficult to effectively protect sensitive data in permission management, and users can bypass traditional permission management mechanisms, resulting in the leakage of sensitive information.
Through the external backend knowledge base, a mapping relationship between user roles and data access permissions is established, and a vector database is used to calculate eigenvalues, and only authorized knowledge data is provided to the user as the context of the question to answer.
It realizes effective protection of sensitive data, ensuring that only users with permission can access relevant information, improving confidentiality effect, and at the same time, the user experience is unaware.
Smart Images

Figure CN120372659A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and particularly to a large model permission management method and device with good confidentiality effect. Background Art
[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) have demonstrated powerful capabilities in the fields of natural language processing, computer vision, etc., and have gradually been applied to various industries. However, the popularization of large model applications has also brought new challenges, one of which is the permission management problem. Permission management is to ensure that a user can only perform operations that meet the requirements after the user's identity is confirmed. Many previous applications adopted role-based access control (RBAC) or attribute-based access control (ABAC). Specifically, when performing a specific operation, it is first checked whether the user has the permission to perform this action. If not, access is denied. Such methods are very common in traditional applications.
[0003] On the enterprise side, many problems solved by large model applications involve a lot of sensitive data. For example, asking the large model to tell the average salary of department personnel involves information on personnel salaries. This information is okay for finance or department heads, but needs to be kept confidential from employees. However, the characteristic of large models is that once they learn this knowledge, anyone can ask similar questions, and the questions themselves can be designed in various forms, resulting in very difficult permission management.
[0004] A simple thought is to analyze the questions of the large model. If it is considered that the question involves restricted access data, no answer will be given. However, one of the advantages of large models themselves is that they can understand natural language. When inputting questions, people can always find ways to bypass these restrictions, making such permission management difficult to play a role.
[0005] Therefore, it is necessary to propose an improvement to overcome the defects of the prior art. Summary of the Invention
[0006] The purpose of the present invention is to solve the problems in the prior art and provide a large model permission management method and device with good confidentiality effect.
[0007] The technical solution of the present invention is as follows: A large model permission management method includes the following steps: S1. Build a large model and complete model training using general knowledge; S2. Establish a background knowledge base, process the data in the background knowledge base, establish a mapping relationship between user roles and data access permissions, and different user roles have different access permissions to data; S3. Calculate eigenvalue and vectorize the data in the knowledge base to establish a vector database; Connect the vector database with the large model for data communication; S4. When a user asks a question, first extract the features of the user question and compare it with the vector data in the vector database to find the vector data related to the user question. The vector database obtains knowledge data from the background knowledge base. When the vector database obtains knowledge data from the background knowledge base, it combines the user role to determine whether the relevant knowledge data in the background knowledge base is accessible to the user. If the user has access permission, the knowledge data is fed back to the large model for question answering. If the user has no access permission, it answers the question in combination with general knowledge and feeds it back to the user; S5. After the question answering is completed, the large model is reset to the state before obtaining the background knowledge base and is ready to answer the next question.
[0008] As a preferred technical solution, the large model includes a main control model and a special language model. The main control model extracts question features, and the special language model answers questions in combination with the knowledge data accessible to the user role.
[0009] As a preferred technical solution, when the vector database obtains knowledge data from the background database in step S4, the number and scope of the knowledge data are set through parameters.
[0010] As a preferred technical solution, the judgment of the user role in step S4 can be to log in the user before asking a question, or the user can input login information when the vector database obtains knowledge data from the background knowledge base.
[0011] The present invention also provides a large model permission management device for implementing the above large model permission management method, including a model operation module, a feature extraction module, a vector database, and a background knowledge base; the model operation module deploys, trains, and applies the large model; the feature extraction module is used to extract the features of the user question; the vector database is used to store the eigenvalues of the knowledge data in the background knowledge base; the background database is used to store knowledge data, and the knowledge data is mapped with user roles, and different user roles access different knowledge data; the model operation module communicates with the background knowledge base through feature data, and the large model answers user questions in combination with the accessible data in the background knowledge base corresponding to the user role.
[0012] As a preferred technical solution, the large model operated by the model operation module includes a main control model and a special language model.
[0013] A large model permission management method and device of the present invention isolate the knowledge data that needs permission management through an external background knowledge base. During the process of user questioning, eigenvalue is obtained through an algorithm, and then relevant external knowledge with permission management is obtained from the vector database. Only the knowledge data that is relevant and the user role has access permission is utilized, and this batch of knowledge data is used as the context for the large model to answer the user's questions. In this way, the part of the data that the user has no permission to access will not appear in the answer, playing a role in data protection. Therefore, the large model permission management method and device of the present invention have the advantage of good confidentiality effect. Brief Description of the Drawings
[0014] Figure 1 It is a flowchart of the specific implementation manner of a large model permission management method of the present invention; Figure 2 It is a structural block diagram of the specific implementation manner of a large model permission management device of the present invention. Specific Embodiment
[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0016] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the", and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. "Multiple" generally includes at least two, but does not exclude the case of including at least one.
[0017] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0018] Depending on the context, as used herein, the words "if" and "when" can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".
[0019] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a commodity or system comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such commodity or system. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the commodity or system comprising said element.
[0020] As Figure 1 As shown in the flowchart of the specific implementation of a large model permission management method of the present invention, a large model permission management method in this embodiment includes the following steps: S1. Build a large model and complete model training using general knowledge; S2. Establish a background knowledge base, process the data in the background knowledge base, establish a mapping relationship between user roles and data access permissions, and different user roles have different data access permissions; S3. Calculate eigenvalue and vectorize the data in the knowledge base to establish a vector database; connect the vector database with the large model for data communication; S4. When a user asks a question, first extract the features of the user question, compare it with the vector data in the vector database to find the vector data related to the user question, and obtain knowledge data from the background knowledge base by the vector database; when the vector database obtains knowledge data from the background knowledge base, judge whether the relevant knowledge data in the background knowledge base is accessible to the user in combination with the user role. If the user has access permission, feedback the knowledge data to the large model for question answering. If the user has no access permission, answer in combination with general knowledge and feedback to the user; S5. After the question answering is completed, reset the large model to the state before obtaining the background knowledge base and prepare to answer the next question.
[0021] In this embodiment, the large model includes a main control model and a special language model. The main control model extracts question features, and the special language model answers questions in combination with the knowledge data accessible to the user role.
[0022] A large model permission management method in this embodiment is that all general knowledge (which does not require permission management) is imported into each model and becomes part of their knowledge systems, while those that require permission management are placed in the background knowledge base, and the eigenvalue of each is calculated and placed in the vector database. After the user asks a question, the main control model first calculates the eigenvalue of the question, and then finds the knowledge in the background knowledge base in the vector database that is relevant to this question. The number and range can be set through parameters. These relevant knowledge are extracted and sent as the context related to the question into a certain special language model for the model to answer.
[0023] A large model permission management method of the present invention places the permission control on the background knowledge base. When the vector database needs to extract background knowledge, the large model permission management method of the present invention sends the user role as a parameter. Based on the permission management rules, the algorithm filters the extracted knowledge to see which knowledge the user can access and which cannot be accessed, and only returns the content that the user can access as the context of the question for the special language model to answer. After completing the answer to this question, the state of this special language model returns to the initial state (that is, the state before seeing the background knowledge) to prepare to answer the next question. In this way, this knowledge protected by permissions only takes effect in the user's current question, does not change the capabilities of the large model itself, and can also ensure that restricted access data is only visible to those with permissions. Moreover, the entire process of the large model permission management method of the present invention is imperceptible to the user. In the extreme case, if the user cannot access the task background knowledge, then the context of this question is empty, and the large model only uses its own existing capabilities combined with general knowledge to answer the question, without involving any information on restricted access. On the contrary, if the user has permissions, that knowledge is placed in the large model together with the question as context, and the answer will be more accurate.
[0024] A large model permission management method of the present invention enables the large model to only understand general knowledge (knowledge that does not require permission protection) by separating the external knowledge base and the internal knowledge of the large model. And through the permission control of the data in the external knowledge base, it is avoided that restricted access content reaches those without permissions. Compared with screening questions, the present invention can ensure the effectiveness of the permission mechanism. Moreover, the entire process of the large model permission management method of the present invention is transparent to the user, and the user experience is exactly the same as when there is no permission management, with a good user experience. In this embodiment, through parameter design, it is possible to define how many pieces / bytes of knowledge with restricted access are given for a specific question, which is a method to balance efficiency and answer quality.
[0025] In the actual application process, the judgment of the user role in step S4 can be to log in the user before asking a question, or the user can input the login information when the vector database obtains knowledge data from the background knowledge base. Neither affects the embodiment of the advantages of the present invention.
[0026] As Figure 2 shown, this embodiment discloses a large model permission management device, including a model operation module, a feature extraction module, a vector database, and a background knowledge base; The model operation module deploys, trains, and applies the large model; The feature extraction module is used to extract features from the user's question; The vector database is used to store the eigenvalue of the knowledge data in the background knowledge base; The background database is used to store knowledge data, and the knowledge data is mapped to the user role. Different user roles access different knowledge data; The model operation module connects data with the background knowledge base through feature data, and the large model combines the accessible data in the background knowledge base corresponding to the user role to answer the user's question.
[0027] For the problem that in the prior art, when applying a large model, the mechanism of importing all data into knowledge and then fusing and replying causes the traditional permission management technical means to fail, the large model permission management method and device of the present invention isolate the knowledge that needs permission management through an external background knowledge base, obtain the eigenvalue through an algorithm during the user's question-asking process, and then obtain the relevant knowledge with permission management from the vector database. At this time, only the relevant knowledge that the user has access permission can be utilized, and then this batch of knowledge is used as the context of the large model Q&A to answer the user's question. In this way, the part that the user has no permission to access will not appear in the answer, playing a role in data protection.
[0028] The large model permission management method and device of the present invention isolate the knowledge data that needs permission management through an external background knowledge base, obtain the eigenvalue through an algorithm during the user's question-asking process, and then obtain the relevant external knowledge with permission management from the vector database. Only the relevant knowledge data that the user role has access permission is utilized, and then this batch of knowledge data is used as the context of the large model Q&A to answer the user's question. In this way, the part of the data that the user has no permission to access will not appear in the answer, playing a role in data protection. Therefore, the large model permission management method and device of the present invention have the advantages of good confidentiality, good user experience, and high answer accuracy.
[0029] The above are only the preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. That is, all equivalent changes and modifications made to the content within the scope of the patent application of the present invention shall fall within the technical scope of the present invention.
Claims
1. A large model permission management method, characterized in that: It includes the following steps: S1. Build a large model and complete model training using general knowledge; S2. Establish a background knowledge base, process the data in the background knowledge base, establish a mapping relationship between user roles and data access permissions, and different user roles have different data access permissions; S3. Calculate the eigenvalue of the data in the knowledge base and perform vectorization processing to establish a vector database; Connect the vector database with the large model for data communication; S4. When a user asks a question, first extract the features of the user question, compare it with the vector data in the vector database, find the vector data related to the user question, and obtain knowledge data from the background knowledge base by the vector database; when the vector database obtains knowledge data from the background knowledge base, judge whether the relevant knowledge data in the background knowledge base is accessible to the user in combination with the user role. If the user can access it, feedback the knowledge data to the large model and answer the question. If the user has no access permission, answer it in combination with general knowledge and feedback it to the user; S5. After the question is answered, the large model is reset to the state before obtaining the background knowledge base and is ready to answer the next question.
2. The method for managing the permissions of a large model according to claim 1, wherein: The large model includes a main control model and a special language model. The main control model extracts question features, and the special language model answers questions in combination with the knowledge data accessible to the user role.
3. The method for managing the permissions of a large model according to claim 1, wherein: When obtaining knowledge data from the background database by the vector database in step S4, the number and range of knowledge data are set through parameters.
4. A large model permission management method according to claim 1, characterized in that: In step S4, the judgment of the user role can be to log in the user before asking a question, or the user can input login information when the vector database obtains knowledge data from the background knowledge base.
5. A large model permission management device for implementing the large model permission management method according to claims 1 to 4, characterized in that: It includes a model operation module, a feature extraction module, a vector database, and a background knowledge base; The model operation module deploys, trains, and applies the large model; The feature extraction module is used to extract the features of the user question; The vector database is used to store the eigenvalues of the knowledge data in the background knowledge base; The background database is used to store knowledge data, and the knowledge data is mapped with the user role. Different user roles access different knowledge data; The model operation module connects with the background knowledge base through feature data, and the large model answers the user question in combination with the accessible data in the background knowledge base corresponding to the user role.
6. The large model permission management device according to claim 5, characterized in that: The large model operated by the model operation module includes a main control model and a special language model.