Multi-dimensional resource dynamic management and efficient access method, terminal equipment and storage medium

By constructing a hierarchical tree node data structure and a multidimensional index mapping table, resource indexes are dynamically managed, enabling efficient access to multidimensional resources and caching strategies. This solves the problem that hierarchical structures cannot adapt to dynamic changes, and improves the efficiency of batch data traversal and the differentiated needs of cache management.

CN122019533APending Publication Date: 2026-05-12XIAMEN XINGZONG DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN XINGZONG DIGITAL TECH CO LTD
Filing Date
2025-12-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, static hierarchical structures cannot adapt to dynamic resource changes, multi-dimensional resource index mapping is difficult, unified caching strategies cannot meet differentiated needs, and batch data traversal is inefficient.

Method used

By defining the node data structure of the hierarchical tree, a static hierarchical skeleton structure is constructed, resource index nodes are dynamically added, a multi-dimensional index mapping table is established, a hierarchical caching strategy and batch cache writing are implemented, an optimized depth-first search algorithm is used for batch traversal, and cache consistency is guaranteed.

Benefits of technology

It enables the construction of dynamic hierarchical structures, supports efficient indexing of multi-dimensional resources and differentiated cache management, improves the efficiency of batch data traversal, and ensures the consistency and availability of cached data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019533A_ABST
    Figure CN122019533A_ABST
Patent Text Reader

Abstract

The invention provides a multi-dimensional resource dynamic management and efficient access method, terminal equipment and a storage medium. The method comprises the following steps: defining a node data structure of a hierarchical tree; constructing a static hierarchical skeleton structure of the hierarchical tree; dynamically adding resource index nodes; establishing a multi-dimensional index mapping table; establishing a node ID index mapping table; realizing a hierarchical caching strategy; batch cache writing is realized; efficient subsequent node traversal is realized; batch traversal operation is realized; and the cache consistency is ensured. According to the method, dynamic construction of hierarchical data, efficient indexing of multi-dimensional resources, differentiated cache management and rapid traversal of batch data can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of distributed data management technology, specifically referring to a method, terminal device and storage medium for dynamic management and efficient access of multi-dimensional resources. Background Technology

[0002] In modern distributed systems, management information is typically organized using a hierarchical tree structure. This structure is widely used in network device management, where objects are organized using object identifiers (OIDs); in file systems, where files and directories are organized using path hierarchies; in organizational structures, where departmental and personnel relationships are represented using tree structures; and in resource catalogs, where various resources are organized using classification hierarchies, and in other hierarchical data management.

[0003] In current cloud computing and distributed systems, managed resources typically possess multiple dimensions of attributes, presenting challenges in managing multidimensional resources. Take server monitoring as an example: at the server level, there's the attribute of which server the resource belongs to; at the device level, there's the attribute of a specific device identifier; and at the time level, there's the attribute of the data collection time and validity period.

[0004] Therefore, existing technologies suffer from the following problems: First, the hierarchical structure is static and cannot adapt to dynamic resource changes. Traditional hierarchical data structures are determined at design time and are difficult to dynamically adjust at runtime. When managed resources change (e.g., adding servers or deleting devices), the entire data structure needs to be rebuilt, or even the system restarted. This is particularly inconvenient in cloud environments where resources can scale elastically. Second, the difficulty of indexing and mapping multi-dimensional resources. Traditional hierarchical structures typically use a single integer index. For resources with multiple dimensions, a single index cannot express the multi-dimensional ownership relationships of the resource. For example, a disk device may belong to both a server and a device path; a single index cannot simultaneously express both dimensions. Third, a unified caching strategy cannot meet differentiated needs. Different types of monitoring data have different change frequencies and real-time requirements. For example, high-frequency data (e.g., CPU utilization) changes on a second-by-second basis and requires high real-time performance; medium-frequency data (e.g., online user count) changes on a minute-by-minute basis and requires moderate real-time performance; low-frequency data (e.g., configuration information) changes on an hour-by-hour basis or less and only requires relatively low real-time performance. A uniform cache expiration time (Time-To-Live, TTL) cannot simultaneously meet these diverse needs. There is also the problem of inefficient batch data traversal. When traversing large amounts of data in a hierarchical structure, traditional linear search methods are inefficient. Especially during batch queries, processing data row by row generates a large amount of redundant computation and network round trips. Summary of the Invention

