A Hybrid Index Structure of Adaptive Radix Tree ART and Skip List Based on NVM Storage Devices

By introducing a hybrid index structure of adaptive cardinality tree ART and table hopping on NVM storage devices, combining dynamic monitoring module and asynchronous update mechanism, the problems of low query efficiency and high write loss of ART index under long character keys are solved, and efficient index performance and low latency operations are achieved.

CN120030196BActive Publication Date: 2025-08-05NORTHEASTERN UNIV CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510517793.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-08-05
Estimated Expiration
2045-04-24

AI Technical Summary

Technical Problem

The existing ART index structure is too large when processing long character keys, resulting in inefficient query efficiency, high write loss of NVM devices and insufficient dynamic adaptability, and the prior art fails to fully utilize the characteristics of NVM devices.

Method used

Adaptive cardinality tree ART and table hopping hybrid index structure is adopted, prefix adjacency is realized through a double-layer HASH table, combined with the dynamic monitoring module to optimize the hierarchical threshold and asynchronous update mechanism, decouple the structure modification operation, and utilize the persistence characteristics of NVM storage devices.

Benefits of technology

Improve query efficiency, reduce performance loss of deep indexes, reduce write latency, make full use of the advantages of NVM storage devices, and is simple to maintain and low cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030196B_ABST
    Figure CN120030196B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of databases, and discloses a hybrid index structure of an Adaptive Radix Tree (ART) and a skip list based on an NVM storage device. It includes a main index structure and an auxiliary index structure; the auxiliary index structure is constructed based on the main index structure and is used to accelerate the indexing process of the main index structure; the main index structure is an ART index structure under the NVM storage device; the auxiliary index structure is a skip list. The present invention solves the problem of low efficiency of deep-level indexing, and fully utilizes the prefix characteristics of the ART index structure, with simple maintenance and an efficient update mechanism to reduce partial performance degradation. Based on the new storage device, it can be persistent, with relatively low read and write latency compared to disks. Through specific optimizations such as decoupling update operations, the characteristics of the NVM storage device are fully utilized. The proposed dynamic monitoring module does not require adjustment of the overall structure, but only changes its execution strategy, with simple operations and low costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular, to a hybrid index structure of an Adaptive Radix Tree (ART) and a skip list based on a NVM storage device. Background Art

[0002] NVM (Non-Volatile Memory) is a persistent storage medium that has the high performance of memory (such as DRAM) and the non-volatile characteristics of traditional disk storage (such as hard disk drive HDD or solid state drive SSD). It has characteristics such as high storage density, low static power consumption, non-volatility, and byte addressability. Therefore, it has also become a hot research application device for databases.

[0003] The current mainstream optimization of NVM index structures mainly focuses on improving read and write performance and designing hybrid structures. Read optimization methods mainly improve query efficiency by reducing the number of accesses, using buffers, or adding fingerprint recognition. Write optimization methods optimize the write performance of NVM by reducing the complexity of write operations and reducing the write amplification effect. The work of structure optimization is to introduce a hybrid structure or provide a framework to achieve a high-performance index structure friendly to NVM. For example, some research proposes to combine the B+ tree with the Log-Structured Merge Tree (LSM tree), using the orderliness of the B+ tree to support efficient range queries, and at the same time reducing the write amplification effect of NVM through the append-write of the LSM tree. Such methods usually introduce buffers or batch operations to reduce the write overhead, such as converting random writes into sequential writes.

[0004] Among them, the Adaptive Radix Tree (ART) has become one of the widely used index structures in NVM due to its efficient character compression ability and cache friendliness. By dynamically adjusting the node type (such as 4-node, 16-node, 48-node, 256-node), the path length is compressed, reducing memory occupancy and improving query performance. For the ART index, for short keys (such as 4 bytes), ART quickly locates the target through multiple layers of nodes. However, in the case of long keys (such as 64 bytes), the tree height linearly increases with the key length, resulting in an overly long access path and amplifying the read latency problem of NVM. In addition, ART relies on path compression technology to optimize space, but the sparsity of long keys reduces the compression efficiency, further increasing the node level. Especially in the case of NVM devices, the write amplification effect is more serious. Therefore, it is necessary to optimize the query performance of ART at high depths to improve its query efficiency at high depths.

