Dynamic page loading method and device, equipment and medium

By verifying the user's permissions and using the resource access permission tree to determine the resources that users can access, the permission leakage and data error display problems caused by the static configuration of permission management in the prior art are solved, and efficient and flexible permission management is achieved.

CN119719552APending Publication Date: 2025-03-28HANGZHOU BANK WEALTH MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411917496.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing permission management method is based on static configuration, and cannot dynamically adjust the permission view or perform secondary permission verification, resulting in permission leakage or data error display, which cannot meet the needs of complex business scenarios.

Method used

By verifying the user's permissions, if the user has permission to access the page, the resources that the user can access on the page are further determined based on the resource access permission tree, and the page can be loaded dynamically and fine-grained permission control is carried out.

Benefits of technology

It improves the security and flexibility of the system, can better adapt to the access needs of different users, achieve fine-grained control of resource access rights, and improves the efficiency and accuracy of permission management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719552A_ABST
    Figure CN119719552A_ABST
Patent Text Reader

Abstract

The invention provides a page dynamic loading method and device, equipment and a medium, and relates to the technical field of Internet, and the method comprises the following steps: in response to receiving an access request initiated by a user, performing permission verification on the user based on the access request to obtain a permission verification result; under the condition that the permission verification result is passed, based on a resource access permission tree corresponding to the user, determining each to-be-displayed resource included in an access page requested to be accessed by the access request; on the basis of each resource access permission node and each to-be-displayed resource in the resource access permission tree, determining a loading resource which the user has the permission to access; and loading the obtained loading resources, and displaying an access page corresponding to the access request. According to the technical scheme, the to-be-displayed resources of the access page can be selectively loaded and displayed, and the display flexibility and accuracy of the access page are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In modern information technology systems, especially web-based applications and websites, user access control and resource management are two crucial aspects. These systems usually contain a large amount of data, functions and pages, and different users have different access rights based on their roles, identities or subscription levels.

[0003] Most existing permission management methods are based on static configuration, and cannot dynamically adjust permission views or perform secondary permission verification. When a user accesses a page, the existing method is only based on the first permission verification, lacking subsequent security checks, which can easily lead to permission leakage or incorrect data display, and cannot meet the needs of complex business scenarios. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a page dynamic loading method, device, equipment and medium, by checking the user's permissions, if the user has the permission to access the page, further determine the resources that the user can access on the page according to the resource access permission tree. Not only improve the security of the system, but also enhance the flexibility and scalability of the system, can better meet the access needs of different users. At the same time, through the introduction of the resource access permission tree, fine-grained control of resource access permissions is achieved, and the efficiency and accuracy of permission management are improved.

[0005] In a first aspect, an embodiment of the present invention provides a method for dynamically loading a page, the method comprising:

[0006] In response to receiving an access request initiated by a user, performing an authority verification on the user based on the access request to obtain an authority verification result;

[0007] If the permission check result is passed, obtain the resource access permission tree corresponding to the user;

[0008] Determine each resource to be displayed included in the access page requested by the access request;

[0009] Based on each resource access permission node in the resource access permission tree and each resource to be displayed, determining the loading resources that the user has permission to access;

[0010] For each resource loaded, the access page corresponding to the access request is displayed.

[0011] In a preferred embodiment of the present invention, in response to receiving an access request initiated by a user, performing a permission check on the user based on the access request to obtain a permission check result includes:

[0012] In response to receiving an access request initiated by a user, querying permission information corresponding to the access request from a permission library;

[0013] Obtaining page access information included in the access request, and matching it with the permission information to obtain a first matching result;

[0014] If the first matching result is a successful match, determining that the permission verification result is passed;

[0015] When the first matching result is a matching failure, it is determined that the permission verification result is a failure.

[0016] In a preferred embodiment of the present invention, when the permission check result is passed, obtaining the resource access permission tree corresponding to the user includes:

[0017] If the verification result is passed, a resource access permission tree corresponding to the user is recursively generated based on the permission information.

[0018] In a preferred embodiment of the present invention, the above permission information includes role permission information and custom permission information, and querying the permission information corresponding to the access request from the permission library includes:

[0019] Get user information in the access request;

[0020] According to the user information, query the role information corresponding to the user information from the permission library;

[0021] According to the role information, obtain the role permission information and custom permission information corresponding to the role information from the permission library;

[0022] Merge the role permission information and the custom permission information to obtain the permission information.

[0023] In a preferred embodiment of the present invention, after each loaded resource is loaded and the access page corresponding to the access request is displayed, the following steps are included:

[0024] In response to receiving an operation request initiated by a user, obtaining a resource access permission tree corresponding to the user;

[0025] Obtaining permission information corresponding to the operation request, and matching it with the resource access permission tree to obtain a second matching result;

[0026] When the second matching result is a successful match, the page resource corresponding to the permission information is loaded.