[0005] To overcome the shortcomings of the prior art, this application provides a method, terminal device and storage medium for multi-dimensional resource dynamic management and efficient access, which can solve the above problems.

[0006] This invention provides a method for dynamic management and efficient access to multi-dimensional resources, the method comprising: Step S1: Define the node data structure of the hierarchical tree; Step S2: Construct the static hierarchical skeleton structure of the hierarchical tree; Step S3: Dynamically add resource index nodes; Step S4: Establish a multidimensional index mapping table; Step S5: Establish a node ID index mapping table; Step S6: Implement a tiered caching strategy; Step S7: Perform batch cache writing; Step S8: Implement efficient successor node traversal; Step S9: Implement batch traversal operations; Step S10: Implement cache consistency guarantee.

[0007] Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S1, defining the node data structure of the hierarchical tree, the node classes of the hierarchical tree are designed, and each node contains the following attributes: Node identifier: Represented by ID, which serves as the unique identifier of the node and is a dot-separated sequence of integers; Child node collection: Stored using a TreeSet ordered collection based on a red-black tree, automatically sorted by identifier lexicographical order; Parent node reference: A reference pointing to the parent node, used for backtracking operations; Node metadata: Stores additional information about the node; The child node set is stored using a TreeSet ordered set based on a red-black tree, and the child node set includes: The time complexity of both insertion and search operations is 0 log k, where k is the number of child nodes; Child nodes are automatically sorted by identifier and support efficient traversal operations; Supports range queries, allowing you to quickly retrieve child nodes within a specified range.

[0008] Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S2, constructing the static hierarchical skeleton structure of the hierarchical tree, constructing the static skeleton structure of the hierarchical tree according to the predefined hierarchical tree data model includes: Create the root node and set its identifier; Traverse the data model definition and create a tree node for each data object; For scalar single-value objects, create an additional leaf node with a ".0" suffix; Parse the identifier of each node, determine its parent node, and add the node to the set of child nodes of the parent node; In step S3, dynamically adding resource index nodes, after the static skeleton of the hierarchical tree is constructed, the actual resource list in the current system is queried, and an index node is dynamically added under the corresponding table entry node for each resource entity, including: Query a relational database to retrieve resource configuration information; Query the time-series database to obtain a list of dynamic resources; Each resource is assigned a unique integer index, which increments from 1. Add an index node at the corresponding position in the hierarchy tree. The node identifier format is "parent node ID.index value".

[0009] Furthermore, according to the multidimensional resource dynamic management and efficient access method provided in this application, in step S4, establishing a multidimensional index mapping table, for resources with multidimensional attributes, a mapping relationship between tag combinations and the index is established, including: Extract dimension labels from time-series database query results; Sort by lexicographical order of dimension label values ​​to ensure the stability of index allocation; Assign a unique integer index to each dimension label combination; The mapping relationship is stored in a distributed cache, where the key format is: {prefix}:index:{resource type}:{dimensional 1 value}:{dimensional 2 value}; Establish inter-dimensional relational indexes.

[0010] Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S5, establishing the node ID index mapping table, a hash table is constructed, with the node ID as the key and the corresponding tree node as the value: Locating a node corresponding to a specific ID can be completed in 0 or 1 time intervals; The node ID index mapping table is generated after the hierarchical tree is built and is updated synchronously when the hierarchical tree structure changes; In step S6, implementing the tiered caching strategy includes: Based on the frequency of data changes, the data is divided into multiple cache levels, and different cache expiration times and collection cycles are set for each level. The formula for coordinating cache expiration time and collection cycle is: Cache expiration time = Collection cycle × Buffer coefficient; where the buffer coefficient is 1.2 to 1.5. Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S7, implementing batch cache writing, a distributed cache pipeline mechanism is used to implement batch writing, including: Create batch operation objects; Iterate through the data items to be cached and add an asynchronous SET operation for each data item; Set the appropriate cache expiration time based on the data's cache level; Perform batch operations to submit all write commands at once; In step S8, achieving efficient successor node traversal, when it is necessary to traverse the hierarchical structure, an optimized depth-first search algorithm is used, including: Quickly locate the current node: Directly locate the node corresponding to the request ID in time complexity of 0 or 1 using the node ID index mapping table; Finding a successor node: If the current node has children, return the first child node; if the current node has no children, search for the next sibling node in the set of children of the parent node; if there is no next sibling node, backtrack to the ancestor node and repeat the above process. Return result: Returns the ID of the successor node and its corresponding data value.

