Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Data storage method and terminal based on consistent hash algorithm

A hash algorithm and data storage technology, applied in the direction of electrical digital data processing, digital data information retrieval, special data processing applications, etc., can solve the problems of uneven distribution of nodes, it is difficult to ensure continuous uniformity, etc., and achieve enhanced redundancy security performance, improving usage efficiency, and improving search efficiency

Active Publication Date: 2021-01-15
JINQIANMAO TECH CO LTD
View PDF8 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, the traditional distributed hash algorithm faces the problem of uneven distribution of nodes, especially after dynamically adding nodes, even if the original distribution is uniform, it is difficult to ensure that it will continue to be uniform
As a result, another serious disadvantage is that when a node is abnormal, all the pressure of the node is transferred to an adjacent node. When a new node is added, it can only share the pressure for an adjacent node.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Data storage method and terminal based on consistent hash algorithm
  • Data storage method and terminal based on consistent hash algorithm
  • Data storage method and terminal based on consistent hash algorithm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0088] Please refer to figure 1 and image 3 , Embodiment 1 of the present invention is:

[0089] A data storage method based on a consistent hash algorithm, comprising steps:

[0090] S1. Construct a physical disk sequence table, and map each physical disk in the physical disk sequence table to more than one virtual node;

[0091] S2. Arranging all the virtual nodes corresponding to all the physical disks in the physical disk sequence table according to the order of the first hash value to form a hash ring;

[0092] In an optional implementation manner, the hash ring, that is, the topology logic structure of each virtual node is a chord ring;

[0093] S3. Receive a file storage request, the file storage request includes a file to be stored and a file name, and uses the file name as a storage key (key value);

[0094] S4. Calculate the second hash value corresponding to the file name, find the first hash value closest to the second hash value on the hash ring according to ...

Embodiment 2

[0103] Please refer to Figure 7 , the second embodiment of the present invention is:

[0104] A data storage method based on a consistent hash algorithm, which differs from Embodiment 1 in that:

[0105] Also includes expansion:

[0106] Adding a third physical disk to the physical disk sequence table, mapping the third physical disk to more than one child node, and calculating a third hash value of each of the child nodes;

[0107] Put each of the child nodes into the hash ring according to the third hash value;

[0108] Obtain an adjacent virtual node adjacent to the child node, and obtain an adjacent hash value corresponding to the adjacent virtual node;

[0109] Calculating the second hash value of all stored files, and storing the files to be stored whose second hash value is within the interval between the third hash value and the adjacent hash value into the third physical disk;

[0110] Also includes removing physical disks:

[0111] Delete the fourth physical di...

Embodiment 3

[0121] Please refer to Figure 3 to Figure 6 , Embodiment three of the present invention is:

[0122] Apply the above-mentioned data storage method based on the consistent hash algorithm to the actual scene:

[0123] (1) if image 3 As shown, construct the local disk sequence table A, B...N with a total of N disks;

[0124] (2) Map each disk into several disk sub-nodes (virtual nodes), such as mapping to 10 virtual nodes, the virtual nodes of disk A are A1, A2...A10, and the virtual nodes of disk B are B1, B2...B10 , the virtual nodes of disk N are N1, N2...N10; calculate the hash value of all the above virtual nodes, and place each virtual node on a consistent hash table such as a chord ring according to its hash value. When performing data query, Store all the data on the physical node (disk) corresponding to the virtual node. For example, for data query, the storage location is AX, all are placed on disk A;

[0125] (3) When storing a file, receive the write data reques...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a data storage method and terminal based on a consistent hash algorithm, and the method comprises the steps: mapping a physical disk into more than one virtual node, and calculating a first hash value of each virtual node; arranging all virtual nodes according to the size sequence of first hash values to form a hash ring; receiving a file storage request, wherein the file storage request comprises a to-be-stored file and a file name; calculating a second hash value corresponding to the filename, finding a first hash value closest to the second hash value on the hash ringaccording to a preset direction, and storing the to-be-stored file corresponding to the filename to a physical disk where a virtual node corresponding to the first hash value closest to the second hash value is located. The single physical disk is mapped into the plurality of virtual nodes, and the file name is used as the key value to identify the to-be-stored file, so that the file searching efficiency is improved.

Description

technical field [0001] The invention relates to the field of data storage, in particular to a data storage method and terminal based on a consistent hash algorithm. Background technique [0002] In recent years, with the explosive growth of data scale, higher requirements have been placed on the storage redundancy and performance of disks; the traditional disk management method is to use RAID (Redundant Arrays of Independent Disks, Redundant Array of Independent Disks) technology , through the way of hardware RAID or software RAID, the disks are formed into a disk pool to realize redundant storage; the emergence of erasure code technology later provides a better solution for data redundant storage. Compared with traditional RAID technology, erasure coding can achieve better disk redundancy, less reconstruction time, and better data access performance, greatly improving disk usage efficiency. [0003] However, the traditional distributed hash algorithm faces the problem of u...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F3/06G06F11/10G06F16/13G06F16/172
CPCG06F3/0608G06F3/0619G06F3/0643G06F3/0676G06F11/1004G06F16/137G06F16/172
Inventor 程永红
Owner JINQIANMAO TECH CO LTD
Features
  • Generate Ideas
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More