[0027] In a preferred embodiment of the present invention, the resource access permission node corresponds to the resource to be displayed, and based on each resource access permission node in the resource access permission tree and each resource to be displayed, determining the loading resource that the user has permission to access includes:

[0028] Match each resource access permission node with the resource to be displayed, and obtain the resource to be displayed corresponding to the resource access permission node;

[0029] The resource to be displayed corresponding to the resource access permission node is used as a loaded resource that the user has permission to access.

[0030] In a preferred embodiment of the present invention, after loading each loaded resource and displaying the access page corresponding to the access request, the following further comprises:

[0031] Receive update information of resource access permission tree;

[0032] According to the updated information, obtain the updated resource access permission tree;

[0033] Based on each resource access permission node and each resource to be displayed in the updated resource access permission tree, the access page corresponding to the access request is updated.

[0034] In a second aspect, an embodiment of the present invention further provides a page dynamic loading device, comprising:

[0035] A verification module, configured to, in response to receiving an access request initiated by a user, perform a permission verification on the user based on the access request and obtain a permission verification result;

[0036] The permission tree acquisition module is used to obtain the resource access permission tree corresponding to the user when the permission verification result is passed;

[0037] A to-be-displayed resource determination module, used to determine various to-be-displayed resources included in the access page requested to be accessed by the access request;

[0038] A resource screening module, used to determine the loaded resources that the user has the permission to access based on each resource access permission node and each resource to be displayed in the resource access permission tree;

[0039] The loading module is used to load the obtained loaded resources and display the access page corresponding to the access request.

[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the page dynamic loading method of the first aspect above.

[0041] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the page dynamic loading method of the first aspect mentioned above.

[0042] The embodiments of the present invention bring the following beneficial effects:

[0043] The embodiment of the present invention provides a page dynamic loading method. When a user tries to access a certain page, the system will first receive an access request initiated by the user. In response, the system will perform a permission check on the user to determine whether the user is qualified to access the requested page. If the permission check result is passed, that is, the user has the permission to access the page, the system will further determine the resources that the user can access on the page according to the resource permission tree corresponding to the user. The resource permission tree is a data structure used to represent the user's access rights to different resources. Each node represents a resource permission, and the hierarchical relationship between nodes reflects the organizational structure and access control logic of the resource. By traversing the resource permission tree, the system can identify the various resources to be displayed included in the page requested by the access request, and determine which resources are accessible to the user (i.e., loading resources) based on the user's permission node. Finally, the system loads these loaded resources and displays them to the user, thereby completing the entire access process. This technical solution not only improves the security of the system, prevents unauthorized access through strict permission verification, but also enhances the flexibility and scalability of the system, and can better adapt to the access needs of different users. At the same time, through the introduction of the resource permission tree, fine-grained control of resource permission is achieved, and the efficiency and accuracy of permission management are improved.

[0044] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0048] Figure 2 A flowchart of another page dynamic loading method provided by an embodiment of the present invention;

[0049] Figure 3 A flowchart of another page dynamic loading method provided by an embodiment of the present invention;

[0050] Figure 4 A flowchart of another page dynamic loading method provided by an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of the structure of a page dynamic loading device provided by an embodiment of the present invention;

[0052] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In modern information technology systems, especially web-based applications and websites, user access control and resource management are two crucial aspects. These systems usually contain a large amount of data, functions and pages, and different users have different access rights based on their roles, identities or subscription levels.

[0055] Most existing permission management methods are based on static configuration, and cannot dynamically adjust permission views or perform secondary permission verification. When a user accesses a page, the existing method is only based on the first permission verification, lacking subsequent security checks, which can easily lead to permission leakage or incorrect data display, and cannot meet the needs of complex business scenarios.

[0056] Based on this, a page dynamic loading method provided by an embodiment of the present invention can prevent unauthorized access through strict permission verification. At the same time, through the introduction of the resource access permission tree, the flexibility and scalability of the system are enhanced, which can better adapt to the access needs of different users, realize fine-grained control of resource access permissions, and improve the efficiency and accuracy of permission management.

[0057] To facilitate understanding of this embodiment, a page dynamic loading method disclosed in an embodiment of the present invention is first introduced in detail.

[0058] Example 1

[0059] The embodiment of the present invention provides a page dynamic loading method. Figure 1 A flow chart of a page dynamic loading method provided by an embodiment of the present invention. Figure 1 As shown, the page dynamic loading method may include the following steps:

[0060] Step S101, in response to receiving an access request initiated by a user, performing a permission check on the user based on the access request to obtain a permission check result.