[0011] Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S9, implementing batch traversal operations, for batch query requests, it supports obtaining multiple successor nodes at once, including: Parse the batch request parameters, including the starting position and the maximum number of responses; Starting from the initial position, perform successor node lookup multiple times consecutively; By utilizing the ordered structure of the hierarchical tree, the successor node can be obtained directly along the preorder traversal path; Implement a response size limit, stopping iteration when the number of results reaches the limit; Pack all results and return them.

[0012] Furthermore, according to the multi-dimensional resource dynamic management and efficient access method provided in this application, in step S10, ensuring cache consistency, guaranteeing the consistency and availability of cached data includes: Cache expiration time fault tolerance design: The cache expiration time is set to 1.2-1.5 times the collection cycle to provide a buffer for collection latency; Data collection retry mechanism: When a data source query fails, it will retry within a short period of time; Cache degradation strategy: When the backend data source is unavailable, extend the expiration time of the existing cache, continue to provide services using "old but available" data, and mark the data status; Health check: Regularly check the freshness of cached data and trigger supplementary data collection when anomalies are detected.

[0013] On the other hand, this application also provides a multi-dimensional resource dynamic management and efficient access terminal device, including a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0014] On the other hand, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0015] The beneficial effects of this invention are as follows: The multidimensional resource dynamic management and efficient access method provided in this application dynamically constructs a hierarchical tree structure at runtime, supporting the construction of a dynamic hierarchical structure for the dynamic addition and subtraction of resources; it maps multidimensional resource attributes to composite indexes, supporting a multidimensional index mapping mechanism for filtering queries by dimension; it sets differentiated cache TTL and hierarchical caching strategies based on data change frequency and optimizes batch traversal by using ordered data structures to achieve efficient batch data traversal, thus realizing the dynamic construction of hierarchical data, efficient indexing of multidimensional resources, differentiated cache management, and fast traversal of batch data. Attached Figure Description

[0016] The technical solution and other beneficial effects of this application will become apparent from the following detailed description of specific embodiments in conjunction with the accompanying drawings.

[0017] Figure 1 This is a flowchart illustrating a method for dynamic management and efficient access to multi-dimensional resources provided in an embodiment of the present invention.

[0018] Figure 2 This is an architecture diagram of a multi-dimensional resource dynamic management and efficient access method provided in an embodiment of the present invention.

[0019] Figure 3 This is a flowchart illustrating the dynamic construction of a hierarchical tree according to an embodiment of the present invention.

[0020] Figure 4 A schematic diagram of a multidimensional index mapping provided for an embodiment of the invention. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0022] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0023] The following disclosure provides many different embodiments or examples for implementing different structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. In addition, various specific examples of processes and materials are provided in this application, but those skilled in the art will recognize the application of other processes and / or the use of other materials.

[0024] The embodiments of this application will now be further described in conjunction with the accompanying drawings and specific implementation details.

[0025] Example 1: Figure 1 This is a flowchart illustrating a method for dynamic management and efficient access to multi-dimensional resources provided in an embodiment of the present invention. Figure 2 This is an architecture diagram of a multi-dimensional resource dynamic management and efficient access method provided in an embodiment of the present invention. Figure 1 , Figure 2 As shown, the multi-dimensional resource dynamic management and efficient access method provided in this embodiment includes: Step S1: Define the node data structure of the hierarchical tree.

[0026] The node class for designing the hierarchical tree includes the following attributes for each node: Node identifier: Represented by ID, which serves as the unique identifier of the node and is a dot-separated sequence of integers; Child node collection: Stored using a TreeSet ordered collection based on a red-black tree, automatically sorted by identifier lexicographical order; Parent node reference: A reference pointing to the parent node, used for backtracking operations; Node metadata: Stores additional information about the node. This additional information includes data type, access permissions, and other information.

[0027] The child node set is stored using a TreeSet ordered set based on a red-black tree, and the characteristics of the child node set include: The time complexity of both insertion and search operations is 0 (log k), where k is the number of child nodes; Child nodes are automatically sorted by identifier and support efficient traversal operations; Supports range queries, allowing you to quickly retrieve child nodes within a specified range.

