A page loading method, system, device and medium

By creating and querying user-associated role tables and permission tables, dynamically loading user permissions and role permissions, the problem of low flexibility in user role management in the existing technology is solved, and the system is high maintainability and flexibility is achieved.

CN113806658BActive Publication Date: 2025-03-11JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111065390.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-12
Publication Date
2025-03-11
Estimated Expiration
2041-09-12

AI Technical Summary

Technical Problem

The existing technology directly writes the user role when creating a user role, which leads to difficulties in handling special users in similar roles, low system flexibility, and frequent hard-code adjustments.

Method used

By creating a user association role table, a user association permission table, and a role association permission table, query roles and permissions based on the user ID, and save the query user permissions and role permissions to the cache, and dynamically load the page.

Benefits of technology

The system is maintained and flexible, and can effectively manage the permissions of special users, reduce hard-coded logic, simplify code, and improve the convenience and configurability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806658B_ABST
    Figure CN113806658B_ABST
Patent Text Reader

Abstract

The present invention discloses a page loading method, comprising the following steps: creating a user-associated role table, a user-associated permission table, and a role-associated permission table; assigning roles to users in the user-associated role table, assigning user permissions to users in the user-associated permission table, and assigning permissions to roles in the role-associated permission table; in response to detecting user login, querying the role corresponding to the user ID in the user-associated role table and the user permission corresponding to the user ID in the user-associated permission table according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID; saving the queried user permissions and role permissions to a cache; loading a page according to the user permissions and role permissions in the cache. The present invention also discloses a system, a computer device, and a readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of page loading, and in particular to a page loading method, system, device and storage medium. Background Art

[0002] What is now common is that the user role is hard-coded when the user is created, and on-demand loading is determined directly based on the role code. This then leads to the problem of handling special users within the same role, resulting in a lot of hard-coded judgment logic being written in the logic. As long as the user role changes slightly or there are new requirements, it has to be hard-coded again, and the system has very low flexibility. Summary of the invention

[0003] In view of this, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a page loading method, comprising the following steps:

[0004] Create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0005] Assign roles to users in the user-associated role table, assign user permissions to users in the user-associated permission table, and assign permissions to roles in the role-associated permission table;

[0006] In response to detecting a user login, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0007] The queried user permissions and role permissions are saved in a cache;

[0008] A page is loaded according to the user permissions and the role permissions in the cache.

[0009] In some embodiments, it also includes:

[0010] In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0011] The re-queried user permissions and role permissions are updated into the cache.

[0012] In some embodiments, it also includes:

[0013] Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

[0014] In some embodiments, creating a user-role association table, a user-permission association table, and a role-permission association table further includes:

[0015] Create a user-associated role table including role ID and user ID;

[0016] Create a role-associated permission table including role ID and permission ID;

[0017] Create a user-related permission table including user IDs and permission IDs.

[0018] In some embodiments, querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID further includes:

[0019] According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table;

[0020] The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

[0021] In some embodiments, saving the queried user permissions and role permissions to a cache further includes:

[0022] Save the queried permission code to the cache.

[0023] In some embodiments, loading a page according to the user permissions and the role permissions in the cache further includes:

[0024] The menus, interfaces and interface elements in the page are loaded according to the permission code.

[0025] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a page loading system, including:

[0026] A creation module configured to create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0027] an allocation module configured to allocate roles to users in the user-associated role table, allocate user permissions to users in the user-associated permission table, and allocate permissions to roles in the role-associated permission table;

[0028] A query module configured to query the role corresponding to the user ID in the user-associated role table and the user rights corresponding to the user ID in the user-associated rights table according to the user ID in response to detecting a user login, and query the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID;

[0029] A cache module, configured to save the queried user permissions and role permissions into a cache;

[0030] A loading module is configured to load a page according to the user permissions and the role permissions in the cache.

[0031] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including:

[0032] at least one processor; and

[0033] A memory storing a computer program executable on the processor, wherein the processor executes the steps of any one of the page loading methods described above when executing the program.

[0034] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the page loading methods described above are performed.