[0061] An access request is a request initiated by a user when logging into a system, where the system can be a web-based application or website. The access request may include information about the page that the user needs to access, and the permission check is used to check whether the user has the permission to view the page information. The permission check results include pass and fail. If the permission check result is pass, the user has the permission to access the page. If the permission check fails, the user does not have the permission to access the page. At this time, the user can be fed back information describing the failure of the permission check. Specifically, the user can be prompted through text, voice, etc. that he does not have the permission to access the page, or he can jump to the page when the system was logged in.

[0062] Specifically, when a user attempts to access a page in the system, the system will first receive an access request initiated by the user. In response, the system will perform a permission check on the user and obtain a permission check result to determine whether the user is qualified to access the requested page. Exemplarily, the system performs a permission check on the user by obtaining user information and information about the page to be accessed from the access request, querying the permission list corresponding to the user information from the permission library, and determining whether the page to be accessed exists in the permission list. If so, the permission check result is passed. If not, the permission check result is failed, and information describing the failure of the permission check is fed back to the user. Among them, the user information is used to describe the identity of the user, which can be a nickname, password, user ID, etc. set by the user, and the page to be accessed information is used to describe the page that the user is trying to access, which can be an IP address, resources contained in the page, etc. In another example, the system may be an employee system of a company. When an employee logs into the employee system, the employee needs to enter the employee's work number and login password and click the login button to initiate an access request. After receiving the access request, the system can obtain the work number and login password entered by the employee, as well as the page information to be accessed associated with the login button, query the permission list corresponding to the work number and login password from the permission library, and query whether there is page information to be accessed for permission verification from the permission list to confirm whether the employee has permission to access the employee system.

[0063] Step S102: if the permission check result is passed, obtain the resource access permission tree corresponding to the user.

[0064] The resource access permission tree is used to describe the resources that a user has permission to access, that is, to describe the permission list corresponding to the user in the form of a tree. The resource access permission tree is a data structure used to represent the user's access permissions to different resources. Each node corresponds to a resource, and the node stores the access permissions of the resource. The hierarchical relationship between nodes reflects the organizational structure and access control logic of the resource. Different users have different corresponding resource access permission trees.

[0065] Specifically, if the permission check result is passed, it indicates that the user has the permission to access the access page requested by the access request. At this time, the system can obtain the resource access permission tree from the permission library.

[0066] Step S103: determining various resources to be displayed included in the access page requested by the access request.

[0067] The resources to be displayed refer to the resources included in the access page requested by the access request. Specifically, the resources to be displayed included in the access page can be queried from the permission library.

[0068] Step S104: Determine the loading resources that the user has the permission to access based on each resource access permission node and each to-be-displayed resource in the resource access permission tree.

[0069] A resource access permission node refers to a node in a resource access permission tree, which is used to describe a resource that a user has permission to access. A resource access permission node corresponds to a resource that a user has permission to access. A loaded resource refers to a resource to be displayed that needs to be loaded on the access page. It is understandable that the access page requested by the access request may contain multiple resources, that is, resources to be displayed. Different users may only have permission to access some of the resources to be displayed. The resources with permission to access can be used as loaded resources, that is, the resources corresponding to the resource access permission node. Exemplarily, the resources to be displayed contained in page 1 are: resource a, resource b, resource c, resource d, resource e. When user a accesses page 1, the resource access permission tree corresponding to user a obtained, the resources described by the resource access permission node include resource a, resource b, resource c. At this time, the loaded resources that user a has permission to access are resource a, resource b, resource c. When user b accesses page 1, the resource access permission tree corresponding to user b obtained, the resources described by the resource access permission node include resource c, resource d, resource e. At this time, the loaded resources that user b has permission to access are resource c, resource d, resource e.

[0070] Specifically, each resource access permission node is matched with the resource to be displayed, and the resource to be displayed corresponding to the resource access permission node is obtained; the resource to be displayed corresponding to the resource access permission node is used as a loading resource that the user has the right to access. Exemplarily, each resource access permission node in the resource access permission tree can be parsed to obtain the resource information stored in the resource access permission node, match the resource information with the resource to be displayed, determine the resource to be displayed described by the resource information from the resource to be displayed, and use the resource to be displayed described by the resource information as a loading resource that the user has the right to access. Exemplarily, the resource information can be a resource ID, a resource name, etc.

[0071] Step S105: load each loaded resource and display the access page corresponding to the access request.

[0072] Specifically, the system loads each loading resource on the page and generates an access page corresponding to the access request.

[0073] Furthermore, a display instruction is stored in the resource access permission node, and the resource access permission node can be parsed to obtain the display instruction stored in the resource access permission node. The display instruction describes the display of the loaded resource corresponding to the resource access permission node. When the display instruction is display, it means that the resource to be displayed corresponding to the resource access permission node can be displayed on the access page. When the display instruction is prohibit, it means that the resource to be displayed corresponding to the resource access permission node is prohibited from being displayed on the access page.