[0005] CN113626433 A splits data by partitioning according to the Key value range, and constructs a two-level ART tree index structure. The first-level ART index is used for range partitioning management, and the second-level ART index is used for fast query of data within the partition. Its technical solutions include: (1) dynamically splitting range partitions to balance the data volume; (2) asynchronously optimizing the index structure through background threads; (3) preferentially matching range partitions when inserting data, and constructing a second-level ART tree within the partition. This technology reduces the height of a single ART tree through hierarchical indexing and improves the query efficiency.

[0006] Although these methods have made progress in their respective fields and their performance has been greatly improved compared to the baseline, they still cannot meet the performance requirements under the increasing data volume. Most optimizations are also based on relatively fine-grained optimizations, with limited performance improvement, and there is a lack of optimization for storage indexing under long characters. The same problem also exists for the currently well-performing ART structure for character storage.

[0007] For example, the partition management of the two-level ART tree in CN113626433A needs to maintain complex range division logic, increasing the overhead of index maintenance. Especially when the data distribution is uneven, the frequency of split and merge operations increases significantly. Although the partition design optimizes range queries, the second-level ART tree still faces the problem of low matching efficiency of deep nodes.

[0008] At the same time, most patents fail to consider the optimization and use of this index in NVM, especially the persistence characteristics and write latency problems of NVM, and do not fully utilize the specific advantages and best performance of NVM devices. Summary of the Invention

[0009] The purpose of the present invention is to provide a hybrid index structure of an adaptive radix tree ART and a skip list based on an NVM storage device, which can effectively solve the problems of low query efficiency, high write loss of NVM devices, and insufficient dynamic adaptability caused by excessive tree depth when the existing ART index structure processes long character keys. At the same time, the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device effectively utilizes the prefix characteristics of the ART index structure and breaks the traditional mechanical combination.

[0010] The technical solution of the present invention is as follows: A hybrid index structure of an adaptive radix tree ART and a skip list based on an NVM storage device, including a main index structure and an auxiliary index structure; the auxiliary index structure is constructed based on the main index structure and is used to accelerate the indexing process of the main index structure; the main index structure is an ART index structure under the NVM storage device; the auxiliary index structure is a skip list.

[0011] The ART index structure nodes are divided into internal nodes and leaf nodes; the internal nodes still adopt the internal node structure type of the ART index structure itself, and the leaf nodes adopt the form of B+ tree leaf nodes, and the leaf nodes are linked by a doubly linked list; select the leaf nodes in the ART index structure with a level greater than the level threshold to construct a skip list; the skip list is a prefix adjacent HASH table, mainly composed of two layers of HASH tables; the first layer of HASH table is responsible for indexing the second layer of HASH table, and an adjacent HASH table structure is formed between the first layer of HASH table and the second layer of HASH table.

[0012] The main index structure stores data information normally and constructs the storage for all inserted data; decouple the modification operation of the leaf nodes in the ART index structure from the structure modification operation of the internal nodes; the leaf nodes are modified in real time; the structure modification operation of the internal nodes is recorded through a lightweight structure modification operation log SMO and asynchronously modified by an additional thread.

[0013] The keys stored in the two layers of HASH tables are all character fragments; the value of the first layer of HASH table is a pointer pointing to the second layer of HASH table with the key in the first layer of HASH table as the prefix; the keys stored in the second layer of HASH table are all suffix branch index fragments with the key in the first layer of HASH table as the prefix; the value of the second layer of HASH table includes a version number and a pointer, the version number is the version number of the ART index structure node when the skip list is constructed, and the pointer points to the ART index structure node with the key in the first layer of HASH table as the prefix in the corresponding ART index structure;

[0014] Find the second layer of HASH table that stores all the suffix node information with the key in the first layer of HASH table as the prefix according to the key in the first layer of HASH table; find the position of the suffix node with the key in the first layer of HASH table as the prefix according to the key in the second layer of HASH table.

[0015] The construction of a hybrid index structure of an Adaptive Radix Tree (ART) and a skip list based on a NVM storage device includes the following steps:

