A dynamic resource directory construction method, device and equipment and storage medium
By establishing the association between the resource directory information table, the tree node information table, and the directory tree information table, the problem of the inability to reuse existing resource directories is solved, and the association between the resource directory and multiple directory trees is realized, thereby improving configuration efficiency and response speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 武汉达梦数据技术有限公司
- Filing Date
- 2022-10-20
- Publication Date
- 2026-04-21
AI Technical Summary
The existing resource catalog relies on manual configuration, cannot be linked to multiple directory trees, cannot be reused, has low configuration efficiency, and cannot respond to business needs in a timely manner.
By acquiring directory classification requirements and system resource information, a resource directory information table, a tree node information table, and a directory tree information table are established. The association mapping table is used to realize the association between the resource directory and multiple directory trees, allowing the resource directory and system resources to be attached to the same directory tree, and supporting the addition, deletion, and modification of directories and the attachment of resources.
It enables rapid configuration and reuse of resource directories, reduces labor costs, improves response speed and work efficiency, and supports resource directory structure maintenance and system resource attachment operations between multiple directory trees.
Smart Images

Figure CN115905628B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data management technology, and more specifically to a dynamic resource catalog construction method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] A data platform possesses four core capabilities: data aggregation and integration, data purification and processing, data service visualization, and data value realization, enabling enterprise employees, customers, and partners to easily utilize data. As the types of resources within the data platform increase, finding specific resources becomes increasingly complex. Therefore, a method is needed to categorize and quickly locate resources, leading to the development of resource catalogs. Resource catalogs support the rapid creation of a directory structure that aligns with business relationships, distributing data resources to corresponding locations within this structure, thus forming multi-level relationships between resources. Users can quickly locate data resources based on the directory name.
[0003] In actual data usage, different business users have different needs for resource catalog categorization. Most existing solutions rely on manual configuration; when a new resource catalog categorization requirement arises, a new resource catalog is reconfigured. This means that catalog names, categories, and other information all need to be reconfigured, even if there are only minor differences between multiple catalogs. This approach wastes a significant amount of manpower and cannot respond promptly to the needs of business users.
[0004] Therefore, it is necessary to design a dynamic resource directory construction method that can change the attributes and hierarchical structure of the resource directory, quickly attach and associate system resources and resource directories, and enable resource reuse among multiple resource directories. Summary of the Invention
[0005] In view of this, it is necessary to provide a dynamic resource catalog construction method, apparatus, electronic device and computer-readable storage medium to solve the problems of existing resource catalogs relying on manual configuration, the inability to mount multiple directory trees to a single catalog, the inability to reuse resource catalogs and low configuration efficiency.
[0006] To address the above problems, this invention provides a dynamic resource catalog construction method, comprising:
[0007] Obtain directory classification requirements and system resource information;
[0008] Establish a resource catalog information table based on the aforementioned catalog classification requirements;
[0009] A tree node information table is established based on the system resource information;
[0010] Establish a directory tree information table that is interconnected with the tree node information table;
[0011] Establish an association mapping table to associate the resource directory information table and the directory tree information table.
[0012] Furthermore, the resource directory information table includes a resource directory primary key field, and the directory tree information table includes a directory tree primary key field;
[0013] The association mapping table associates the resource directory information table and the directory tree information table based on the resource directory primary key field and the directory tree primary key field.
[0014] Furthermore, the tree node information table includes a primary key field for the target tree;
[0015] Establish a directory tree information table that is interconnected with the tree node information table, including:
[0016] Based on the target tree primary key field of the tree node information table and the directory tree primary key field of the directory tree information table, establish the association between the tree node information table and the directory tree information table.
[0017] Furthermore, the tree node information table also includes a parent node field and a node primary key field;
[0018] The parent node field is associated with the node primary key field to establish a parent-child node relationship; wherein, the node primary key field corresponds to the system resource information.
[0019] Furthermore, the directory tree information table also includes a root primary key field:
[0020] The root primary key field of the directory tree information table is associated with the parent node field of the tree node information table.
[0021] Furthermore, the tree node information table also includes a template field;
[0022] The template field is used to determine whether it is necessary to associate the copied node with the primary key information of the original node when copying the node's primary key information.
[0023] Furthermore, the resource catalog information table also includes a display field;
[0024] The display field is used to set the presentation method of the resource catalog information table.
[0025] The present invention also provides a dynamic resource catalog building apparatus, comprising:
[0026] The information acquisition module is used to acquire directory classification requirements and system resource information;
[0027] The resource catalog information table creation module is used to create a resource catalog information table according to the catalog classification requirements.
[0028] The tree node information table creation module is used to create a tree node information table based on the system resource information.
[0029] The directory tree information table creation module is used to create a directory tree information table that is associated with the tree node information table.
[0030] The association mapping table creation module is used to create an association mapping table to associate the resource directory information table and the directory tree information table.
[0031] The present invention also provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it implements a dynamic resource catalog construction method as described in any of the above technical solutions.
[0032] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a dynamic resource catalog construction method as described in any of the above technical solutions.
[0033] Compared with existing technologies, the beneficial effects of this invention include: First, obtaining directory classification requirements and system resource information; second, establishing a resource directory information table based on the directory classification requirements and a tree node information table based on the system resource information; third, establishing a directory tree information table associated with the tree node information table; and finally, establishing an association mapping table to associate the resource directory information table and the directory tree information table. This invention, by establishing a tree node information table and associating it with the directory tree information table, and then using an association mapping table to associate the directory tree information table and the resource directory information table, achieves the association of resource directories with multiple directory trees. Furthermore, the maintenance of resource directories and the attachment of system resources to the same directory tree facilitate the addition, deletion, and modification of directories and their association with system resources. This invention can quickly configure resource directories according to the classification requirements of different business parties, enabling the reuse of multiple resource directories with the same directory classification. The resource directory structure is simple to maintain, facilitating the attachment of resource directories to system resources, greatly saving configuration time and improving work efficiency. Attached Figure Description
[0034] Figure 1 A flowchart illustrating an embodiment of a dynamic resource catalog construction method provided by the present invention;
[0035] Figure 2 This is a schematic diagram illustrating an embodiment of the association relationships between the resource directory information table, association table, directory tree information table, and tree node information table provided by the present invention.
[0036] Figure 3 A schematic diagram of an embodiment of the resource catalog display format provided by the present invention;
[0037] Figure 4 A schematic diagram of an embodiment of a dynamic resource catalog building device provided by the present invention;
[0038] Figure 5 A schematic diagram of the structure of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0039] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0040] Before describing the embodiments, the relevant terms used in this document will be explained.
[0041] System resources: Data tables, views, databases, data interfaces, files, etc. in the system.
[0042] Resource Directory: A directory structure that aligns with the company's business relationships, distributing multiple company accounts to corresponding locations within the directory structure, thereby forming a multi-level relationship between resources. Companies can rely on this directory structure for centralized management of accounts and resources, meeting unified control requirements in areas such as network deployment, billing, user permissions, security compliance, and log auditing.
[0043] Most existing resource directories are configured manually. A resource directory can only be associated with one directory tree, and directory maintenance and resource attachment are on different pages, requiring users to switch back and forth between the two pages for configuration. Multiple resource directories may have the same directories but cannot be reused, requiring the same resources to be reattached. Even minor differences between multiple directories necessitate reconfiguration, resulting in high labor costs and an inability to respond promptly to the needs of business users.
[0044] This invention presents a dynamic resource directory construction method that can associate a resource directory with multiple directory trees. Resource directories and system resources are attached to the same directory tree, facilitating the addition, deletion, and modification of resource directories, as well as the attachment of directories to system resources. System resources can be attached manually or copied or associated from another directory, avoiding duplicate configurations of the same directory, saving manpower costs, and improving response speed.
[0045] This invention provides a dynamic resource catalog construction method, such as... Figure 1 As shown, Figure 1 This is a flowchart illustrating the dynamic resource catalog construction method, including:
[0046] Step S101: Obtain directory classification requirements and system resource information;
[0047] Step S102: Establish a resource catalog information table according to the catalog classification requirements;
[0048] Step S103: Establish a tree node information table based on the system resource information;
[0049] Step S104: Establish a directory tree information table that is associated with the tree node information table;
[0050] Step S105: Establish an association mapping table to associate the resource directory information table and the directory tree information table.
[0051] The dynamic resource catalog construction method provided in this embodiment first obtains catalog classification requirements and system resource information; second, it establishes a resource catalog information table based on the catalog classification requirements and a tree node information table based on the system resource information; third, it establishes a catalog tree information table associated with the tree node information table; and finally, it establishes an association mapping table to associate the resource catalog information table and the catalog tree information table. This method, by establishing a tree node information table and associating it with the catalog tree information table, and then using an association mapping table to associate the catalog tree information table and the resource catalog information table, achieves the association of resource catalogs with multiple catalog trees. Furthermore, the maintenance of resource catalogs and the attachment of system resources to the same catalog tree facilitate the addition, deletion, and modification of catalogs and their association with system resources. This invention can quickly configure resource catalogs according to the classification requirements of different business parties, enabling the reuse of multiple resource catalogs with the same catalog classification. The resource catalog structure is simple to maintain, and the operation of attaching resource catalogs to system resources is convenient.
[0052] In a preferred embodiment, the resource directory information table includes a resource directory primary key field, and the directory tree information table includes a directory tree primary key field;
[0053] The association mapping table associates the resource directory information table and the directory tree information table based on the resource directory primary key field and the directory tree primary key field.
[0054] In a preferred embodiment, the tree node information table includes a primary key field for the target tree;
[0055] Establish a directory tree information table that is interconnected with the tree node information table, including:
[0056] Based on the target tree primary key field of the tree node information table and the directory tree primary key field of the directory tree information table, establish the association between the tree node information table and the directory tree information table.
[0057] In a preferred embodiment, the tree node information table further includes a parent node field and a node primary key field;
[0058] The parent node field is associated with the node primary key field to establish a parent-child node relationship; wherein, the node primary key field corresponds to the system resource information.
[0059] In a preferred embodiment, the directory tree information table further includes a root primary key field:
[0060] The root primary key field of the directory tree information table is associated with the parent node field of the tree node information table.
[0061] As a specific implementation, Tables 1, 2, 3, and 4 illustrate the specific forms of the resource directory information table, association mapping table, directory tree information table, and tree node information table, respectively. Specifically, the resource directory information table is associated with the association mapping table through the resource directory primary key ID, and the association mapping table records the corresponding resource directory primary key ID; the association mapping table is associated with the directory tree information table through the directory tree primary key TREE_ID; the directory tree information table is associated with the target tree primary key of the tree node information table through the directory tree primary key TREE_ID, and corresponds to the PARENT_NODE_ID in the tree node information table through the ROOT_ID field; in the directory tree information table, the node field NODE_ID is associated with the parent node field PARENT_NODE_ID; and system resources are stored as nodes in the tree node information table. Therefore, system resources can be attached to the directory tree as nodes, or copied or associated from an existing directory node in the directory tree to the current directory, thus forming a resource directory tree.
[0062] To more intuitively illustrate the relationships between the four tables—the resource directory information table, the association table, the directory tree information table, and the tree node information table—as follows: Figure 2 As shown, Figure 2 The relationships between the four tables are shown.
[0063] like Figure 2 The resource directory information table is associated with the association mapping table through the id field; the association mapping table is associated with the directory tree information table through the tree_id field; the directory tree information table is associated with the tree node information table through the tree_id field, and corresponds to the parent_node_id field in the tree node information table through the root_id field, which facilitates resource searching; in the tree node information table, node_id is associated with parent_node_id to determine the parent node information of the node.
[0064] It should be noted that the directory tree information table and the tree node information table are associated through `tree_id` and `root_id`. This is to facilitate the use of recursive queries in SQL to associate system resources. In SQL, recursive queries are implemented using CTEs (Table Expressions). At least two queries are required: the first query is for a fixed-point member, returning a valid table used as the basis or location point for recursion; the second query is for recursive members, stopping only when the second recursive query returns null or exceeds the maximum number of recursions. This query method improves query speed with large datasets. In this embodiment, the valid tree node information table is located using `tree_id`, and the recursive member is found by matching `root_id` with `parent_node_id`, quickly locating the required node.
[0065] Table 1 Resource Catalog Information
[0066]
[0067] Table 2 Association Mapping Table
[0068] Serial Number Field Name type describe Example 1 ID VARCHAR Mapping table primary key MAPPING_001 2 RESOURCE_DIR_ID VARCHAR Resource directory primary key RES_DIR_001 3 TREE_ID VARCHAR Directory tree primary key TREE_001 4 ORDER_NO VARCHAR Sort number 1
[0069] Table 3 Directory Tree Information Table
[0070] Serial Number Field Name type describe Example 1 TREE_ID VARCHAR Directory tree primary key TREE_001 2 TREE_NAME VARCHAR Tree Name XX Tree 3 ROOT_ID VARCHAR Root ID 11 4 ORDER_NO VARCHAR Sort number 1
[0071] Table 4 Tree Node Information Table
[0072]
[0073] In order to flexibly configure the display format of the resource catalog, as a preferred embodiment, the resource catalog information table also includes a display field;
[0074] The display field is used to set the presentation method of the resource catalog information table.
[0075] As a specific example, such as Figure 3 As shown, Figure 3 This demonstrates various resource catalog display formats, including tab layouts, button-to-switch layouts, and multi-level tree layouts, allowing users to choose the appropriate display view based on their needs. From Figure 3 As can be seen, a resource directory can be associated with multiple directory trees, and directory maintenance and resource attachment can be performed on the same page.
[0076] As a specific implementation, when a new resource directory needs to be added, basic information about the resource directory is added to the resource directory information table, configuring the resource directory name and description. Tree information is added to the directory tree information table, configuring basic information such as the tree name and description. Nodes are added under the directory tree according to business needs, adding attributes such as node name, node code, and sort number. The node information is stored in the tree node information table. The association information between the resource directory and the directory tree is stored in the association mapping table.
[0077] Once the nodes are added, the directory tree will be displayed on the resource directory interface, allowing users to modify, delete, and drag and drop to sort the directory. Multi-level subdirectories can be added (e.g., the structure of a data resource directory for a specific industry might be "Industry-Unit-Department-System").
[0078] As a specific implementation, when associating the resource directory information table with system resources, select a node in a directory tree under the resource directory, check one or more system resources to be attached, and click the mount button. The backend will build a node with the detailed information of each resource. The parent node of this node corresponds to the root ID of the tree directory to which it needs to be attached, thereby forming an association between the resource directory and the system resources.
[0079] As a specific implementation, when multiple resource directories need to reuse system resources, selecting a pre-configured resource directory tree B displays all directory nodes under resource directory B. Selecting a directory under resource directory tree B and clicking the copy button will copy all nodes under the directory to generate new nodes. The copied nodes have no relation to the original nodes, and modifications or deletions to the source nodes will have no impact on the new nodes.
[0080] To improve the flexibility of node reuse, as a preferred embodiment, the tree node information table also includes a template field;
[0081] The template field is used to determine whether it is necessary to associate the copied node with the primary key information of the original node when copying the node's primary key information.
[0082] As a specific example, when it is necessary to retain the correspondence between the copied node and the original node, that is, when the source node is modified or deleted, the associated ID can also be used to modify or delete the corresponding node in the new directory tree, the associated button can be clicked. At this time, the template ID in the tree node information table will be set to the information of the copied source node ID. The specific backend operation is as follows: a copy is made to generate a new node, but the ID of the original node will be recorded on the copied node, thereby retaining the correspondence between the copied node and the original node. This allows the associated ID to modify or delete the corresponding node in the new directory tree after the source node is modified or deleted, which greatly saves configuration time and improves work efficiency.
[0083] This invention also provides a dynamic resource catalog construction apparatus, such as... Figure 4 As shown, Figure 4 This embodiment also provides a structural schematic diagram of a dynamic resource catalog building device 400, including:
[0084] Information acquisition module 401 is used to acquire directory classification requirements and system resource information;
[0085] Resource catalog information table creation module 402 is used to create a resource catalog information table according to the catalog classification requirements;
[0086] Tree node information table creation module 403 is used to create a tree node information table based on the system resource information;
[0087] The directory tree information table creation module 404 is used to create a directory tree information table that is associated with the tree node information table.
[0088] The association mapping table establishment module 405 is used to establish an association mapping table to associate the resource directory information table and the directory tree information table.
[0089] like Figure 5 As shown in the above-described dynamic resource catalog construction method, this invention also provides an electronic device 500, which can be a mobile terminal, desktop computer, laptop, handheld computer, server, or other computing device. The electronic device includes a processor 501, a memory 502, and a display 503.
[0090] In some embodiments, memory 502 may be an internal storage unit of a computer device, such as a hard disk or RAM. In other embodiments, memory 502 may be an external storage device of a computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory 502 may include both internal and external storage units. Memory 502 is used to store application software and various types of data installed on the computer device, such as program code for installing the computer device. Memory 502 may also be used to temporarily store data that has been output or will be output. In one embodiment, memory 502 stores a dynamic resource catalog construction method program 504, which can be executed by processor 501 to implement a dynamic resource catalog construction method according to various embodiments of the present invention.
[0091] In some embodiments, processor 501 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 502 or process data, such as executing a dynamic resource catalog construction method program.
[0092] In some embodiments, display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 503 is used to display information on the computer device and to display a visual user interface. Components 501-503 of the computer device communicate with each other via a system bus.
[0093] This embodiment also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements a dynamic resource catalog construction method as described in any of the above technical solutions.
[0094] The computer-readable storage medium and computing device provided in the above embodiments of the present invention can be implemented with reference to the content specifically described in the above-described method for constructing a dynamic resource catalog, and have similar beneficial effects to the above-described method for constructing a dynamic resource catalog, which will not be repeated here.
[0095] This invention provides a dynamic resource catalog construction method, apparatus, electronic device, and storage medium. First, it acquires catalog classification requirements and system resource information. Second, it establishes a resource catalog information table based on the catalog classification requirements and a tree node information table based on the system resource information. Third, it establishes a catalog tree information table associated with the tree node information table. Finally, it establishes an association mapping table to associate the resource catalog information table and the catalog tree information table.
[0096] This invention establishes a tree node information table and associates it with a directory tree information table. Furthermore, it uses a mapping table to link the directory tree information table and the resource directory information table, enabling the association of resource directories with multiple directory trees. The maintenance of resource directories and the attachment of system resources to the same directory tree facilitates the addition, deletion, and modification of directories and their attachment to system resources. This invention can quickly configure resource directories according to the classification requirements of different business parties, allowing multiple resource directories with the same directory category to be reused. The resource directory structure is simple to maintain, and the attachment of resource directories to system resources is convenient.
[0097] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A dynamic resource catalog construction method, characterized in that, include; Obtain directory classification requirements and system resource information; Establish a resource catalog information table based on the aforementioned catalog classification requirements; A tree node information table is established based on the system resource information; Establish a directory tree information table that is interconnected with the tree node information table; Establish an association mapping table to associate the resource directory information table and the directory tree information table; the resource directory information table includes a resource directory primary key field, and the directory tree information table includes a directory tree primary key field; The association mapping table associates the resource directory information table and the directory tree information table based on the resource directory primary key field and the directory tree primary key field; The tree node information table includes the primary key field of the target tree; Establish a directory tree information table that is interconnected with the tree node information table, including: Based on the target tree primary key field of the tree node information table and the directory tree primary key field of the directory tree information table, establish the association between the tree node information table and the directory tree information table; The tree node information table also includes a parent node field and a node primary key field; The parent node field is associated with the node primary key field to establish a parent-child node relationship; wherein, the node primary key field corresponds to the system resource information; The directory tree information table also includes a root primary key field: The root primary key field of the directory tree information table is associated with the parent node field of the tree node information table.
2. The dynamic resource catalog construction method according to claim 1, characterized in that, The tree node information table also includes a template field; The template field is used to determine whether it is necessary to associate the copied node with the primary key information of the original node when copying the node's primary key information.
3. The dynamic resource catalog construction method according to claim 1, characterized in that, The resource catalog information table also includes display fields; The display field is used to set the presentation method of the resource catalog information table.
4. A dynamic resource catalog construction apparatus, applicable to the dynamic resource catalog construction method according to any one of claims 1-3, characterized in that, include: The information acquisition module is used to acquire directory classification requirements and system resource information; The resource catalog information table creation module is used to create a resource catalog information table according to the catalog classification requirements. The tree node information table creation module is used to create a tree node information table based on the system resource information. The directory tree information table creation module is used to create a directory tree information table that is associated with the tree node information table. The association mapping table creation module is used to create an association mapping table to associate the resource directory information table and the directory tree information table.
5. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements a dynamic resource catalog construction method as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements a dynamic resource catalog construction method as described in any one of claims 1-3.
Citation Information
Patent Citations
Method for constructing tree structural directory in database
CN102096711A
Catalog compiling method and device
CN112182138A