[0074] By storing display instructions in the resource access permission node, the system can dynamically decide which resources to display to the user first. This dynamic loading mechanism helps reduce unnecessary resource consumption and improves system performance and response speed. At the same time, it can generate a personalized user interface based on the user's permissions, which helps improve the user experience and enables users to more conveniently access and use the resources they need. Through the combination of resource access permission nodes and display instructions, precise control of user access to resources is achieved, ensuring that users can only access the resources they are authorized to, thereby effectively preventing unauthorized access and data leakage.

[0075] The page dynamic loading method provided by the embodiment of the present invention responds to and receives an access request initiated by a user, and performs a permission check on the user. If the permission check result is passed, that is, the user has the permission to access the page, the system will further determine the resources that the user can access on the page based on the resource access permission tree corresponding to the user. Finally, the system loads these loaded resources and displays them to the user, thereby completing the entire access process. This technical solution not only improves the security of the system, prevents unauthorized access through strict permission verification, but also enhances the flexibility and scalability of the system, and can better adapt to the access needs of different users. At the same time, through the introduction of the resource access permission tree, fine-grained control of resource access permissions is achieved, and the efficiency and accuracy of permission management are improved.

[0076] Example 2

[0077] An embodiment of the present invention also provides another method for dynamically loading a page; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing a specific implementation method of responding to an access request initiated by a user, performing permission verification on the user based on the access request, and obtaining a permission verification result.

[0078] Figure 2 A flowchart of another page dynamic loading method provided by an embodiment of the present invention, such as Figure 2 As shown, the page dynamic loading method may include the following steps:

[0079] Step S201, in response to receiving an access request initiated by a user, querying permission information corresponding to the access request from a permission library.

[0080] In the process of performing permission verification, the permission information corresponding to the access request is first queried from the permission library. The permission information is used to describe whether the user has the permission to access the resources in the system. Exemplarily, the permission information may include the permission information, which usually includes the user ID, resource ID, operation type (such as read, write, execute, etc.) and the hierarchical relationship of these permissions. It is understandable that the system may include multiple pages, each of which can be used to display multiple resources. Different users have different permission information for the same resource. Accordingly, when different users access the same page in the system, different resources are displayed on the access page.

[0081] Specifically, in response to receiving an access request initiated by a user, the system queries the permission information corresponding to the access request from the permission library. For example, when an employee logs into the employee system, the system can query the permission information corresponding to the employee number from the permission library based on the employee number and login password entered by the employee, if the employee number and password match. Among them, if the employee number and password match, it means that the employee number and password entered by the employee are correct and the permission information can be obtained. If the employee number and password do not match, it means that the employee number or password entered by the employee is incorrect and the permission information cannot be obtained.

[0082] Furthermore, the permission information corresponding to the access request can be queried from the permission library through steps A1 to A4.

[0083] Step A1, obtaining user information in the access request.

[0084] User information is used to describe the identity of the user. For example, the user information may be a name, password, user ID, etc. set by the user. Specifically, when the user initiates an access request, the access request may carry user information. After receiving the access request initiated by the user, the system may parse the access request and obtain the user information carried in the access request.

[0085] Step A2: According to the user information, the role information corresponding to the user information is searched from the permission library.

[0086] The permission library is used to store the mapping relationship between user information, role information, and permission information, and records which users have which roles, and which resources these roles can access. Specifically, the permission library can be a relational database. In the permission library, the mapping relationship between user information and role information can be implemented by a one-to-many relationship table, and the mapping relationship between user information and permission information can be implemented by a many-to-many relationship table. The permission library supports real-time add, delete, and modify operations. For example, when an administrator adds new permission information for a user or modifies the permission information corresponding to the role information, these changes will be immediately recorded in the permission library to ensure that the system can obtain the latest permission information. Role information is used to describe the role to which the user belongs.

[0087] Specifically, after obtaining user information, the system can query the role information corresponding to the user information from the permission library according to the mapping relationship between user information and role information. Among them, one user information can correspond to multiple role information, that is, one user can have multiple roles. By processing users with multiple roles and users with different permission levels, the system can flexibly use various organizational structures and business needs.

[0088] Step A3: According to the role information, role permission information and custom permission information corresponding to the role information are obtained from the permission library.

[0089] Permission information includes role permission information and custom permission information. Role permission information refers to the permission information corresponding to the role to which the user belongs. Role permission information is the permission information pre-set for different roles in the system, which is equivalent to basic permission information. Custom permission information refers to permission information that is customized for different users, that is, when a user has additional special permissions, the permission information can be set according to the special permissions possessed by the user. Exemplarily, the system is an employee system of a company, and the roles may include employees and managers. When employee A logs into the employee system, he queries the role permission information corresponding to the employee from the permission library. At the same time, employee A also has additional special permissions, that is, to view the work completion status of employee B. At this time, the custom permission information included in employee A's permission information is the permission information used to describe the permission information for viewing the work completion status of employee B.