[0016] Step 1: When the status information of the hybrid index structure of the Adaptive Radix Tree (ART) and the skip list based on the NVM storage device exceeds the set distribution threshold, preferentially obtain the storage insertion position through skip list query, otherwise directly locate the leaf node position for storage insertion through the ART index structure;

[0017] Step 2: If the skip list query is not successful, switch to the ART index structure for indexing operation, index the corresponding leaf node, and go to Step 3; if the skip list query is successful, index the leaf node in the ART index structure pointed to by the pointer in the value of the second layer of HASH table of the skip list, and also go to Step 3;

[0018] Step 3: According to the indexed leaf nodes, the ART index structure performs an insertion operation on the leaf nodes, and determines whether the depth level of the leaf node insertion exceeds the level threshold. If it exceeds the level threshold, go to Step 4; otherwise, directly insert it into the leaf node;

[0019] Step 4: Perform skip list construction; the skip list construction process is added to a task queue, and the skip list construction process is asynchronously executed by an additional thread, and optimistic locking is used to ensure the consistency of the stored data.

[0020] The mechanism of the optimistic lock is as follows: when creating an ART index structure node, an initial version number version = '1' is generated. During the first skip list construction based on this ART index structure node, the value of the second-layer HASH table records the initial version number of this ART index structure node. Any subsequent operation involving modification and change of this ART index structure node will atomically update the version number version of this ART index structure node, and set the new version number new_version = old_version + 1, where old_version represents the version number before the update; when the modified ART index structure node is a leaf node, the modified ART index structure leaf node information is simultaneously added to another task queue, and another additional thread asynchronously performs skip list modification and change operations, mainly modifying and changing the version number of the value in the second-layer HASH table of the skip list and the leaf node information pointed to by the pointer.

[0021] The specific steps of the skip list query process are as follows:

[0022] Step 1: Through the dynamic monitoring module, determine the prefix length of the key during the skip list query for the data to be queried, intercept the corresponding prefix segment as the key, and go to Step 2;

[0023] Step 2: Index according to the key in the first-layer HASH table of the skip list. If not indexed, go to the ART index structure for lookup; if indexed, go to Step 3;

[0024] Step 3: Continue to search in the second-layer HASH table by intercepting the corresponding key according to the corresponding key prefix length. If not found, go to the ART index structure for lookup; otherwise, go to Step 4;

[0025] Step 4: Determine whether the node pointed to by the value pointer is a leaf node. If it is a leaf node, compare whether the version number stored in the value is the same as the version number of the found leaf node; if they are the same, return the found leaf node; if they are different, return the ART index structure for lookup; if it is not a leaf node, go to Step 5;

[0026] Step 5: Accumulate the key prefixes in the two-layer HASH table as the new key prefix length, go to Step 2, and repeat Steps 2 - 4.

[0027] The dynamic monitoring module determines the prefix length of the key during skip list query through the following formula:

[0028] Calculate the initial probability of the data to be queried at each level according to the initial distribution of nodes at each level;

[0029] (1)

[0030] is the maximum level currently existing in the ART index structure; is the level; P( ) is the initial probability that the data to be queried is at the level of ; λ is the smoothing factor, and λ does not exceed the number of leaf nodes contained in the level with the fewest leaf nodes; is the number of leaf nodes at the level of ; is the number of leaf nodes at the level of k;

[0031] Add a dynamic trend correction factor to correct the initial probability of the data to be queried at each level according to the number of newly added leaf nodes within the time;

[0032] (2)

[0033] is the trend factor; α is the trend sensitivity coefficient; is the initial probability after correction at the level of ; within the time, the increment of leaf nodes at the level of ;

[0034] Predict the level where the data to be queried is located according to the relationship between the key length and the level;

[0035] (3)

[0036] L is the length of the key of the currently queried data, is the maximum length of the keys in the stored data, is the key length prediction level calculated according to the key length, and β is the calibration coefficient;

[0037] Fuse the weights of the normal distribution to calculate the final probability of the data to be queried at each level;

[0038] (4)

[0039] σ controls the level diffusion degree; is the probability density function of the normal distribution; m is the weight coefficient; To obtain the probabilities of the data to be queried at different levels for the final comprehensive prediction;