[0035] The present invention has one of the following beneficial technical effects: The solution proposed by the present invention increases the maintainability of the system by decoupling role management and user management. And by jointly managing user rights through role rights and user rights, the system achieves tolerance for specialized users. In this way, the parallel operation of role rights management and user rights management allows the system to have both tolerance characteristics for special users in the same role, without the need for special processing, removing the hard-coded logic in the code, reducing redundant code for users, and simplifying the logic. In addition, specialized and flexible loading is achieved, which increases convenience, and this configurable management of module loading greatly facilitates customer use. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0037] Figure 1 A schematic diagram of a flow chart of a page loading method provided by an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of the structure of a page loading system provided by an embodiment of the present invention;

[0039] Figure 3 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention;

[0040] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0042] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0043] According to one aspect of the present invention, an embodiment of the present invention provides a page loading method, such as Figure 1 As shown, it may include the steps of:

[0044] S1, create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0045] S2, assigning a role to the user in the user-associated role table, assigning user rights to the user in the user-associated rights table, and assigning rights to the role in the role-associated rights table;

[0046] S3, in response to detecting a user login, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0047] S4, saving the queried user permissions and role permissions into a cache;

[0048] S5: Load a page according to the user authority and the role authority in the cache.

[0049] The solution proposed by the present invention increases the maintainability of the system by decoupling role management from user management. And the user rights are managed by role rights and user rights together, so that the system can accommodate specialized users. In this way, the hard-coded logic in the code is removed, redundant code is reduced, and the logic is simplified. In addition, specialized and flexible loading is achieved, which increases convenience. In addition, this configurable management of module loading greatly facilitates the use of customers.

[0050] In some embodiments, it also includes:

[0051] Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

[0052] In some embodiments, creating a user-role association table, a user-permission association table, and a role-permission association table further includes:

[0053] Create a user-associated role table including role ID and user ID;

[0054] Create a role-associated permission table including role ID and permission ID;

[0055] Create a user-related permission table including user IDs and permission IDs.

[0056] In some embodiments, querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID further includes:

[0057] According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table;

[0058] The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

[0059] In some embodiments, saving the queried user permissions and role permissions to a cache further includes:

[0060] Save the queried permission code to the cache.

[0061] In some embodiments, loading a page according to the user permissions and the role permissions in the cache further includes:

[0062] The menus, interfaces and interface elements in the page are loaded according to the permission code.

[0063] Specifically, the system uses roles and permissions to assign page permissions and function permissions to users to better implement permission control. Permissions can be assigned to menu permissions, tab permissions, interface element permissions, etc. Permissions can be assigned to users and roles, that is, there are two types of permissions: user-associated permissions and role-associated permissions. Role-associated permissions are a one-to-many relationship. A role is a collection of permissions. User-associated permissions can be seen as a supplement to role-associated permissions. For a user, the permissions it has are the collection of role-associated permissions and user-associated permissions.

[0064] The table design module can be used to configure the permission table, user table, user-associated role table, user-associated permission table, and role-associated permission table. The user table and role table are not described here because the user information required by each system is inconsistent. However, there will definitely be unique identifiers such as uID (user ID) and role_ID (role ID).

[0065] In some embodiments, the permission table may include the following fields: permission ID, permission name, permission code, permission type (menu permission, page label permission, interface element permission, etc.), permission status (effective and invalid), permission creation time, permission modification time, etc. Permission configuration is generally divided into menu permission, page label permission and interface element permission. Menu permission is to configure a permission to associate this permission with the menu. If you have this permission, you can display this menu; page label permission means that the menu page may have many tab label pages, and these tab labels are provided to users of different roles. Only users and roles with this page label permission can display this tab page label; the last interface element setting is that there are special cases. In the interface, not all functions of this interface can be operated by having menu permission and page label permission. Some create buttons, delete buttons, etc. are provided to administrators, and ordinary users can only view them. At this time, the page display of the last menu user can be determined by whether the user has these permissions. The system will provide super administrator users to operate the addition, deletion, modification and query of permissions.