[0090] Specifically, after obtaining the role information, the system can query the role permission information and custom permission information corresponding to the role information from the permission library according to the mapping relationship between the role information and the permission information. It is understandable that a user can have multiple roles, and when the system obtains the role permission information and custom permission information, it can obtain the role permission information and custom permission information corresponding to all the role information owned by the user.

[0091] Furthermore, the user information may also include a user role, that is, a role to which the user belongs. When the system receives an access request, it obtains the user role input by the user from the access request, queries the permission library for the role information corresponding to the user role, and queries the permission library for the role permission information and custom permission information corresponding to the role information based on the role information. At this time, when the user has multiple roles, the system can query only the role permission information and custom permission information corresponding to some roles based on the user role input by the user, thereby improving the query efficiency and thus improving the permission verification efficiency.

[0092] Step A4: merge the role permission information and the custom permission information to obtain permission information.

[0093] Specifically, the role permission information and the custom permission information are merged, the same permission information in the role permission information and the custom permission information is eliminated, and the remaining role permission information and the custom permission information are used as the permission information.

[0094] By dividing the permission information into role permission information and custom permission information, the permission information can be personalized and dynamically maintained, and the flexibility of setting the permission information can be improved. By merging the role permission information and custom permission information, deduplication can be achieved, simplifying and improving the accuracy of the permission information.

[0095] Step S202: Obtain page access information included in the access request, and match it with the permission information to obtain a first matching result.

[0096] The page access information is used to describe the access page requested by the access request. Exemplarily, the page access information can be the IP address of the access page, or it can be the corresponding resource in the access page. The page access information is matched with the permission information to query whether the permission information includes the page access information, that is, to query whether the resources corresponding to the permission information include the resources corresponding to the page access information. If included, the first matching result is determined to be a successful match. If not included, the first matching result is determined to be a failed match. It can be understood that the resources corresponding to the permission information can include all resources that the user can access in the system. If the resources corresponding to the permission information include the resources corresponding to the page access information, it indicates that the user has the authority to access the access page. If the resources corresponding to the permission information do not include the resources corresponding to the page access information, it indicates that the user does not have the authority to access the access page.

[0097] Step S203: when the first matching result is a successful match, determine that the permission verification result is passed.

[0098] The first matching result is a successful match, indicating that the resources corresponding to the permission information include the resources corresponding to the page access information, and the user has the permission to access the access page, and the permission verification result is determined to be passed.

[0099] Step S204: when the first matching result is a matching failure, determining that the permission verification result is a failure.

[0100] The first matching result is a matching failure, indicating that the resources corresponding to the permission information do not include the resources corresponding to the page access information, the user does not have permission to access the access page, and the permission verification result is determined to be a failure.

[0101] Furthermore, the system can store the permission verification results. When the same user repeatedly initiates access requests within a short period of time, the permission verification results can be directly obtained, reducing the execution process of steps S201 to S204, and improving permission verification efficiency and system performance.

[0102] Step S205: When the permission check result is passed, a resource access permission tree corresponding to the user is recursively generated according to the permission information.

[0103] Based on the permission information, starting from the top-level resource, recursively check whether each resource node contained in the system is in the user permission list, and add the resource nodes existing in the user permission list as resource access permission nodes to the resource access permission tree to generate a permission tree containing all resources that are allowed to be accessed. The resource type and permission information are stored in the resource node, and the resource type includes page ID, operation button, etc. Among them, the user permission list is used to describe the permission information corresponding to the access request, which contains all the rights information corresponding to the access request.

[0104] Furthermore, the system can store the resource access permission tree in memory after the user generates the resource access permission tree, so as to avoid the user from regenerating the resource access permission tree every time the user accesses the system within a certain period of time. At the same time, the cached resource access permission tree can also correspond to an expiration time, and when the storage time of the resource access permission tree exceeds the expiration time, it will be cleared from the memory. The cached resource access permission tree can also clear the resource access permission tree in memory through the permission change notification mechanism when the permission information changes. Exemplarily, the administrator can add, delete, modify and other operations on the permission information stored in the permission library. After completing the operations of adding, deleting, modifying and other operations, the permission change notification mechanism is triggered to send permission change information to the system to notify the system to delete the resource access permission tree in memory.

[0105] Step S206: determining various resources to be displayed included in the access page requested by the access request.

[0106] Step S207: Determine the loading resources that the user has the permission to access based on each resource access permission node and each to-be-displayed resource in the resource access permission tree.

[0107] Step S208: load each loaded resource and display the access page corresponding to the access request.

[0108] The page dynamic loading method provided in the embodiment of the present invention recursively generates a resource access permission tree and parses the nodes therein. The system can dynamically determine which resources should be loaded and displayed to the user, thereby providing a personalized user interface and smooth user experience, helping to reduce unnecessary resource loading and improving system performance and response speed.