[0040] According to the probabilities of the data to be queried at different levels in Equation (4), select the level with the highest probability as the final prediction level of the data to be queried. According to the level threshold, determine the prefix length of the key when querying the data to be queried, and ensure that the determined key prefix length corresponds to the key length of the skip list;

[0041] (5)

[0042] is the final prediction level, which is the level with the highest probability in Equation (4); To make the level with the maximum value; H is the level threshold; is the remainder obtained by dividing the final prediction level by the level threshold. The final prediction level minus this remainder corresponds to the key length of the skip list; is the prefix length of the key finally determined for querying the data to be queried in the skip list;

[0043] The level threshold is dynamically adjusted by the dynamic monitoring module, including:

[0044] The starting key length of the first-layer HASH table required when constructing the skip list is used as the level threshold H, which is initially defaulted to 4. The dynamic monitoring module monitors the level situation of the ART index structure. When the sum of the number of leaf nodes at levels in the ART index structure where level > H + 2 is compared with the total number of leaf nodes in the whole and the ratio is greater than a specific threshold, then the starting key length of the first-layer HASH table required when constructing the skip list is adjusted to as the new level threshold; the adjustment formula of the level threshold is as follows:

[0045]

[0046] The dynamic monitoring module records the overall state of the ART index structure, records the number of leaf nodes at different levels and the total number of leaf nodes, and calculates the prefix length of the key when performing a search in the skip list according to the dynamic monitoring module.

[0047] Compared with the prior art, the present invention has the following beneficial effects: It solves the problem of low efficiency of deep indexing, and fully utilizes the prefix characteristics of the ART index structure, with simple maintenance and an efficient update mechanism to reduce partial performance degradation. Based on a new type of storage device, it can be persistent, with relatively low read and write latency compared to disks. Through specific optimizations such as decoupling update operations, it fully utilizes the characteristics of the NVM storage device. The proposed dynamic monitoring module does not require adjusting the overall structure, but only changes its execution strategy, with simple operation and low cost.

[0048] Compared with the prior art, the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device in the present invention has a lower complexity, is more effective in solving the problem of low performance of deep-level indexes, and effectively avoids the performance loss caused by frequent partition splitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device;

[0050] Figure 2 It is a flowchart for constructing the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device;

[0051] Figure 3 It is a flowchart for skip list query. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] As shown in the Figure 1 drawings, the present invention provides a hybrid index structure of an adaptive radix tree ART and a skip list based on an NVM storage device. The main index structure is an ART index structure under a non-volatile storage device NVM, which is optimized. The skip list serves as an auxiliary index structure, and the two complement each other to form a hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device.

[0053] The main index structure stores data information normally, constructs storage for all inserted data, and the leaf nodes adopt the form of B+ tree leaf nodes. The leaf nodes are linked by a doubly linked list, which is more convenient for querying, especially for searching and traversing during range queries. As shown in Figure 1 process 5 in the figure, decouple the modification operations of the leaf nodes in the ART index structure and the structure modification operations of the internal nodes, record the structure modification operations through a lightweight structure modification operation log, and perform asynchronous modification operations by an additional thread, so as to make full use of the characteristics of the NVM storage device and reduce the blocking delay problem caused by structure modification operations.

[0054] The skip list is a prefix adjacent HASH table. As an auxiliary index structure, it will select nodes with a deeper depth in the ART index structure to construct an index to achieve a function similar to that of the skip list. It is not a simple combination of the HASH table and the ART index structure, but a new index structure that makes full use of the prefix characteristics of the ART index structure and the structural characteristics of the adjacent list to implement the corresponding functions of the skip list. As shown in Figure 1As shown in the figure, the skip list mainly consists of two layers of HASH tables. The first layer of the HASH table is responsible for indexing the second layer of the HASH table. An adjacency HASH table structure is formed between the first layer of the HASH table and the second layer of the HASH table to achieve precise positioning of branches. The keys stored in both layers of the HASH table are character fragments rather than the entire data key, which can save space consumption and improve the performance of the HASH table at the same time.