[0066] In some embodiments, the authority configuration management, role configuration management, user configuration management, and authority allocation configuration management functions can be provided to super users through the authority configuration management, role configuration management, user configuration management, and authority allocation configuration management modules. Authority configuration management provides the functions of adding, modifying, deleting, and querying authorities. Super administrator users can manage authorities, and provide visual interface operations, which are convenient and fast. Similarly, role configuration management, user configuration management, and authority allocation configuration management also provide visual operation functions for roles, users, and authority allocation, and provide functions of adding, modifying, deleting, and querying to provide convenience for users. In addition, authority allocation management includes two parts: user authority allocation and role authority allocation, which are used to provide authority allocation for users and roles that have been created and taken effect. The benefit of the authority allocation function is that it realizes module configuration management. The system can realize the configuration management of large modules by configuring menu permissions, load response modules on demand, and realize configuration module management. In addition, page label authority allocation and interface element authority allocation are supplements to large modules to realize the configuration management of small module functions. Configuration conforms to the needs of the market. The joint management of role permissions and user permissions can realize variable operations of user modules. User permission allocation is a supplement to user role permissions. Because for the same type of role users, there will be some users who need more permissions to handle more things. For a system, the role is the classification of a type of users. You cannot create a new role for certain users. Therefore, the introduction of user permissions greatly facilitates the management of all user permissions.

[0067] In some embodiments, the user-associated role table includes the following fields: role ID, user ID, creation time, status; the role-associated permission table includes the following fields: role ID, permission ID, creation time, status; the user-associated permission table includes the following fields: user ID, permission ID, creation time, status. The above is the created table information. The role-associated permission table is to assign permissions to roles first, such as administrator roles and ordinary user roles. First, assign permissions to administrator roles and ordinary users, and then assign roles to users. Users will have the permissions of this role. The user-associated permission table can be said to be a supplement to special cases. For example, user A is an ordinary role. Ordinary roles do not have the permission of menu B. Only administrator roles have it. However, for user A, he needs to be specially assigned the permission of menu B. At this time, the configuration of the user-associated permission table can be used. 3. Provide role-associated permission configuration page and function, provide user-associated permission configuration page and function, and provide user-associated role permissions and configuration. Make the allocation of permissions configurable and remove the hard-coded method. Provide better services to operation and maintenance and customers, and make management more convenient.

[0068] In some embodiments, it also includes:

[0069] In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0070] The re-queried user permissions and role permissions are updated into the cache.

[0071] Specifically, the user's permissions need to be checked after successful login, and the role permissions and user permissions are combined. The page cancels the hard-coded format and adopts permission control. The introduction of related modules can be determined based on whether the user has permission coding. The cache is planned according to the system. If the system does not have other cache technologies, it can be managed using session. After the login is completed, all user permissions are stored in the session, and the front end is stored in the global cache or in the cookie. After the user's permissions are updated, the user can take the initiative to refresh, or wait for the next login to refresh, providing interface management.

[0072] The user's permissions can be queried through the cache module when logging in. For example, permissions can be put into the front-end cache and the back-end cache. The front-end cache can use cookies or localstorage, and the back-end cache java can use redis, session or global variables, etc. The back-end can also make unauthorized judgments on logical processing. If the user does not have permissions for certain functions, operations related to these functions cannot be performed. The cache supports page query display, refresh and other functions, so that newly assigned permissions can be actively refreshed to the cache, and configurable management will be more intuitive and convenient. The introduction of cache also improves the efficiency of the system.

[0073] Through the solution proposed in the present invention, interface management, operation logic and permission management are combined, and the back-end logic processing can also use permissions to judge and process, reducing the introduction of hard-coded logic, realizing configurable loading of module functions, providing more convenient means for handling various special situations, providing convenience for system operation and maintenance, and improving user experience.

[0074] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a page loading system 400, such as Figure 2 As shown, including:

[0075] A creation module 401 is configured to create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0076] An assignment module 402 is configured to assign roles to users in the user-role association table, assign user rights to users in the user-rights association table, and assign rights to roles in the role-rights association table;

[0077] The query module 403 is configured to query the role corresponding to the user ID in the user-associated role table and the user rights corresponding to the user ID in the user-associated rights table according to the user ID in response to detecting the user login, and query the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID;

[0078] The cache module 404 is configured to save the queried user permissions and role permissions into a cache;

[0079] The loading module 405 is configured to load a page according to the user authority and the role authority in the cache.