[0109] Example 3

[0110] The embodiment of the present invention also provides another page dynamic loading method; this method is implemented on the basis of the method of the above embodiment; this method focuses on describing the loaded resources obtained by loading, and displays the specific implementation method after the access page corresponding to the access request.

[0111] Figure 3 A flowchart of another page dynamic loading method provided by an embodiment of the present invention, such as Figure 3 As shown, the page dynamic loading method may include the following steps:

[0112] Step S301, in response to receiving an access request initiated by a user, performing a permission check on the user based on the access request to obtain a permission check result.

[0113] Step S302: if the permission check result is passed, obtain the resource access permission tree corresponding to the user.

[0114] Step S303: determine the resources to be displayed included in the access page requested by the access request.

[0115] Step S304: Determine the loading resources that the user has the permission to access based on each resource access permission node and each resource to be displayed in the resource access permission tree.

[0116] Step S305: load each loaded resource and display the access page corresponding to the access request.

[0117] Step S306: in response to receiving the operation request initiated by the user, obtaining a resource access permission tree corresponding to the user.

[0118] An operation request refers to an operation request that is triggered when a user performs an operation on an access page. In an embodiment of the present invention, access requests initiated by specific sensitive operations can be verified, that is, secondary verification. Exemplarily, specific sensitive operations can be operations such as button clicks and data queries. It is understandable that after the user logs in to the system, he can click the "Delete User" button on the page displayed after login to initiate an operation request. After receiving the operation request, the system performs a secondary verification on the access request to check whether the user has the "delete user" authority. Since the secondary verification is triggered after the user logs in to the system, the system can store the resource access permission tree in the memory when performing the initial verification. Therefore, when performing the secondary verification, the resource access permission tree corresponding to the user can be directly read from the memory.

[0119] Furthermore, before the system performs a secondary verification, it receives updated information of the resource access permission tree, indicating that the relevant staff has modified the permission information in the permission library. The system can query the modified permission information from the permission library and recursively generate the resource access permission tree corresponding to the user. When the system queries the modified permission information from the permission library, it can obtain the user information in the access request; based on the user information, query the role information corresponding to the user information from the permission library; based on the role information, obtain the modified role permission information and the modified custom permission information corresponding to the role information from the permission library; merge the modified role permission information and the modified custom permission information to obtain the modified permission information. By obtaining the modified permission information, it can ensure that the system uses the latest permission information for verification during the secondary verification, improve the accuracy of the permission verification, and ensure that the user's permission is valid for each operation.

[0120] Step S307: Acquire permission information corresponding to the operation request, and match it with the resource access permission tree to obtain a second matching result.

[0121] Match the permission information corresponding to the operation request with the resource access permission tree, and query whether the access permission node in the resource access permission tree includes the permission information corresponding to the operation request. If it is included, determine that the second matching result is a successful match; if not, determine that the second matching result is a failed match.

[0122] Step S308: When the second matching result is a successful match, the page resource corresponding to the permission information is loaded.

[0123] The second matching result is a successful match, indicating that the access permission node in the resource access permission tree includes permission information corresponding to the operation request, the user has the permission to access the page resource corresponding to the permission information, and loads the page resource corresponding to the permission information.

[0124] The second matching result is a matching failure, indicating that the access permission node in the resource access permission tree does not include the permission information corresponding to the operation request, and the user does not have the permission to access the page resources corresponding to the permission information. Information that the user does not have the permission to access the page resources corresponding to the permission information can be fed back to the user in the form of text, pictures, etc.

[0125] The page dynamic loading method provided in the embodiment of the present invention implements a secondary verification of the operation request initiated by the user after the access page is displayed. By verifying the access request initiated by specific sensitive operations, it can further prevent unauthorized access and data leakage and improve the security of the system.

[0126] Example 4

[0127] The embodiment of the present invention also provides another page dynamic loading method; this method is implemented on the basis of the method of the above embodiment; this method focuses on describing the loaded resources obtained by loading, and displays the specific implementation method after the access page corresponding to the access request.

[0128] Figure 4 A flowchart of another page dynamic loading method provided by an embodiment of the present invention, such as Figure 3 As shown, the page dynamic loading method may include the following steps:

[0129] Step S401, in response to receiving an access request initiated by a user, performing a permission check on the user based on the access request to obtain a permission check result.

[0130] Step S402: if the permission check result is passed, obtain the resource access permission tree corresponding to the user.

[0131] Step S403: determining various resources to be displayed included in the access page requested by the access request.

[0132] Step S404: Determine the loading resources that the user has the permission to access based on each resource access permission node and each resource to be displayed in the resource access permission tree.

[0133] Step S405: load each loaded resource and display the access page corresponding to the access request.

[0134] Step S406: receiving update information of the resource access permission tree.

