Distributed storage indexing method and system based on multiple hashing

By optimizing the distributed storage index system with a Master/Slave architecture and a multi-hash algorithm, the performance bottleneck and load imbalance issues in large-scale data storage are resolved, achieving efficient data storage and load balancing, and improving system reliability and throughput.

CN114416645BActive Publication Date: 2025-11-28SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210060384.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2025-11-28
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

Existing storage indexing systems suffer from performance bottlenecks, poor scalability, and unbalanced loads in large-scale data storage, which are particularly difficult to solve effectively in distributed systems.

Method used

It adopts a Master/Slave architecture, combining multiple hash algorithms and LB+-Trees data structure to achieve dynamic scalability and load balancing. It optimizes node load through linear hash functions and Cuckoo hash algorithms, and uses a three-tier storage structure of DRAM+NVM+SSD to achieve multiple data backups and fast access.

Benefits of technology

It improves the system's scalability, resource utilization, reliability, and throughput, and provides dynamic load balancing to prevent data loss and enhance system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416645B_ABST
    Figure CN114416645B_ABST
Patent Text Reader

Abstract

The application discloses a distributed storage index method and system based on multiple hash, and the method is as follows: based on a key-value storage engine, a Master / Slave architecture is adopted to build a distributed storage index system; the Master / Slave architecture comprises one Master node and multiple Slave nodes; according to an access request of a key-value pair, the Master node calls multiple linear hash functions to calculate the key of the key-value pair, and obtains the Slave nodes corresponding to all hash values; the Master node sends corresponding operation requests to the corresponding Slave nodes, including an increase operation, a deletion operation, a modification operation and a search operation; when the Master node detects that the real-time load rate of a certain Slave node exceeds a load critical point triggering node splitting, a node splitting operation is performed. The method utilizes the automatic expansion feature of linear hash, improves the scalability and resource utilization rate; based on multiple hash functions, multiple data backups are realized, data loss is avoided, and the reliability is improved; access and storage are realized by using nodes with low load rates, and load balancing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of storage index, and particularly relates to a distributed storage index method and system based on multiple hash. BACKGROUND

[0002] Since the development of the Internet, the explosive growth of data volume has brought great challenges to storage. Especially with the large-scale use of 4G, the data volume and the size of a single file are increasing, and video type data also makes a single file present GB level. With the advent of the Internet of Things era, the rapid deployment of sensors further expands the data volume, and sensors collect a large amount of data every second, resulting in an explosive growth of data volume, so that a single machine basically cannot store the required data in most scenarios, and distributed storage has become a possible solution to this problem. Since sensors obtain massive time series data, indexes applied to solve data lookup problems also show an explosive growth, and therefore the index system needs to be deployed on different machines to realize a distributed index system.

[0003] The existing storage index system mainly includes B-tree index and hash index. B+ tree is a tree data structure, which is usually used in databases and file systems of operating systems; B+ tree is a tree structure formed by continuously splitting index data from bottom to top, and node splitting is performed when the node exceeds the threshold, and the feature is that it can keep data stable and ordered, and its insertion and modification have a relatively stable logarithmic time complexity. LB+ tree uses a hybrid architecture of DRAM+3DXPoint, places non-leaf nodes in DRAM to improve retrieval performance, and places leaves in 3DXPoint; data recovery is performed through non-leaf nodes by using the relationship between leaf nodes and non-leaf nodes. The existing hash structure is roughly divided into static hash and dynamic hash; static hash needs to determine the number of buckets at the beginning, and the number of buckets cannot be changed with the data volume; dynamic hash can set a small number of buckets in the initial state, and expand with the expansion of the data volume. In 1997, Massachusetts Institute of Technology proposed a special hash algorithm-consistent hash algorithm, which solves the problem of load imbalance by introducing virtual nodes, that is, each physical server is virtually a group of virtual servers, and the virtual servers are placed on a hash ring. If you want to determine the server of an object, you need to determine the virtual server of the object first, and then determine the physical server from the virtual server.