[0080] In some embodiments, it also includes:

[0081] In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0082] The re-queried user permissions and role permissions are updated into the cache.

[0083] In some embodiments, it also includes:

[0084] Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

[0085] In some embodiments, creating a user-role association table, a user-permission association table, and a role-permission association table further includes:

[0086] Create a user-associated role table including role ID and user ID;

[0087] Create a role-associated permission table including role ID and permission ID;

[0088] Create a user-related permission table including user IDs and permission IDs.

[0089] In some embodiments, querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID further includes:

[0090] According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table;

[0091] The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

[0092] In some embodiments, saving the queried user permissions and role permissions to a cache further includes:

[0093] Save the queried permission code to the cache.

[0094] In some embodiments, loading a page according to the user permissions and the role permissions in the cache further includes:

[0095] The menus, interfaces and interface elements in the page are loaded according to the permission code.

[0096] The solution proposed by the present invention increases the maintainability of the system by decoupling role management from user management. And the user rights are managed by role rights and user rights together, so that the system can accommodate specialized users. In this way, the hard-coded logic in the code is removed, redundant code is reduced, and the logic is simplified. In addition, specialized and flexible loading is achieved, which increases convenience. In addition, this configurable management of module loading greatly facilitates the use of customers.

[0097] Based on the same inventive concept, according to another aspect of the present invention, Figure 3 As shown, an embodiment of the present invention further provides a computer device 501, including:

[0098] at least one processor 520; and

[0099] The memory 510 stores a computer program 511 that can be run on the processor. When the processor 520 executes the program, the following steps are performed:

[0100] S1, create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0101] S2, assigning a role to the user in the user-associated role table, assigning user rights to the user in the user-associated rights table, and assigning rights to the role in the role-associated rights table;

[0102] S3, in response to detecting a user login, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0103] S4, saving the queried user permissions and role permissions into a cache;

[0104] S5: Load a page according to the user authority and the role authority in the cache.

[0105] In some embodiments, it also includes:

[0106] In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0107] The re-queried user permissions and role permissions are updated into the cache.

[0108] In some embodiments, it also includes:

[0109] Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

[0110] In some embodiments, creating a user-role association table, a user-permission association table, and a role-permission association table further includes:

[0111] Create a user-associated role table including role ID and user ID;

[0112] Create a role-associated permission table including role ID and permission ID;

[0113] Create a user-related permission table including user IDs and permission IDs.

[0114] In some embodiments, querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID further includes:

[0115] According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table;

[0116] The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

[0117] In some embodiments, saving the queried user permissions and role permissions to a cache further includes:

[0118] Save the queried permission code to the cache.

[0119] In some embodiments, loading a page according to the user permissions and the role permissions in the cache further includes:

[0120] The menus, interfaces and interface elements in the page are loaded according to the permission code.

[0121] The solution proposed by the present invention increases the maintainability of the system by decoupling role management from user management. And the user rights are managed by role rights and user rights together, so that the system can accommodate specialized users. In this way, the hard-coded logic in the code is removed, redundant code is reduced, and the logic is simplified. In addition, specialized and flexible loading is achieved, which increases convenience. In addition, this configurable management of module loading greatly facilitates the use of customers.

[0122] Based on the same inventive concept, according to another aspect of the present invention, Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium 601, wherein the computer-readable storage medium 601 stores computer program instructions 610, and when the computer program instructions 610 are executed by a processor, the following steps are performed:

[0123] S1, create a user-associated role table, a user-associated permission table, and a role-associated permission table;

[0124] S2, assigning a role to the user in the user-associated role table, assigning user rights to the user in the user-associated rights table, and assigning rights to the role in the role-associated rights table;

[0125] S3, in response to detecting a user login, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0126] S4, saving the queried user permissions and role permissions into a cache;

[0127] S5: Load a page according to the user authority and the role authority in the cache.

[0128] In some embodiments, it also includes:

[0129] In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID;

[0130] The re-queried user permissions and role permissions are updated into the cache.

[0131] In some embodiments, it also includes:

[0132] Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

[0133] In some embodiments, creating a user-role association table, a user-permission association table, and a role-permission association table further includes:

[0134] Create a user-associated role table including role ID and user ID;

