Large model authority management system and large model management system
By introducing gateways and backend management centers into the large-model permission management system, the judgment is based on the user requested permission acquisition and the permission rules of the large-model tool, the problem of low efficiency in determining permissions in the existing system is solved, more efficient permission management is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411670349.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-21
Smart Images

Figure CN119622801A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a large model authority management system and a large model management system. Background Art
[0002] With the continuous development of big models, various tools have been derived from big models, such as translation, drawing, speech recognition, image recognition and other tools based on big models. However, big model tools themselves are extremely dependent on computing power and have high requirements for hardware resources, so it is necessary to restrict different categories of users. However, the current big model permission management system has low permission determination efficiency, which leads to a long time for users to obtain the processing results of big model tools, reducing the user experience.
[0003] This shows that the current large-model permission management system still has the problem of low efficiency in permission determination. Summary of the invention
[0004] Based on this, it is necessary to provide a large model authority management system and a large model management system that can improve the efficiency of authority determination in response to the above technical problems.
[0005] In a first aspect, the present application provides a large model rights management system, the large model rights management system comprising a gateway and a background management center, wherein:
[0006] The gateway is connected to the backend management center and at least one large model tool respectively, and is used to send a permission acquisition request to the backend management center based on a user request;
[0007] The backend management center is used to obtain user authority information corresponding to the authority acquisition request based on the authority acquisition request; and send the user authority information to the gateway;
[0008] The gateway is also used to select to forward the user request to the corresponding big model tool, or return an unauthorized result based on the user authority information and the big model tool information corresponding to the user request; the big model tool information includes the authority rules of the big model tool.
[0009] In one of the embodiments, the large model rights management system further includes an in-memory database;
[0010] The memory database is connected to the gateway and the backend management center respectively, and is used to store user information and large model tool information;
[0011] The backend management center is further used to perform a first update operation on the memory-based database, wherein the first update operation includes one or more operations of adding, deleting and editing the user information and / or the large model tool information;
[0012] The gateway is also used to store the large model tool information in the memory-type database into the local memory of the gateway when the memory-type database is updated.
[0013] In one embodiment, the large model rights management system further includes a message queue, and the message queue is connected to the gateway and the background management center respectively, wherein:
[0014] After performing an update operation on the memory-type database, the background management center is further used to publish an update event in a preset subscription topic in the message queue;
[0015] The gateway is also used to obtain the large model tool information in the memory database based on the update event of the preset subscription topic, and store the large model tool information in the local memory of the gateway.
[0016] In one embodiment, the background management center is also used for:
[0017] Based on the permission acquisition request, acquiring user information corresponding to the permission acquisition request in the in-memory database;
[0018] Determining user authority information corresponding to the authority acquisition request based on the user information;
[0019] The user authority information is sent to the gateway.
[0020] In one of the embodiments, the gateway is connected to the in-memory database via a first database component, and the background management center is connected to the in-memory database via a second database component.
[0021] In one embodiment, the large model rights management system further includes a relational database, which is connected to the background management center, wherein:
[0022] The relational database is used to store user information and large model tool information;
[0023] The background management center is also used to perform a second update operation on the relational database, and the second update operation includes one or more operations of adding, deleting and editing the user information and / or large model tool information in the relational database.
[0024] In one embodiment, the background management center is also used for:
[0025] When the in-memory database does not include the user information corresponding to the permission acquisition request, acquiring the user information corresponding to the permission acquisition request in the relational database;
[0026] Determining user authority information corresponding to the authority acquisition request based on the user information;
[0027] The user authority information is sent to the gateway.
[0028] In one embodiment, the user information includes user-user group information and user group-authority information, and the backend management center is further used to:
[0029] Based on the permission acquisition request, acquiring user-user group information corresponding to the permission acquisition request, and based on the user-user group information, determining a user group corresponding to the user;
[0030] Based on the user group, obtaining user group-authority information corresponding to the user group;
[0031] Based on the user group-authority information, user authority information corresponding to the authority acquisition request is determined.
[0032] In one embodiment, the gateway is further configured to:
[0033] If the user authority information matches the large model tool information corresponding to the user request, forwarding the user request to the corresponding large model tool;
[0034] If the user authority information does not match the large model tool information corresponding to the user request, an unauthorized result is returned.
[0035] In a second aspect, the present application provides a big model management system, which includes the big model authority management system as described above and at least one big model tool, wherein the big model tool is used to respond to a user request and generate a big model processing result corresponding to the user request.
[0036] The above-mentioned large model authority management system and large model management system send an authority acquisition request to the background management center through the gateway based on the user request; the background management center obtains the user authority information corresponding to the authority acquisition request based on the authority acquisition request; and sends the user authority information to the gateway; the gateway chooses to forward the user request to the corresponding large model tool or return an unauthorized result based on the user authority information and the large model tool information corresponding to the user request, so that the gateway can implement authority determination, avoiding the computational burden and efficiency reduction caused by the background management center determining authority or the large model tool determining authority, thereby achieving the effect of improving the efficiency of authority determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A structural block diagram of a large model authority management system in one embodiment;
[0038] Figure 2 A structural block diagram of a rights management system of a large model tool based on user groups in one embodiment;
[0039] Figure 3 A schematic diagram of the timing of modifying large model tool information in one embodiment;
[0040] Figure 4 A schematic diagram of the timing of modifying user group information in one embodiment;
[0041] Figure 5 A schematic diagram of a timing sequence of a user using a large model tool in one embodiment;
[0042] Figure 6 1 is a structural block diagram of a large model management system in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] In one embodiment, Figure 1 As shown, a large model rights management system is provided, the large model rights management system includes a gateway 100 and a background management center 200, wherein:
[0045] The gateway 100 is connected to the backend management center 200 and at least one large model tool respectively, and is used to send a permission acquisition request to the backend management center 200 based on a user request;
[0046] The backend management center 200 is used to obtain user authority information corresponding to the authority acquisition request based on the authority acquisition request; and send the user authority information to the gateway 100;
[0047] The gateway 100 is also used to select to forward the user request to the corresponding big model tool or return an unauthorized result based on the user authority information and the big model tool information corresponding to the user request.
[0048] The gateway 100 is used to receive requests from users, and send permission acquisition requests to the background management center 200 according to the information in the user request. The user request may include user identity, the big model tool to be called, prompt words and other contents. The big model tool to be called may be represented by the name of the big model tool or other unique identification code. Furthermore, in the case where the big model tool has the corresponding function, the user request may also include personalized customization information of the big model tool. Furthermore, the gateway 100 is used to intercept user requests, and after performing permission determination at the gateway 100 end, determine whether to forward the user request to the big model tool or directly return an unauthorized result.
[0049] Furthermore, the gateway 100 may include a local cache, and the local cache is used to store the big model tool information of each big model tool, and the big model tool information includes the permission rules of the big model tool. When receiving a user request sent by the user end, the big model tool to be called by the user can be determined according to the user request, and then the local cache can be accessed to determine the permission rules corresponding to the big model tool.
[0050] Furthermore, in order to reduce the number of interactions with the background management center 200, the local cache can also store the user authority information that has been recently accessed or recently obtained. When a request from the same user is received again, it can try to read the user authority information from the cache and make a decision directly.
[0051] The backend management center 200 is used to manage and maintain user information, and quickly and accurately returns corresponding user authority information after receiving the authority acquisition request from the gateway 100. Exemplarily, the backend management center 200 can locate the user authority information corresponding to the authority acquisition request through database indexing technology.
[0052] Furthermore, considering the performance requirements in high-concurrency scenarios, the background management center 200 can be designed as a distributed architecture, using load balancing technology to disperse request pressure and ensure system stability and availability.
[0053] After obtaining the user authority information, the gateway 100 may choose to forward the user request to the corresponding big model tool or return an unauthorized result according to whether the obtained user authority information satisfies the authority rules corresponding to the big model tool.
[0054] Furthermore, each user may have one or more permissions. For example, to determine whether the obtained user permission information satisfies the permission rules corresponding to the big model tool, it may be determined whether the permissions in the permission rules corresponding to the big model tool also exist in the user's permissions, thereby obtaining a judgment result. Each user may also have permissions of different levels. For example, in the permission rules corresponding to the big model tool, it may be determined whether the user's permission level is greater than or equal to the required permission level, thereby obtaining a judgment result.
[0055] The present embodiment provides a large model permission management system, which sends a permission acquisition request to the background management center based on a user request through a gateway; the background management center obtains user permission information corresponding to the permission acquisition request based on the permission acquisition request; and sends the user permission information to the gateway; the gateway chooses to forward the user request to the corresponding large model tool or return an unauthorized result based on the user permission information and the large model tool information corresponding to the user request, so that the gateway can implement permission determination, avoiding the computational burden and efficiency reduction caused by the background management center determining the permission or the large model tool determining the permission, thereby achieving the effect of improving the efficiency of permission determination.
[0056] In one of the embodiments, the large model rights management system further includes an in-memory database;
[0057] The memory database is connected to the gateway and the backend management center respectively, and is used to store user information and large model tool information;
[0058] The backend management center is also used to perform a first update operation on the memory-based database; the first update operation includes one or more operations of adding, deleting and editing the user information and / or the large model tool information.
[0059] The gateway is also used to store the large model tool information in the memory-type database into the local memory of the gateway when the memory-type database is updated.
[0060] Among them, the in-memory database is a database system that stores data in RAM (Random Access Memory), and has a very high read and write speed compared to the traditional disk database. In this embodiment, the in-memory database is used to store user information and large model tool information.
[0061] The memory-based database is connected to the gateway and the backend management center respectively, wherein the backend management center may perform a first update operation on the memory-based database according to management requirements. The first update operation includes one or more operations of adding, deleting and editing the user information and / or the large model tool information.
[0062] Furthermore, when the in-memory database is updated, the gateway synchronizes the updated large model tool information to its own local memory. In this way, when the gateway needs to make a permission determination, it can directly obtain the required information from the local memory without querying the in-memory database again, thus greatly reducing latency.
[0063] The large model permission management system provided in this embodiment can improve the reading and writing speed and the response speed of the system to user requests by setting up a memory database to be connected to the gateway and the background management center respectively, and through the local cache of the gateway, it can reduce the frequency of direct access to the memory database and reduce the load on the database, thereby achieving the effect of improving the permission determination efficiency, stability and reliability of the large model permission management system.
[0064] In one embodiment, the large model rights management system further includes a message queue, and the message queue is connected to the gateway and the background management center respectively, wherein:
[0065] After performing an update operation on the memory-type database, the background management center is further used to publish an update event in a preset subscription topic in the message queue;
[0066] The gateway is also used to obtain the large model tool information in the memory database based on the update event of the preset subscription topic, and store the large model tool information in the local memory of the gateway.
[0067] The message queue is a container for storing messages during the message transmission process. In this embodiment, the message queue can be implemented using technologies such as Kafka. The message queue is connected to the background management center and the gateway respectively. When the background management center updates the data of the memory database, the background management center publishes an update event in the preset subscription topic of the message queue to notify the gateway that the data has been updated. The preset subscription topic is the topic subscribed by the gateway.
[0068] The gateway subscribes to the preset subscription topic in the message queue and monitors update events in real time. When the gateway receives an update event, it will obtain the latest large model tool information from the in-memory database and store it in the local memory of the gateway to ensure that the gateway always uses the latest data for permission determination.
[0069] Furthermore, the large model permission management system can include multiple gateways. In high-concurrency scenarios, the request pressure can be shared by setting up multiple gateways. Each gateway subscribes to the update events in the message queue to ensure that each gateway can obtain the latest large model tool information in a timely manner and ensure data consistency.
[0070] Furthermore, the gateway may asynchronously process data synchronization tasks after receiving the update time to avoid blocking request processing of other users, thereby improving the response speed of the system.
[0071] The large model permission management system provided in this embodiment sets a message queue so that when the background management center updates the memory database, the gateway can obtain the update event in time and synchronize the data, thereby ensuring that the gateway always uses the latest data for permission determination, improving the real-time and accuracy of the system, and making the system more flexible and scalable, thereby achieving the effect of improving the permission determination efficiency of the large model permission management system.
[0072] In one embodiment, user information is stored in a memory database. When the gateway generates a permission acquisition request according to a user request and sends it to a background management database, the background management center is also used to:
[0073] Based on the permission acquisition request, acquiring user information corresponding to the permission acquisition request in the in-memory database;
[0074] Determining user authority information corresponding to the authority acquisition request based on the user information;
[0075] The user authority information is sent to the gateway.
[0076] Among them, obtaining the user information corresponding to the permission acquisition request in the memory database can be performed by querying the memory database according to the user name in the permission acquisition request or the unique identity identification code of other users, so as to obtain the user information of the user.
[0077] The user permission information corresponding to the permission acquisition request is determined based on the user information. The specific permission information of the user can be determined based on the acquired user information and the permission rules predefined by the system. Furthermore, a structured data format can be constructed and sent to the gateway.
[0078] The present embodiment provides a large model permission management system, which determines the user permission information corresponding to the permission acquisition request by acquiring the user information corresponding to the permission acquisition request in the memory database. Due to the high reading and writing speed of the memory database, the background management center can quickly acquire user information, which can significantly shorten the time for permission determination, thereby improving the permission determination efficiency of the large model permission management system.
[0079] In one of the embodiments, the gateway is connected to the in-memory database via a first database component, and the background management center is connected to the in-memory database via a second database component.
[0080] Each database component is responsible for managing the connection with the memory database, including establishing, maintaining and disconnecting the connection. The gateway is connected to the memory database through the first database component, which is used to process the data interaction between the gateway and the memory database. The backend management center is connected to the memory database through the second database component, which is used to process the data interaction between the backend management center and the memory database.
[0081] Exemplarily, the database component may provide a standardized data access interface so that the gateway and the backend management center can easily query and update the data in the memory database.
[0082] The large model permission management system provided in this embodiment realizes the decoupling of the gateway and the background management center from the memory database by introducing a special database component, making the system more modular, easy to maintain and expand, and optimizing the data access path, reducing unnecessary network communication and data transmission, and improving the overall performance of the system, thereby improving the efficiency of permission determination of the large model permission management system.
[0083] In one embodiment, the large model rights management system further includes a relational database, which is connected to the background management center, wherein:
[0084] The relational database is used to store user information and large model tool information;
[0085] The background management center is also used to perform a second update operation on the relational database, and the second update operation includes one or more operations of adding, deleting and editing the user information and / or large model tool information in the relational database.
[0086] Among them, the relational database is a database that uses a relational model to organize data, and is used to persistently store user information and large model tool information. The relational database is connected to the background management center, which is responsible for data operations on the relational database.
[0087] The backend management center is also used to perform a second update operation on the relational database, wherein the second update operation is an update operation for user information and large model tool information of the relational database, including one or more of adding, deleting and editing. After the backend management center performs the update operation on the relational database, it can also synchronize these updates to the memory database to ensure that the data in the memory database is in the latest state.
[0088] The large model permission management system provided in this embodiment can realize persistent storage of user information and large model tool information by setting up a relational database, ensuring that data will not be lost due to system restart or failure, and supports complex SQL queries, which can facilitate data retrieval and statistical analysis, and synchronize data in the relational database to the in-memory database. Combined with the high performance characteristics of the in-memory database, it can also ensure the stability and reliability of the system in high-concurrency scenarios, thereby achieving the effect of improving the permission determination efficiency, stability and reliability of the large model permission management system.
[0089] In one embodiment, the background management center is also used for:
[0090] When the in-memory database does not include the user information corresponding to the permission acquisition request, acquiring the user information corresponding to the permission acquisition request in the relational database;
[0091] Determining user authority information corresponding to the authority acquisition request based on the user information;
[0092] The user authority information is sent to the gateway.
[0093] Among them, the user information in the relational database can be obtained when the memory database does not include the user information, that is, the background management center can try to obtain the user information corresponding to the user identifier from the memory database, and when the memory database does not include the user information corresponding to the permission acquisition request, the user information corresponding to the permission acquisition request in the relational database is obtained.
[0094] Furthermore, after obtaining the user information from the relational database, the background management center can also synchronize this information to the memory database so that subsequent requests can be directly obtained from the memory database.
[0095] The large-model permission management system provided by this embodiment can quickly obtain user information through efficient reading of the memory database, significantly shorten the permission determination time, and reduce the user's waiting time. When there is no user information in the memory database, it can be obtained from the relational database, ensuring the integrity and accuracy of the data, thereby achieving the effect of improving the permission determination efficiency of the large-model permission management system.
[0096] In one embodiment, the user's authority may be granted according to the corresponding user group. The operator may edit the user group to which the user belongs and grant unified authority to the corresponding user group, thereby realizing the unified setting of user authority. The backend management center is also used for:
[0097] Based on the permission acquisition request, acquiring user-user group information corresponding to the permission acquisition request, and based on the user-user group information, determining a user group corresponding to the user;
[0098] Based on the user group, obtaining user group-authority information corresponding to the user group;
[0099] Based on the user group-authority information, user authority information corresponding to the authority acquisition request is determined.
[0100] Wherein, the user information includes user-user group information and user group-authority information. The user-user group information can be a mapping relationship between a user identifier and a user group, and can determine the user group to which the user corresponds. It is understandable that each user can correspond to multiple user groups, and thus can be granted multiple permissions. The user group-authority information is a mapping relationship between a user group and user group permissions, and can determine the user group to which the user corresponds. Each user group can also be granted multiple permissions, and diversified user permission management can be achieved.
[0101] Based on the permission acquisition request, the user-user group information corresponding to the permission acquisition request is obtained, and the user-user group information in the memory database or the relational database is read according to the user identifier to determine the user-user group information corresponding to the user identifier.
[0102] Acquiring the user group-authority information corresponding to the user group based on the user group may be acquiring the user group-authority information corresponding to the user group identifier according to the user group identifier.
[0103] One user may correspond to multiple user groups, so based on the user-user group information, at least one user group corresponding to the user may be determined.
[0104] Based on the user group-authority information, the user authority information corresponding to the authority acquisition request is determined, which may be to obtain the authority information corresponding to the user group. When the user exists in multiple user groups, the authorities corresponding to the multiple user groups may be obtained to determine the user authority information.
[0105] The large-model permission management system provided in this embodiment can achieve more fine-grained permission control through multi-layer management of users-user groups and user groups-permissions, thereby achieving the effect of improving the flexibility and security of the system.
[0106] In one embodiment, the gateway is further configured to:
[0107] If the user authority information matches the large model tool information corresponding to the user request, forwarding the user request to the corresponding large model tool;
[0108] If the user authority information does not match the large model tool information corresponding to the user request, an unauthorized result is returned.
[0109] Among them, judging whether the user authority information matches the big model tool information corresponding to the user request can be to judge whether the user authority information includes the authority required by the big model tool information. If included, the user authority information and the big model tool information corresponding to the user request match, otherwise they do not match.
[0110] In the case of a match, the user request may be forwarded to the corresponding large model tool. Furthermore, in the case of a match, after determining whether the user request frequency is abnormal, the user request may be forwarded to the corresponding large model tool, or the large model tool may determine the user request frequency and return a corresponding response result.
[0111] In the case of a mismatch, the user request will not be forwarded to the large model tool, and a response result will be generated directly. The response result is an unauthorized result, which is used to prompt the user that he does not currently have the authority to use the large model tool.
[0112] The large model permission management system provided in this embodiment ensures that only users with corresponding permissions can access large model tools through detailed permission matching logic. When users try to access tools without permissions, they can immediately receive no permission results, avoiding long waiting times and achieving the effect of improving the security of the system.
[0113] In one of the embodiments, the permission rules of the large model tool include a request path of the large model tool and a permission requirement of the large model tool.
[0114] Among them, each large model tool has a unique request path, which is used to identify the access entrance of the tool; the permission requirement includes the minimum permission required to access the tool, which can be, for example, role restriction or permission level restriction.
[0115] The large model permission management system provided in this embodiment can achieve more fine-grained permission control through the combination of request paths and permission requirements, ensuring that only users with corresponding permissions can access specific large model tools, thereby achieving the effect of improving the flexibility and security of the system.
[0116] In order to more clearly illustrate the technical solution of the present application, the present application also provides a detailed embodiment.
[0117] In one embodiment, a user group-based permission management system for a large model tool is provided. Different from the common role-based or attribute-based permission management methods, it is closer to the actual business scenario of managing and controlling large model tools, and can manage user permissions in batches and in real time, wherein:
[0118] The system consists of a gateway 100, a backend management center 200, a relational database 400, an in-memory database 300, a message queue 500, and a large model tool that needs to be managed; the gateway 100 is connected to the in-memory database 300 through a database component; the backend management center 200 is connected to the relational database 400 and the in-memory database 300 through a database component. The gateway 100 is exposed to the outside, while the backend management center 200 and the large model tool are not exposed to the outside.
[0119] The gateway 100 is responsible for forwarding user requests; the background management center 200 is responsible for managing users, user groups, and authority data.
[0120] The relational database 400 stores user data; the in-memory database 300 stores the cache of user data and large model tool permission rules.
[0121] When the gateway 100 receives a user's request, it will request the background management center 200 to obtain the user's permission information; the gateway 100 determines whether the user can use the big model tool based on the user's permission information and the big model tool permission rules; if the user has permission, the gateway 100 forwards the request to the corresponding big model tool; if the user does not have permission, the gateway 100 directly returns the result to inform the user that he does not have permission to use the corresponding big model tool.
[0122] like Figure 2The figure shows a block diagram of the authority management system. The whole system consists of a gateway 100, a background management center 200, a relational database 400, an in-memory database 300, and a message queue 500. The gateway 100 is responsible for intercepting user requests, the background management center 200 is responsible for managing large model tools, permissions, and user groups, the relational database 400 is responsible for persisting the relevant information of large model tools, permissions, and user groups, the in-memory database 300 is responsible for caching user permission information and large model tool permission rules, and the message queue 500 is responsible for notifying the gateway 100 of changes in the large model tool permission rules when the background management center 200 modifies the large model tools and permissions.
[0123] Furthermore, the relational database 400 stores user, user group, and permission data, which may include:
[0124] User table: stores user information, including primary key id, user name user_name, etc.
[0125] User group table: stores user group information, including primary key id, user group name group_name, etc.
[0126] Permission table: stores permission information, including primary key id, permission name permission_name, etc.
[0127] User-user group relationship table: stores the relationship information between users and user groups, including primary key id, user id user_id (corresponding to the primary key id in the user table), user group id group_id (corresponding to the primary key id in the user group table), etc.
[0128] User group-permission relationship table: stores the relationship information between user groups and permissions, including primary key id, user group id (corresponding to the primary key id of the user group table), and permission id (corresponding to the primary key id of the permission table).
[0129] Large model tool table: stores the request path information of large model tools, including the primary key id, the request path tool_path of the large model tool, the name tool_name of the large model tool, etc.
[0130] Large model tool-permission relationship table: stores the relationship information between the request path and permissions of the large model tool, including the primary key id, the large model tool id tool_id (corresponding to the primary key id of the large model tool table), and the permission id permission_id (corresponding to the primary key id of the permission table).
[0131] Furthermore, the backend management center 200 can process the user group, the request path of the large model tool and the user's authority through operations such as creating, editing, and deleting. A user group can have 0, 1, or more authorities; a user group can contain 0, 1, or more users; if the backend management center 200 wants to grant authority to a user, it can add the user to the corresponding user group with authority.
[0132] Furthermore, when the background management center 200 receives a request from the gateway 100 to obtain the user's permission information, it will read the in-memory database 300; if the user's permission information exists in the in-memory database 300, it will directly read it and return it to the gateway 100; if the user's permission information does not exist in the in-memory database 300, it will read the user table, user-user group relationship table, and user group-permission relationship table in the relational database 400, obtain the user's permission information after processing, write it into the in-memory database 300, and finally return it to the gateway 100.
[0133] After the backend management center 200 performs an operation that causes a change in user authority, the corresponding user information in the memory database 300 will be deleted; when the backend management center 200 is started, the large model tool table and the large model tool-authority relationship table in the relational database 400 will be read, and the large model tool authority rules will be obtained after processing, and written into the memory database 300. The read and write speed of the memory database 300 is much higher than that of the relational database 400, which can improve the overall response speed of the system.
[0134] like Figure 3 As shown, this is a sequence diagram when the administrator modifies the request path and permissions of the large model tool in the background management center 200. A new large model tool tool_1 that needs to be controlled is added, and its request path is / tool_1. A new permission permission_1 is added. Tool_1 can only be used by users with permission_1. The background management center 200 updates the large model tool table, permission table, and large model tool-permission relationship table in the relational database 400 through the database component. Because the new large model tool permission rule adds a rule that / tool_1 requires permission_1, the background management center 200 will update this rule to the in-memory database 300 and notify the gateway 100 through the message queue 500. After receiving the notification, the gateway 100 reads the rule that the request / tool_1 requires permission_1 from the in-memory database 300 and stores it in the local memory.
[0135] like Figure 4As shown, when the administrator modifies the user group in the backend management center 200, a new user group group_1 is added, permission permission_1 is granted, and user user_1 is added to group_1. The backend management center 200 updates the user group table, user-user group relationship table, and user group-permission relationship table in the relational database 400 through the database component. Because user user_1 joins the user group group_1 and obtains permission permission_1, the permission information of user user_1 has changed. The backend management center 200 will delete the cache of the permission information of user user_1 in the in-memory database 300.
[0136] like Figure 5 As shown, when a user uses the large model tool, user user_1 requests / tool_1, and the request is intercepted by the gateway 100. The gateway 100 sends a request to the background management center 200 to query the permission information of user user_1. The user management center will first query the memory database 300, and find that there is no permission information of user user_1. Then, through the database component, it queries the user-user group relationship table and the user group-permission relationship table in the relational database 400 to obtain the latest permission information of user user_1, store it in the memory database 300, and return it to the gateway 100. After the gateway 100 obtains the latest permission information of user user_1, according to the rule in the local memory that the request / tool_1 requires permission permission_1 and the user user_1 has permission permission_1, it determines that user user_1 can request / tool_1, and then forwards the request of user user_1 to / tool_1. At this time, user user_1 successfully uses the large model tool tool_1.
[0137] Furthermore, the permission rules for the large model tool are in the form of key-value pairs, where the key is the request path of the large model tool and the value is the set of permissions required by the large model tool.
[0138] Furthermore, when the gateway 100 is started, the large model tool path permission rules in the in-memory database 300 are saved in the local memory; the gateway 100 will subscribe to a topic Topic in the message queue 500; after the background management center 200 performs an operation that causes the large model tool path permission rules to change, it will publish a message to the topic Topic of the message queue 500. After receiving the message, the gateway 100 will re-read the large model tool path permission rules in the in-memory database 300 and update them to the local memory; the gateway 100 uses local memory to reduce the network communication overhead between the in-memory database 300 and improve the overall response speed of the system.
[0139] In actual use, the execution steps of the permission management system of the large model tool based on user groups are as follows:
[0140] Step 1: Create a new user table, user group table, permission table, user group-permission relationship table, large model tool table, and large model tool-permission relationship table in the relational database 400.
[0141] Step 2: The administrator enters the backend management center 200 and adds permissions and request paths for large model tools.
[0142] Step 3: The backend management center 200 updates the updated large model permission rules to the in-memory database 300.
[0143] Step 4: The backend management center 200 sends a message to the message queue 500 to notify the gateway 100 that the large model tool permission rules are updated.
[0144] Step 5: The gateway 100 receives a message from the message queue 500, reads the large model tool permission rules in the in-memory database 300, and saves them to the local memory.
[0145] Step 6: The administrator enters the backend management center 200, creates a user group, grants permissions to the user group, and selects users to add to the user group. A user group can have 0, 1, or more permissions and can have 0, 1, or more users.
[0146] Step 7: The backend management center 200 operates on the data tables in the relational database 400, including adding, modifying, and deleting large model tools in the large model tool table, adding, modifying, and deleting permissions in the permission table, adding and deleting permissions in the large model tool-permission relationship table, creating, modifying, and deleting user groups in the user group table, adding and deleting permissions in the user group-permission relationship table, and adding and reducing users in the user-user group relationship table.
[0147] Step 8: The user's request path for accessing the large model tool, the gateway 100 intercepts the request and sends a request to the background management center 200 to obtain the user's permission information.
[0148] Step 9: The background management center 200 queries the memory database 300. If the user's permission information cache exists, it reads it and returns it to the gateway 100; if the user's permission information cache does not exist, it queries the relational database 400, stores the query results in the memory database 300, and then returns it to the gateway 100.
[0149] Step 10: The gateway 100 determines the authority. If the user has the corresponding authority, the request is forwarded to the request path of the corresponding large model tool. If the user does not have the authority, the result is directly returned to inform the user that he does not have the authority to use the corresponding large model tool.
[0150] The present embodiment provides a user group-based permission management method and system for a large model tool. By customizing user groups, permissions, and large model tools in the background management center, permission management of different types of users can be easily and batch-controlled. In addition, user groups are closer to actual business scenarios, making it easier for administrators to better manage permissions, such as the Chinese group, the American user group, etc. The user permission check is placed separately on the gateway to avoid occupying the computing resources of the large model tool. It will not affect the large model tool that has been online, and no code is required on the large model tool side. The access path, permissions, and user groups of the large model tool can be directly added in the background management center to achieve permission management.
[0151] Based on the same inventive concept, the embodiment of the present application also provides a large model management system for implementing the large model rights management system involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more large model management system embodiments provided below can refer to the limitations of the large model rights management system above, and will not be repeated here.
[0152] In one embodiment, Figure 6 As shown, a large model management system is provided, which includes the large model authority management system as described above and at least one large model tool, and the large model tool is used to respond to a user request and generate a large model processing result corresponding to the user request.
[0153] The large model rights management system includes a gateway and a background management center, wherein:
[0154] The gateway is connected to the backend management center and at least one large model tool respectively, and is used to send a permission acquisition request to the backend management center based on a user request;
[0155] The backend management center is used to obtain user authority information corresponding to the authority acquisition request based on the authority acquisition request; and send the user authority information to the gateway;
[0156] The gateway is also used to select to forward the user request to the corresponding big model tool, or return an unauthorized result based on the user authority information and the big model tool information corresponding to the user request; the big model tool information includes the authority rules of the big model tool.
[0157] Each module in the above-mentioned large model management system can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A large model rights management system, characterized in that: The large model rights management system includes a gateway and a background management center, wherein: The gateway is connected to the backend management center and at least one large model tool respectively, and is used to send a permission acquisition request to the backend management center based on a user request; The backend management center is configured to obtain user authority information corresponding to the authority acquisition request based on the authority acquisition request; and send the user authority information to the gateway; The gateway is also used to select to forward the user request to the corresponding big model tool, or return an unauthorized result based on the user authority information and the big model tool information corresponding to the user request; the big model tool information includes the authority rules of the big model tool.
2. The large model rights management system according to claim 1, characterized in that: The large model rights management system also includes an in-memory database; The memory database is connected to the gateway and the backend management center respectively, and is used to store user information and large model tool information; The backend management center is further used to perform a first update operation on the memory-based database, wherein the first update operation includes one or more operations of adding, deleting and editing the user information and / or the large model tool information; The gateway is also used to store the large model tool information in the memory-type database into the local memory of the gateway when the memory-type database is updated.
3. The large model rights management system according to claim 2 is characterized in that: The large model rights management system further includes a message queue, which is connected to the gateway and the background management center respectively, wherein: After performing an update operation on the memory-type database, the background management center is further used to publish an update event in a preset subscription topic in the message queue; The gateway is also used to obtain the large model tool information in the memory database based on the update event of the preset subscription topic, and store the large model tool information in the local memory of the gateway.
4. The large model rights management system according to claim 2, characterized in that: The backend management center is also used for: Based on the permission acquisition request, acquiring user information corresponding to the permission acquisition request in the in-memory database; Determining user authority information corresponding to the authority acquisition request based on the user information; The user authority information is sent to the gateway.
5. The large model rights management system according to claim 2, characterized in that: The gateway is connected to the memory-type database via a first database component, and the background management center is connected to the memory-type database via a second database component.
6. The large model rights management system according to claim 2, characterized in that: The large model authority management system further includes a relational database, which is connected to the background management center, wherein: The relational database is used to store user information and large model tool information; The background management center is also used to perform a second update operation on the relational database, and the second update operation includes one or more operations of adding, deleting and editing the user information and / or large model tool information in the relational database.
7. The large model rights management system according to claim 6, characterized in that: The backend management center is also used for: When the in-memory database does not include the user information corresponding to the permission acquisition request, acquiring the user information corresponding to the permission acquisition request in the relational database; Determining user authority information corresponding to the authority acquisition request based on the user information; The user authority information is sent to the gateway.
8. The large model rights management system according to any one of claims 2 to 7, characterized in that: The user information includes user-user group information and user group-authority information. The backend management center is also used for: Based on the permission acquisition request, acquiring user-user group information corresponding to the permission acquisition request, and based on the user-user group information, determining a user group corresponding to the user; Based on the user group, obtaining user group-authority information corresponding to the user group; Based on the user group-authority information, user authority information corresponding to the authority acquisition request is determined.
9. The large model rights management system according to claim 1, characterized in that: The gateway is also used to: If the user authority information matches the large model tool information corresponding to the user request, forwarding the user request to the corresponding large model tool; If the user authority information does not match the large model tool information corresponding to the user request, an unauthorized result is returned.
10. A large model management system, characterized in that: The big model management system includes the big model authority management system as described in claims 1 to 9 and at least one big model tool, and the big model tool is used to respond to a user request and generate a big model processing result corresponding to the user request.
Citation Information
Patent Citations
Method and system for realizing micro-service gateway authentication
CN113055367A
High-performance gateway authentication method and system oriented to credential field
CN114039759A
JWT-based large model knowledge base access control method and system
CN117972787A
User permission data query method and apparatus, electronic device and medium
US20210224412A1
Message queue-based method for managing row and column permissions, and related device
WO2021135255A1