[0004] Although B-tree indexes and their variants such as B+ trees can achieve ordered distribution and have a time complexity of O(log N) for each data access when used for range queries, they can lead to performance bottlenecks in large-scale random data searches. LB+ trees apply B+ trees to the new NVM storage material, placing leaf nodes on the NVM non-volatile storage material, which eliminates the need for locking and logging of key-value pairs, greatly accelerating storage speed. However, LB+ trees are only for single-machine indexes, and the speed of a single-machine engine is limited in large-scale data storage systems, resulting in poor scalability. Hash indexes can achieve O(1) time complexity and are commonly used in indexing systems, but they are prone to load imbalance. Consistent hashing has proposed a solution to load imbalance in distributed indexing systems, but this system heavily relies on personal experience and requires manual addition of machines, making it cumbersome in big data storage systems. Summary of the Invention

[0005] The main objective of this invention is to overcome the shortcomings and deficiencies of existing technologies and provide a distributed storage indexing method and system based on multiple hashing. This method uses a Master / Slave architecture to build the system, realizing distributed storage; it adopts the dynamic scalability of the linear hash algorithm to improve resource utilization; based on multiple hash functions, it realizes multiple data backups, avoids data loss, and improves reliability; it accesses and stores low-load nodes, realizing dynamic load balancing and improving system throughput.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] This invention provides a distributed storage indexing method based on multiple hashing, comprising the following steps:

[0008] A distributed storage indexing system is built based on a key-value storage engine and using a Master / Slave architecture.

[0009] The Master / Slave architecture includes one Master node and multiple Slave nodes;

[0010] The Master node stores distributed storage index system information, including hash algorithm information and Slave node information, and is used for data forwarding and Slave node management; the Slave node is used to implement key-value pair storage.

[0011] The hash algorithm information includes a plurality of linear hash functions, a number of hash functions, a split pointer, and a load critical point triggering node splitting; the Slave node information includes a number of Slave nodes in use, a number of idle Slave nodes, Slave node addresses, and real-time load rates of Slave nodes;

[0012] According to the access request of the key-value pair, the Master node calls a plurality of linear hash functions to calculate the key of the key-value pair, and obtains the Slave nodes corresponding to all hash values;

[0013] The Master node sends a corresponding operation request to the corresponding Slave node; the operation includes an increase operation, a deletion operation, a modification operation, and a search operation;

[0014] When the Master node detects that the real-time load rate of a certain Slave node exceeds the load critical point triggering node splitting, a node splitting operation is performed.

[0015] As a preferred technical solution, the Slave node adopts an LB+-Trees data structure, and a three-layer storage structure, namely DRAM+NVM+SSD, is set;

[0016] The data distribution of the Slave node is composed of a B+ tree, and non-leaf nodes are stored on DRAM, and leaf nodes are stored on NVM;

[0017] Each time a data operation is performed, the leaf nodes on the NVM are operated first, and then the non-leaf nodes of the DRAM are updated;

[0018] For overflow data of the Slave node, LevelDB is used to perform serial write operations on the SSD.

[0019] As a preferred technical solution, the increase operation is specifically:

[0020] Based on the idea of the cuckoo hash algorithm, the Master node obtains the real-time load rate of the corresponding Slave node according to the corresponding Slave node;

[0021] In ascending order, the first half of the Slave node serial numbers, i.e., the half of the Slave nodes with lower real-time load rates, are obtained;

[0022] Operation requests for increasing key-value pairs are sent to the half of the Slave nodes with lower real-time load rates;

[0023] After the Slave node increase operation is completed, the Master node is returned with the new real-time load rate of the Slave node.

[0024] As a preferred technical solution, the deletion operation is specifically:

[0025] The Master node sends a request to the corresponding Slave node to delete the key-value pair;

[0026] After the corresponding Slave node deletion operation is completed, the new real-time load rate of the corresponding Slave node is returned to the Master node.

[0027] As a preferred technical solution, the modification operation specifically includes:

[0028] The Master node first sends a request to the corresponding Slave node to delete the key-value pair;

[0029] After the corresponding Slave node deletion operation is completed, based on the idea of ​​the Cuckoo hash algorithm, the Master node obtains the real-time load rate of the corresponding Slave node;

[0030] Sort the nodes in ascending order to get the first half of the Slave node numbers, which are the Slave nodes with the lowest real-time load rate.

[0031] Send an operation request to add key-value pairs to half of the slave nodes with lower real-time load rates;

[0032] After the Slave node addition operation is completed, the new real-time load rate of the Slave node is returned to the Master node.