[0135] Create a role-associated permission table including role ID and permission ID;

[0136] Create a user-related permission table including user IDs and permission IDs.

[0137] In some embodiments, querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID further includes:

[0138] According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table;

[0139] The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

[0140] In some embodiments, saving the queried user permissions and role permissions to a cache further includes:

[0141] Save the queried permission code to the cache.

[0142] In some embodiments, loading a page according to the user permissions and the role permissions in the cache further includes:

[0143] The menus, interfaces and interface elements in the page are loaded according to the permission code.

[0144] The solution proposed by the present invention increases the maintainability of the system by decoupling role management from user management. And the user rights are managed by role rights and user rights together, so that the system can accommodate specialized users. In this way, the hard-coded logic in the code is removed, redundant code is reduced, and the logic is simplified. In addition, specialized and flexible loading is achieved, which increases convenience. In addition, this configurable management of module loading greatly facilitates the use of customers.

[0145] Finally, it should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0146] Furthermore, it should be appreciated that the computer-readable storage medium (eg, memory) herein may be either a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0147] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.

[0148] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0149] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.

[0150] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0151] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0152] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A page loading method, characterized in that: The following steps are involved: Create a user-associated role table, a user-associated permission table, and a role-associated permission table; Assign roles to users in the user-associated role table, assign user permissions to users in the user-associated permission table, and assign permissions to roles in the role-associated permission table; In response to detecting a user login, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID; The queried user permissions and role permissions are saved in a cache; Loading a page according to the user permissions and the role permissions in the cache; Creating a user-associated role table, a user-associated permission table, and a role-associated permission table further includes: Create a user-associated role table including role ID and user ID; Create a role-associated permission table including role ID and permission ID; Create a user-related permission table including user ID and permission ID; The method further comprises: querying the role corresponding to the user ID in the user-associated role table according to the user ID and querying the user rights corresponding to the user ID in the user-associated rights table according to the user ID, and querying the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID. According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table; The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

2. The method according to claim 1, characterized in that Also includes: In response to receiving an instruction to refresh the cache, querying the user-associated role table for the role corresponding to the user ID and the user-associated permission table for the user permission corresponding to the user ID according to the user ID, and querying the role permission corresponding to the user ID in the role-associated permission table according to the role corresponding to the user ID; The re-queried user permissions and role permissions are updated into the cache.

3. The method according to claim 1, characterized in that Also includes: Create a permission table including permission ID, permission name, permission code and permission type, where the permission type includes menu permission, page label permission and interface element permission.

4. The method according to claim 1, characterized in that Saving the queried user permissions and role permissions to a cache further includes: Save the queried permission code to the cache.

5. The method according to claim 4, characterized in that Loading a page according to the user permissions and the role permissions in the cache further includes: The menus, interfaces and interface elements in the page are loaded according to the permission code.

6. A page loading system, characterized in that: include: A creation module configured to create a user-associated role table, a user-associated permission table, and a role-associated permission table; an allocation module configured to allocate roles to users in the user-associated role table, allocate user permissions to users in the user-associated permission table, and allocate permissions to roles in the role-associated permission table; A query module configured to query the role corresponding to the user ID in the user-associated role table and the user rights corresponding to the user ID in the user-associated rights table according to the user ID in response to detecting a user login, and query the role rights corresponding to the user ID in the role-associated rights table according to the role corresponding to the user ID; A cache module, configured to save the queried user permissions and role permissions into a cache; A loading module configured to load a page according to the user authority and the role authority in the cache; The creation module is also configured as: Create a user-associated role table including role ID and user ID; Create a role-associated permission table including role ID and permission ID; Create a user-related permission table including user ID and permission ID; The query module is also configured to: According to the user ID, the corresponding role ID is searched in the user-associated role table and the first permission ID is searched in the user-associated permission table, and according to the corresponding role ID, the second permission ID is searched in the role-associated permission table; The corresponding permission code is searched in the permission table according to the first permission ID and the second permission ID.

7. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 5 when executing the program.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are performed.

Citation Information

Patent Citations

  • Method and device for creating data storage structure

    CN110968580A

  • Role and authority control system of website user

    CN111783050A