[0135] The update information is used to notify the system that the permission information stored in the permission library has been updated. Specifically, the relevant technical personnel can directly update the permission information stored in the resource access permission node in the resource access permission tree in the permission library, where the update operation includes adding, deleting, and modifying operations. After completing the update operation, the update information can be sent to the system through the permission library as the update information of the resource access permission tree, and the system receives the update information sent by the permission library in real time.

[0136] Step S407: Obtain an updated resource access permission tree according to the update information.

[0137] After receiving the update information, the system obtains the updated permission information corresponding to the access request from the permission library, and recursively checks whether each resource node contained in the system is in the user's updated permission list, starting from the top-level resource. The resource nodes existing in the user's updated permission list are added as resource access permission nodes to the updated resource access permission tree, and an updated permission tree containing all resources allowed to be accessed is generated. Among them, the user's updated permission list is used to describe the updated permission information corresponding to the access request, which contains all the updated rights information corresponding to the access request.

[0138] Step S408: updating the access page corresponding to the access request based on each resource access permission node and each resource to be displayed in the updated resource access permission tree.

[0139] Specifically, from the updated resource access permission tree, the display instruction corresponding to each resource access permission node is obtained; for each resource access permission node, when the display instruction is display, the to-be-displayed resource corresponding to the resource access permission node is used as a loaded resource that the user has the right to access. Each loaded resource is loaded to obtain an updated access page corresponding to the access request.

[0140] The page dynamic loading method provided by the embodiment of the present invention can update the access page corresponding to the access request according to the update information of the resource access permission tree, realize the real-time update of the access page when the permission information is modified, improve the accuracy of permission management, and effectively prevent unauthorized access and data leakage.

[0141] Example 5

[0142] Corresponding to the above method embodiment, the embodiment of the present invention provides a page dynamic loading device, Figure 5 A schematic diagram of a page dynamic loading device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the page dynamic loading device may include:

[0143] The verification module 501 is used to, in response to receiving an access request initiated by a user, perform a permission verification on the user based on the access request to obtain a permission verification result;

[0144] The permission tree acquisition module 502 is used to obtain the resource access permission tree corresponding to the user when the permission verification result is passed;

[0145] The to-be-displayed resource determination module 503 is used to determine each to-be-displayed resource included in the access page requested by the access request;

[0146] A resource screening module 504, for determining the loaded resources that the user has the permission to access based on each resource access permission node and each resource to be displayed in the resource access permission tree;

[0147] The loading module 505 is used to load the obtained loaded resources and display the access page corresponding to the access request.

[0148] The page dynamic loading device provided by the embodiment of the present invention performs permission verification on the user by responding to and receiving the access request initiated by the user. If the permission verification result is passed, that is, the user has the permission to access the page, the system will further determine the resources that the user can access on the page according to the resource access permission tree corresponding to the user. Finally, the system loads these loaded resources and displays them to the user, thereby completing the entire access process. This technical solution not only improves the security of the system by preventing unauthorized access through strict permission verification, but also enhances the flexibility and scalability of the system, and can better adapt to the access needs of different users. At the same time, through the introduction of the resource access permission tree, fine-grained control of resource access permissions is achieved, and the efficiency and accuracy of permission management are improved.

[0149] In some embodiments, the verification module 501 further includes:

[0150] A permission information acquisition unit, configured to query permission information corresponding to the access request from a permission library in response to receiving an access request initiated by a user;

[0151] A first matching unit, configured to obtain page access information included in the access request, and match the page access information with the permission information to obtain a first matching result;

[0152] A first passing unit, configured to determine that the permission verification result is passed when the first matching result is a successful match;

[0153] The first failure unit is used to determine that the permission verification result is a failure when the first matching result is a matching failure.

[0154] In some embodiments, the to-be-displayed resource determination module 502 is further configured to:

[0155] When the permission check result is passed, a resource access permission tree corresponding to the user is recursively generated based on the permission information.

[0156] In some embodiments, the permission information includes role permission information and custom permission information, and the permission information acquisition unit is further used to:

[0157] Get user information in the access request;

[0158] According to the user information, query the role information corresponding to the user information from the permission library;

[0159] According to the role information, obtain the role permission information and custom permission information corresponding to the role information from the permission library;

[0160] Merge the role permission information and the custom permission information to obtain the permission information.

[0161] In some embodiments, the apparatus further comprises:

[0162] An operation request response module, used to obtain a resource access permission tree corresponding to the user in response to receiving an operation request initiated by the user;

[0163] A second matching unit is used to obtain permission information corresponding to the operation request and match it with the resource access permission tree to obtain a second matching result;

[0164] The second passing unit is used to load the page resource corresponding to the permission information when the second matching result is a successful match.

[0165] In some embodiments, the resource screening module 504 is further configured to:

[0166] A to-be-displayed resource acquisition unit, used for matching each resource access permission node with the to-be-displayed resource, and acquiring the to-be-displayed resource corresponding to the resource access permission node;

[0167] The loading resource determination unit is used to use the to-be-displayed resource corresponding to the resource access permission node as a loading resource that the user has the permission to access.

[0168] In some embodiments, the apparatus further comprises:

[0169] An update information receiving module, used for receiving update information of a resource access permission tree;

[0170] The permission tree update module is used to obtain the updated resource permission tree according to the update information;

[0171] The access page update module is used to update the access page corresponding to the access request based on each resource access permission node and each resource to be displayed in the updated resource access permission tree.

[0172] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0173] Example 6

[0174] The embodiment of the present invention also provides an electronic device for executing the above-mentioned page dynamic loading method; see Figure 6 A structural schematic diagram of an electronic device is shown, which includes a memory 600 and a processor 601, wherein the memory 600 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 601 to implement the above-mentioned page dynamic loading method.

[0175] Further, Figure 6 The electronic device shown further includes a bus 602 and a communication interface 603 , and the processor 601 , the communication interface 603 and the memory 600 are connected via the bus 602 .

[0176] The memory 600 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0177] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 600, and the processor 601 reads the information in the memory 600 and completes the steps of the method of the above embodiment in combination with its hardware.

[0178] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned page dynamic loading method. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0179] The computer program product for the page dynamic loading method provided in the embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0180] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0181] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0184] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0185] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A page dynamic loading method, characterized in that: The method comprises: In response to receiving an access request initiated by a user, performing an authority verification on the user based on the access request to obtain an authority verification result; If the permission check result is passed, obtaining the resource access permission tree corresponding to the user; Determine various resources to be displayed included in the access page requested by the access request; Determine the loading resources that the user has the permission to access based on each resource access permission node in the resource access permission tree and each resource to be displayed; Each of the loaded resources obtained by loading is displayed with an access page corresponding to the access request.

2. The method according to claim 1, characterized in that In response to receiving an access request initiated by a user, performing permission verification on the user based on the access request to obtain a permission verification result, including: In response to receiving an access request initiated by a user, querying permission information corresponding to the access request from a permission library; Obtaining page access information included in the access request, and matching the page access information with the permission information to obtain a first matching result; If the first matching result is a successful match, determining that the permission verification result is a pass; When the first matching result is a matching failure, it is determined that the permission verification result is a failure.

3. The method according to claim 2, characterized in that When the permission verification result is passed, obtaining the resource access permission tree corresponding to the user includes: When the permission check result is passed, a resource access permission tree corresponding to the user is recursively generated according to the permission information.

4. The method according to claim 2, characterized in that: The permission information includes role permission information and custom permission information, and querying the permission information corresponding to the access request from the permission library includes: Obtaining user information in the access request; According to the user information, query the role information corresponding to the user information from the permission library; According to the role information, obtaining role permission information and custom permission information corresponding to the role information from a permission library; The role permission information and the custom permission information are combined to obtain the permission information.

5. The method according to claim 1, characterized in that After displaying the access page corresponding to the access request for each of the loaded resources obtained by the loading, the method includes: In response to receiving an operation request initiated by a user, obtaining a resource access permission tree corresponding to the user; Obtaining permission information corresponding to the operation request, and matching it with the resource access permission tree to obtain a second matching result; When the second matching result is a successful match, the page resource corresponding to the permission information is loaded.

6. The method according to claim 1, characterized in that The step of determining the loading resources that the user has the permission to access based on each resource access permission node in the resource access permission tree and each of the resources to be displayed includes: Matching each of the resource access permission nodes with the resources to be displayed, and obtaining the resources to be displayed corresponding to the resource access permission nodes; The resource to be displayed corresponding to the resource access permission node is used as a loading resource that the user has permission to access.

7. The method according to claim 1, characterized in that After displaying the access page corresponding to the access request for each of the loaded resources obtained by loading, the method further includes: Receiving update information of the resource access permission tree; According to the update information, obtaining an updated resource access permission tree; Based on each resource access permission node in the updated resource access permission tree and each resource to be displayed, an access page corresponding to the access request is updated.

8. A page dynamic loading device, characterized in that: include: A verification module, configured to, in response to receiving an access request initiated by a user, perform an authority verification on the user based on the access request to obtain an authority verification result; A permission tree acquisition module, used to obtain the resource access permission tree corresponding to the user if the permission verification result is passed; A to-be-displayed resource determination module, used to determine each to-be-displayed resource included in the access page requested to be accessed by the access request; A resource screening module, configured to determine the loading resources that the user has the permission to access based on each resource access permission node in the resource access permission tree and each resource to be displayed; The loading module is used to load each of the loaded resources obtained and display the access page corresponding to the access request.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the page dynamic loading method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the page dynamic loading method according to any one of claims 1 to 7.