[0033] As a preferred technical solution, the search operation specifically includes:

[0034] The Master node sorts the corresponding Slave nodes in ascending order based on their real-time load rates, sends lookup requests to the Slave nodes in sequence, and returns the current Slave node sequence number when the lookup is successful.

[0035] As a preferred technical solution, the node splitting operation specifically involves:

[0036] When the Master node detects that the real-time load rate of a Slave node exceeds the load threshold that triggers node splitting, it splits the Slave node pointed to by the split pointer.

[0037] Automatically add an idle Slave node to the distributed storage index system and update the storage index system information in the Master node;

[0038] Perform deletion operations on all data stored in each Slave node one by one;

[0039] When deleting, the key-value pairs of the slave node to be deleted are cached in the master node first, then the slave node deletes all the stored data, and after successful deletion, the master node sends an increase operation to the slave node to store the cached key-value pairs to the slave node, and after successful increase operation, the split pointer is moved to complete node splitting.

[0040] The application further provides a distributed storage index system based on multiple hashings, comprising a building module, a calculation module, an operation module, a storage module and a splitting module.

[0041] The building module is based on a key-value storage engine and adopts a Master / Slave architecture to build the system.

[0042] The Master / Slave architecture comprises one master node and multiple slave nodes.

[0043] The master node stores distributed storage index system information, including hash algorithm information and slave node information, for data forwarding and slave node management; and the slave node is used for realizing storage of key-value pairs.

[0044] The hash algorithm information comprises multiple linear hash functions, the number of hash functions, a split pointer and a load critical point triggering node splitting; and the slave node information comprises the number of slave nodes in use, the number of idle slave nodes, slave node addresses and real-time load rates of slave nodes.

[0045] The calculation module calculates the keys of the key-value pairs according to access requests of the key-value pairs, and obtains all the hash values corresponding to the slave nodes by calling multiple linear hash functions in the master node.

[0046] The operation module sends corresponding operation requests from the master node to the corresponding slave nodes according to the corresponding slave nodes calculated by the calculation module.

[0047] The storage module is located in the slave node.

[0048] The splitting module judges whether the real-time load rate of the slave node exceeds the load critical point triggering node splitting according to the detection of the master node, and executes node splitting operation if yes.

[0049] As a preferred technical solution, the operation module comprises an increase module, a deletion module, a modification module and a search module.

[0050] The increasing module obtains real-time load rates of the corresponding Slave nodes according to the corresponding Slave nodes calculated by the calculating module based on the idea of the cuckoo hash algorithm, sorts the Slave nodes in ascending order to obtain the sequence numbers of the first half of the Slave nodes, i.e. the half of the Slave nodes with lower real-time load rates, sends an operation request of increasing key-value pairs to the half of the Slave nodes with lower real-time load rates, stores the key-value pairs in the storage modules of the half of the Slave nodes with lower real-time load rates, and returns new real-time load rates of the Slave nodes to the Master node after the increasing operation is completed;

[0051] The deleting module sends an operation request of deleting key-value pairs to the corresponding Slave nodes according to the corresponding Slave nodes calculated by the calculating module, deletes the key-value pairs from the storage modules of the corresponding Slave nodes, and returns new real-time load rates of the corresponding Slave nodes to the Master node after the deleting operation is completed.

[0052] The modifying module first sends an operation request of deleting key-value pairs to the corresponding Slave nodes calculated by the calculating module, deletes the key-value pairs from the corresponding storage modules after the corresponding Slave nodes complete the deletion, obtains real-time load rates of the corresponding Slave nodes, sorts the Slave nodes in ascending order to obtain the sequence numbers of the first half of the Slave nodes, i.e. the half of the Slave nodes with lower real-time load rates, sends an operation request of increasing key-value pairs to the half of the Slave nodes with lower real-time load rates, stores the key-value pairs in the storage modules of the half of the Slave nodes with lower real-time load rates, and returns new real-time load rates of the Slave nodes to the Master node after the increasing operation is completed.

[0053] The finding module sorts real-time load rates of the corresponding Slave nodes in ascending order according to the corresponding Slave nodes calculated by the calculating module, sends finding requests to the Slave nodes in sequence, and returns the sequence numbers of the current Slave nodes when the finding is successful.

