Large model permission management system and large model management system
By introducing a gateway and a backend management center into the large-scale permission management system, and combining an in-memory database and a message queue, the permission determination process was optimized, solving the problem of low permission determination efficiency and achieving more efficient and stable permission management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG LAB
- Filing Date
- 2024-11-21
- Publication Date
- 2026-04-21
AI Technical Summary
The current large-scale permission management system has low permission determination efficiency, resulting in long user waiting times and a reduced user experience.
By introducing a gateway and a backend management center, optimizing the permission determination process using an in-memory database and message queues, reducing direct interaction with the backend management center and large model tools, and improving response speed by adopting local caching and a distributed architecture, high efficiency in permission determination is achieved.
It improves the efficiency of permission determination, reduces user waiting time, enhances system stability and reliability, and ensures data consistency and flexibility.
Smart Images

Figure CN119622801B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a large-scale model access control system and a large-scale model management system. Background Technology
[0002] With the continuous development of large-scale models, various tools have been derived from them, such as those for translation, drawing, speech recognition, and image recognition. However, large-scale model tools are highly dependent on computing power and have high hardware resource requirements, thus necessitating restrictions on different user categories. However, current large-scale model permission management systems have low permission determination efficiency, resulting in long processing times for users and a reduced user experience.
[0003] This shows that current large-scale permission management systems still suffer from low efficiency in permission determination. Summary of the Invention
[0004] Therefore, it is necessary to provide a large-model permission management system and a large-model management system that can improve the efficiency of permission determination in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a large-scale model access control system, which includes a gateway and a backend management center, wherein:
[0006] The gateway is connected to the backend management center and at least one large model tool, and is used to send permission acquisition requests to the backend management center based on user requests.
[0007] The backend management center is used to obtain user permission information corresponding to the permission acquisition request based on the permission acquisition request; and send the user permission information to the gateway.
[0008] The gateway is also used to select whether to forward the user request to the corresponding large model tool or return a no-permission result based on the user permission information and the large model tool information corresponding to the user request; the large model tool information includes the permission rules of the large model tool.
[0009] In one embodiment, the large model permission management system further includes an in-memory database;
[0010] The in-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 back-end management center is also used to perform a first update operation on the memory database. The first update operation includes one or more operations such as adding, deleting and editing user information and / or the large model tool information.
[0012] The gateway is also configured to store large model tool information from the in-memory database to the gateway's local memory when the in-memory database is updated.
[0013] In one embodiment, the large model permission management system further includes a message queue, which is connected to both the gateway and the backend management center, wherein:
[0014] After updating the in-memory database, the backend management center is also used to publish update events in the preset subscription topics in the message queue;
[0015] The gateway is also used to obtain large model tool information from the in-memory database based on the update event of the preset subscription topic, and store the large model tool information in the gateway's local memory.
[0016] In one embodiment, the backend management center is further used for:
[0017] Based on the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the in-memory database;
[0018] Based on the user information, determine the user permission information corresponding to the permission acquisition request;
[0019] The user permission information is sent to the gateway.
[0020] In one embodiment, the gateway is connected to the in-memory database via a first database component, and the back-end management center is connected to the in-memory database via a second database component.
[0021] In one embodiment, the large-model permission management system further includes a relational database connected to the backend management center, wherein:
[0022] The relational database is used to store user information and large model tool information;
[0023] The back-end management center is also used to perform a second update operation on the relational database. The second update operation includes one or more operations such as adding, deleting, and editing user information and / or large model tool information in the relational database.
[0024] In one embodiment, the backend management center is further used for:
[0025] When the in-memory database does not contain user information corresponding to the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the relational database.
[0026] Based on the user information, determine the user permission information corresponding to the permission acquisition request;
[0027] The user permission information is sent to the gateway.
[0028] In one embodiment, the user information includes user-user group information and user group-permission information, and the backend management center is further used for:
[0029] Based on the permission acquisition request, obtain the user-user group information corresponding to the permission acquisition request, and determine the user group corresponding to the user based on the user-user group information;
[0030] Based on the user group, obtain the user group-permission information corresponding to the user group;
[0031] Based on the user group-permission information, determine the user permission information corresponding to the permission acquisition request.
[0032] In one embodiment, the gateway is further configured to:
[0033] If the user permission information matches the large model tool information corresponding to the user request, then the user request is forwarded to the corresponding large model tool.
[0034] If the user permission information and the large model tool information corresponding to the user request do not match, a "no permission" result will be returned.
[0035] Secondly, this application provides a large model management system, which includes the large model permission management system described above and at least one large model tool. The large model tool is used to generate a large model processing result corresponding to the user request in response to the user request.
[0036] The aforementioned large-scale model permission management system and large-scale model management system send permission acquisition requests to the backend management center through a gateway based on user requests. The backend management center, based on the permission acquisition requests, obtains the user permission information corresponding to the permission acquisition requests and sends the user permission information to the gateway. The gateway, based on the user permission information and the large-scale model tool information corresponding to the user requests, chooses to forward the user requests to the corresponding large-scale model tool or return a no-permission result. Thus, permission determination can be performed by the gateway, avoiding the computational burden and efficiency reduction caused by permission determination by the backend management center or the large-scale model tool, thereby improving the efficiency of permission determination. Attached Figure Description
[0037] Figure 1 This is a structural block diagram of a large-scale model permission management system in one embodiment;
[0038] Figure 2 This is a structural block diagram of a permission management system for a large user group-based tool in one embodiment.
[0039] Figure 3 This is a timing diagram illustrating the modification of large model tool information in one embodiment;
[0040] Figure 4 This is a timing diagram illustrating the modification of user group information in one embodiment;
[0041] Figure 5 This is a timing diagram illustrating a user's use of a large model tool in one embodiment;
[0042] Figure 6 This is a block diagram of the large model management system in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] In one embodiment, such as Figure 1 As shown, a large-scale model access control system is provided, which includes a gateway 100 and a backend management center 200, wherein:
[0045] The gateway 100 is connected to the backend management center 200 and at least one large model tool, and is used to send permission acquisition requests to the backend management center 200 based on user requests.
[0046] The backend management center 200 is used to obtain user permission information corresponding to the permission acquisition request based on the permission acquisition request; and send the user permission information to the gateway 100.
[0047] The gateway 100 is also used to select, based on the user permission information and the large model tool information corresponding to the user request, whether to forward the user request to the corresponding large model tool or return a no-permission result.
[0048] Gateway 100 receives requests from users and, based on the information in the user request, sends an access request to the backend management center 200. The user request may include the user's identity identifier, the large model tool to be invoked, and a prompt word. The large model tool to be invoked can be represented by its name or other unique identifier. Furthermore, if the large model tool has the corresponding functionality, the user request may also include personalized customization information for the large model tool. Gateway 100 intercepts user requests and, after performing permission checks at its end, determines whether to forward the user request to the large model tool or directly return a "no permission" result.
[0049] Furthermore, gateway 100 may include a local cache for storing large model tool information for each large model tool, including the permission rules for the large model tool. When a user request is received from a user terminal, the large model tool that the user wants to invoke can be determined based on the user request, and then the local cache can be accessed to determine the permission rules corresponding to that large model tool.
[0050] Furthermore, in order to reduce the number of interactions with the backend management center 200, the local cache can also store recently accessed or recently acquired user permission information. When the same user makes a request again, the cache can be used to read the user permission information and make a decision directly.
[0051] The backend management center 200 is used to manage and maintain user information, and upon receiving a permission acquisition request from the gateway 100, it quickly and accurately returns the corresponding user permission information. For example, the backend management center 200 may use database indexing technology to locate the user permission information corresponding to the permission acquisition request.
[0052] Furthermore, considering the performance requirements under high concurrency scenarios, the backend management center 200 can be designed as a distributed architecture, using load balancing technology to distribute request pressure and ensure the stability and availability of the system.
[0053] After obtaining the user permission information, the gateway 100 can choose to forward the user request to the corresponding large model tool or return a no-permission result, depending on whether the obtained user permission information meets the permission rules corresponding to the large model tool.
[0054] Furthermore, each user can have one or more permissions. For example, to determine whether the obtained user permission information meets the permission rules corresponding to the large model tool, it can be to determine whether the permissions in the permission rules corresponding to the large model tool also exist in the user's permissions, and obtain the judgment result. Each user can also have different levels of permissions. For example, it can be to determine whether the user's permission level in the permission rules corresponding to the large model tool is greater than or equal to the required permission level, and obtain the judgment result.
[0055] This embodiment provides a large-scale model permission management system. A gateway sends a permission acquisition request to the backend management center based on a user request. The backend management center, based on the permission acquisition request, obtains the user permission information corresponding to the request and sends the user permission information to the gateway. The gateway, based on the user permission information and the large-scale model tool information corresponding to the user request, chooses to forward the user request to the corresponding large-scale model tool or return a "no permission" result. This allows the gateway to perform permission determination, avoiding the computational burden and efficiency reduction caused by permission determination by the backend management center or the large-scale model tool, thus improving the efficiency of permission determination.
[0056] In one embodiment, the large model permission management system further includes an in-memory database;
[0057] The in-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 in-memory database; the first update operation includes one or more operations such as adding, deleting, and editing user information and / or the large model tool information.
[0059] The gateway is also configured to store large model tool information from the in-memory database to the gateway's local memory when the in-memory database is updated.
[0060] An in-memory database is a database system that stores data in RAM (Random Access Memory), offering significantly higher read and write speeds compared to traditional disk-based databases. In this embodiment, the in-memory database is used to store user information and large model tool information.
[0061] The in-memory database maintains connections with both the gateway and the backend management center. The backend management center may perform the first update operation on the in-memory database based on management needs. This first update operation includes one or more operations such as adding, deleting, and editing 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 local memory. Thus, when the gateway needs to perform permission checks, it can directly retrieve the required information from local memory without querying the in-memory database again, significantly reducing latency.
[0063] This embodiment provides a large-scale permission management system. By setting up an in-memory database connected to both the gateway and the backend management center, read and write speeds can be improved, enhancing the system's response speed to user requests. Furthermore, by utilizing the gateway's local caching, the frequency of direct access to the in-memory database can be reduced, lowering the database load. This, in turn, improves the permission determination efficiency, stability, and reliability of the large-scale permission management system.
[0064] In one embodiment, the large model permission management system further includes a message queue, which is connected to both the gateway and the backend management center, wherein:
[0065] After updating the in-memory database, the backend management center is also used to publish update events in the preset subscription topics in the message queue;
[0066] The gateway is also used to obtain large model tool information from the in-memory database based on the update event of the preset subscription topic, and store the large model tool information in the gateway's local memory.
[0067] The message queue serves as a container for storing messages during transmission. In this embodiment, the message queue can be implemented using technologies such as Kafka. The message queue connects to both the backend management center and the gateway. When the backend management center updates data in the in-memory database, it publishes an update event in a preset subscription topic on the message queue to notify the gateway that the data has been updated. This preset subscription topic is the topic subscribed to by the gateway.
[0068] The gateway subscribes to preset topics in the message queue and listens for update events in real time. When the gateway receives an update event, it retrieves the latest large model tool information from the in-memory database and stores it in the gateway's local memory, ensuring 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 distributed by setting up multiple gateways. Each gateway subscribes to 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 can asynchronously process data synchronization tasks after receiving the update time, avoiding blocking the processing of other users' requests, thereby improving the system's response speed.
[0071] This embodiment provides a large-scale permission management system. By setting up a message queue, when the backend management center updates the in-memory database, the gateway can promptly obtain the update event and synchronize the data. This ensures that the gateway always uses the latest data for permission determination, improving the system's real-time performance and accuracy, as well as making the system more flexible and scalable, thereby improving the permission determination efficiency of the large-scale permission management system.
[0072] In one embodiment, user information is stored in an in-memory database. When the gateway generates a permission acquisition request based on a user request and sends it to the backend management database, the backend management center is further used for:
[0073] Based on the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the in-memory database;
[0074] Based on the user information, determine the user permission information corresponding to the permission acquisition request;
[0075] The user permission information is sent to the gateway.
[0076] Specifically, obtaining the user information corresponding to the permission acquisition request from the in-memory database can be achieved by querying the in-memory database based on the user name or the unique identification code of another user in the permission acquisition request, thereby obtaining the user information of that user.
[0077] Determining the user permission information corresponding to the permission acquisition request based on the user information can be achieved by combining the acquired user information with predefined permission rules of the system to determine the specific permission information of the user. Furthermore, a structured data format can be constructed and sent to the gateway.
[0078] This embodiment provides a large-scale permission management system. By obtaining user information corresponding to the permission acquisition request from the in-memory database, the system determines the user permission information corresponding to the permission acquisition request. Due to the high read and write speed of the in-memory database, the backend management center can quickly obtain user information, which can significantly shorten the permission determination time and thus improve the permission determination efficiency of the large-scale permission management system.
[0079] In one embodiment, the gateway is connected to the in-memory database via a first database component, and the back-end management center is connected to the in-memory database via a second database component.
[0080] Each database component is responsible for managing the connection to the in-memory database, including establishing, maintaining, and disconnecting the connection. The gateway connects to the in-memory database through a first database component, which handles data interaction between the gateway and the in-memory database. The backend management center connects to the in-memory database through a second database component, which handles data interaction between the backend management center and the in-memory database.
[0081] For example, the database component can provide a standardized data access interface, enabling gateways and back-end management centers to easily query and update data in the in-memory database.
[0082] This embodiment provides a large-scale permission management system that decouples the gateway and backend management center from the in-memory database by introducing a dedicated database component. This makes the system more modular, easier to maintain and expand, optimizes data access paths, reduces unnecessary network communication and data transmission, and improves the overall performance of the system, thereby enhancing the permission determination efficiency of the large-scale permission management system.
[0083] In one embodiment, the large-model permission management system further includes a relational database connected to the backend management center, wherein:
[0084] The relational database is used to store user information and large model tool information;
[0085] The back-end management center is also used to perform a second update operation on the relational database. The second update operation includes one or more operations such as adding, deleting, and editing user information and / or large model tool information in the relational database.
[0086] Relational databases are databases that use a relational model to organize data, and are used for persistent storage of user information and large model tool information. The relational database connects to the backend management center, which is responsible for performing data operations on the relational database.
[0087] The backend management center is also used to perform a second update operation on the relational database. This second update operation involves updating user information and large model tool information in the relational database, including one or more of adding, deleting, and editing. After performing the update operation on the relational database, the backend management center can also synchronize these updates to the in-memory database to ensure that the data in the in-memory database is up-to-date.
[0088] This embodiment provides a large-model permission management system. By setting up a relational database, it can achieve persistent storage of user information and large-model tool information, ensuring that data will not be lost due to system restarts or failures. It also supports complex SQL queries, facilitating data retrieval and statistical analysis. By synchronizing data from the relational database to an in-memory database and leveraging 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 improving the efficiency, stability, and reliability of permission determination in the large-model permission management system.
[0089] In one embodiment, the backend management center is further used for:
[0090] When the in-memory database does not contain user information corresponding to the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the relational database.
[0091] Based on the user information, determine the user permission information corresponding to the permission acquisition request;
[0092] The user permission information is sent to the gateway.
[0093] The process of retrieving user information from a relational database can be performed when the user information is not included in the in-memory database. That is, the backend management center can attempt to retrieve the user information corresponding to the user identifier from the in-memory database. If the in-memory database does not contain the user information corresponding to the permission retrieval request, then the user information corresponding to the permission retrieval request can be retrieved from the relational database.
[0094] Furthermore, after retrieving user information from the relational database, the backend management center can also synchronize this information to the in-memory database so that subsequent requests can be directly retrieved from the in-memory database.
[0095] This embodiment provides a large-scale permission management system that, through efficient reading from an in-memory database, can quickly retrieve user information, significantly shortening the permission determination time and reducing user waiting time. When user information is not available in the in-memory database, it can be retrieved from a relational database, ensuring data integrity and accuracy, thereby improving the permission determination efficiency of the large-scale permission management system.
[0096] In one embodiment, user permissions can be granted based on the corresponding user group. Operators can edit the user groups to which users belong and assign uniform permissions to the corresponding user groups, thereby achieving unified setting of user permissions. The backend management center is also used for:
[0097] Based on the permission acquisition request, obtain the user-user group information corresponding to the permission acquisition request, and determine the user group corresponding to the user based on the user-user group information;
[0098] Based on the user group, obtain the user group-permission information corresponding to the user group;
[0099] Based on the user group-permission information, determine the user permission information corresponding to the permission acquisition request.
[0100] The user information includes user-user group information and user group-permission information. User-user group information is a mapping between user identifiers and user groups, identifying the user group to which a user belongs. It is understood that each user can correspond to multiple user groups, thus being granted various permissions. User group-permission information is a mapping between user groups and user group permissions, identifying the user group to which a user belongs. Each user group can also be assigned multiple permissions, enabling diverse user permission management.
[0101] Based on the permission acquisition request, the user-user group information corresponding to the permission acquisition request can be obtained by reading the user-user group information in an in-memory database or a relational database according to the user identifier, thereby determining the user-user group information corresponding to the user identifier.
[0102] Obtaining user group-permission information corresponding to the user group can be achieved by obtaining user group-permission information corresponding to the user group identifier based on the user group identifier.
[0103] A user can correspond to multiple user groups. Therefore, based on user-user group information, at least one user group corresponding to a user can be determined.
[0104] Based on the user group-permission information, the user permission information corresponding to the permission acquisition request is determined. This may involve acquiring the permission information corresponding to the user group. When a user exists in multiple user groups, the user permission information may be determined by acquiring the permissions corresponding to multiple user groups.
[0105] This embodiment provides a large-scale permission management system that, through multi-layered management of users-user groups and user groups-permissions, can achieve more granular permission control, thereby improving the system's flexibility and security.
[0106] In one embodiment, the gateway is further configured to:
[0107] If the user permission information matches the large model tool information corresponding to the user request, then the user request is forwarded to the corresponding large model tool.
[0108] If the user permission information and the large model tool information corresponding to the user request do not match, a "no permission" result will be returned.
[0109] Specifically, determining whether the user permission information matches the large model tool information corresponding to the user request can be done by checking whether the user permission information includes the permissions required by the large model tool information. If it does, then the user permission information and the large model tool information corresponding to the user request match; otherwise, they do not match.
[0110] In the case of a match, the user request can 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 can be forwarded to the corresponding large model tool, or the large model tool can determine the user request frequency and return the corresponding response.
[0111] In the event of a mismatch, the user request will not be forwarded to the large model tool, and a response result will be generated directly. This response result is a permission-invalid result, used to inform the user that they do not currently have permission to use the large model tool.
[0112] This embodiment provides a large model permission management system that, through detailed permission matching logic, ensures that only users with the corresponding permissions can access large model tools. When a user attempts to access a tool without permission, they will immediately receive a "no permission" result, avoiding long waiting times and thus improving system security.
[0113] In one embodiment, the permission rules of the large model tool include the request path of the large model tool and the permission requirements of the large model tool.
[0114] Each large model tool has a unique request path that identifies the access point for that tool; permission requirements include the minimum permissions required to access the tool, which can be, for example, role restrictions or permission level restrictions.
[0115] This embodiment provides a large model permission management system that, through a combination of request paths and permission requirements, can achieve more granular permission control, ensuring that only users with the corresponding permissions can access specific large model tools, thereby improving the system's flexibility and security.
[0116] To more clearly illustrate the technical solution of this application, a detailed embodiment is also provided.
[0117] In one embodiment, a user group-based permission management system for large-scale tool models is provided. Unlike common role-based or attribute-based permission control methods, this system more closely aligns with real-world business scenarios for managing large-scale tool models. It allows for batch and real-time management of user permissions, 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 large-scale model tools that require management. Gateway 100 connects to the in-memory database 300 via a database component; the backend management center 200 connects to both the relational database 400 and the in-memory database 300 via database components. Gateway 100 is exposed externally, while the backend management center 200 and the large-scale model tools are not.
[0119] Gateway 100 is responsible for forwarding user requests; the backend management center 200 is responsible for managing user, user group, and permission data.
[0120] The relational database 400 stores user data; the in-memory database 300 stores user data and a cache of permission rules for large model tools.
[0121] When Gateway 100 receives a user's request, it requests the backend management center 200 to obtain the user's permission information. Gateway 100 determines whether the user can use the large model tool based on the user's permission information and the permission rules of the large model tool. If the user has permission, Gateway 100 forwards the request to the corresponding large model tool. If the user does not have permission, Gateway 100 directly returns the result, informing the user that they do not have permission to use the corresponding large model tool.
[0122] like Figure 2The diagram shows the structural block of the access control system. The entire system consists of a gateway 100, a backend management center 200, a relational database 400, an in-memory database 300, and a message queue 500. Gateway 100 is responsible for intercepting user requests. The backend management center 200 manages large-scale tools, permissions, and user groups. The relational database 400 persists information related to large-scale tools, permissions, and user groups. The in-memory database 300 caches user permission information and large-scale tool permission rules. The message queue 500 notifies gateway 100 of changes to the large-scale tool permission rules when the backend management center 200 modifies large-scale tools or permissions.
[0123] Furthermore, relational databases store user, user group, and permission data, which may include:
[0124] User table: Stores user information, including primary key id, username user_name, etc.
[0125] User group table: Stores user group information, including primary key id, user group name group_name, etc.
[0126] Permissions table: Stores permission information, including primary key id, permission name permission_name, etc.
[0127] User-User Group Relationship Table: Stores information about the relationship 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 Tools Table: Stores request path information for large model tools, including primary key id, request path tool_path, and tool name tool_name.
[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 handle user groups, request paths for large model tools, and user permissions through operations such as creating, editing, and deleting. A user group can have 0, 1, or more permissions; a user group can contain 0, 1, or more users; if the backend management center 200 wants to grant permissions to a user, it can add the user to the corresponding user group that has the permissions.
[0132] Furthermore, when the backend management center 200 receives a request from the gateway 100 to obtain user permission information, it will read the in-memory database 300. If the user permission information exists in the in-memory database 300, it will directly read it and return it to the gateway 100. If the user 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 from the relational database 400, process them to obtain the user permission information, 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 changes user permissions, it will delete the corresponding user information from the in-memory database 300. When the backend management center 200 starts, it reads the large model tool table and the large model tool-permission relationship table from the relational database 400, processes them to obtain the large model tool permission rules, and writes them to the in-memory database 300. The read and write speed of the in-memory database 300 is much higher than that of the relational database 400, which can improve the overall system response speed.
[0134] like Figure 3 The diagram illustrates the sequence of events when an administrator modifies the request path and permissions of a large model tool in the backend management center 200. A new large model tool, tool_1, needs to be managed. Its request path is / tool_1, and a new permission, permission_1, is added, allowing only users with permission_1 to use tool_1. The backend management center 200 updates the large model tool table, permission table, and large model tool-permission relationship table in the relational database 400 via the database component. Because the new large model tool permission rules include a rule requiring permission_1 for / tool_1, the backend management center 200 updates this rule in the in-memory database 300 and notifies the gateway 100 via message queue 500. Upon receiving the notification, the gateway 100 reads the rule requesting permission_1 for / tool_1 from the in-memory database 300 and stores it in local memory.
[0135] like Figure 4As shown, when the administrator modifies user groups in the backend management center 200, a new user group `group_1` is created, the permission `permission_1` is granted, and user `user_1` is added to `group_1`. Backend management center 200 updates the user group table, user-user group relationship table, and user group-permission relationship table in relational database 400 through database components. Because user `user_1` is added to user group `group_1` and acquires the permission `permission_1`, user `user_1`'s permission information changes. Therefore, backend management center 200 will delete the cached permission information for user `user_1` in in-memory database 300.
[0136] like Figure 5 As shown, when a user uses the large model tool, user_1 requests / tool_1. This request is intercepted by gateway 100. Gateway 100 sends a request to the backend management center 200 to query user_1's permission information. The user management center first queries the in-memory database 300 and finds no permission information for user_1. Then, it queries the user-user group relationship table and user group-permission relationship table in the relational database 400 through the database component to obtain the latest permission information for user_1. This information is then stored in the in-memory database 300 and returned to gateway 100. After obtaining the latest permission information for user_1, gateway 100, based on the rule in its local memory that requesting / tool_1 requires permission_1 and user_1 possessing permission_1, determines that user_1 can request / tool_1. It then forwards user_1's request to / tool_1, at which point user_1 successfully uses the large model tool tool_1.
[0137] Furthermore, the permission rules for large model tools are in key-value pair format, 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 Gateway 100 starts up, the large model tool path permission rules in the in-memory database 300 are saved to local memory. Gateway 100 subscribes to a topic in message queue 500. After the backend management center 200 performs an operation that causes changes to the large model tool path permission rules, it publishes the message to the topic in message queue 500. After receiving the message, Gateway 100 rereads the large model tool path permission rules in the in-memory database 300 and updates them to local memory. Gateway 100's use of local memory reduces network communication overhead with the in-memory database 300 and improves the overall system response speed.
[0139] In practical use, the execution steps of a permission management system based on a large user group model are as follows:
[0140] Step 1: Create the following tables in the relational database 400: User table, User group table, Permission table, User group-Permission relationship table, Large model tool table, and Large model tool-Permission relationship table.
[0141] Step 2: The administrator enters the backend management center 200 and adds permissions and the request path for the large model tool.
[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 message queue 500 to notify the gateway 100 that the permission rules for the large model tool have been updated.
[0144] Step 5: Gateway 100 receives a message from message queue 500, reads the large model tool permission rules from memory database 300, and saves them to local memory.
[0145] Step 6: The administrator logs into the backend management center 200, creates a user group, assigns 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 performed operations 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 removing users from the user-user group relationship table.
[0147] Step 8: When a user accesses the large model tool, the gateway 100 intercepts the request and simultaneously sends a request to the backend management center 200 to obtain the user's permission information.
[0148] Step 9: The backend management center 200 queries the in-memory database 300. If the user's permission information is cached, it reads it and returns it to the gateway 100. If the user's permission information is not cached, it queries the relational database 400, stores the query result in the in-memory database 300, and then returns it to the gateway 100.
[0149] Step 10: Gateway 100 checks permissions. If the user has the corresponding permissions, it forwards the request to the request path of the corresponding large model tool; if the user does not have the permissions, it directly returns the result to inform the user that they do not have permission to use the corresponding large model tool.
[0150] This embodiment provides a permission management method and system for a large model tool based on user groups. By customizing user groups, permissions, and the large model tool in the backend management center, permission control for different types of users can be easily and in batches implemented. In addition, the user groups are closer to actual business scenarios, making it easier for administrators to better manage permissions, such as China group, US user group, etc. User permission checks are placed separately on the gateway to avoid consuming the computing resources of the large model tool. It will not affect the already deployed large model tool, and no code is required on the large model tool side. Access paths, permissions, and user groups for the large model tool can be added directly in the backend management center to achieve permission control.
[0151] Based on the same inventive concept, this application also provides a large model management system for implementing the large model permission management system described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more large model management system embodiments provided below can be found in the limitations of the large model permission management system described above, and will not be repeated here.
[0152] In one embodiment, such as Figure 6 As shown, a large model management system is provided, which includes a large model permission management system as described above and at least one large model tool. The large model tool is used to generate a large model processing result corresponding to the user request in response to the user request.
[0153] The large-scale model permission management system includes a gateway and a backend management center, wherein:
[0154] The gateway is connected to the backend management center and at least one large model tool, and is used to send permission acquisition requests to the backend management center based on user requests.
[0155] The backend management center is used to obtain user permission information corresponding to the permission acquisition request based on the permission acquisition request; and send the user permission information to the gateway.
[0156] The gateway is also used to select whether to forward the user request to the corresponding large model tool or return a no-permission result based on the user permission information and the large model tool information corresponding to the user request; the large model tool information includes the permission rules of the large model tool.
[0157] The modules in the aforementioned large-scale model management system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[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, data stored, data displayed, 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 will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0160] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A large-scale permission management system, characterized in that, The large-scale model permission management system includes a gateway and a backend management center, wherein: The gateway is connected to the backend management center and at least one large model tool, and is used to send permission acquisition requests to the backend management center based on user requests. The backend management center is used to obtain user permission information corresponding to the permission acquisition request based on the permission acquisition request; and send the user permission information to the gateway. The gateway is also configured to, based on the user permission information and the large model tool information corresponding to the user request, choose to forward the user request to the corresponding large model tool, or return a no-permission result; the large model tool information includes the permission rules of the large model tool; The large model permission management system also includes an in-memory database; the in-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 also used to perform a first update operation on the in-memory database, the first update operation including one or more operations such as adding, deleting and editing user information and / or the large model tool information; the gateway is also used to store the large model tool information in the in-memory database to the gateway's local memory when the in-memory database is updated.
2. The large-model permission management system according to claim 1, characterized in that, The large-scale model permission management system also includes a message queue, which is connected to both the gateway and the backend management center, wherein: After updating the in-memory database, the backend management center is also used to publish update events in the preset subscription topics in the message queue; The gateway is also used to obtain large model tool information from the in-memory database based on the update event of the preset subscription topic, and store the large model tool information in the gateway's local memory.
3. The large-model permission management system according to claim 1, characterized in that, The back-end management center is also used for: Based on the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the in-memory database; Based on the user information, determine the user permission information corresponding to the permission acquisition request; The user permission information is sent to the gateway.
4. The large-model permission management system according to claim 1, characterized in that, The gateway is connected to the in-memory database through a first database component, and the back-end management center is connected to the in-memory database through a second database component.
5. The large-model permission management system according to claim 1, characterized in that, The large-scale model permission management system also includes a relational database, which is connected to the backend management center, wherein: The relational database is used to store user information and large model tool information; The back-end management center is also used to perform a second update operation on the relational database. The second update operation includes one or more operations such as adding, deleting, and editing user information and / or large model tool information in the relational database.
6. The large-model permission management system according to claim 5, characterized in that, The back-end management center is also used for: When the in-memory database does not contain user information corresponding to the permission acquisition request, retrieve the user information corresponding to the permission acquisition request from the relational database. Based on the user information, determine the user permission information corresponding to the permission acquisition request; The user permission information is sent to the gateway.
7. The large-model access control system according to any one of claims 1 to 6, characterized in that, The user information includes user-user group information and user group-permission information. The backend management center is also used for: Based on the permission acquisition request, obtain the user-user group information corresponding to the permission acquisition request, and determine the user group corresponding to the user based on the user-user group information; Based on the user group, obtain the user group-permission information corresponding to the user group; Based on the user group-permission information, determine the user permission information corresponding to the permission acquisition request.
8. The large-scale model access control system according to claim 1, characterized in that, The gateway is also used for: If the user permission information matches the large model tool information corresponding to the user request, then the user request is forwarded to the corresponding large model tool. If the user permission information and the large model tool information corresponding to the user request do not match, a "no permission" result will be returned.
9. A large-scale model management system, characterized in that, The large model management system includes a large model permission management system as described in any one of claims 1 to 8 and at least one large model tool, wherein the large model tool is used to generate a large model processing result corresponding to the user request in response to the user request.
Citation Information
Patent Citations
High-performance gateway authentication method and system oriented to credential field
CN114039759A
JWT-based large model knowledge base access control method and system
CN117972787A