Lazy loading method and device for large data volume resource tree authorization, equipment and medium
By adopting a lazy loading method in the large data resource tree, the resource tree level information is loaded successively according to the user's trigger operation and updating the authorization attribute identification, the problem of inefficient resource tree loading in the existing technology is solved, and more efficient loading and accurate authorization information display is achieved.
Patent Information
- Application Number
- CN202411656879.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-19
AI Technical Summary
When the resource tree contains large data volume, the existing technology adopts a full loading method, resulting in an increase in waiting time for users to view the resource tree, and the loading efficiency is ineffective.
The lazy loading method is adopted to load the hierarchical information of the resource tree successively according to the user's trigger display operation, and update and determine the authorization attribute identifier of the resource node every time it is loaded.
Lazy loading technology significantly improves the loading efficiency of the resource tree, reduces the waiting time for users, and ensures that the authorization attribute identification on the resource tree is accurate every time they are loaded, so that users can understand the specific authorization situation of the resource tree.
Smart Images

Figure CN119719533A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of resource tree loading, and in particular, to a lazy loading method, apparatus, device and medium applicable to authorization of a large amount of data resource tree. Background Art
[0002] In the browser-based page system, some authorized resources of remote devices will be recorded in the form of a resource tree to facilitate users to load and view them in a timely manner. For example, the BS (Brower / Server) system installs a browser on the client and a specified service database on the background server to facilitate data interaction between the client and the server.
[0003] In the related art, when a resource tree with a small amount of data is loaded and displayed, it is mainly loaded in full, that is, all resource nodes of the resource tree are loaded at one time, and a full resource tree is displayed to the user. However, when the resource tree contains a large amount of data, the user's waiting time for viewing the resource tree will undoubtedly increase, resulting in low loading efficiency of the resource tree. Summary of the invention
[0004] The embodiments described herein provide a lazy loading method, apparatus, device and medium for authorization of a large amount of data resource tree, which overcomes the above-mentioned problems.
[0005] In a first aspect, according to the content of the present disclosure, a lazy loading method for authorizing a large amount of data resource tree is provided, comprising:
[0006] Receive a device authorization request for a target resource tree, the target resource tree comprising: a plurality of root resource nodes, a plurality of group resource nodes and a plurality of leaf resource nodes, the group resource node being a subordinate node of the root resource node, the leaf resource node being a subordinate node of the group resource node, and the leaf resource node being used to describe a remote device with controllable permissions;
[0007] Obtaining an authorization operation node corresponding to the device authorization request, where the authorization operation node is used to describe one of the root resource node, the group resource node, and the leaf resource node;
[0008] If the authorized operation node corresponds to the leaf resource node, then based on the authorization ranking status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and determine the authorization attribute identifier of the root resource node to which the leaf resource node belongs;
[0009] If the authorization operation node corresponds to the group resource node, then the authorization attribute identifier of each leaf resource node contained in the group resource node is updated, and based on the authorization sorting status of the group resource node among all the group resource nodes contained in the root resource node to which it belongs, the authorization attribute identifier of the root resource node to which the group resource node belongs is determined;
[0010] If the authorization operation node corresponds to the root resource node, then updating the authorization attribute identifier of each of the group resource nodes contained in the root resource node and the authorization attribute identifier of each of the leaf resource nodes;
[0011] When a trigger display operation of the target resource tree by a user device is detected, the target resource tree is lazily loaded and displayed based on the trigger node position of the trigger display operation. The lazy loading display is used to sequentially overlay and display a level of resource node information according to successive trigger operations at different trigger node positions.
[0012] In a second aspect, according to the content of the present disclosure, a lazy loading device for authorizing a large amount of data resource tree is provided, comprising:
[0013] A receiving module, used to receive a device authorization request for a target resource tree, wherein the target resource tree includes: a plurality of root resource nodes, a plurality of group resource nodes, and a plurality of leaf resource nodes, wherein the group resource node is a subordinate node of the root resource node, the leaf resource node is a subordinate node of the group resource node, and the leaf resource node is used to describe a remote device with controllable permissions;
[0014] An acquisition module, used to acquire an authorization operation node corresponding to the device authorization request, wherein the authorization operation node is used to describe one of the root resource node, the group resource node, and the leaf resource node;
[0015] A first determination module is used to determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and the authorization attribute identifier of the root resource node to which the leaf resource node belongs based on the authorization sorting status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, if the authorization operation node corresponds to the leaf resource node;
[0016] A second determination module is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorization operation node corresponds to the group resource node, and determine the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization sorting status of the group resource node in all the group resource nodes contained in the root resource node to which it belongs;
[0017] An update module, used for updating the authorization attribute identifier of each of the group resource nodes and the authorization attribute identifier of each of the leaf resource nodes contained in the root resource node if the authorization operation node corresponds to the root resource node;
[0018] The display module is used to lazily load and display the target resource tree based on the trigger node position of the trigger display operation when a trigger display operation of the target resource tree is detected by the user device. The lazy loading display is used to sequentially overlay and display a level of resource node information according to successive trigger operations of different trigger node positions.
[0019] In a third aspect, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the lazy loading method for authorizing a large amount of data resource tree in any of the above embodiments are implemented.
[0020] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the lazy loading method for authorizing a large amount of data resource tree in any of the above embodiments are implemented.
[0021] The lazy loading method for authorizing a large amount of data resource tree provided in an embodiment of the present application receives a device authorization request for a target resource tree, wherein the target resource tree includes: multiple root resource nodes, multiple group resource nodes, and multiple leaf resource nodes, wherein the group resource node is a subordinate node of the root resource node, and the leaf resource node is a subordinate node of the group resource node, and the leaf resource node is used to describe a remote device with controllable permissions; obtains an authorization operation node corresponding to the device authorization request, wherein the authorization operation node is used to describe one of the root resource node, the group resource node, and the leaf resource node; if the authorization operation node corresponds to a leaf resource node, then based on the authorization sorting status of the leaf resource node in all the leaf resource nodes contained in the group resource node to which it belongs, determines the authorization attribute identifier of the group resource node to which the leaf resource node belongs, and determines the leaf resource node The authorization attribute identifier of the root resource node to which it belongs; if the authorization operation node corresponds to the group resource node, the authorization attribute identifier of each leaf resource node contained in the group resource node is updated, and based on the authorization ranking status of the group resource node in all the group resource nodes contained in the root resource node to which it belongs, the authorization attribute identifier of the root resource node to which the group resource node belongs is determined; if the authorization operation node corresponds to the root resource node, the authorization attribute identifier of each group resource node contained in the root resource node and the authorization attribute identifier of each leaf resource node are updated; when the user device detects the trigger display operation of the target resource tree, the target resource tree is lazily loaded and displayed based on the trigger node position of the trigger display operation, and the lazy loading display is used to sequentially overlay and display a level of resource node information according to the successive trigger operations of different trigger node positions. In this way, by setting the lazy loading mode of the resource tree, the superimposed resource node information is sequentially displayed based on the successive trigger operations of the user, and when each lazy loading is not fully displayed, the authorization attribute identifier of the corresponding resource node can be identified on the resource tree, so that the user can understand the specific authorization situation of the resource tree and effectively improve the loading efficiency of the resource tree.
[0022] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0024] Figure 1 The present invention provides a flowchart of a lazy loading method for authorizing a large amount of resource trees.
[0025] Figure 2A It is an authorization diagram of a resource tree provided by the present disclosure.
[0026] Figure 2B This is another authorization diagram of a resource tree provided by the present disclosure.
[0027] Figure 2C This is another authorization diagram of a resource tree provided by the present disclosure.
[0028] Figure 2D This is a lazy loading schematic diagram of a resource tree provided by the present invention.
[0029] Figure 2E This is another lazy loading schematic diagram of a resource tree provided by the present disclosure.
[0030] Figure 3 It is a structural schematic diagram of a lazy loading device for large-scale resource tree authorization provided by the present invention.
[0031] Figure 4 It is a structural schematic diagram of a computer device provided by the present disclosure.
[0032] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure 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 disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0034] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by a person skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, a statement that two or more parts are "connected" or "coupled" together shall mean that the parts are joined together directly or through one or more intermediate components.
[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0036] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists, A and B exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or a part of a component) from another component (or another part of a component).
[0037] In the description of the present application, unless otherwise specified, "plurality" means more than two (including two), and similarly, "multiple groups" means more than two groups (including two).
[0038] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0039] Figure 1 is a flow chart of a lazy loading method for authorizing a large amount of resource tree provided by an embodiment of the present disclosure, such as Figure 1 As shown, the specific process of the lazy loading method for large data resource tree authorization includes:
[0040] S110: Receive a device authorization request for a target resource tree, where the target resource tree includes: a plurality of root resource nodes, a plurality of group resource nodes, and a plurality of leaf resource nodes.
[0041] The group resource node is a subordinate node of the root resource node, and the leaf resource node is a subordinate node of the group resource node. The leaf resource node is used to describe a remote device with controllable permissions. For example, a leaf resource node can be different types of cameras, environmental equipment, monitoring equipment (such as monitors), and other devices with controllable permissions.
[0042] Correspondingly, the upper-level group resource node corresponding to the leaf resource node may be a larger regional range (such as a certain urban area), and the upper-level root resource node corresponding to the group resource node may be an even larger regional range (such as a certain province).
[0043] It should be noted that each of the multiple group resource nodes included belongs to the resource nodes under the same level, that is, the corresponding upper node is the root resource node, and the corresponding lower node is the leaf resource node. If in a resource tree with a larger / richer data volume, the group resource nodes can be divided into multiple levels, such as the group resource nodes are divided into two levels of nodes, namely: group resource node 1 and group resource node, group resource node 1 is the upper node of group resource node 2, that is, the upper node corresponding to group resource node 1 is the root resource node, the upper node corresponding to group resource node 2 is group resource node 1, and the lower node corresponding to group resource node 2 is a leaf resource node.
[0044] S120: Obtain the authorization operation node corresponding to the device authorization request.
[0045] Among them, the authorization operation node is used to describe one of the root resource node, the group resource node and the leaf resource node. That is, when the authorization trigger operation is performed on the root resource node, the authorization operation node corresponds to the root resource node, and the device authorization request of the target resource tree received is the device authorization request for the root resource node; when the authorization trigger operation is performed on the group resource node, the authorization operation node corresponds to the group resource node, and the device authorization request of the target resource tree received is the device authorization request for the group resource node; when the authorization trigger operation is performed on the leaf resource node, the authorization operation node corresponds to the leaf resource node, and the device authorization request of the target resource tree received is the device authorization request for the leaf resource node.
[0046] It should be noted that when obtaining the authorization operation node corresponding to the device authorization request, it can be determined based on the trigger operation data of the corresponding resource node. For example, if the trigger operation data (such as single click, double click, etc.) is generated in the trigger area corresponding to the root resource node, the authorization operation node corresponding to the device authorization request is the root resource node; if the trigger operation data is generated in the trigger area corresponding to the group resource node, the authorization operation node corresponding to the device authorization request is the group resource node; if the trigger operation data is generated in the trigger area corresponding to the leaf resource node, the authorization operation node corresponding to the device authorization request is the leaf resource node.
[0047] S130. If the authorized operation node corresponds to a leaf resource node, then based on the authorization ranking status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and determine the authorization attribute identifier of the root resource node to which the leaf resource node belongs.
[0048] Wherein, the authorization attribute identifier may include: a half-selected attribute identifier, a fully selected attribute identifier and an unselected attribute identifier. If the authorization attribute identifier of a group resource node is a half-selected attribute identifier, it is determined that the multiple leaf resource nodes included in the group resource node are not fully authorized, that is, some leaf resource nodes are authorized (the authorization attribute identifiers of some leaf resource nodes are fully selected attribute identifiers), and the remaining leaf resource nodes are not authorized (the authorization attribute identifiers of the remaining leaf resource nodes are unselected attribute identifiers); if the authorization attribute identifier of a group resource node is a fully selected attribute identifier, it is determined that the multiple leaf resource nodes included in the group resource node are fully authorized, that is, each leaf resource node is authorized (the authorization attribute identifier of each leaf resource node is a fully selected attribute identifier); if the authorization attribute identifier of a group resource node is an unselected attribute identifier, it is determined that the multiple leaf resource nodes included in the group resource node are not authorized, that is, each leaf resource node is not authorized (the authorization attribute identifier of each leaf resource node is an unselected attribute identifier).
[0049] It should be noted that the semi-selected attribute identifier only corresponds to the root resource node (which correspondingly includes at least two group resource nodes) and the group resource node (which correspondingly includes at least two leaf resource nodes).
[0050] The group resource node to which a leaf resource node belongs can be used to describe that the leaf resource node is a node in the group resource node to which it belongs, and the root resource node to which a leaf resource node belongs can be used to describe that the leaf resource node is a node in the group resource node to which it belongs, and the group resource node is a node in the root resource node to which it belongs. That is, the leaf resource node has a direct inclusion relationship with the group resource node to which it belongs, and the leaf resource node has an indirect inclusion relationship with the root resource node to which it belongs.
[0051] For example, the target resource tree includes: 2 root resource nodes (A1, A2), root resource node A1 includes 2 group resource nodes (B11, B12), root resource node A2 includes 2 group resource nodes (B21, B22), group resource node B11 includes 2 leaf resource nodes (C11, C12), and group resource node B12 includes 2 leaf resource nodes (C21, C22). If the leaf resource node is C11, its group resource node is B11, and its root resource node is A1.
[0052] In some embodiments, determining the authorization attribute identifier of the resource node of the group to which the leaf resource node belongs based on the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the resource node of the group to which the leaf resource node belongs includes:
[0053] If the authorization sorting status of the leaf resource node among all the leaf resource nodes included in the group resource nodes to which it belongs is the first authorization status, then the authorization attribute identifier of the resource nodes in the group to which the leaf resource node belongs is determined to be a half-selected attribute identifier; if the authorization sorting status of the leaf resource node among all the leaf resource nodes included in the group resource nodes to which it belongs is the second authorization status, then the authorization attribute identifier of the resource nodes in the group to which the leaf resource node belongs is determined to be a fully selected attribute identifier.
[0054] The first authorization state is used to describe that the leaf resource node is the first node to perform device authorization operation among all leaf resource nodes included in the group resource node to which it belongs. Figure 2A As shown, or, used to describe that the leaf resource node is a node that performs device authorization operation among all leaf resource nodes included in the group resource node to which it belongs, which is neither the first nor the last node, such as Figure 2B The second authorization state is used to describe that the leaf resource node is the last node to perform device authorization operation among all leaf resource nodes included in the resource node group to which it belongs, such as Figure 2C shown. Figure 2A , Figure 2B , Figure 2C In the figure, the resource node represented by the dotted box is the leaf resource node to be authorized.
[0055] Therefore, the authorization attribute identifier of the resource node of the group to which the leaf resource node belongs can be effectively determined through the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the resource node of the group to which the leaf resource node belongs.
[0056] In some embodiments, determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs includes:
[0057] Obtain the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs; if the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs is the third authorization status, then determine that the authorization attribute identifier of the root resource node to which the leaf resource node belongs is a half-selected attribute identifier; if the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs is the fourth authorization status, then determine that the authorization attribute identifier of the root resource node to which the leaf resource node belongs is a fully selected attribute identifier.
[0058] Among them, the third authorization state is used to describe that the group resource node to which the leaf resource node belongs is the first node to perform device authorization operation among all the group resource nodes included in the root resource node to which it belongs, or, it is used to describe that the group resource node to which the leaf resource node belongs is neither the first nor the last node to perform device authorization operation among all the group resource nodes included in the root resource node to which it belongs. The fourth authorization state is used to describe that the group resource node to which the leaf resource node belongs is the last node to perform device authorization operation among all the group resource nodes included in the root resource node to which it belongs.
[0059] Therefore, the authorization attribute identifier of the root resource node to which the leaf resource node belongs can be effectively determined through the authorization ranking status of the group resource node to which the leaf resource node belongs in all the group resource nodes included in the root resource node to which the leaf resource node belongs.
[0060] S140. If the authorization operation node corresponds to a group resource node, the authorization attribute identifier of each leaf resource node included in the group resource node is updated, and based on the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs, the authorization attribute identifier of the root resource node to which the group resource node belongs is determined.
[0061] Among them, determining the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs may include: if the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs is the fifth authorization status, then determining the authorization attribute identifier of the root resource node to which the group resource node belongs is a half-selected attribute identifier; if the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs is the sixth authorization status, then determining the authorization attribute identifier of the root resource node to which the group resource node belongs is a fully selected attribute identifier.
[0062] It should be noted that the fifth authorization state can be used to describe that the group resource node is the first node to perform a device authorization operation among all the group resource nodes included in the root resource node to which it belongs, or to describe that the group resource node is neither the first nor the last node to perform a device authorization operation among all the group resource nodes included in the root resource node to which it belongs. The sixth authorization state can be used to describe that the group resource node is the last node to perform a device authorization operation among all the group resource nodes included in the root resource node to which it belongs.
[0063] In some embodiments, updating the authorization attribute identifier of each leaf resource node included in the group resource node includes: updating the authorization attribute identifier of each leaf resource node included in the group resource node to a full selection attribute identifier.
[0064] Among them, since a group resource node contains multiple leaf resource nodes, if the device authorization operation is performed on the group resource node, each leaf resource node under the group resource node is authorized by default. Therefore, by updating the authorization attribute identifier of each leaf resource node contained in the group resource node to the full selection attribute identifier, the synchronization authorization of each leaf resource node under the group resource node is quickly performed.
[0065] S150: If the authorization operation node corresponds to a root resource node, then update the authorization attribute identifier of each group resource node contained in the root resource node and the authorization attribute identifier of each leaf resource node.
[0066] In some embodiments, updating the authorization attribute identifier of each group resource node included in the root resource node and the authorization attribute identifier of each leaf resource node includes:
[0067] The authorization attribute identifier of each group resource node contained in the root resource node is updated to a fully selected attribute identifier; and the authorization attribute identifier of each leaf resource node contained in the root resource node is updated to a fully selected attribute identifier.
[0068] Among them, since a root resource node contains multiple group resource nodes, and each group resource node contains multiple leaf resource nodes, if the device authorization operation is performed on the root resource node, each group resource node under the root resource node is authorized by default, and each leaf resource node included in each group resource node is also authorized.
[0069] Therefore, by updating the authorization attribute identifier of each group resource node contained in the root resource node to a full selection attribute identifier, and updating the authorization attribute identifier of each leaf resource node contained in the root resource node to a full selection attribute identifier, the synchronization authorization of each group resource node and leaf resource node under the root resource node can be quickly performed.
[0070] S160: When a triggering display operation of the target resource tree by the user device is detected, the target resource tree is lazily loaded and displayed based on a triggering node position of the triggering display operation.
[0071] Among them, lazy loading display is used to sequentially display a level of resource node information in an overlapping manner according to successive triggering operations at different trigger node positions.
[0072] The trigger node position for triggering the display operation may correspond to a triggerable region of a root resource node or a triggerable region of a group resource node.
[0073] For example, if a trigger display operation is performed on the triggerable area of the root resource node in the target resource tree, the lazy loading display result of the target resource tree is as follows: Figure 2DAs shown; based on this, the trigger display operation is performed on the triggerable area of the next group resource node of the root resource node, and the lazy loading display result of the target resource tree is obtained as follows Figure 2E shown.
[0074] In this embodiment, a device authorization request for a target resource tree is received, the target resource tree includes: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, the group resource node is a subordinate node of the root resource node, the leaf resource node is a subordinate node of the group resource node, and the leaf resource node is used to describe a remote device with controllable permissions; an authorization operation node corresponding to the device authorization request is obtained, the authorization operation node is used to describe one of the root resource node, the group resource node and the leaf resource node; if the authorization operation node corresponds to a leaf resource node, then based on the authorization sorting status of the leaf resource node in all the leaf resource nodes contained in the group resource node to which it belongs, the authorization attribute identifier of the group resource node to which the leaf resource node belongs and the authorization attribute of the root resource node to which the leaf resource node belongs are determined Authorization attribute identification; if the authorization operation node corresponds to a group resource node, then the authorization attribute identification of each leaf resource node contained in the group resource node is updated, and based on the authorization ranking status of the group resource node in all the group resource nodes contained in the root resource node to which it belongs, the authorization attribute identification of the root resource node to which the group resource node belongs is determined; if the authorization operation node corresponds to a root resource node, then the authorization attribute identification of each group resource node contained in the root resource node and the authorization attribute identification of each leaf resource node are updated; when the user device detects the trigger display operation of the target resource tree, the target resource tree is lazily loaded and displayed based on the trigger node position of the trigger display operation, and the lazy loading display is used to sequentially superimpose and display a level of resource node information according to the successive trigger operations of different trigger node positions. In this way, by setting the lazy loading mode of the resource tree, the superimposed resource node information is sequentially displayed based on the user's successive trigger operations, and when each lazy loading is not fully displayed, the authorization attribute identification of the corresponding resource node can be identified on the resource tree, which is convenient for users to understand the specific authorization status of the resource tree and effectively improve the loading efficiency of the resource tree.
[0075] In some embodiments, the method of this embodiment further includes:
[0076] When performing device authorization operations on leaf resource nodes, the authorization association relationship between the leaf resource node and the selected authorization subject triggered during the device authorization operation is sent to the backend server; when performing device authorization operations on group resource nodes, the authorization association relationship between the group resource node and the selected authorization subject triggered during the device authorization operation is sent to the backend server; when performing device authorization operations on root resource nodes, the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation is sent to the backend server.
[0077] The authorized subject may be one or more enterprise users, individual users, etc. who have control authority over the remote device.
[0078] The authorization association relationship between the leaf resource node and the selected authorization subject triggered during the device authorization operation can be used to determine the permission of the selected authorization subject triggered during the device authorization operation to control the remote device corresponding to the leaf resource node; the authorization association relationship between the group resource node and the selected authorization subject triggered during the device authorization operation can be used to determine the permission of the selected authorization subject triggered during the device authorization operation to control the remote device corresponding to the group resource node; the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation can be used to determine the permission of the selected authorization subject triggered during the device authorization operation to control the remote device corresponding to the root resource node.
[0079] Therefore, after the device authorization operation is performed on the target resource tree in the front-end device, the corresponding operation status is promptly fed back to the back-end server, so that the back-end server can record the authorization operation information of the front-end device and effectively synchronize the resource node information when the node information of the target resource tree is displayed.
[0080] Due to temporary device downtime or system crash, the background process of the (add / delete) resources and (add / delete) groups of the lazy loading tree running by the thread for the target resource tree was not successfully processed. This embodiment has a resource tree authorization self-repair function.
[0081] In some embodiments, if the device system is abnormally interrupted after the front-end device sends corresponding information to the back-end server, the back-end server records the authorization operation information of the front-end device and can promptly and effectively repair the device authorization operation of the target resource tree.
[0082] The method of this embodiment also includes:
[0083] If the device authorization operation of the group resource node is interrupted after the authorization association relationship of the selected authorization subject is triggered during the device authorization operation of the group resource node and the device is sent to the back-end server, then after the group resource node is lazy loaded and displayed, the authorization attribute identifier of the group resource node is updated based on the authorization association relationship of the selected authorization subject triggered during the device authorization operation of the group resource node and the device recorded by the back-end server; if the device authorization operation of the root resource node is interrupted after the authorization association relationship of the selected authorization subject is triggered during the device authorization operation of the root resource node and the device is sent to the back-end server, then after the root resource node is lazy loaded and displayed, the authorization attribute identifier of the root resource node is updated based on the authorization association relationship of the selected authorization subject triggered during the device authorization operation of the root resource node and the device recorded by the back-end server.
[0084] For example, when expanding a fully selected group resource node (the current state is fully selected), lazily load its subordinate nodes, and load the authorization status of these subordinate nodes (fully selected / half selected / unselected). When it is found that the status of a leaf resource node is unselected and the status of the remaining leaf resource nodes is fully selected, the front-end component will automatically update the status of this leaf resource node to half selected.
[0085] When expanding a fully selected root resource node (the current state is fully selected), lazily load its subordinate nodes, and load the authorization status of these subordinate nodes (fully selected / half selected / unselected). When it is found that the status of a group resource node is unselected and the status of the remaining group resource nodes is fully selected, the front-end component will automatically update the status of this group resource node to half selected.
[0086] Therefore, by utilizing the check-change event of the front-end component Element, the front-end captures this event and then calls the back-end interface to self-repair the authorization status of the group resource node and the root resource node.
[0087] In addition, if the device authorization operation of the leaf resource node is interrupted after the authorization association relationship between the leaf resource node and the selected authorization subject is triggered during the device authorization operation is sent to the back-end server, then after the leaf resource node is lazy loaded and displayed, the authorization attribute identifier of the leaf resource node is updated based on the authorization association relationship between the leaf resource node and the selected authorization subject triggered during the device authorization operation recorded by the back-end server.
[0088] In some embodiments, if the device system is abnormally interrupted when the front-end device sends corresponding information to the back-end server, the back-end server does not promptly record the authorization operation information of the front-end device. At this time, a front-end cache server can be set to temporarily cache the authorization operation records of the front-end device to facilitate authorization repair.
[0089] The method of this embodiment also includes:
[0090] If the device authorization operation of the leaf resource node is interrupted, the behavior operation data of the leaf resource node is obtained from the front-end cache service after the lazy loading display of the group resource node; based on the behavior operation data of the leaf resource node, the authorization attribute identifier of the leaf resource node is updated.
[0091] The behavior operation data is used to describe the trigger record of the authorization attribute identifier of the leaf resource node.
[0092] For example, if the device authorization operation of a leaf resource node is interrupted, the behavioral operation data of the leaf resource node is used to describe that the device authorization operation has been performed on the leaf resource node (such as single-click, double-click, etc. to trigger the selection behavior). At this time, the authorization attribute identifier of the feature resource node can be updated to the full selection attribute identifier, so as to facilitate authorization repair through the front-end cache server in the event of a timely communication with the back-end server.
[0093] In addition, when canceling device authorization for a resource node on the target resource tree, it can also include: obtaining the corresponding authorization cancellation node; if the authorization cancellation node corresponds to a leaf resource node, then based on the authorization ranking status of the leaf resource node in all the leaf resource nodes contained in the group resource node to which it belongs, determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs and determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs; if the authorization cancellation node corresponds to a group resource node, then updating the authorization attribute identifier of each leaf resource node contained in the group resource node to be a non-selected attribute identifier, and based on the authorization ranking status of the group resource node in all the group resource nodes contained in the root resource node to which it belongs, determining the authorization attribute identifier of the root resource node to which the group resource node belongs; if the authorization cancellation node corresponds to a root resource node, then updating the authorization attribute identifier of each group resource node contained in the root resource node and the authorization attribute identifier of each leaf resource node to be a non-selected attribute identifier.
[0094] Among them, determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs based on the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs may include: if the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs corresponds to the only device authorization node among all the leaf resource nodes, then determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs to be a non-selected attribute identifier; if the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs corresponds to the not the only device authorization node among all the leaf resource nodes, then determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs to be a semi-selected attribute identifier.
[0095] Determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs may include: if the authorization sorting status of the group resource node to which the leaf resource node belongs corresponds to that of all the group resource nodes included in the root resource node to which it belongs, and it is the only device authorization node among all the group resource nodes, then determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs to be a non-selected attribute identifier; if the authorization sorting status of the group resource node to which the leaf resource node belongs corresponds to that of all the group resource nodes included in the root resource node to which it belongs, and it is not the only device authorization node among all the group resource nodes, then determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs to be a semi-selected attribute identifier.
[0096] Determining the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs may include: if the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs corresponds to the only device authorization node among all the group resource nodes, then determining the authorization attribute identifier of the root resource node to which the group resource node belongs to be a non-selected attribute identifier; if the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs corresponds to the not the only device authorization node among all the group resource nodes, then determining the authorization attribute identifier of the root resource node to which the group resource node belongs to be a semi-selected attribute identifier.
[0097] When deleting an authorized node on a resource node on a target resource tree, it may also include: obtaining a corresponding authorized deletion node, and if the authorized deletion node corresponds to a leaf resource node, deleting the leaf resource node; if the authorized deletion node corresponds to a group resource node, deleting each leaf resource node contained in the group resource node, and determining the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization sorting status of the group resource node among all the group resource nodes contained in the root resource node to which it belongs; if the authorized cancellation node corresponds to a root resource node, deleting each group resource node and leaf resource node contained in the root resource node.
[0098] Among them, based on the authorization ranking status of the group resource node among all the group resource nodes included in the root resource node to which it belongs, determining the authorization attribute identifier of the root resource node to which the group resource node belongs may include: if the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs corresponds to, and it is the only device authorization node among all the leaf resource nodes, then determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs to be a non-selected attribute identifier; if the authorization ranking status of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs corresponds to, and it is not the only device authorization node among all the leaf resource nodes, then determining the authorization attribute identifier of the group resource node to which the leaf resource node belongs to be a semi-selected attribute identifier, and finally, deleting the leaf resource node.
[0099] In summary, when a large amount of data, hundreds of thousands of resources and tens of thousands of group nodes are hung on the resource tree and loaded at one time, users will have to wait for dozens of minutes, and even worse, the browser will freeze and crash (the browser cache cannot bear it). The authorization tree adopts lazy loading, loading one level of nodes at a time, and the page is smooth. At the same time, the status of each level of group (full selection / half selection / unselected) is stored and maintained in the background.
[0100] It should be noted that in this embodiment, when performing resource node authorization, resource node cancellation, resource node repair and resource node deletion, the backend server performs multi-threaded processing, the front end is unaware, and the front end response is not affected.
[0101] Figure 3 A structural diagram of a lazy loading device for large-scale resource tree authorization provided in this embodiment may include: a receiving module 310, an acquisition module 320, a first determination module 330, a second determination module 340, an update module 350 and a display module 360.
[0102] The receiving module 310 is used to receive a device authorization request for a target resource tree, wherein the target resource tree includes: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, wherein the group resource node is a subordinate node of the root resource node, and the leaf resource node is a subordinate node of the group resource node, and the leaf resource node is used to describe a remote device with controllable permissions.
[0103] The acquisition module 320 is used to acquire the authorization operation node corresponding to the device authorization request, where the authorization operation node is used to describe one of a root resource node, a group resource node, and a leaf resource node.
[0104] The first determination module 330 is used to determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and the authorization attribute identifier of the root resource node to which the leaf resource node belongs based on the authorization sorting status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, if the authorized operation node corresponds to a leaf resource node.
[0105] The second determination module 340 is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorization operation node corresponds to a group resource node, and determine the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization sorting status of the group resource node among all the group resource nodes contained in the root resource node to which it belongs.
[0106] The updating module 350 is used to update the authorization attribute identifier of each group resource node and the authorization attribute identifier of each leaf resource node contained in the root resource node if the authorization operation node corresponds to the root resource node.
[0107] Display module 360 is used to lazily load and display the target resource tree based on the trigger node position of the trigger display operation when a trigger display operation of the target resource tree is detected by the user device. The lazy loading display is used to sequentially overlay and display a level of resource node information according to successive trigger operations of different trigger node positions.
[0108] In this embodiment, optionally, the first determining module 330 is specifically configured to:
[0109] If the authorization sorting status of the leaf resource node among all the leaf resource nodes included in the group resource nodes to which it belongs is the first authorization status, then the authorization attribute identifier of the resource node of the group to which the leaf resource node belongs is determined to be a semi-selected attribute identifier; if the authorization sorting status of the leaf resource node among all the leaf resource nodes included in the group resource nodes to which it belongs is the second authorization status, then the authorization attribute identifier of the resource node of the group to which the leaf resource node belongs is determined to be a fully selected attribute identifier; wherein, the first authorization status is used to describe that the leaf resource node is the first node among all the leaf resource nodes included in the group resource nodes to which it belongs to perform device authorization operations, or that the leaf resource node is neither the first nor the last node among all the leaf resource nodes included in the group resource nodes to which it belongs to perform device authorization operations, and the second authorization status is used to describe that the leaf resource node is the last node among all the leaf resource nodes included in the group resource nodes to which it belongs to perform device authorization operations.
[0110] In this embodiment, optionally, the first determining module 330 is specifically configured to:
[0111] Obtain the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs; if the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs is the third authorization status, then determine that the authorization attribute identifier of the root resource node to which the leaf resource node belongs is a half-selected attribute identifier; if the authorization sorting status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs is the fourth authorization status, then determine that the authorization attribute identifier of the root resource node to which the leaf resource node belongs is a fully selected attribute identifier.
[0112] In this embodiment, optionally, the second determining module 340 is specifically configured to:
[0113] Update the authorization attribute identifier of each leaf resource node contained in the group resource node to a full selection attribute identifier.
[0114] The updating module 350 is specifically used for:
[0115] The authorization attribute identifier of each group resource node contained in the root resource node is updated to a fully selected attribute identifier; and the authorization attribute identifier of each leaf resource node contained in the root resource node is updated to a fully selected attribute identifier.
[0116] In this embodiment, optionally, it also includes: a sending module.
[0117] A sending module is used to send the authorization association relationship between the leaf resource node and the selected authorization subject triggered during the device authorization operation to the back-end server when performing device authorization operation on the leaf resource node; to send the authorization association relationship between the group resource node and the selected authorization subject triggered during the device authorization operation to the back-end server when performing device authorization operation on the group resource node; and to send the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation to the back-end server when performing device authorization operation on the root resource node.
[0118] In this embodiment, optionally, the update module 350 is also used to update the authorization attribute identifier of the group resource node based on the authorization association relationship between the group resource node and the selected authorization subject triggered during the device authorization operation recorded by the backend server after the group resource node is lazy loaded and displayed. If the device authorization operation of the group resource node is interrupted after the authorization association relationship between the group resource node and the selected authorization subject is triggered during the device authorization operation is sent to the backend server, then after the root resource node is lazy loaded and displayed, the authorization attribute identifier of the root resource node is updated based on the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation recorded by the backend server.
[0119] In this embodiment, optionally, the acquisition module 320 is also used to obtain the behavior operation data of the leaf resource node from the front-end cache service after the lazy loading display of the group resource node if the device authorization operation of the leaf resource node is interrupted, and the behavior operation data is used to describe the trigger record of the authorization attribute identifier of the leaf resource node.
[0120] The updating module 350 is also used to update the authorization attribute identifier of the leaf resource node based on the behavior operation data of the leaf resource node.
[0121] The lazy loading device for large-scale resource tree authorization provided by the present disclosure can execute the above method embodiments. Its specific implementation principles and technical effects can be found in the above method embodiments, and the present disclosure will not repeat them here.
[0122] The present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0123] The computer device includes a memory 410 and a processor 420 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with a memory 410 and a processor 420, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0124] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.
[0125] The memory 410 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, for example, a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of a computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 410 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card or a flash card (FlashCard) equipped on the computer device. Of course, the memory 410 may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory 410 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 410 may also be used to temporarily store various data that have been output or are to be output.
[0126] The processor 420 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 410 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 420 is used to execute the program codes or instructions stored in the memory 410 or process data, such as running the program code of the above method.
[0127] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0128] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.
[0129] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.
[0130] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.
[0131] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] Each functional unit or module in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0134] In the claims, any reference symbols placed between brackets shall not be construed as limiting the claims. The word "comprising" described in the present application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented with the aid of hardware comprising several different elements and with the aid of a suitably programmed computer. In a unit claim that lists a number of devices, several units of these devices may be embodied by the same hardware item. The use of first, second, and third, etc. does not indicate any order, and these words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
[0135] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A lazy loading method for large data resource tree authorization, characterized in that: include: Receive a device authorization request for a target resource tree, the target resource tree comprising: a plurality of root resource nodes, a plurality of group resource nodes and a plurality of leaf resource nodes, the group resource node being a subordinate node of the root resource node, the leaf resource node being a subordinate node of the group resource node, and the leaf resource node being used to describe a remote device with controllable permissions; Obtaining an authorization operation node corresponding to the device authorization request, where the authorization operation node is used to describe one of the root resource node, the group resource node, and the leaf resource node; If the authorized operation node corresponds to the leaf resource node, then based on the authorization ranking status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and determine the authorization attribute identifier of the root resource node to which the leaf resource node belongs; If the authorization operation node corresponds to the group resource node, then the authorization attribute identifier of each leaf resource node contained in the group resource node is updated, and based on the authorization sorting status of the group resource node among all the group resource nodes contained in the root resource node to which it belongs, the authorization attribute identifier of the root resource node to which the group resource node belongs is determined; If the authorization operation node corresponds to the root resource node, then updating the authorization attribute identifier of each of the group resource nodes contained in the root resource node and the authorization attribute identifier of each of the leaf resource nodes; When a trigger display operation of the target resource tree by a user device is detected, the target resource tree is lazily loaded and displayed based on the trigger node position of the trigger display operation. The lazy loading display is used to sequentially overlay and display a level of resource node information according to successive trigger operations at different trigger node positions.
2. The method according to claim 1, characterized in that The step of determining the authorization attribute identifier of the resource node of the group to which the leaf resource node belongs based on the authorization ranking status of all leaf resource nodes included in the resource node of the group to which the leaf resource node belongs comprises: If the authorization ranking state of the leaf resource node among all the leaf resource nodes included in the group resource node to which it belongs is the first authorization state, determining that the authorization attribute identifier of the group resource node to which the leaf resource node belongs is a semi-selected attribute identifier; If the authorization ranking state of the leaf resource node in all leaf resource nodes included in the group resource node to which it belongs is the second authorization state, determining that the authorization attribute identifier of the group resource node to which the leaf resource node belongs is the all-selected attribute identifier; Among them, the first authorization state is used to describe that the leaf resource node is the first node to perform device authorization operation among all leaf resource nodes included in the resource node group to which it belongs, or, the leaf resource node is neither the first nor the last node to perform device authorization operation among all leaf resource nodes included in the resource node group to which it belongs, and the second authorization state is used to describe that the leaf resource node is the last node to perform device authorization operation among all leaf resource nodes included in the resource node group to which it belongs.
3. The method according to claim 2, characterized in that The step of determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs includes: Obtaining the authorization ranking status of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs; If the authorization ranking state of the group resource node to which the leaf resource node belongs in all the group resource nodes included in the root resource node to which it belongs is the third authorization state, determining that the authorization attribute identifier of the root resource node to which the leaf resource node belongs is the semi-selected attribute identifier; If the authorization ranking state of the group resource node to which the leaf resource node belongs among all the group resource nodes included in the root resource node to which it belongs is the fourth authorization state, the authorization attribute identifier of the root resource node to which the leaf resource node belongs is determined to be the all-select attribute identifier.
4. The method according to claim 3, characterized in that The updating of the authorization attribute identifier of each leaf resource node included in the group resource node includes: Updating the authorization attribute identifier of each leaf resource node included in the group resource node to the all-select attribute identifier; The updating of the authorization attribute identifier of each of the group resource nodes contained in the root resource node and the authorization attribute identifier of each of the leaf resource nodes includes: Updating the authorization attribute identifier of each of the group resource nodes included in the root resource node to the all-select attribute identifier; The authorization attribute identifier of each leaf resource node contained in the root resource node is updated to the all-selected attribute identifier.
5. The method according to claim 1, characterized in that: Also includes: When performing a device authorization operation on the leaf resource node, sending to the backend server the authorization association relationship between the leaf resource node and the authorization subject selected during the device authorization operation; When performing a device authorization operation on the group resource node, sending to the backend server an authorization association relationship between the group resource node and an authorization subject selected and triggered during the device authorization operation; When performing a device authorization operation on the root resource node, the authorization association relationship between the root resource node and the authorization subject selected and triggered during the device authorization operation is sent to the backend server.
6. The method according to claim 5, characterized in that Also includes: If the device authorization operation of the group resource node is interrupted after the authorization association relationship between the group resource node and the authorization subject selected during the device authorization operation is sent to the back-end server, then after the lazy loading display of the group resource node, based on the authorization association relationship between the group resource node and the authorization subject selected during the device authorization operation recorded by the back-end server, the authorization attribute identifier of the group resource node is updated; If the device authorization operation of the root resource node is interrupted after the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation is sent to the back-end server, then after the root resource node is lazily loaded and displayed, the authorization attribute identifier of the root resource node is updated based on the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation recorded by the back-end server.
7. The method according to claim 5, characterized in that Also includes: If the device authorization operation of the leaf resource node is interrupted, then after the lazy loading display of the group resource node, the behavior operation data of the leaf resource node is obtained from the front-end cache service, and the behavior operation data is used to describe the trigger record of the authorization attribute identifier of the leaf resource node; Based on the behavior operation data of the leaf resource node, the authorization attribute identifier of the leaf resource node is updated.
8. A lazy loading device for large data resource tree authorization, characterized in that: include: A receiving module, used to receive a device authorization request for a target resource tree, wherein the target resource tree includes: a plurality of root resource nodes, a plurality of group resource nodes, and a plurality of leaf resource nodes, wherein the group resource node is a subordinate node of the root resource node, the leaf resource node is a subordinate node of the group resource node, and the leaf resource node is used to describe a remote device with controllable permissions; An acquisition module, used to acquire an authorization operation node corresponding to the device authorization request, wherein the authorization operation node is used to describe one of the root resource node, the group resource node, and the leaf resource node; A first determination module is used to determine the authorization attribute identifier of the group resource node to which the leaf resource node belongs and the authorization attribute identifier of the root resource node to which the leaf resource node belongs based on the authorization sorting status of the leaf resource node among all the leaf resource nodes contained in the group resource node to which it belongs, if the authorization operation node corresponds to the leaf resource node; A second determination module is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorization operation node corresponds to the group resource node, and determine the authorization attribute identifier of the root resource node to which the group resource node belongs based on the authorization sorting status of the group resource node in all the group resource nodes contained in the root resource node to which it belongs; An update module, used for updating the authorization attribute identifier of each of the group resource nodes and the authorization attribute identifier of each of the leaf resource nodes contained in the root resource node if the authorization operation node corresponds to the root resource node; The display module is used to lazily load and display the target resource tree based on the trigger node position of the trigger display operation when a trigger display operation of the target resource tree is detected by the user device. The lazy loading display is used to sequentially overlay and display a level of resource node information according to successive trigger operations of different trigger node positions.
9. A computer device, characterized in that: The invention comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, a lazy loading method for authorization of a large data resource tree as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the lazy loading method for authorizing a large amount of data resource tree as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Authority management method and device
CN113505996A
Implementation method for tree-shaped display of multi-module multi-table permission resource data
CN118838946A
Cited By
Resource lazy loading method and device
CN121092803A