[0028] Figure 3 This is a flowchart illustrating the dynamic construction of a hierarchical tree according to an embodiment of the present invention. Figure 3 As shown, in this embodiment, the dynamic construction of the hierarchical tree specifically includes: Step S2: Construct the static hierarchical skeleton structure of the hierarchical tree.

[0029] In this embodiment, constructing the static skeleton structure of the hierarchical tree according to the predefined data model specifically includes: Create the root node and set its identifier; Traverse the data model definition and create a tree node for each data object; For scalar single-value objects, create an additional leaf node with a ".0" suffix; Parse the identifier of each node, determine its parent node, and add the node to the set of child nodes of the parent node.

[0030] Step S3: Dynamically add resource index nodes.

[0031] In this embodiment, after the static skeleton is constructed, the actual resource list in the current system is queried, and an index node is dynamically added to the corresponding table entry node for each resource entity, including: The resource configuration information is obtained by querying a relational database; the resource configuration information includes information such as server list and device configuration.

[0032] Query the time-series database to obtain a dynamic resource list; wherein, the dynamic resource list includes information such as disk devices and network interfaces.

[0033] Each resource is assigned a unique integer index, which increments from 1. Add an index node at the corresponding position in the hierarchy tree. The node identifier format is "parent node ID.index value".

[0034] Figure 4 A schematic diagram of a multidimensional index mapping provided for an embodiment of the invention.

[0035] like Figure 4 As shown, the multidimensional index mapping includes: Step S4: Establish a multidimensional index mapping table.

[0036] In this embodiment, for resources with multi-dimensional attributes, establishing the mapping relationship between tag combinations and indexes specifically includes: Extract dimension labels from the query results of the time series database; for example, dimension labels such as node_name and device.

[0037] Sort by lexicographical order of dimension label values ​​to ensure the stability of index allocation.

[0038] Assign a unique integer index to each dimension label combination.

[0039] The mapping relationship is stored in a distributed cache, where the key format is: {prefix}:index:{resource type}:{dimensional 1 value}:{dimensional 2 value}.

[0040] When creating a multidimensional index mapping table, it is also necessary to create relational indexes between dimensions. Specifically, in addition to the global index of the resource itself, relational indexes with other dimensions are also recorded. For example, a disk device records the index of its own server, supporting filtering by server.

[0041] Step S5: Establish a node ID index mapping table.

[0042] Construct a hash table with node IDs as keys and corresponding tree nodes as values, including: Locating a node corresponding to a certain ID can be completed in 0 (1) time; The node ID index mapping table is generated after the hierarchical tree is built and is updated synchronously when the hierarchical tree structure changes. Step S6: Implement a tiered caching strategy.

[0043] Based on the frequency of data changes, the data is divided into multiple cache levels, and a different TTL and collection cycle are set for each level.

[0044] Specifically, Table 1 below provides a hierarchical caching strategy in this embodiment, as shown in Table 1 below.

[0045]

[0046] Table 1.

[0047] In this embodiment, the coordination formula between TTL and acquisition period is as follows: TTL = Acquisition period × Buffer coefficient; In this embodiment, the buffer coefficient is between 1.2 and 1.5. This design ensures that the cache is refreshed before it expires, avoiding a window of time when data is unavailable.

[0048] Step S7: Implement batch cache writing.

[0049] Specifically, in this embodiment, a distributed caching Pipeline mechanism is used to implement batch writes, including: Create batch operation objects; Iterate through the data items to be cached and add an asynchronous SET operation for each data item; Set the appropriate cache expiration time based on the data's cache level; Perform batch operations to submit all write commands at once.

[0050] Batch writing can reduce the number of network round trips from N to 1, significantly improving system throughput.

[0051] Step S8: Implement efficient successor node traversal.

[0052] When it is necessary to traverse a hierarchical structure, an optimized depth-first search algorithm can be used, including: Quickly locate the current node: directly locate the node corresponding to the request ID in O(1) time complexity by using the node ID index mapping table; Find the successor node: If the current node has child nodes, return the first child node (TreeSet.first(), 0(1) operation); If the current node has no children, search for the next sibling node in the set of children of the parent node (TreeSet.higher(), 0(log k) operation). If there is no next sibling node, backtrack to the ancestor node and repeat the above process; Return result: Returns the ID of the successor node and its corresponding data value.