[0055] The value of the first layer of the HASH table is a pointer; the pointer of the first layer of the HASH table points to the second layer of the HASH table with the key in the first layer of the HASH table as the prefix; the keys stored in the second layer of the HASH table are all suffix branch index fragments with the key in the first layer of the HASH table as the prefix. The value of the second layer of the HASH table includes a version number and a pointer. The version number is synchronized with the version number of the ART index structure node when constructing the skip list. The pointer points to the ART index structure node with the key in the first layer of the HASH table as the prefix in the corresponding ART index structure; according to the key of the first layer of the HASH table, find the second layer of the HASH table that stores all the suffix node information with the key in the first layer of the HASH table as the prefix, and according to the key in the second layer of the HASH table, find the corresponding suffix node position with the key in the first layer of the HASH table as the prefix. It avoids the process of matching character by character like the ART index structure, accelerates its query efficiency, and at the same time realizes the precise positioning function of its branches according to the characteristics of the adjacency list.

[0056] In some instances, when performing relevant basic database operations (INSERT, SEARCH, SCAN, DELETE), the index module can be dynamically selected to avoid unnecessary matching processes and maximize its index performance. Further, according to Figure 2 、 Figure 3 to perform the specific construction and query processes.

[0057] Figure 2 This is a schematic diagram of the construction process (insert operation processing) of the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device in the present invention, including the following steps:

[0058] Step 1: When the status information of the hybrid index structure of the adaptive radix tree ART and the skip list based on the NVM storage device exceeds the set distribution threshold, preferentially obtain the stored insertion position through skip list query, otherwise directly locate the leaf node position for storage insertion through the ART index structure;

[0059] Step 2: If the skip list query is unsuccessful, switch to the ART index structure for index operation, index the corresponding leaf node, and go to Step 3; if the skip list query is successful, index the leaf node in the ART index structure pointed to by the pointer in the value of the second layer of the HASH table of the skip list, and also go to Step 3;

[0060] Step 3: According to the indexed leaf nodes, the ART index structure performs the insertion operation of leaf nodes, determines whether the insertion depth level of the leaf nodes exceeds the level threshold. If it exceeds the level threshold, go to Step 4; otherwise, directly insert it into the leaf node.

[0061] Step 4: Perform skip list construction. The skip list construction process is added to a task queue, and the skip list construction process is asynchronously executed by an additional thread, and optimistic locking is used to ensure the consistency of the stored data.

[0062] The optimistic locking mechanism in Step 4 is as follows: When creating an ART index structure node, an initial version number version = 1 is generated. During the first skip list construction based on this ART index structure node, the value of the second-layer HASH table records the initial version number of this ART index structure node. Any subsequent operation involving the modification of this ART index structure node will atomically update the version number version of this ART index structure node, set the new version number new_version = old_version + 1, where old_version represents the version number before the update; when the modified ART index structure node is a leaf node, the modified ART index structure leaf node information is simultaneously added to another task queue, and another additional thread asynchronously performs the update operation of the skip list, mainly updating the version number of the value in the second-layer HASH table of the skip list and the leaf node information pointed to by the pointer.

[0063] Figure 3 What is shown in [ID] is the specific query process of the skip list, and the steps include:

[0064] Step 1: Through the dynamic monitoring module, determine the prefix length of the key when querying the data in the skip list, intercept the corresponding prefix segment as the key, and go to Step 2;

[0065] Step 2: Index according to the key in the first-layer HASH table of the skip list. If not found, go to the ART index structure for searching; if found, go to Step 3;

[0066] Step 3: Continue to search in the second-layer HASH table by intercepting the corresponding key according to the corresponding key prefix length. If not found, go to the ART index structure for searching; otherwise, go to Step 4;

[0067] Step 4: Determine whether the node pointed to by the value pointer is a leaf node. If it is a leaf node, compare whether the version number stored in the value is consistent with the version number of the found leaf node; if consistent, return the found leaf node; if inconsistent, return the ART index structure for searching; if it is not a leaf node, go to Step 5;

[0068] Step 5: Accumulate the key prefixes of the two-layer HASH table as the new key prefix length and go to Step 2, repeating Steps 2 - 4.

[0069] The dynamic monitoring module determines the key prefix length of the data to be queried during skip list query through the following formula:

[0070] Calculate the initial probability of the data to be queried at each level according to the initial node distribution at each level;

[0071] (6)

