Lazy loading methods, devices, equipment, and media for large-scale resource tree authorization
By using lazy loading to load resource tree nodes level by level, the problem of low loading efficiency for large amounts of data in resource trees is solved, achieving efficient loading of resource trees and timely display of authorization status.
Patent Information
- Application Number
- CN202411656879.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-19
AI Technical Summary
When the amount of resource tree data is large, the full loading method in the existing technology leads to low resource tree loading efficiency and increased user waiting time.
The lazy loading method is adopted to load resource nodes level by level according to the user's successive triggering operations. During the loading process, the authorization attributes of resource nodes are identified, including the authorization attribute identifiers of root, group and leaf resource nodes. The resource node information is displayed in sequence through lazy loading.
This improves the loading efficiency of the resource tree, reduces user waiting time, and ensures that the authorization status is displayed in a timely manner during the loading process, making it easier for users to understand the specific authorization status of the resource tree.
Smart Images

Figure CN119719533B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure relate to the field of resource tree loading technology, and more specifically, to a lazy loading method, apparatus, device, and medium suitable for a large-scale resource tree authorization. Background Technology
[0002] Browser-based page systems record authorized resources from remote devices through a resource tree, facilitating timely loading and viewing by users. For example, in a BS (Browser / Server) system, a browser is installed on the client machine, and a specified service database is installed on the backend server, enabling data interaction between the client and the server.
[0003] In related technologies, when a resource tree with a small amount of data is loaded and displayed, it is mainly done through full loading, that is, loading all resource nodes of the resource tree at once to show the user a full resource tree. However, using the existing method, when the resource tree contains a large amount of data, will undoubtedly increase the waiting time for users to view the resource tree, 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 granting large amounts of resource tree licenses, overcoming the aforementioned problems.
[0005] Firstly, based on the content of this disclosure, a lazy loading method for granting permissions to large-scale resource trees is provided, including:
[0006] Receive a device authorization request for a target resource tree, the target resource tree including: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, the group resource nodes are the subordinate nodes of the root resource nodes, the leaf resource nodes are the subordinate nodes of the group resource nodes, and the leaf resource nodes are used to describe remote devices with controllable permissions;
[0007] Obtain the 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;
[0008] If the authorized operation node corresponds to the leaf resource node, then based on the authorized sorting status of the leaf resource node among all leaf resource nodes contained in its group of resource nodes, the authorized attribute identifier of the group resource node to which the leaf resource node belongs and the authorized attribute identifier of the root resource node to which the leaf resource node belongs are determined.
[0009] If the authorized operation node corresponds to the group resource node, then the authorized attribute identifier of each leaf resource node contained in the group resource node is updated, and the authorized attribute identifier of the root resource node to which the group resource node belongs is determined based on the authorized sorting status of the group resource node in all group resource nodes contained in its root resource node.
[0010] If the authorized operation node corresponds to the root resource node, then update the authorized attribute identifier of each group of resource nodes contained in the root resource node and the authorized attribute identifier of each leaf resource node;
[0011] When a user device triggers a display operation on the target resource tree, the target resource tree is lazy-loaded based on the trigger node position of the trigger display operation. The lazy-loaded display is used to sequentially overlay and display resource node information of one level according to the successive trigger operations at different trigger node positions.
[0012] Secondly, according to the content of this disclosure, a lazy loading device for granting large amounts of data on resource trees is provided, comprising:
[0013] The receiving module is used to receive device authorization requests for a target resource tree, the target resource tree including: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, the group resource nodes are the subordinate nodes of the root resource nodes, the leaf resource nodes are the subordinate nodes of the group resource nodes, and the leaf resource nodes are used to describe remote devices with controllable permissions.
[0014] The acquisition module is used to acquire the 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] The first determining 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 leaf resource nodes contained in the group resource node to which the leaf resource node belongs, if the authorized operation node corresponds to the leaf resource node.
[0016] The second determining module is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorized 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 group resource nodes contained in the root resource node to which it belongs.
[0017] The update module is used to update the authorization attribute identifier of each group of resource nodes included in the root resource node and the authorization attribute identifier of each leaf resource node if the authorized operation node corresponds to the root resource node.
[0018] The display module is used to perform lazy loading display on the target resource tree based on the trigger node position of the trigger display operation when a user device triggers the display operation on the target resource tree. The lazy loading display is used to sequentially display resource node information of one level according to the successive trigger operations at different trigger node positions.
[0019] Thirdly, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the lazy loading method for granting large data resource tree licenses as described in any of the above embodiments.
[0020] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the lazy loading method for granting large data resource tree licenses as described in any of the above embodiments.
[0021] The lazy loading method for authorizing large-scale resource trees provided in this application embodiment receives a device authorization request for a target resource tree, which includes multiple root resource nodes, multiple group resource nodes, and multiple leaf resource nodes. Group resource nodes are subordinate nodes of the root resource nodes, and leaf resource nodes are subordinate nodes of the group resource nodes. Leaf resource nodes describe remote devices with controllable permissions. The method obtains the authorization operation node corresponding to the device authorization request. The authorization operation node describes one of the root resource nodes, group resource nodes, and leaf resource nodes. If the authorization operation node corresponds to a leaf resource node, the method determines the authorization attribute identifier of the group resource node to which the leaf resource node belongs and determines the leaf resource node itself based on the authorization sorting status of the leaf resource node among all leaf resource nodes included in its group resource node. The authorization attribute identifier of the root resource node is determined. If the authorized operation node corresponds to a group resource node, the authorization attribute identifier of each leaf resource node contained in the group resource node is updated, and the authorization attribute identifier of the root resource node to which the group resource node belongs is determined based on the authorization sorting status of the group resource node among all group resource nodes contained in the root resource node. If the authorized operation node corresponds to a 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 a user device triggers a display operation on the target resource tree, the target resource tree is lazy-loaded based on the trigger node position of the trigger display operation. Lazy-loading display is used to sequentially overlay and display resource node information of one level according to the successive trigger operations at different trigger node positions. In this way, by setting the lazy-loading method of the resource tree, the overlaid resource node information is displayed sequentially based on the user's successive trigger operations. Moreover, when the lazy loading is not complete, the authorization attribute identifier of the corresponding resource node can be marked on the resource tree, which makes it easier for users to understand the specific authorization status of the resource tree and effectively improves the loading efficiency of the resource tree.
[0022] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein:
[0024] Figure 1 This is a flowchart illustrating a lazy loading method for authorizing large-scale resource trees, as publicly provided.
[0025] Figure 2A This is a licensed diagram of a resource tree provided in this public disclosure.
[0026] Figure 2B This is an authorized diagram of another resource tree provided in this publication.
[0027] Figure 2C This is another licensed diagram of a resource tree provided in this public disclosure.
[0028] Figure 2D This is a schematic diagram of lazy loading of a resource tree provided in this publication.
[0029] Figure 2E This is a schematic diagram of lazy loading of another resource tree provided in this publication.
[0030] Figure 3 This is a schematic diagram of a lazy loading device for licensing large-scale resource trees, as disclosed in this publication.
[0031] Figure 4 This is a schematic diagram of the structure of a computer device provided in this disclosure.
[0032] It should be noted that the elements in the attached diagram are schematic and not drawn to scale. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.
[0034] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, the statement of “connecting” or “coupling” two or more parts together shall mean that these parts are directly joined together or joined through one or more intermediate components.
[0035] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0036] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or part of a component) from another component (or another part of a component).
[0037] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).
[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0039] Figure 1 This is a flowchart illustrating a lazy loading method for authorizing large-scale resource trees according to an embodiment of this disclosure, as shown below. Figure 1 As shown, the specific process of the lazy loading method for granting large amounts of resource tree permissions includes:
[0040] S110. Receive a device authorization request for a target resource tree, which includes: multiple root resource nodes, multiple group resource nodes, and multiple leaf resource nodes.
[0041] In this system, group resource nodes are subordinate nodes of the root resource node, and leaf resource nodes are subordinate nodes of the group resource nodes. Leaf resource nodes are used to describe remote devices with controllable permissions. For example, leaf resource nodes can be different types of cameras, environmental devices, monitoring devices (such as monitors), and other devices with controllable permissions.
[0042] Correspondingly, the parent group resource node corresponding to the leaf resource node can be a large area (such as a city), and the parent root resource node corresponding to the group resource node can be an even larger area (such as a province).
[0043] It should be noted that each group resource node within a group resource node belongs to the same level of resource nodes, meaning its parent node is the root resource node and its child nodes are leaf resource nodes. In a resource tree with larger / richer data, group resource nodes can be divided into multiple levels. For example, group resource nodes can be divided into two levels: group resource node 1 and group resource node 2. Group resource node 1 is the parent node of group resource node 2. That is, the parent node of group resource node 1 is the root resource node, the parent node of group resource node 2 is group resource node 1, and the child nodes of group resource node 2 are leaf resource nodes.
[0044] S120. Obtain the authorization operation node corresponding to the device authorization request.
[0045] In this context, the authorization operation node describes one of the root resource node, group resource node, or leaf resource node. Specifically, when an 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 received from the target resource tree is the device authorization request for the root resource node; when an authorization trigger operation is performed on a group resource node, the authorization operation node corresponds to the group resource node, and the device authorization request received from the target resource tree is the device authorization request for the group resource node; and when an authorization trigger operation is performed on a leaf resource node, the authorization operation node corresponds to the leaf resource node, and the device authorization request received from the target resource tree 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 trigger operation data (such as single click, double click, etc.) is generated in the trigger area corresponding to the root resource node, then the authorization operation node corresponding to the device authorization request is the root resource node; if trigger operation data is generated in the trigger area corresponding to the group resource node, then the authorization operation node corresponding to the device authorization request is the group resource node; if trigger operation data is generated in the trigger area corresponding to the leaf resource node, then 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 authorized sorting status of the leaf resource node among all leaf resource nodes contained in the group resource nodes to which it belongs, determine the authorized attribute identifier of the group resource node to which the leaf resource node belongs and determine the authorized attribute identifier of the root resource node to which the leaf resource node belongs.
[0048] The authorization attribute identifier can include: partial selection, full selection, and no selection. If the authorization attribute identifier of a group of resource nodes is partial selection, it is determined that the multiple leaf resource nodes contained in the group are not fully authorized; that is, some leaf resource nodes are authorized (the authorization attribute identifier of some leaf resource nodes is full selection), and the remaining leaf resource nodes are not authorized (the authorization attribute identifier of the remaining leaf resource nodes is no selection). If the authorization attribute identifier of a group of resource nodes is full selection, it is determined that the multiple leaf resource nodes contained in the group are fully authorized; that is, each leaf resource node is authorized (the authorization attribute identifier of each leaf resource node is full selection). If the authorization attribute identifier of a group of resource nodes is no selection, it is determined that none of the multiple leaf resource nodes contained in the group are authorized; that is, none of the leaf resource nodes are authorized (the authorization attribute identifier of each leaf resource node is no selection).
[0049] It should be noted that the semi-selection attribute identifier only corresponds to the root resource node (which contains at least two group resource nodes) and the group resource node (which contains at least two leaf resource nodes).
[0050] A leaf resource node belongs to a group of resource nodes, which can be used to describe that the leaf resource node is a node in that group of resource nodes. A leaf resource node belongs to a root resource node, which can be used to describe that the leaf resource node belongs to a group of resource nodes, and the leaf resource node belongs to a group of resource nodes, which is a node in the root resource node. That is, a leaf resource node and its group of resource nodes have a direct containment relationship, and a leaf resource node and its root resource node have an indirect containment relationship.
[0051] For example, the target resource tree includes: two root resource nodes (A1, A2), root resource node A1 contains two group resource nodes (B11, B12), root resource node A2 contains two group resource nodes (B21, B22), group resource node B11 contains two leaf resource nodes (C11, C12), and group resource node B12 contains two 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, the authorization attribute identifier of the resource nodes to which the leaf resource node belongs is determined based on the authorization sorting status of the leaf resource node among all leaf resource nodes contained in its group of resource nodes, including:
[0053] If the authorization sorting status of a leaf resource node among all leaf resource nodes in its group is the first authorization status, then the authorization attribute identifier of the resource node in the group to which the leaf resource node belongs is determined to be the half-select attribute identifier; if the authorization sorting status of a leaf resource node among all leaf resource nodes in its group is the second authorization status, then the authorization attribute identifier of the resource node in the group to which the leaf resource node belongs is determined to be the full-select attribute identifier.
[0054] The first authorization status describes the leaf resource node as the first node among all leaf resource nodes in its group to perform device authorization operations, such as... Figure 2A As shown, or, used to describe a leaf resource node as the node that performs device authorization operations among all leaf resource nodes contained in its group of resource nodes, which is neither the first nor the last. Figure 2B As shown. The second authorization status is used to describe a leaf resource node as the last node to perform device authorization operations among all leaf resource nodes contained in its group, such as... Figure 2C As shown. Figure 2A , Figure 2B , Figure 2C In the diagram, the resource nodes indicated by the dashed boxes are leaf resource nodes awaiting authorization.
[0055] Therefore, by determining the authorization order of a leaf resource node among all leaf resource nodes in its group, the authorization attribute identifier of the group resource node to which the leaf resource node belongs can be effectively determined.
[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 resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node; if the authorization sorting status of the resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node 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 the half-selection attribute identifier; if the authorization sorting status of the resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node 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 the full selection attribute identifier.
[0058] The third authorization state describes a leaf resource node as the first node in its group to perform a device authorization operation among all group resource nodes contained in its root resource node, or it describes a leaf resource node as neither the first nor the last node in its group to perform a device authorization operation among all group resource nodes contained in its root resource node. The fourth authorization state describes a leaf resource node as the last node in its group to perform a device authorization operation among all group resource nodes contained in its root resource node.
[0059] Therefore, by determining the authorization attribute identifier of the root resource node to which the leaf resource node belongs, the authorization order status of the group resource nodes to which the leaf resource node belongs among all group resource nodes contained in the root resource node can be effectively determined.
[0060] S140. If the authorized operation node corresponds to a group resource node, then update the authorized attribute identifier of each leaf resource node contained in the group resource node, and determine the authorized attribute identifier of the root resource node to which the group resource node belongs based on the authorized sorting status of the group resource node among all group resource nodes contained in its root resource node.
[0061] Specifically, 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 group resource nodes contained in its root resource node may include: if the authorization sorting status of the group resource node among all group resource nodes contained in its root resource node is the fifth authorization status, then the authorization attribute identifier of the root resource node to which the group resource node belongs is determined to be a half-selection attribute identifier; if the authorization sorting status of the group resource node among all group resource nodes contained in its root resource node is the sixth authorization status, then the authorization attribute identifier of the root resource node to which the group resource node belongs is determined to be a full-selection attribute identifier.
[0062] It should be noted that the fifth authorization state can be used to describe a group resource node as the first node to perform a device authorization operation among all group resource nodes contained in its root resource node, or it can be used to describe a group resource node as neither the first nor the last node to perform a device authorization operation among all group resource nodes contained in its root resource node. The sixth authorization state can be used to describe a group resource node as the last node to perform a device authorization operation among all group resource nodes contained in its root resource node.
[0063] In some embodiments, updating the authorization attribute identifier of each leaf resource node contained in the group resource node includes: updating the authorization attribute identifier of each leaf resource node contained in the group resource node to the select all attribute identifier.
[0064] Since a group of resource nodes contains multiple leaf resource nodes, if a device authorization operation is performed on the group of resource nodes, each leaf resource node under the group of resource nodes will be authorized by default. Therefore, by updating the authorization attribute identifier of each leaf resource node contained in the group of resource nodes to the select all attribute identifier, the synchronous authorization of each leaf resource node under the group of resource nodes can be quickly performed.
[0065] S150. If the authorized operation node corresponds to the root resource node, then update the authorized attribute identifier of each group of resource nodes contained in the root resource node and the authorized attribute identifier of each leaf resource node.
[0066] In some embodiments, updating the authorization attribute identifier of each group of resource nodes included in the root resource node and the authorization attribute identifier of each leaf resource node includes:
[0067] Update the authorization attribute identifier of each group of resource nodes contained in the root resource node to the select all attribute identifier; update the authorization attribute identifier of each leaf resource node contained in the root resource node to the select all attribute identifier.
[0068] Since a root resource node contains multiple group resource nodes, and each group resource node contains multiple leaf resource nodes, if a device authorization operation is performed on the root resource node, then by default each group resource node under the root resource node is authorized, and each leaf resource node included under 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 the select all attribute identifier, and updating the authorization attribute identifier of each leaf resource node contained in the root resource node to the select all attribute identifier, the synchronous authorization of each group resource node and leaf resource node under the root resource node can be quickly performed.
[0070] S160. When a user equipment triggers a display operation on the target resource tree, the target resource tree is lazy-loaded and displayed based on the location of the trigger node of the display operation.
[0071] Among them, lazy loading display is used to sequentially display a level of resource node information based on the successive triggering operations at different trigger node positions.
[0072] The trigger node location for triggering the display operation can correspond to the triggerable area of the root resource node or the triggerable area of the group resource node.
[0073] For example, if a triggerable display operation is performed on the triggerable region of the root resource node in the target resource tree, the resulting lazy-loaded display of the target resource tree will be as follows: Figure 2DAs shown; based on this, if a trigger display operation is then performed on the triggerable area of the next group of resource nodes of the root resource node, the lazy loading display result of the target resource tree will be as follows. Figure 2E As 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. Group resource nodes are subordinate nodes of root resource nodes, and leaf resource nodes are subordinate nodes of group resource nodes. Leaf resource nodes are used to describe remote devices with controllable permissions. The authorization operation node corresponding to the device authorization request is obtained. The authorization operation node is used to describe one of the root resource nodes, group resource nodes, and leaf resource nodes. If the authorization operation node corresponds to a leaf resource node, the authorization attribute identifier of the group resource node to which the leaf resource node belongs and the authorization of the root resource node to which the leaf resource node belongs are determined based on the authorization sorting status of the leaf resource node among all leaf resource nodes contained in its group resource node. The authorization attribute identifier is defined as follows: If the authorized operation node corresponds to a group resource node, the authorization attribute identifier of each leaf resource node contained in the group resource node is updated, and the authorization attribute identifier of the root resource node to which the group resource node belongs is determined based on the authorization sorting status of the group resource node among all group resource nodes contained in its root resource node; if the authorized operation node corresponds to a 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 a user device triggers a display operation on the target resource tree, the target resource tree is lazy-loaded based on the trigger node position of the trigger display operation. Lazy-loading display is used to sequentially overlay and display resource node information of one level according to the successive trigger operations at different trigger node positions. In this way, by setting the lazy-loading method of the resource tree, the overlaid resource node information is displayed sequentially based on the user's successive trigger operations, and when the lazy loading is not complete, the authorization attribute identifier of the corresponding resource node can be marked on the resource tree, which makes it easier for users to understand the specific authorization status of the resource tree and effectively improves 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 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 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 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 entity can be one or more enterprise users, individual users, etc., who have controllable permissions over remote devices.
[0078] The authorization association between leaf resource nodes and the selected authorization subject triggered during the device authorization operation can be used to determine the permissions of the selected authorization subject to control the remote device corresponding to the leaf resource node during the device authorization operation; the authorization association between group resource nodes and the selected authorization subject triggered during the device authorization operation can be used to determine the permissions of the selected authorization subject to control the remote device corresponding to the group resource node during the device authorization operation; the authorization association between root resource nodes and the selected authorization subject triggered during the device authorization operation can be used to determine the permissions of the selected authorization subject to control the remote device corresponding to the root resource node during the device authorization operation.
[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. This allows the back-end server to record the authorization operation information of the front-end device, so that the resource node information can be effectively synchronized when the node information of the target resource tree is displayed.
[0080] Due to temporary device downtime or system crashes, the background process of adding / deleting resources or adding / deleting groups in the lazy-loaded tree running by the thread may not be successfully processed for the target resource tree. This embodiment has a resource tree authorization self-repair function.
[0081] In some embodiments, if the device system experiences an abnormal interruption after the front-end device sends the corresponding information to the back-end server, the back-end server records the authorization operation information of the front-end device, which can effectively repair the device authorization operation of the target resource tree in a timely manner.
[0082] The method in this embodiment also includes:
[0083] If the device authorization operation of the group resource node is interrupted after the authorization association of the selected authorization subject is triggered during the group resource node and device authorization operation is sent to the backend server, the authorization attribute identifier of the group resource node is updated based on the authorization association of the selected authorization subject triggered during the group resource node and 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 root resource node is interrupted after the authorization association of the selected authorization subject is triggered during the root resource node and device authorization operation is sent to the backend server, the authorization attribute identifier of the root resource node is updated based on the authorization association of the selected authorization subject triggered during the root resource node and device authorization operation recorded by the backend server after the root resource node is lazy-loaded and displayed.
[0084] For example, when expanding a group resource node in a selected state (currently selected), its child nodes are lazy-loaded, and the authorization states (selected / partially selected / not selected) of these child nodes are loaded. When a leaf resource node is found to be unselected and the remaining leaf resource nodes are selected, the front-end component will automatically update the state of the leaf resource node to partial selection.
[0085] Expanding a root resource node in a selected state (currently selected), lazy-loading its child nodes and loading the authorization states (selected / partially selected / not selected) of these child nodes. When it is found that a group of resource nodes is not selected and the remaining group of resource nodes are selected, the front-end component will automatically update the state of this group of resource nodes to partially 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] Additionally, if the device authorization operation of the leaf resource node is interrupted after the authorization association of the selected authorization subject is triggered during the authorization operation of the leaf resource node and the device authorization operation is sent to the backend server, the authorization attribute identifier of the leaf resource node will be updated based on the authorization association of the selected authorization subject triggered during the authorization operation of the leaf resource node and the device authorization operation recorded by the backend server after the leaf resource node is lazy-loaded and displayed.
[0088] In some embodiments, if the device system experiences an abnormal interruption when the front-end device sends corresponding information to the back-end server, the back-end server does not record the authorization operation information of the front-end device in a timely manner. In this case, a front-end cache server can be set up to temporarily cache the authorization operation records of the front-end device to facilitate authorization repair.
[0089] The method in 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 group resource node is lazy-loaded and displayed; based on the behavior operation data of the leaf resource node, the authorization attribute identifier of the leaf resource node is updated.
[0091] Among them, the behavioral operation data is used to describe the trigger records 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 behavior operation data of that leaf resource node is used to describe the device authorization operation that 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 that authorization can be repaired through the front-end cache server if there is no timely communication with the back-end server.
[0093] Additionally, when canceling device authorization for a resource node on the target resource tree, the process may further include: obtaining the corresponding authorization cancellation node; if the authorization cancellation node corresponds to a leaf resource node, determining 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 leaf resource nodes contained in its group resource node; if the authorization cancellation node corresponds to a group resource node, updating the authorization attribute identifier of each leaf resource node contained in the group resource node to a non-selected attribute identifier, 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 group resource nodes contained in its root resource node; if the authorization cancellation node corresponds to a root resource node, 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 a non-selected attribute identifier.
[0094] Specifically, determining the authorization attribute identifier of the resource node belonging to the group of resource nodes based on the authorization sorting status of the leaf resource node among all leaf resource nodes in its group can include: if the authorization sorting status of the leaf resource node among all leaf resource nodes in its group corresponds to a unique device authorization node among all leaf resource nodes, then the authorization attribute identifier of the resource node belonging to the group of resource nodes is determined to be a non-selected attribute identifier; if the authorization sorting status of the leaf resource node among all leaf resource nodes in its group corresponds to a non-unique device authorization node among all leaf resource nodes, then the authorization attribute identifier of the resource node belonging to the group of resource nodes is determined 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 order status of the resource nodes in the group to which the leaf resource node belongs corresponds to that of all resource nodes in the group to which the root resource node belongs, and there is only one authorized device node in the group to which the leaf resource node belongs, then the authorization attribute identifier of the root resource node to which the leaf resource node belongs is determined to be a non-selected attribute identifier; if the authorization order status of the resource nodes in the group to which the leaf resource node belongs corresponds to that of all resource nodes in the group to which the root resource node belongs, and there is not only one authorized device node in the group to which the leaf resource node belongs, then the authorization attribute identifier of the root resource node to which the leaf resource node belongs is determined to be a semi-selected attribute identifier.
[0096] Based on the authorization sorting status of a group resource node among all group resource nodes contained in its root resource node, the authorization attribute identifier of the root resource node to which the group resource node belongs is determined. This may include: if the authorization sorting status of a group resource node among all group resource nodes contained in its root resource node corresponds to a unique device authorization node among all group resource nodes, then the authorization attribute identifier of the root resource node to which the group resource node belongs is determined to be a non-selected attribute identifier; if the authorization sorting status of a group resource node among all group resource nodes contained in its root resource node corresponds to a non-unique device authorization node among all group resource nodes, then the authorization attribute identifier of the root resource node to which the group resource node belongs is determined to be a semi-selected attribute identifier.
[0097] When deleting an authorized node from a resource node on a target resource tree, the process may further include: obtaining the corresponding authorized deletion node; if the authorized deletion node corresponds to a leaf resource node, deleting that 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 authorized attribute identifier of the root resource node to which the group resource node belongs based on the authorized sorting status of the group resource node among all group resource nodes contained in its root resource node; 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] Specifically, 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 group resource nodes contained in its root resource node, may include: if the authorization sorting status of the leaf resource node among all leaf resource nodes contained in its group resource node corresponds to the unique device authorization node among all leaf resource nodes, then the authorization attribute identifier of the group resource node to which the leaf resource node belongs is determined to be a non-selected attribute identifier; if the authorization sorting status of the leaf resource node among all leaf resource nodes contained in its group resource node corresponds to the not unique device authorization node among all leaf resource nodes, then the authorization attribute identifier of the group resource node to which the leaf resource node belongs is determined to be a semi-selected attribute identifier, and finally, the leaf resource node is deleted.
[0099] In summary, loading hundreds of thousands of data resources and tens of thousands of group nodes all at once on the resource tree can cause users to wait for tens of minutes, or even crash the browser (due to browser cache overload). The authorization tree uses lazy loading, loading nodes one level at a time, resulting in smooth page loading. Simultaneously, the state of each group (select all / partially select / deselect) is stored and maintained in the background.
[0100] It should be noted that in this embodiment, resource node authorization, resource node cancellation, resource node repair, and resource node deletion are all handled by the backend server using multiple threads, without the frontend being aware of them, and thus without affecting the frontend response.
[0101] Figure 3 This is a schematic diagram of a lazy loading device for granting large amounts of resource tree data in this embodiment. The lazy loading device for granting large amounts of resource tree data may include: a receiving module 310, an obtaining module 320, a first determining module 330, a second determining module 340, an updating module 350, and a display module 360.
[0102] The receiving module 310 is used to receive device authorization requests for a target resource tree. The target resource tree includes: multiple root resource nodes, multiple group resource nodes, and multiple leaf resource nodes. The group resource nodes are the subordinate nodes of the root resource nodes, and the leaf resource nodes are the subordinate nodes of the group resource nodes. The leaf resource nodes are used to describe remote devices with controllable permissions.
[0103] The acquisition module 320 is used to acquire the authorization operation node corresponding to the device authorization request. The authorization operation node is used to describe one of the root resource node, group resource node and leaf resource node.
[0104] The first determining 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 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 determining module 340 is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorized 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 group resource nodes contained in the root resource node to which it belongs.
[0106] The update module 350 is used to update the authorization attribute identifier of each group of resource nodes contained in the root resource node and the authorization attribute identifier of each leaf resource node if the authorized operation node corresponds to the root resource node.
[0107] The display module 360 is used to perform lazy loading display on the target resource tree based on the trigger node position of the trigger display operation when a user device triggers the display operation on the target resource tree. The lazy loading display is used to sequentially overlay and display resource node information of one level according to the successive trigger operations at different trigger node positions.
[0108] In this embodiment, optionally, the first determining module 330 is specifically used for:
[0109] If the authorization sorting status of a leaf resource node among all leaf resource nodes in its group is in the first authorization state, then the authorization attribute identifier of the resource node in the group to which the leaf resource node belongs is determined to be a half-selection attribute identifier; if the authorization sorting status of a leaf resource node among all leaf resource nodes in its group is in the second authorization state, then the authorization attribute identifier of the resource node in the group to which the leaf resource node belongs is determined to be a full-selection attribute identifier; wherein, 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 in its group, or that the leaf resource node is neither the first nor the last node to perform device authorization operation among all leaf resource nodes in its group, 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 in its group.
[0110] In this embodiment, optionally, the first determining module 330 is specifically used for:
[0111] Obtain the authorization sorting status of the resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node; if the authorization sorting status of the resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node 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 the half-selection attribute identifier; if the authorization sorting status of the resource nodes in the group to which the leaf resource node belongs among all the resource nodes in the group contained in the root resource node 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 the full selection attribute identifier.
[0112] In this embodiment, optionally, the second determining module 340 is specifically used for:
[0113] Update the authorization attribute identifier of each leaf resource node contained in the group resource node to the select all attribute identifier.
[0114] Update module 350, specifically used for:
[0115] Update the authorization attribute identifier of each group of resource nodes contained in the root resource node to the select all attribute identifier; update the authorization attribute identifier of each leaf resource node contained in the root resource node to the select all attribute identifier.
[0116] In this embodiment, optionally, a sending module is also included.
[0117] The 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 backend server when performing device authorization operation on the leaf resource node; when performing device authorization operation on the group resource node, it sends the authorization association relationship between the group resource node and the selected authorization subject triggered during the device authorization operation to the backend server; and when performing device authorization operation on the root resource node, it sends the authorization association relationship between the root resource node and the selected authorization subject triggered during the device authorization operation to the backend server.
[0118] In this embodiment, optionally, the update module 350 is further configured to: if the device authorization operation of the group resource node is interrupted after sending the authorization association relationship of the selected authorization subject triggered during the group resource node and device authorization operation to the backend server, then after the group resource node is lazy-loaded and displayed, update the authorization attribute identifier of the group resource node based on the authorization association relationship of the selected authorization subject triggered during the group resource node and device authorization operation recorded by the backend server; if the device authorization operation of the root resource node is interrupted after sending the authorization association relationship of the selected authorization subject triggered during the root resource node and device authorization operation to the backend server, then after the root resource node is lazy-loaded and displayed, update the authorization attribute identifier of the root resource node based on the authorization association relationship of the selected authorization subject triggered during the root resource node and device authorization operation recorded by the backend server.
[0119] In this embodiment, optionally, the acquisition module 320 is further configured to, if the device authorization operation of the leaf resource node is interrupted, 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. The behavior operation data is used to describe the trigger record of the authorization attribute identifier of the leaf resource node.
[0120] The update 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 big data resource tree authorization provided in this disclosure can execute the above method embodiments. Its specific implementation principle and technical effects can be found in the above method embodiments, and will not be repeated here.
[0122] This application also provides a computer device. Please refer to the following for details. 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 communicatively connected to each other via a system bus. It should be noted that only a computer device with memory 410 and processor 420 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing 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 (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0124] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.
[0125] The memory 410 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of a computer device, such as the hard disk or RAM 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 drive, Smart Media Card (SMC), Secure Digital (SD) card, or FlashCard. Of course, the memory 410 may include both internal and external storage units of the computer device. In this embodiment, the memory 410 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the methods described above. Furthermore, the memory 410 may also be used to temporarily store various types of data that have been output or will be output.
[0126] Processor 420 is typically used to perform overall operations of a computer device. In this embodiment, memory 410 is used to store program code or instructions, including computer operation instructions, and processor 420 is used to execute the program code or instructions stored in memory 410 or process data, such as program code that runs the methods described above.
[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. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0128] Another embodiment of this 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 computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or 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 suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.
[0130] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.
[0131] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0132] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0133] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0134] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this 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. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.
[0135] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A lazy loading method for granting permissions to large-scale resource trees, characterized in that, include: Receive a device authorization request for a target resource tree, the target resource tree including: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, the group resource nodes are the subordinate nodes of the root resource nodes, the leaf resource nodes are the subordinate nodes of the group resource nodes, and the leaf resource nodes are used to describe remote devices with controllable permissions; Obtain the 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 authorized operation node corresponds to the leaf resource node, then based on the authorized sorting status of the leaf resource node among all leaf resource nodes contained in its group of resource nodes, the authorized attribute identifier of the group resource node to which the leaf resource node belongs and the authorized attribute identifier of the root resource node to which the leaf resource node belongs are determined. If the authorized operation node corresponds to the group resource node, then the authorized attribute identifier of each leaf resource node contained in the group resource node is updated, and the authorized attribute identifier of the root resource node to which the group resource node belongs is determined based on the authorized sorting status of the group resource node in all group resource nodes contained in its root resource node. If the authorized operation node corresponds to the root resource node, then update the authorized attribute identifier of each group of resource nodes contained in the root resource node and the authorized attribute identifier of each leaf resource node; When a user device triggers a display operation on the target resource tree, the target resource tree is lazy-loaded based on the trigger node position of the trigger display operation. The lazy-loaded display is used to sequentially overlay and display resource node information of one level according to the 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 group resource nodes to which the leaf resource node belongs, based on the authorization sorting status of the leaf resource node among all leaf resource nodes in its group resource nodes, includes: If the authorization sorting status of the leaf resource node among all leaf resource nodes in the group of resource nodes to which the leaf resource node belongs is the first authorization status, then the authorization attribute identifier of the group of resource nodes to which the leaf resource node belongs is determined to be a half-selection attribute identifier. If the authorization sorting status of the leaf resource node among all leaf resource nodes in the group of resource nodes to which the leaf resource node belongs is the second authorization status, then the authorization attribute identifier of the group of resource nodes to which the leaf resource node belongs is determined to be the select all attribute identifier. Wherein, 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 of resource nodes, or that 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 group of resource nodes. 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 group of resource nodes.
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: Obtain the authorized sorting status of the group resource nodes to which the leaf resource node belongs among all group resource nodes contained in the root resource node; If the authorization sorting status of the group resource node to which the leaf resource node belongs is the third authorization status among all group resource nodes contained in the root resource node to which it belongs, then the authorization attribute identifier of the root resource node to which the leaf resource node belongs is determined to be the semi-selection attribute identifier. If the authorization sorting status of the group resource node to which the leaf resource node belongs is the fourth authorization status among all group resource nodes contained in the root resource node to which it belongs, then the authorization attribute identifier of the root resource node to which the leaf resource node belongs is determined to be the select all attribute identifier.
4. The method according to claim 3, characterized in that, The step of updating the authorization attribute identifier of each leaf resource node contained in the group of resource nodes includes: Update the authorized attribute identifier of each leaf resource node contained in the group of resource nodes to the selected all attribute identifier; Updating the authorization attribute identifier of each group of resource nodes included in the root resource node and the authorization attribute identifier of each leaf resource node includes: Update the authorization attribute identifier of each group resource node contained in the root resource node to the select all attribute identifier; Update the authorization attribute identifier of each leaf resource node contained in the root resource node to the select all attribute identifier.
5. The method according to claim 1, characterized in that, Also includes: When performing device authorization operations on the leaf resource node, the authorization association relationship between the leaf resource node and the authorized subject selected during the device authorization operation is sent to the backend server; When performing device authorization operations on the group of resource nodes, the authorization association relationship between the group of resource nodes and the authorized subject selected during the device authorization operation is sent to the backend server; When performing device authorization operations on the root resource node, the authorization association relationship between the root resource node and the authorized subject selected 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 authorized subject selected during the device authorization operation is sent to the backend 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 between the group resource node and the authorized subject selected during the device authorization operation recorded by the backend server. If the device authorization operation of the root resource node is interrupted after the authorization association between the root resource node and the authorized subject selected 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 between the root resource node and the authorized subject selected during the device authorization operation recorded by the backend 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, after the group of resource nodes is lazy-loaded and displayed, the behavior operation data of the leaf resource node is obtained from the front-end cache service. The behavior operation data is used to describe the trigger record of the authorization attribute identifier of the leaf resource node. Update the authorization attribute identifier of the leaf resource node based on the behavior operation data of the leaf resource node.
8. A lazy loading device for authorizing large-scale resource trees, characterized in that, include: The receiving module is used to receive device authorization requests for a target resource tree, the target resource tree including: multiple root resource nodes, multiple group resource nodes and multiple leaf resource nodes, the group resource nodes are the subordinate nodes of the root resource nodes, the leaf resource nodes are the subordinate nodes of the group resource nodes, and the leaf resource nodes are used to describe remote devices with controllable permissions. The acquisition module is used to acquire the 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; The first determining 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 leaf resource nodes contained in the group resource node to which the leaf resource node belongs, if the authorized operation node corresponds to the leaf resource node. The second determining module is used to update the authorization attribute identifier of each leaf resource node contained in the group resource node if the authorized 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 group resource nodes contained in the root resource node to which it belongs. The update module is used to update the authorization attribute identifier of each group of resource nodes included in the root resource node and the authorization attribute identifier of each leaf resource node if the authorized operation node corresponds to the root resource node. The display module is used to perform lazy loading display on the target resource tree based on the trigger node position of the trigger display operation when a user device triggers the display operation on the target resource tree. The lazy loading display is used to sequentially display resource node information of one level according to the successive trigger operations at different trigger node positions.
9. A computer device, characterized in that, It includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the lazy loading method for granting large data resource tree licenses as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the lazy loading method for granting large amounts of resource tree data as described in any one of claims 1 to 7.
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