[0053] Step S9: Implement batch traversal operations.

[0054] For batch query requests, it is supported to retrieve multiple successor nodes at once, including: Parse the batch request parameters, including the starting position and the maximum number of responses; Starting from the initial position, perform successor node lookup multiple times consecutively; By utilizing the ordered structure of the hierarchical tree, the successor node can be obtained directly along the preorder traversal path; Implement a response size limit, stopping iteration when the number of results reaches the limit; Pack all results and return them.

[0055] Step S10: Implement cache consistency guarantee.

[0056] To ensure the consistency and availability of cached data, the following methods are used: Cache expiration time fault tolerance design: The cache expiration time is set to 1.2-1.5 times the collection cycle to provide a buffer for collection latency; Data collection retry mechanism: When a data source query fails, it will retry within a short period of time; Cache degradation strategy: When the backend data source is unavailable, extend the expiration time of the existing cache, continue to provide services using "old but available" data, and mark the data status; Health check: Regularly check the freshness of cached data and trigger supplementary data collection when anomalies are detected.

[0057] In summary, the multidimensional resource dynamic management and efficient access method provided in this embodiment achieves dynamic construction of hierarchical tree structures at runtime, supporting dynamic addition and removal of resources; it maps multidimensional resource attributes to composite indexes, supporting a multidimensional index mapping mechanism for dimension-based filtering and querying; it sets differentiated cache TTL and collection cycle hierarchical caching strategies based on data change frequency; and it optimizes batch traversal by utilizing ordered data structures to achieve efficient batch data traversal. This enables dynamic construction of hierarchical data, efficient indexing of multidimensional resources, differentiated cache management, and fast batch data traversal.

[0058] Specifically, in this embodiment, incremental updates of the hierarchical tree can also be performed. In addition to periodic full reconstruction, an incremental update mechanism can be implemented. When a resource change event is detected, only the affected subtree portion is updated, reducing reconstruction overhead.

[0059] Alternatively, a multi-level caching architecture can be implemented. This can be achieved using a combination of local memory caching and distributed caching. The local cache uses a shorter TTL (e.g., 5 seconds), while the distributed cache employs the patented tiered TTL strategy to further reduce access latency.

[0060] Alternatively, the TTL can be dynamically adjusted. The TTL can be dynamically adjusted based on the actual rate of change of the data. The rate of change is monitored; when the rate of change decreases, the TTL is automatically extended; when the rate of change increases, the TTL is automatically shortened.

[0061] Alternatively, parallel traversal optimization can be adopted. For multiple starting positions in a batch traversal request, they can be processed separately in parallel, and then the results can be merged, further reducing the processing time by utilizing multi-core CPUs.

[0062] Alternatively, prefetching optimization can be implemented. When processing traversal requests, the nodes that will be accessed later can be predicted, and data can be prefetched from the cache in advance, hiding cache access latency and improving overall efficiency.

[0063] Alternatively, a composite primary key index can be used. In some scenarios, a combination of multiple dimensions can be used as the primary key index (such as server ID + device name), allowing direct location of records through the values ​​of two dimensions.

[0064] Alternatively, cross-table joins can be performed. The extensible query feature supports cross-table joins similar to SQL JOIN. The client sends a query request in a specific format, and the system returns the joined result set.

[0065] Therefore, the multi-dimensional resource dynamic management and efficient access method provided in this embodiment has the following beneficial effects: The hierarchical tree is dynamically constructed and stored in an ordered manner at runtime. The hierarchical tree structure provided in this embodiment is dynamically constructed at runtime, using an ordered set (TreeSet) based on a red-black tree to store child nodes. This design has the following advantages: Dynamic adaptability: No system restart is required when resources change; the tree is periodically reconstructed via a scheduled task, automatically synchronizing with actual resources. Ordered storage: Child nodes are automatically sorted by identifier; the time complexity of obtaining the first child node is O(1), and the time complexity of finding the next sibling node is O(log k). Efficient traversal is also achieved: The time complexity of finding a successor node is reduced from the traditional O(n) to O(d + log k), where d is the node depth and k is the number of sibling nodes. Composite indexing and association mapping of multidimensional resources. The method provided in this embodiment divides cache levels according to data change frequency, and sets differentiated TTLs and collection periods for each level, specifically including: High-frequency data, short TTL (20 seconds) + short acquisition cycle (15 seconds) to ensure second-level real-time performance; Low-frequency data, long TTL (6 minutes) + longer acquisition cycle, reduce reconstruction overhead; TTL is coordinated with the acquisition cycle. TTL = acquisition cycle × buffer coefficient (the buffer coefficient is 1.2-1.5) to ensure that the buffer will not expire before the next acquisition.