[0054] As a preferred technical solution, the Slave node adopts an LB+-Trees data structure, and the storage module of the Slave node is provided with a three-layer storage structure, i.e. DRAM+NVM+SSD.

[0055] The data distribution of the Slave node is composed of a B+ tree, non-leaf nodes are stored on the DRAM structure of the storage module, and leaf nodes are stored on the NVM structure of the storage module; each time data is operated, the leaf nodes on the NVM structure of the storage module are operated first, and then the non-leaf nodes of the DRAM structure of the storage module are updated.

[0056] For overflow data of the Slave node, LevelDB is used to perform serial write operation on the SSD structure of the storage module.

[0057] Compared with the prior art, the present application has the following advantages and beneficial effects:

[0058] 1. Since large-scale index data storage will inevitably lead to a bottleneck of a single node, and linear hashing, as a dynamic hashing algorithm, can achieve dynamic expansion, the present application uses linear hashing as the algorithm for expanding nodes, applies it to a distributed system, realizes dynamic expansion of nodes, and improves scalability.

[0059] 2. Since linear hashing has the feature of automatic expansion, the present application uses linear hashing as the algorithm for expanding nodes, realizes dynamic expansion of nodes according to needs, and improves the degree of automation.

[0060] 3. Since the efficiency of linear hashing is twice that of other technologies each time the node is expanded, resources are greatly saved, and the resource utilization rate of the system is improved.

[0061] 4. The present application uses a method combining multiple hashings, realizes multiple backups of data, avoids the situation of data loss caused by damage of a single node, and improves reliability.

[0062] 5. The present application is based on the idea of the cuckoo hashing algorithm in the increase operation, the system selects a node with a lower load rate for access and storage, realizes dynamic load balancing of multiple nodes in the case of a large amount of data, and improves the throughput of the system. BRIEF DESCRIPTION OF DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0064] Figure 1 The flowchart of the distributed storage index method based on multiple hashings of the embodiment of the present application;

[0065] Figure 2 The distributed storage index system architecture diagram built by the Master / Slave architecture of the embodiment of the present application;

[0066] Figure 3 The structure diagram of the Master node of the embodiment of the present application;

[0067] Figure 4 The structure diagram of the Slave node of the embodiment of the present application;

[0068] Figure 5A structure diagram of a distributed storage index system based on multiple hash according to an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0070] In the present application, the phrase "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase at various places in the specification does not necessarily mean that it refers to the same embodiment, nor is it independent or alternative to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments.

[0071] Embodiments

[0072] Referring to Figure 1 In an embodiment of the present application, a multiple hash-based distributed storage index method is provided, comprising the following steps:

[0073] S1, based on a distributed key-value storage engine, a Master / Slave architecture is used to build a distributed storage index system;

[0074] As shown in Figure 2 , the Master / Slave architecture includes one Master node and multiple Slave nodes;

[0075] As shown in Figure 3 , the distributed storage index system generally has one Master node, which stores detailed information of the distributed storage index system, including hash algorithm information and Slave node information, for data forwarding and Slave node management; the Master node has multiple Slave nodes, which are used to realize the storage of key-value pairs;

[0076] The hash algorithm information includes multiple linear hash functions, the number of hash functions, split pointers, and load critical points triggering node splitting, etc. The Slave node information includes the number of Slave nodes in use, the number of idle Slave nodes, Slave node addresses, and Slave node real-time load rate, etc.

[0077] More specifically, as shown in Figure 4As shown, the Slave node adopts LB+-Trees data structure, and three-layer storage structure, namely DRAM+NVM+SSD, is set;

[0078] The data distribution of the Slave node is composed of a B+ tree, and the non-leaf nodes are stored in the DRAM, and the leaf nodes are stored in the NVM;

[0079] Each time the data is operated, the leaf nodes on the NVM are operated first, and then the non-leaf nodes of the DRAM are updated; log free can be realized, and the time consumption of writing log is reduced;

[0080] For the overflow data of the Slave node, LevelDB is used to realize serial write operation on the SSD.

[0081] In the application, the non-volatile memory NVM selects 3DXPoint storage medium, and fast access and processing of data can be realized.

[0082] S2, according to the access request of the key-value pair, the Master node calls a plurality of linear hash functions to calculate the key of the key-value pair, and obtains the Slave node corresponding to all hash values;