[0072] is the maximum level currently existing in the ART index structure; is the level; P( ) is the initial probability that the data to be queried is at level ; λ is the smoothing factor, and λ does not exceed the number of leaf nodes contained in the level with the fewest leaf nodes; is the number of leaf nodes at level ; is the number of leaf nodes at level k;

[0073] Add a dynamic trend correction factor, and correct the initial probability of the data to be queried at each level according to the number of newly added leaf nodes within the

[0074] (7)

[0075] is the trend factor; α is the trend sensitivity coefficient; is the corrected initial probability at level ; within the time, the leaf node increment at level

[0076] Predict the level where the data to be queried is located according to the relationship between the key length and the level;

[0077] (8)

[0078] L is the length of the key of the current data to be queried, is the maximum length of the keys in the stored data, is the key length prediction level calculated according to the key length, and β is the calibration coefficient; Perform normal distribution weight fusion to calculate the final probability of the data to be queried at each level;

[0079] (9)

[0080] σ controls the level diffusion degree; The probability density function of the normal distribution; m is the weight coefficient; is the probability of the data to be queried in the final comprehensive prediction at different levels;

[0081] According to the probability of the data to be queried in the final comprehensive prediction at different levels in Equation (9), the level with the maximum probability is taken as the final prediction level of the data to be queried. According to the level threshold, the prefix length of the key when querying the data to be queried is determined, and it is ensured that the determined key prefix length corresponds to the key length of the skip list;

[0082] (10)

[0083] is the final prediction level, which is the level with the maximum probability in Equation (9); To make the level with the maximum value; H is the level threshold; is the remainder obtained by dividing the final prediction level by the level threshold. The final prediction level minus this remainder corresponds to the key length of the skip list; is the prefix length of the key when querying the data to be queried finally determined in the skip list;

[0084] Meanwhile, during the construction of the skip list, the starting key length of the HASH table, that is, the level threshold, is not fixed and can be adjusted according to the dynamic monitoring module, in order to further reduce the problem of space consumption caused by the introduction of additional index structures. The level threshold is dynamically adjusted by the dynamic monitoring module, including:

[0085] The starting key length of the first-layer HASH table required when constructing the skip list is used as the level threshold H, which is initially defaulted to 4. The dynamic monitoring module monitors the level situation of the ART index structure. When the sum of the number of leaf nodes at levels in the ART index structure where level > H + 2 is greater than the specific threshold compared with the total number of leaf nodes of the whole, then the starting key length of the first-layer HASH table required when constructing the skip list is adjusted to as the new level threshold; The adjustment formula of the level threshold is as follows:

[0086]

[0087] The dynamic monitoring module records the overall state of the ART index structure, records the number of leaf nodes at different levels and the total number of leaf nodes, and calculates the prefix length of the key when searching in the skip list according to the dynamic monitoring module, reducing its search times and pointer chasing, and further improving the search performance.

[0088] The core of this invention is to build a hybrid index structure of adaptive radix tree (ART) and jump table based on NVM storage devices, which overcomes the limitations of existing indexing technology through the following technical means:

[0089] Two-layer index coordination mechanism: This combines the adaptive radix tree (ART) with a skip list to form a dual-layer index structure with primary and secondary coordination. The ART index structure serves as the primary index structure, responsible for basic data storage and path compression. The skip list serves as the secondary index structure, quickly locating deep nodes using prefix-segmented keys, reducing the length of the ART index structure's layer-by-layer matching paths. For example, for a long string key "ABCDEFGHIJK," the skip list intercepts the first four characters "ABCD" as the key and directly locates the second-layer adjacency table to match the remaining characters, avoiding deep traversal of the adaptive radix tree ART.

[0090] Dynamic monitoring and adaptive adjustment: A dynamic monitoring module is introduced to analyze the hierarchical distribution of the ART index structure (such as node depth and key length distribution) in real time. Using a probabilistic model, the prefix length and level threshold of the skip list are dynamically adjusted. For example, if the number of nodes with a depth exceeding a preset threshold (such as Level > 5) exceeds 60%, the key length is automatically increased from 4 characters to 6 characters to optimize skip list space utilization.