[0066] Batch operations and response size control. This embodiment implements several batch optimizations, specifically including: Batch cache writing uses a pipeline mechanism to package multiple write operations, reducing network round trips from N to 1, resulting in a performance improvement of approximately 500 times. Batch traversal optimization utilizes the ordered structure of the hierarchical tree to continuously obtain successor nodes along the preorder traversal path; Response size limits are implemented by checking the size in real time during response construction and gracefully truncating responses when the limit is exceeded to avoid transmission issues.

[0067] And cache consistency and degradation strategies. This embodiment implements a comprehensive cache consistency guarantee mechanism, specifically including: TTL fault-tolerant design provides a 20%-50% buffer margin for acquisition latency; A data acquisition retry mechanism is implemented, allowing data source queries to retry within a short period of time if the query fails. The cache degradation strategy extends the TTL when the data source is unavailable, continues service using stale data, and marks the status and sends alarms. Example 2: This embodiment also provides a multi-dimensional resource dynamic management and efficient access terminal device. The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the embodiments of the method described in Embodiment 1 of the present invention.

[0068] Furthermore, as an executable solution, the multi-dimensional resource dynamic management and efficient access terminal device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The multi-dimensional resource dynamic management and efficient access terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described composition of the multi-dimensional resource dynamic management and efficient access terminal device is merely an example and does not constitute a limitation on the multi-dimensional resource dynamic management and efficient access terminal device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the multi-dimensional resource dynamic management and efficient access terminal device may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.

[0069] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the multi-dimensional resource dynamic management and efficient access terminal device, connecting all parts of the device via various interfaces and lines.

[0070] The memory can be used to store the computer programs and / or modules. The processor, by running or executing the computer programs and / or modules stored in the memory, and by calling the data stored in the memory, realizes various functions of the multi-dimensional resource dynamic management and efficient access terminal device. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0071] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.

[0072] If the module / unit integrating the multi-dimensional resource dynamic management and efficient access terminal device 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, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc.

[0073] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the present invention. Finally, it should be noted that in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0074] The foregoing has provided a detailed description of a multi-dimensional resource dynamic management and efficient access method, terminal device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. 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. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for dynamic management and efficient access to multi-dimensional resources, characterized in that, The method includes: Step S1: Define the node data structure of the hierarchical tree; Step S2: Construct the static hierarchical skeleton structure of the hierarchical tree; Step S3: Dynamically add resource index nodes; Step S4: Establish a multidimensional index mapping table; Step S5: Establish a node ID index mapping table; Step S6: Implement a tiered caching strategy; Step S7: Perform batch cache writing; Step S8: Implement efficient successor node traversal; Step S9: Implement batch traversal operations; Step S10: Implement cache consistency guarantee.

2. The method for multi-dimensional resource dynamic management and efficient access according to claim 1, characterized in that, In step S1, defining the node data structure of the hierarchical tree, the node classes of the hierarchical tree are designed, and each node contains the following attributes: Node identifier: Represented by ID, which serves as the unique identifier of the node and is a dot-separated sequence of integers; Child node collection: Stored using a TreeSet ordered collection based on a red-black tree, automatically sorted by identifier lexicographical order; Parent node reference: A reference pointing to the parent node, used for backtracking operations; Node metadata: Stores additional information about the node; The child node set is stored using a TreeSet ordered set based on a red-black tree, and the child node set includes: The time complexity of both insertion and search operations is 0 log k, where k is the number of child nodes; Child nodes are automatically sorted by identifier and support efficient traversal operations; Supports range queries, allowing you to quickly retrieve child nodes within a specified range.