[0083] S3, the Master node sends a corresponding operation request to the corresponding Slave node, including an increase operation, a deletion operation, a modification operation and a search operation;

[0084] For the increase operation, based on the idea of cuckoo hash algorithm, the Master node obtains the real-time load rate of the corresponding Slave node according to the corresponding Slave node; the Slave node sequence number of the first half, namely the half Slave node with lower real-time load rate, is obtained in ascending order; the operation request of increasing the key-value pair is sent to the half Slave node with lower real-time load rate; after the Slave node increases the operation, the new real-time load rate of the Slave node is returned to the Master node;

[0085] For the deletion operation, the Master node sends the operation request of deleting the key-value pair to the corresponding Slave node; after the corresponding Slave node completes the deletion operation, the new real-time load rate of the corresponding Slave node is returned to the Master node;

[0086] For the modification operation, the Master node first sends an operation request of deleting the key-value pair to the corresponding Slave node; after the corresponding Slave node completes the deletion operation, the Master node obtains the real-time load rate of the corresponding Slave node based on the idea of the cuckoo hash algorithm; the Slave nodes are sorted in ascending order, and the sequence numbers of the first half of the Slave nodes, i.e., the half of the Slave nodes with lower real-time load rates, are obtained; the operation request of adding the key-value pair is sent to the half of the Slave nodes with lower real-time load rates; after the Slave node completes the addition operation, the Slave node returns the new real-time load rate of the Slave node to the Master node.

[0087] For the lookup operation, the Master node sorts the real-time load rates of the corresponding Slave nodes in ascending order, and sends the lookup request to the Slave nodes in sequence, and returns the current Slave node sequence number when the lookup is successful.

[0088] S4, since the Master node stores the load critical point of the Slave node triggering node splitting, when the Master node detects that the real-time load rate of a Slave node exceeds the load critical point of triggering node splitting, the node splitting operation is performed, specifically:

[0089] When the Master node detects that the real-time load rate of a node Slave exceeds the load critical point of triggering node splitting, the Slave node pointed to by the split pointer is split;

[0090] An idle Slave node is automatically added in the distributed storage index system, and the information of the storage index system stored in the Master node is updated;

[0091] All data stored in the Slave node is deleted one by one;

[0092] When deleting, the Master node first caches the key-value pair of the Slave node to be deleted, then the Slave node deletes all the data stored, and after the deletion is successful, the Master node sends an addition operation to the Slave node, stores the cached key-value pair to the Slave node, and after the addition operation is successful, the split pointer is moved backward, completing the node splitting.

[0093] It should be noted that for the foregoing method embodiments, in order to simplify the description, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other order or simultaneously.

[0094] Based on the same idea as the multiple hash-based distributed storage index method in the above embodiment, the application also provides a multiple hash-based distributed storage index system which can be used to execute the above multiple hash-based distributed storage index method. For the convenience of illustration, in the structural schematic diagram of the embodiment of the multiple hash-based distributed storage index system, only the parts related to the embodiment of the application are shown, and those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and the device can include more or fewer components than the illustrated ones, or combine certain components, or have a different arrangement of components.

[0095] Please refer to Figure 5 In another embodiment of the present application, a multiple hash-based distributed storage index system is provided, which includes at least the following modules:

[0096] The building module is based on a key-value storage engine and uses a Master / Slave architecture to build the system;

[0097] More specifically, the Master / Slave architecture used by the system includes a Master node and multiple Slave nodes; the Master node stores detailed information of the system, including hash algorithm information and Slave node information, which are used for data forwarding and Slave node management; the Slave nodes are used to implement the storage of key-value pairs;

[0098] The hash algorithm information includes multiple linear hash functions, the number of hash functions, split pointers, and the load critical point triggering node splitting, etc.; the Slave node information includes the number of Slave nodes in use, the number of idle Slave nodes, Slave node addresses, and real-time load rates of Slave nodes, etc.

[0099] The computing module calculates the keys of the key-value pairs according to the access request of the key-value pairs, and calls multiple linear hash functions in the Master node to obtain the Slave nodes corresponding to all hash values;

[0100] The operation module sends corresponding operation requests from the Master node to the corresponding Slave nodes according to the corresponding Slave nodes calculated by the computing module;