[0091] NVM write optimization strategy: To address the write amplification issue of NVM storage devices, we decouple structural modification operations (such as node splitting and merging) of the ART index structure from data updates. We use a lightweight structural modification operation log to record structural changes, which are executed asynchronously by background threads to reduce blocking of the main thread. Version tags and optimistic locking mechanisms ensure data consistency and avoid frequent writes to NVM storage devices.

[0092] High concurrency support: Skiplist construction and querying are implemented through asynchronous threads and atomic operations. Node updates in the ART index structure are synchronized with the skiplist version tags, ensuring stable performance in large-scale concurrent read and write scenarios while avoiding the overhead of traditional locking mechanisms.

Claims

1. A method for constructing a hybrid index structure of an adaptive radix tree (ART) and a jump table based on an NVM storage device, characterized in that: It includes a primary index structure and an auxiliary index structure; the auxiliary index structure is built based on the primary index structure and is used to accelerate the indexing process of the primary index structure; the primary index structure is the ART index structure under the NVM storage device; the auxiliary index structure is a skip list; the ART index structure nodes are divided into internal nodes and leaf nodes; the internal nodes still use the internal node structure type of the ART index structure itself, and the leaf nodes use the B+ leaf node form, and the leaf nodes are linked by a bidirectional linked list; A skip table is constructed by selecting leaf nodes with a level greater than a level threshold in the ART index structure; the skip table is a prefix adjacency HASH table, mainly composed of two layers of HASH tables; the first layer HASH table is responsible for indexing the second layer HASH table, and an adjacency HASH table structure is formed between the first layer HASH table and the second layer HASH table.

2. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 1, characterized in that: The main index structure stores data information normally and stores and constructs all inserted data; Decouple the modification of leaf nodes in the ART index structure from the structural modification of internal nodes; Leaf nodes are modified in real time; structural modification operations on internal nodes are recorded through lightweight structural modification operation logs and modified asynchronously by additional threads.

3. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 1, characterized in that: The keys stored in the two-layer HASH table are all character fragments; the value of the first-layer HASH table is a pointer to the second-layer HASH table with the key in the first-layer HASH table as the prefix; the keys stored in the second-layer HASH table are all suffix branch index fragments with the key in the first-layer HASH table as the prefix; The value of the second-level HASH table includes a version number and a pointer. The version number is the version number of the ART index structure node when building the jump table. The pointer points to the ART index structure node in the corresponding ART index structure with the key in the first-level HASH table as the prefix; According to the key of the first-layer HASH table, find the second-layer HASH table that stores all suffix node information prefixed by the key in the first-layer HASH table; according to the key in the second-layer HASH table, find the position of the suffix node prefixed by the key in the first-layer HASH table.

4. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 3, characterized in that: The construction of a hybrid index structure based on the adaptive radix tree ART and jump table of NVM storage devices includes the following steps: Step 1: When the status information of the hybrid index structure of the adaptive radix tree (ART) and skip list based on the NVM storage device exceeds the set distribution threshold, the insertion position of the storage is obtained through the skip list query first, otherwise the leaf node position of the storage insertion is directly located through the ART index structure; Step 2: If the skip table query is unsuccessful, switch to the ART index structure for indexing, index the corresponding leaf node, and go to step 3; if the skip table query is successful, index the leaf node in the ART index structure pointed to by the pointer in the value of the second-level HASH table of the skip table, and also go to step 3; Step 3: Based on the indexed leaf node, the ART index structure performs the leaf node insertion operation and determines whether the leaf node insertion depth exceeds the level threshold. If it exceeds the level threshold, go to step 4, otherwise directly insert it into the leaf node; Step 4: construct a skip list; the skip list construction process is added to a task queue, and the skip list construction process is asynchronously executed by an additional thread, and the consistency of the stored data is ensured by optimistic locking.

5. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 4, characterized in that: The optimistic locking mechanism is as follows: when the ART index structure node is created, an initial version number version=1 is generated. During the first skip list construction based on the ART index structure node, the value of the second-level HASH table records the initial version number of the ART index structure node. Any subsequent operation involving modification or change of the ART index structure node will atomically update the version number version of the ART index structure node and set the new version number new_version=old_version+1, where old_version represents the version number before the update. When the modified ART index structure node is a leaf node, the modified ART index structure leaf node information is added to another task queue at the same time, and another additional thread asynchronously performs the skip list modification and change operation, mainly modifying the version number of the value in the second-level HASH table of the skip list and the leaf node information pointed to by the pointer.

6. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 4, characterized in that: The skip table query process specifically includes the following steps: Step 1: Determine the prefix length of the key of the data to be queried during the table jump query through the dynamic monitoring module, intercept the prefix fragment of the corresponding length as the key, and go to step 2; Step 2: Search the first-level HASH table in the jump list according to the key. If the key is not found, search the ART index structure. If the key is found, go to step 3. Step 3: Continue to search for the corresponding key in the second-layer HASH table according to the corresponding key prefix length. If not found, switch to the ART index structure search. Otherwise, go to step 4. Step 4: Determine whether the node pointed to by the value pointer is a leaf node. If it is a leaf node, compare the version number stored in the value with the version number of the found leaf node to see if they are consistent; if they are consistent, return the found leaf node; if not, return to the ART index structure search; if it is not a leaf node, go to step 5; Step 5: Accumulate the prefixes of the keys in the two-layer HASH table as the new key prefix length and go to step 2, repeating steps 2 to 4.

7. The method for constructing a hybrid index structure of an adaptive radix tree ART and a jump table based on an NVM storage device according to claim 6, characterized in that: The dynamic monitoring module determines the prefix length of the key of the data to be queried during the table jump query by the following formula: Calculate the initial probability of the query data at each level based on the initial node distribution at each level; D max The maximum level of the ART index structure currently exists; d i is the level; P(d i ) is the level of the data to be queried, which is d i The initial probability of ;λ is the smoothing factor, λ does not exceed the number of leaf nodes contained in the level with the least number of leaf nodes; For level d i The number of leaf nodes at the time; n k is the number of leaf nodes when the level is k; Add a dynamic trend correction factor to correct the initial probability of the query data at each level according to the number of new leaf nodes added within Δt time; G(d i ) is the trend factor; α is the trend sensitivity coefficient; P ′ (d i ) is the modified level d i The initial probability under is the level d within time Δt i Next leaf node increment; According to the relationship between key length and hierarchy, predict the hierarchy of the data to be queried; L is the length of the current data key to be queried, L max is the maximum length of the key in the stored data, d pred is the bond length prediction level calculated based on the bond length, β is the calibration coefficient; Normal distribution weight fusion to calculate the final probability of the query data at each level; σ is the control d pred The degree of hierarchical diffusion; is the probability density function of the normal distribution; m is the weight coefficient; P final (d i ) is the final comprehensive prediction probability of the query data at different levels; According to the final comprehensive prediction of the probability of the query data at different levels in formula (4), the level with the largest probability is taken as the final prediction level of the query data. According to the level threshold, the prefix length of the key when querying the query data is determined, and it is ensured that the determined key prefix length corresponds to the key length of the skip table; d=argmax(P final (d i )),key Len =d-d%H (5) d is the final prediction level, which is the level with the highest probability in formula (4); argmax(P final (d i ))To make P final (d i ) value is the largest level; H is the level threshold; d%H is the remainder of the final predicted level divided by the level threshold, and the final predicted level minus the remainder corresponds to the key length of the jump table; key len The prefix length of the key of the finalized data to be queried during the table skipping query; The level threshold is dynamically adjusted by the dynamic monitoring module, including: The starting key length of the first-level HASH table required for constructing the jump table is used as the level threshold H, which is initially set to 4. The dynamic monitoring module monitors the level of the ART index structure. When the number of leaf nodes n at level > H+2 in the ART index structure is k The sum of the total number of leaf nodes N total If the ratio is greater than a specific threshold, the starting key length of the first-level HASH table required for constructing the skip table is adjusted to H new , as the new level threshold; μ is the scaling factor; the adjustment formula for the level threshold is as follows: The dynamic monitoring module records the overall status of the ART index structure, the number of leaf nodes at different levels and the total number of leaf nodes, and calculates the prefix length of the key when searching in the jump table based on the dynamic monitoring module.

Citation Information

Patent Citations

  • Data storage method based on two layers of ART trees

    CN113626433A

  • Memory database storage engine management method

    CN113688130A

  • Self-adaptive multi-level mixed index data storage system and storage method

    CN118152407A