3. The method for multi-dimensional resource dynamic management and efficient access according to claim 2, characterized in that, In step S2, constructing the static hierarchical skeleton structure of the hierarchical tree, the construction of the static skeleton structure of the hierarchical tree according to the predefined data model of the hierarchical tree includes: Create the root node and set its identifier; Traverse the data model definition and create a tree node for each data object; For scalar single-value objects, create an additional leaf node with a ".0" suffix; Parse the identifier of each node, determine its parent node, and add the node to the set of child nodes of the parent node; In step S3, dynamically adding resource index nodes, after the static skeleton of the hierarchical tree is constructed, the actual resource list in the current system is queried, and an index node is dynamically added under the corresponding table entry node for each resource entity, including: Query a relational database to retrieve resource configuration information; Query the time-series database to obtain a list of dynamic resources; Each resource is assigned a unique integer index, which increments from 1. Add an index node at the corresponding position in the hierarchy tree. The node identifier format is "parent node ID.index value".

4. The method for multi-dimensional resource dynamic management and efficient access according to claim 3, characterized in that, In step S4, establishing a multidimensional index mapping table, for resources with multidimensional attributes, establishing a mapping relationship between tag combinations and the index, including: Extract dimension labels from time-series database query results; Sort by lexicographical order of dimension label values ​​to ensure the stability of index allocation; Assign a unique integer index to each dimension label combination; The mapping relationship is stored in a distributed cache, where the key format is: {prefix}:index:{resource type}:{dimensional 1 value}:{dimensional 2 value}; Establish inter-dimensional relational indexes.

5. The method for multi-dimensional resource dynamic management and efficient access according to claim 4, characterized in that, In step S5, establishing the node ID index mapping table, a hash table is constructed, with the node ID as the key and the corresponding tree node as the value, including: Locating a node corresponding to a specific ID can be completed in 0 or 1 time intervals; The node ID index mapping table is generated after the hierarchical tree is built and is updated synchronously when the hierarchical tree structure changes; In step S6, implementing the tiered caching strategy includes: Based on the frequency of data changes, the data is divided into multiple cache levels, and different cache expiration times and collection cycles are set for each level. The formula for coordinating cache expiration time and collection cycle is: Cache expiration time = Collection cycle × Buffer coefficient; where the buffer coefficient is 1.2 to 1.

5.

6. The method for multi-dimensional resource dynamic management and efficient access according to claim 5, characterized in that, In step S7, implementing batch cache writing, a distributed cache pipeline mechanism is used to implement batch writing, including: Create batch operation objects; Iterate through the data items to be cached and add an asynchronous SET operation for each data item; Set the appropriate cache expiration time based on the data's cache level; Perform batch operations to submit all write commands at once; In step S8, achieving efficient successor node traversal, when it is necessary to traverse the hierarchical structure, an optimized depth-first search algorithm is used, including: Quickly locate the current node: Directly locate the node corresponding to the request ID in time complexity of 0 or 1 using the node ID index mapping table; Finding a successor node: If the current node has children, return the first child node; if the current node has no children, search for the next sibling node in the set of children of the parent node; if there is no next sibling node, backtrack to the ancestor node and repeat the above process. Return result: Returns the ID of the successor node and its corresponding data value.

7. The method for multi-dimensional resource dynamic management and efficient access according to claim 6, characterized in that, In step S9, implementing the batch traversal operation, for batch query requests, it supports retrieving multiple successor nodes at once, including: Parse the batch request parameters, including the starting position and the maximum number of responses; Starting from the initial position, perform successor node lookup multiple times consecutively; By utilizing the ordered structure of the hierarchical tree, the successor node can be obtained directly along the preorder traversal path; Implement a response size limit, stopping iteration when the number of results reaches the limit; Pack all results and return them.

8. The method for multi-dimensional resource dynamic management and efficient access according to claim 7, characterized in that, In step S10, ensuring cache consistency, guaranteeing the consistency and availability of cached data includes: Cache expiration time fault tolerance design: The cache expiration time is set to 1.2-1.5 times the collection cycle to provide a buffer for collection latency; Data collection retry mechanism: When a data source query fails, it will retry within a short period of time; Cache degradation strategy: When the backend data source is unavailable, extend the expiration time of the existing cache, continue to provide services using "old but available" data, and mark the data status; Health check: Regularly check the freshness of cached data and trigger supplementary data collection when anomalies are detected.

9. A multi-dimensional resource dynamic management and efficient access terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 8.