[0101] The storage module is located in the Slave node;

[0102] The splitting module judges whether the real-time load rate of the Slave node exceeds the load critical point triggering node splitting according to the detection of the Master node, and if so, performs node splitting operation on the Slave node pointed by the split pointer.

[0103] More specifically, the operation module includes an adding module, a deleting module, a modifying module and a searching module;

[0104] The adding module, based on the cuckoo hashing algorithm, obtains the real-time load rate of the corresponding Slave node according to the corresponding Slave node calculated by the calculating module; sorts in ascending order to obtain the sequence number of the first half of the Slave nodes, i.e. the half of the Slave nodes with lower real-time load rate; sends an operation request of adding a key-value pair to the half of the Slave nodes with lower real-time load rate, stores the key-value pair in the storage module of the half of the Slave nodes with lower real-time load rate, and returns the new real-time load rate of the Slave node to the Master node after the adding operation is completed;

[0105] The deleting module, according to the corresponding Slave node calculated by the calculating module, sends an operation request of deleting a key-value pair to the corresponding Slave node, deletes the key-value pair from the storage module of the corresponding Slave node, and returns the new real-time load rate of the corresponding Slave node to the Master node after the deleting operation is completed;

[0106] The modifying operation first sends an operation request of deleting a key-value pair to the corresponding Slave node calculated by the calculating module, and after the corresponding Slave node deletes the key-value pair from the corresponding storage module, obtains the real-time load rate of the corresponding Slave node; sorts in ascending order to obtain the sequence number of the first half of the Slave nodes, i.e. the half of the Slave nodes with lower real-time load rate; sends an operation request of adding a key-value pair to the half of the Slave nodes with lower real-time load rate; stores the key-value pair in the storage module of the half of the Slave nodes with lower real-time load rate, and returns the new real-time load rate of the Slave node to the Master node after the adding operation is completed;

[0107] The searching module, according to the corresponding Slave node calculated by the calculating module, sorts the real-time load rate of the corresponding Slave node in ascending order, sends a search request to the Slave nodes in sequence, and returns the sequence number of the current Slave node when the search is successful.

[0108] More specifically, the splitting module performs the node splitting operation as follows:

[0109] First, an idle Slave node is automatically added in the distributed storage index system, and the information of the entire storage index system in the Master node is updated;

[0110] Delete operation is performed on all data stored in the Slave nodes one by one;

[0111] When deleting, the key-value pairs of the slave node to be deleted are cached in the master node first, then the slave node deletes all the stored data, and after successful deletion, the master node sends an increase operation to the slave node to store the cached key-value pairs to the slave node, and after the increase operation is successful, the split pointer is moved to complete node splitting.

[0112] More specifically, the slave node adopts an LB+-Trees data structure, and the storage module of the slave node is provided with a three-layer storage structure, namely DRAM+NVM+SSD.

[0113] The data distribution of the slave node is composed of a B+ tree, the non-leaf nodes are stored on the DRAM structure of the storage module, and the leaf nodes are stored on the NVM structure of the storage module; each time a data operation is performed, the leaf nodes on the NVM structure of the storage module are operated first, and then the non-leaf nodes of the DRAM structure are updated; for the overflow data of the slave node, LevelDB is used to perform serial write operation on the SSD structure of the storage module.

[0114] It should be noted that the distributed storage index system based on multiple hash of the application corresponds to the distributed storage index method based on multiple hash of the application, the technical features and advantages described in the above embodiment of the distributed storage index method based on multiple hash are applicable to the embodiment of the distributed storage index system based on multiple hash, and the specific content can be referred to the description in the method embodiment of the application, which will not be described here. It is hereby declared.

[0115] In addition, in the embodiment of the distributed storage index system based on multiple hash of the above embodiment, the logical division of each program module is only an example, and in actual application, the above function allocation can be completed by different program modules according to the needs, for example, considering the configuration requirements of the corresponding hardware or the convenience of software implementation, that is, the internal structure of the distributed storage index system based on multiple hash is divided into different program modules to complete all or part of the functions described above.

[0116] The technical features of the above embodiments can be combined arbitrarily, and in order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0117] The above embodiments are the preferred embodiments of the application, but the embodiments of the application are not limited to the above embodiments, and any changes, modifications, substitutions, combinations and simplifications made without departing from the spirit and principles of the application shall be equivalent replacement modes, and shall be included in the protection scope of the application.

