Private domain knowledge sharing method and system for different users
By acquiring user identity and historical access information, calculating access permission levels, and merging LoRA sub-models, the problem of information leakage and security risks of private domain knowledge in the training of large models is solved, realizing personalized access permission management and security protection.
Patent Information
- Application Number
- CN202411280430.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-09-12
AI Technical Summary
In existing technologies, private domain knowledge presents risks of inconsistent analytical logic and information leakage during large model training and inference, and different users have different access permissions to private domain knowledge, leading to security vulnerabilities.
By acquiring user identity information and historical access information, the system calculates access permission levels and divides private domain knowledge into accessible and forgotten knowledge based on these levels. The system then uses LoRA sub-models to merge these into a merged model, providing personalized access permission management.
It achieves secure protection of private domain knowledge, ensures access control for different users, minimizes the risk of information leakage, and improves the security and management efficiency of the model.
Smart Images

Figure CN119203090B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of private domain knowledge protection, and particularly relates to a private domain knowledge sharing method and system for different users. BACKGROUND
[0002] Large models are widely used in the field of artificial intelligence and can handle complex tasks and generate high-quality results. For some specific tasks, it is often necessary to integrate private domain knowledge into the training and inference of large models. The RAG (Retrieval Augmented Generation) knowledge base solution has problems such as inconsistent analysis logic and serious dependence on the retrieval system. Directly using private domain knowledge for model training will result in no isolation between knowledge sets, cannot be modified flexibly, and has the risk of information leakage.
[0003] In related technologies, LoRA (Low-Rank Adaptation) models can be separately set for private domain knowledge for calling. However, when users access private domain knowledge, different users have different access permissions to private domain knowledge. Therefore, when all private domain knowledge is opened to all users, there is a certain security risk. SUMMARY
[0004] To solve the above technical problems, the present application provides a private domain knowledge sharing method for different users, which obtains the access permission level of different users and opens the corresponding private domain knowledge according to the access permission level, thereby better protecting the private domain knowledge.
[0005] The technical scheme adopted by the present application is as follows:
[0006] A private domain knowledge sharing method for different users includes the following steps: S1, upon receiving an access request of a current user, obtaining identity information and historical access information of the current user; S2, determining the access permission level of the current user according to the identity information and the historical access information; S3, determining whether the access permission level matches the access request; S4, if the access permission level matches the access request, dividing K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level, wherein each group of private domain knowledge corresponds to a LoRA sub-model, and K = m + n; S5, merging m LoRA sub-models corresponding to m groups of accessible knowledge to obtain a merged model, and opening the access right of the merged model to the current user, wherein the current user learns m groups of accessible knowledge through the merged model.
[0007] In an embodiment of the present application, the historical access information comprises a historical access frequency and a first access time, the identity information is an identity level, and step S2 specifically comprises the following steps: S21, sequentially dividing the first access time to a current access time into M access time intervals, and setting a first weight value for each of the access time intervals; S22, obtaining the historical access frequency in each of the access time intervals; S23, calculating an access permission score of the current user according to the identity level, the historical access frequency in each of the access time intervals, and the first weight value; and S24, confirming the access permission level according to the access permission score.
[0008] In an embodiment of the present application, step S23 specifically comprises calculating the access permission score by the following formula:
[0009]
[0010] wherein P is the access permission score, λ i is the first weight value corresponding to the i-th access time interval, α1 is a second weight value, d is the identity level, α2 is a third weight value, χ i is the historical access frequency in the i-th access time interval.
[0011] In an embodiment of the present application, step S5 specifically comprises the following steps: S51, respectively obtaining a first weight matrix corresponding to the first to m-th LoRA sub-models and a weight coefficient corresponding thereto; S52, calculating a second weight matrix corresponding to the merged model by the following formula:
[0012]
[0013] wherein W is the first weight matrix, a j is the weight coefficient of the j-th LoRA sub-model, W j is the first weight matrix of the j-th LoRA sub-model; and S53, obtaining the merged model according to the second weight matrix.
[0014] A private domain knowledge sharing system for different users, comprising: a first acquisition module, configured to acquire identity information and historical access information of a current user when receiving an access request of the current user; a confirmation module, configured to confirm an access permission level of the current user according to the identity information and the historical access information; a judgment module, configured to judge whether the access permission level matches the access request; a division module, configured to divide K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level when the access permission level matches the access request, wherein each group of private domain knowledge corresponds to a LoRA sub-model, and K = m + n; a second acquisition module, configured to combine m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a combined model, and open the access right of the combined model to the current user, wherein the current user learns the m groups of accessible knowledge through the combined model.
[0015] A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the private domain knowledge sharing method for different users as described above when executing the computer program.
[0016] A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the program is executable by a processor to implement the private domain knowledge sharing method for different users as described above.
[0017] The beneficial effects of the present application are as follows:
[0018] The present application acquires corresponding access permission levels for different users and opens corresponding private domain knowledge according to the access permission levels, thereby better protecting the private domain knowledge. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flowchart of the private domain knowledge sharing method for different users of the embodiments of the present application;
[0020] Figure 2 A block schematic diagram of the private domain knowledge sharing system for different users of the embodiments of the present application. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0022] As Figure 1 shown, the private domain knowledge sharing method for different users of the embodiment of the application can include the following steps:
[0023] S1, upon receiving an access request of a current user, obtaining identity information and historical access information of the current user.
[0024] The historical access information can include historical access times and initial access time, and the identity information can be an identity level. As a possible implementation, the identity level of the current user can be obtained according to the position of the current user, for example, if the current user is an ordinary employee, the identity level is 1; if the current user is a supervisor, the identity level is 2; if the current user is a director, the identity level is 3.
[0025] S2, confirming the access permission level of the current user according to the identity information and the historical access information.
[0026] In an embodiment of the application, step S2 specifically includes the following steps:
[0027] S21, dividing the initial access time to the current access time into M access time intervals in turn, and setting a first weight for each access time interval.
[0028] Wherein, M can be calibrated according to actual conditions.
[0029] S22, obtaining the historical access times in each access time interval.
[0030] S23, calculating the access permission score of the current user according to the identity level, the historical access times in each access time interval and the first weight.
[0031] In an embodiment of the application, step S23 specifically includes calculating the access permission score by the following formula:
[0032]
[0033] Wherein, P is the access permission score, λ i is the first weight corresponding to the i-th access time interval, α1 is the second weight, d is the identity level, α2 is the third weight, χ i is the historical access times in the i-th access time interval.
[0034] Wherein, the first weight, the second weight and the third weight can be calibrated according to actual conditions.
[0035] S24, confirming the access permission level according to the access permission score.
[0036] In one embodiment of the present application, the access permission level can be determined according to the range in which the access permission score is located. Specifically, in one specific embodiment of the present application, it can be determined whether the access permission score is less than a first set value. If the access permission score is less than the first set value, it is determined that the access permission level is level 1. If the access permission score is greater than or equal to the first set value, it is determined whether the access permission score is less than a second set value. If the access permission score is less than the second set value, it is determined that the access permission level is level 2. If the access permission score is greater than or equal to the second set value, it is determined that the access permission level is level 3.
[0037] S3, determine whether the access permission level matches the access request.
[0038] Specifically, it can be determined whether the accessible knowledge corresponding to the access permission level is greater than or equal to the range of private domain knowledge required to be accessed in the access request of the current user. If not, it is determined that the access permission level does not match the access request, and the result is fed back to the current user. If yes, it is determined that the access permission level matches the access request.
[0039] S4, if the access permission level matches the access request, the K groups of private domain knowledge are divided into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level. Each group of private domain knowledge corresponds to a LoRA sub-model trained, and K = m + n.
[0040] Specifically, the private domain knowledge has K groups, wherein the K groups of private domain knowledge can correspond to the setting of the LoRA model, each group of private domain knowledge corresponds to a LoRA sub-model trained, that is, the LoRA model is composed of K LoRA sub-models.
[0041] Assuming that the private domain knowledge is divided into three groups, that is, type one private domain knowledge, type two private domain knowledge and type three private domain knowledge. When the access permission level is level 1, the type one private domain knowledge can be divided into one group of accessible knowledge, and the type two private domain knowledge and the type three private domain knowledge can be divided into two groups of forgotten knowledge, that is, the type two private domain knowledge is one group of forgotten knowledge, and the type three private domain knowledge is another group of forgotten knowledge. When the access permission level is level 2, the type one private domain knowledge and the type two private domain knowledge can be divided into two groups of accessible knowledge, that is, the type one private domain knowledge is one group of accessible knowledge, and the type two private domain knowledge is another group of accessible knowledge, and the type three private domain knowledge can be divided into one group of forgotten knowledge. Of course, the type one private domain knowledge and the type three private domain knowledge can also be divided into two groups of accessible knowledge, and the type two private domain knowledge can be divided into one group of forgotten knowledge. When the access permission level is level 3, the type one private domain knowledge, the type two private domain knowledge and the type three private domain knowledge are divided into three groups of accessible knowledge, that is, the type one private domain knowledge is one group of accessible knowledge, the type two private domain knowledge is another group of accessible knowledge, and the type three private domain knowledge is another group of accessible knowledge.
[0042] S5, merging the m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a merged model, and opening the access right of the merged model to the current user. Wherein, the current user obtains the m groups of accessible knowledge through the merged model.
[0043] Specifically, after dividing the m groups of accessible knowledge, the m LoRA sub-models corresponding to the m groups of accessible knowledge can be merged to obtain a merged model, and the access right of the merged model is opened. For example, after dividing the type one private domain knowledge and the type two private domain knowledge into two groups of accessible knowledge, the LoRA sub-model corresponding to the type one private domain knowledge and the LoRA sub-model corresponding to the type two private domain knowledge can be merged to obtain a merged model.
[0044] In an embodiment of the present application, the merged model can be obtained by the following steps:
[0045] S51, respectively obtaining a first weight matrix corresponding to the first to the mth LoRA sub-model and a corresponding weight coefficient.
[0046] S52, the second weight matrix corresponding to the merged model is calculated by the following formula:
[0047]
[0048] Wherein, W is the first weight matrix, a j is the weight coefficient of the jth LoRA sub-model, W ja first weight matrix of the jth LoRA sub-model.
[0049] S53, obtaining the merged model according to the second weight matrix.
[0050] Therefore, through these multi-level security protection measures, the security of the model and the confidentiality of the private domain knowledge data can be ensured to the greatest extent, and the safe and effective application and management of the model are realized.
[0051] In summary, according to the private domain knowledge sharing method for different users according to the embodiment of the application, when receiving an access request of a current user, identity information and historical access information of the current user are obtained, and the access permission level of the current user is confirmed according to the identity information and the historical access information, and it is judged whether the access permission level matches the access request, if the access permission level matches the access request, then according to the access permission level, K groups of private domain knowledge are divided into m groups of accessible knowledge and n groups of forgotten knowledge, and m LoRA sub-models corresponding to the m groups of accessible knowledge are merged to obtain a merged model, and the current user is opened the access right of the merged model, wherein the current user knows the m groups of accessible knowledge through the merged model. Therefore, the corresponding access permission level is obtained for different users, and the corresponding private domain knowledge is opened according to the access permission level, so that the private domain knowledge can be better protected.
[0052] Corresponding to the private domain knowledge sharing method for different users of the above-mentioned embodiment, the application further proposes a private domain knowledge sharing system for different users.
[0053] As shown in Figure 2 The private domain knowledge sharing system for different users according to the embodiment of the application can include a first obtaining module 100, a confirming module 200, a judging module 300, a dividing module 400 and a second obtaining module 500.
[0054] The first obtaining module 100 is configured to obtain the identity information and the historical access information of the current user when receiving an access request of a current user; the confirming module 200 is configured to confirm the access permission level of the current user according to the identity information and the historical access information; the judging module 300 is configured to judge whether the access permission level matches the access request; the dividing module 400 is configured to divide K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level when the access permission level matches the access request, wherein each group of private domain knowledge corresponds to a LoRA sub-model, and K = m + n; the second obtaining module 500 is configured to merge m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a merged model, and open the access right of the merged model to the current user, wherein the current user knows the m groups of accessible knowledge through the merged model.
[0055] In an embodiment of the present application, the historical access information includes a historical access frequency and a first access time, the identity information is an identity level, and the confirmation module 200 is specifically configured to: sequentially divide the first access time to a current access time into M access time intervals, and set a first weight value for each access time interval; obtain the historical access frequency in each access time interval; calculate an access permission score of the current user according to the identity level, the historical access frequency in each access time interval, and the first weight value; and confirm the access permission level according to the access permission score.
[0056] In an embodiment of the present application, the confirmation module 200 is specifically configured to calculate the access permission score by the following formula:
[0057]
[0058] wherein P is the access permission score, λ i is the first weight value corresponding to the i th access time interval, a1 is a second weight value, d is the identity level, a2 is a third weight value, χ i is the historical access frequency in the i th access time interval.
[0059] In an embodiment of the present application, the second obtaining module 500 is specifically configured to: respectively obtain a first weight matrix corresponding to the first to the m th LoRA sub-model and a weight coefficient corresponding thereto; and calculate a second weight matrix corresponding to the merged model by the following formula:
[0060]
[0061] wherein W is the first weight matrix, a j is the weight coefficient of the j th LoRA sub-model, W j is the first weight matrix of the j th LoRA sub-model; and the merged model is obtained according to the second weight matrix.
[0062] It should be noted that the details of the private domain knowledge sharing system for different users in the embodiments of the present application are not disclosed, and please refer to the details disclosed in the private domain knowledge sharing method for different users in the embodiments of the present application, which will not be described here in detail.
[0063] According to the private domain knowledge sharing system for different users provided by the embodiment of the present application, when receiving an access request of a current user, the first acquisition module acquires identity information and historical access information of the current user, the confirmation module is used to confirm an access permission level of the current user according to the identity information and the historical access information, the judgment module is used to judge whether the access permission level matches the access request, and when the access permission level matches the access request, the division module is used to divide K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level, the second acquisition module is used to combine m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a combined model, and the access right of the combined model is opened to the current user. Therefore, the corresponding access permission level is acquired for different users, and the corresponding private domain knowledge is opened according to the access permission level, so that the private domain knowledge can be better protected.
[0064] Corresponding to the above-mentioned embodiments, the present application further provides a computer device.
[0065] The computer device provided by the embodiment of the present application comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the private domain knowledge sharing method for different users provided by the above-mentioned embodiments is realized.
[0066] According to the computer device provided by the embodiment of the present application, the corresponding access permission level is acquired for different users, and the corresponding private domain knowledge is opened according to the access permission level, so that the private domain knowledge can be better protected.
[0067] Corresponding to the above-mentioned embodiments, the present application further provides a non-transitory computer readable storage medium.
[0068] The non-transitory computer readable storage medium provided by the embodiment of the present application stores a computer program, and when the processor executes the program, the private domain knowledge sharing method for different users provided by the above-mentioned embodiments is realized.
[0069] According to the non-transitory computer readable storage medium provided by the embodiment of the present application, the corresponding access permission level is acquired for different users, and the corresponding private domain knowledge is opened according to the access permission level, so that the private domain knowledge can be better protected.
[0070] In the description of the present application, the terms "first", "second" are only used for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first", "second" can explicitly or implicitly include one or more of the features. The meaning of "a plurality of" is two or more, unless otherwise specifically limited.
[0071] In the present application, unless specifically defined otherwise and limited, the terms "mount", "connected", "connection", "fixed", and the like should be construed as being broadly, for example, it can be fixed connection, or detachable connection, or integrated; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0072] In the present application, unless specifically defined otherwise and limited, the first feature is "on" or "under" the second feature. The first and second features can be in direct contact, or the first and second features can be indirectly in contact through an intermediate medium. Moreover, the first feature "above", "over" and "on" the second feature can be the first feature directly above or obliquely above the second feature, or only indicates that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "under" and "under" the second feature can be the first feature directly below or obliquely below the second feature, or only indicates that the horizontal height of the first feature is less than that of the second feature.
[0073] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or features of different embodiments or examples described in the present application without contradiction.
[0074] In addition, each functional unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module. The integrated module, if realized in the form of a software function module and sold or used as an independent product, can also be stored in a computer readable storage medium.
[0075] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and cannot be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A private domain knowledge sharing method for different users, characterized in that, The method comprises the following steps: S1, upon receiving an access request of a current user, obtaining identity information and historical access information of the current user; S2, determining an access permission level of the current user according to the identity information and the historical access information; wherein the historical access information comprises a historical access frequency and a first access time, and the identity information is an identity level, and step S2 specifically comprises the following steps: S21, dividing the first access time to a current access time into M access time intervals in sequence, and setting a first weight for each access time interval; S22, obtaining the historical access frequency in each access time interval; S23, calculating an access permission score of the current user according to the identity level, the historical access frequency in each access time interval, and the first weight; wherein step S23 specifically comprises calculating the access permission score by the following formula: , wherein, score the access right, the first weight value corresponding to the i-th access time interval, the second weight value, the identity level, the third weight value, the historical access times in the i-th access time interval; S24, determining the access permission level according to the access permission score; S3, determining whether the access permission level matches the access request; S4, if the access permission level matches the access request, dividing K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level, wherein each group of private domain knowledge corresponds to a LoRA sub-model, and K = m + n; S5, merging m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a merged model, and opening the access right of the merged model to the current user, wherein the current user learns the m groups of accessible knowledge through the merged model.
2. The method of claim 1, wherein, Step S5 specifically comprises the following steps: S51, obtaining a first weight matrix corresponding to the first LoRA sub-model to the mth LoRA sub-model and a corresponding weight coefficient; S52, calculating a second weight matrix corresponding to the merged model by the following formula: ; wherein, is the first weight matrix for the jth LoRA sub-model, is the weight coefficient of the jth LoRA sub-model, is the first weight matrix for the jth LoRA sub-model; S53, obtaining the merged model according to the second weight matrix.
3. A private domain knowledge sharing system for different users, characterized in that, Comprise: The first acquisition module is used for obtaining the identity information and the historical access information of the current user when receiving an access request of a current user; The determination module is used for determining an access permission level of the current user according to the identity information and the historical access information; wherein the determination module is specifically used for: dividing the first access time to a current access time into M access time intervals in sequence, and setting a first weight for each access time interval; obtaining the historical access frequency in each access time interval; calculating an access permission score of the current user according to the identity level, the historical access frequency in each access time interval, and the first weight; determining the access permission level according to the access permission score; wherein step S23 specifically comprises calculating the access permission score by the following formula: , wherein, score the access right, the first weight value corresponding to the i-th access time interval, the second weight value, the identity level, the third weight value, the historical access times in the i-th access time interval; The determination module is used for determining whether the access permission level matches the access request; a dividing module, configured to divide K groups of private domain knowledge into m groups of accessible knowledge and n groups of forgotten knowledge according to the access permission level when the access permission level matches the access request, wherein each group of private domain knowledge corresponds to a LoRA sub-model trained; a second obtaining module, configured to combine m LoRA sub-models corresponding to the m groups of accessible knowledge to obtain a combined model, and open access to the combined model for the current user, wherein the current user learns the m groups of accessible knowledge through the combined model.
4. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program, and the private domain knowledge sharing method for different users according to any one of claims 1 and 2 is implemented.
5. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor, and the private domain knowledge sharing method for different users according to any one of claims 1 and 2 is implemented.
Citation Information
Patent Citations
Fault tree collaborative analysis system based on authority management and model decomposition
CN104298825A
Secure access control method and system for private domain network, and readable storage medium
CN114221824A
Multi-field fine-tuning large model parallel reasoning system and method thereof
CN117474102A