Claims

1. A distributed storage indexing method based on multiple hashing, characterized in that, Includes the following steps: A distributed storage indexing system is built based on a key-value storage engine and using a Master / Slave architecture. The Master / Slave architecture includes one Master node and multiple Slave nodes; The Master node stores distributed storage index system information, including hash algorithm information and Slave node information, and is used for data forwarding and Slave node management; the Slave node is used to implement key-value pair storage. The hash algorithm information includes multiple linear hash functions, the number of hash functions, split pointers, and the load threshold that triggers node splitting; the slave node information includes the number of slave nodes currently in use, the number of idle slave nodes, slave node addresses, and the real-time load rate of slave nodes; Based on the access request for key-value pairs, the Master node calls multiple linear hash functions to calculate the key of the key-value pair, and obtains the Slave nodes corresponding to all hash values; The Master node sends corresponding operation requests to the corresponding Slave nodes; the operations include add, delete, modify, and search operations. The specific addition operation is as follows: Based on the Cuckoo hash algorithm, the Master node obtains the real-time load rate of the corresponding Slave node according to the Slave node. Sort the nodes in ascending order to get the first half of the Slave node numbers, which are the Slave nodes with the lowest real-time load rate. Send an operation request to add key-value pairs to half of the slave nodes with lower real-time load rates; After the Slave node addition operation is completed, the new real-time load rate of the Slave node is returned to the Master node. When the Master node detects that the real-time load rate of a Slave node exceeds the load threshold that triggers node splitting, it executes a node splitting operation. The specific execution node splitting operation is as follows: When the Master node detects that the real-time load rate of a Slave node exceeds the load threshold that triggers node splitting, it splits the Slave node pointed to by the split pointer. Automatically add an idle Slave node to the distributed storage index system and update the storage index system information in the Master node; Perform deletion operations on all data stored in each Slave node one by one; During deletion, the key-value pairs of the Slave node to be deleted are first cached in the Master node. Then, the Slave node deletes all the stored data. After successful deletion, the Master node sends an add operation to the Slave node, stores the cached key-value pairs in the Slave node, and after successful add operation, the split pointer is moved forward to complete the node split.

2. The distributed storage indexing method based on multiple hashing according to claim 1, characterized in that, The Slave node adopts the LB+-Trees data structure and sets up a three-layer storage structure, namely DRAM+NVM+SSD; The data distribution of the Slave node is composed of a B+ tree, with non-leaf nodes stored in DRAM and leaf nodes stored in NVM; Each time a data operation is performed, the leaf nodes on the NVM are operated on first, and then the non-leaf nodes in the DRAM are updated. For overflow data from Slave nodes, LevelDB is used to perform serial write operations on the SSD.

3. The distributed storage indexing method based on multiple hashing according to claim 2, characterized in that, The deletion operation is specifically as follows: The Master node sends a request to the corresponding Slave node to delete the key-value pair; After the corresponding Slave node deletion operation is completed, the new real-time load rate of the corresponding Slave node is returned to the Master node.

4. The distributed storage indexing method based on multiple hashing according to claim 2, characterized in that, The modification operation is specifically as follows: The Master node first sends a request to the corresponding Slave node to delete the key-value pair; After the corresponding Slave node deletion operation is completed, the Master node obtains the real-time load rate of the corresponding Slave node based on the Cuckoo hash algorithm; Sort the nodes in ascending order to get the first half of the Slave node numbers, which are the Slave nodes with the lowest real-time load rate. Send an operation request to add key-value pairs to half of the slave nodes with lower real-time load rates; After the Slave node addition operation is completed, the new real-time load rate of the Slave node is returned to the Master node.

5. The distributed storage indexing method based on multiple hashing according to claim 2, characterized in that, The search operation is specifically as follows: The Master node sorts the corresponding Slave nodes in ascending order based on their real-time load rates, sends lookup requests to the Slave nodes in sequence, and returns the current Slave node sequence number when the lookup is successful.

6. A distributed storage index system based on multiple hashing, characterized in that, It includes a construction module, a calculation module, an operation module, a storage module, and a splitting module; The building module is based on a key-value storage engine and uses a Master / Slave architecture to build the system; The Master / Slave architecture includes one Master node and multiple Slave nodes; The Master node stores distributed storage index system information, including hash algorithm information and Slave node information, and is used for data forwarding and Slave node management; the Slave node is used to implement key-value pair storage. The hash algorithm information includes multiple linear hash functions, the number of hash functions, split pointers, and the load threshold that triggers node splitting; the slave node information includes the number of slave nodes currently in use, the number of idle slave nodes, slave node addresses, and the real-time load rate of slave nodes; The calculation module calls multiple linear hash functions on the Master node to calculate the key of the key-value pair according to the access request of the key-value pair, so as to obtain the Slave node corresponding to all hash values. The operation module sends corresponding operation requests from the Master node to the corresponding Slave node based on the Slave node calculated by the calculation module; the operation module includes an add module, a delete module, a modify module, and a search module; The addition module is based on the Cuckoo hash algorithm. According to the corresponding Slave node calculated by the calculation module, it obtains the real-time load rate of the corresponding Slave node; sorts them in ascending order to obtain the sequence number of the first half of the Slave nodes, that is, the half of the Slave nodes with lower real-time load rates; sends an operation request to add key-value pairs to the half of the Slave nodes with lower real-time load rates, stores the key-value pairs in the storage module of the half of the Slave nodes with lower real-time load rates, and returns the new real-time load rate of the Slave nodes to the Master node after the addition operation is completed. The storage module is located on the Slave node; The splitting module determines whether the real-time load rate of the Slave node exceeds the load threshold that triggers node splitting based on the detection of the Master node. If so, it executes the node splitting operation. The specific execution node splitting operation is as follows: When the Master node detects that the real-time load rate of a Slave node exceeds the load threshold that triggers node splitting, it splits the Slave node pointed to by the split pointer. Automatically add an idle Slave node to the distributed storage index system and update the storage index system information in the Master node; Perform deletion operations on all data stored in each Slave node one by one; During deletion, the key-value pairs of the Slave node to be deleted are first cached in the Master node. Then, the Slave node deletes all the stored data. After successful deletion, the Master node sends an add operation to the Slave node, stores the cached key-value pairs in the Slave node, and after successful add operation, the split pointer is moved forward to complete the node split.

7. The distributed storage index system based on multiple hashing according to claim 6, characterized in that, The deletion module sends a request to delete key-value pairs to the corresponding Slave node based on the calculation module, deletes the key-value pairs from the storage module of the corresponding Slave node, and returns the new real-time load rate of the corresponding Slave node to the Master node after the deletion operation is completed. The modification module first sends a request to delete key-value pairs to the corresponding Slave node calculated by the calculation module. After the corresponding Slave node is deleted from the corresponding storage module, the real-time load rate of the corresponding Slave node is obtained. The Slave nodes are sorted in ascending order to obtain the sequence numbers of the first half of the Slave nodes, which are the half of the Slave nodes with lower real-time load rates. The modification module then sends a request to add key-value pairs to the half of the Slave nodes with lower real-time load rates. The key-value pairs are stored in the storage module of the half of the Slave nodes with lower real-time load rates. After the addition operation is completed, the modification module returns the new real-time load rate of the Slave nodes to the Master node. The search module sorts the real-time load rates of the corresponding slave nodes in ascending order according to the calculation module, and sends search requests to the slave nodes in sequence. When the search is successful, it returns the current slave node sequence number.

8. The distributed storage index system based on multiple hashing according to claim 6, characterized in that, The Slave node adopts the LB+-Trees data structure, and the storage module of the Slave node is set with a three-layer storage structure, namely DRAM+NVM+SSD. The data distribution of the Slave node is composed of a B+ tree. Non-leaf nodes are stored on the DRAM structure of the storage module, and leaf nodes are stored on the NVM structure of the storage module. Each time a data operation is performed, the leaf nodes on the NVM structure of the storage module are operated on first, and then the non-leaf nodes on the DRAM structure of the storage module are updated. For overflow data from Slave nodes, LevelDB is used to perform serial write operations on the SSD structure of the storage module.

Citation Information

Patent Citations

  • Distributed small file system and method for block storage, storage medium and electronic equipment

    CN111913928A

  • Storage-efficient and collision-free hash-based packet processing architecture and method

    US20070136331A1