WO2012034470A1 - 一种基于哈希算法的数据存储方法及装置 - Google Patents

一种基于哈希算法的数据存储方法及装置 Download PDF

Info

Publication number
WO2012034470A1
WO2012034470A1 PCT/CN2011/078564 CN2011078564W WO2012034470A1 WO 2012034470 A1 WO2012034470 A1 WO 2012034470A1 CN 2011078564 W CN2011078564 W CN 2011078564W WO 2012034470 A1 WO2012034470 A1 WO 2012034470A1
Authority
WO
WIPO (PCT)
Prior art keywords
key value
primary key
data
stored
storage module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2011/078564
Other languages
English (en)
French (fr)
Inventor
袁清
章建桂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to RU2013114990/08A priority Critical patent/RU2586010C2/ru
Publication of WO2012034470A1 publication Critical patent/WO2012034470A1/zh
Priority to US13/610,876 priority patent/US9104676B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables

Definitions

  • the present invention relates to computer data storage technology, and in particular, to a data storage method and apparatus based on a hash algorithm. Background of the invention
  • IM Instant Messaging
  • the instant messaging client often adopts a hash algorithm, and uses a hash table to implement fast data storage.
  • the hash algorithm generally includes: a CRC (Cyclic Redundancy Check) algorithm 32, Message-Digest Algorithm (5) and Secure Hash Algorithm (SHA), which uses a hash algorithm to digitize a data string to generate a primary key (ey). Value, and then use the Key value to take a larger prime M, so that the data can be evenly distributed on the M-size hash table.
  • CRC Cyclic Redundancy Check
  • SHA Secure Hash Algorithm
  • FIG. 1 is a schematic diagram of a data storage structure based on a hash algorithm in the prior art.
  • Md5 digitizes the data, takes a first 8 bytes to generate a Key value, and takes the Key value to a predetermined larger prime number M, and then the data and the data thereof.
  • the corresponding Key value is stored in the hash table of the remainder mapping, and M can be determined according to actual needs and the Key value obtained by hashing the data.
  • the data to be queried is processed by using a hash algorithm to obtain a Key value, and then the prime number M used in the stored hash table is used to locate the position of the data in the Hash table, and then located in the location.
  • the location query linked list if the data stored in the linked list matches the data to be queried, obtains the data corresponding to the Key value and returns corresponding information to the user.
  • the Hash table is in the form of a linked list. For storage, each data has the same primary key value, which makes subsequent query and read difficulties. For the data corresponding to the primary key value that does not conflict, you need to reserve the conflicting primary key value for the hash table.
  • the corresponding storage space, and the traversal in the hash table using the prime number M, to determine that there is no identical data can be stored, so that the storage efficiency is low; further, for the non-conflicting data stored in the Hash table
  • the complexity (efficiency) of the query is related to the prime number M used in the hash table, and the complexity of the query data is O(n) for the conflicting data stored in the hash table. Where n is the number of data stored in the conflicting list, for example, by querying the data datalll in FIG.
  • the main object of the present invention is to provide a data storage method based on a hash algorithm, which reduces storage device requirements and improves storage efficiency.
  • Another object of the present invention is to provide a data storage device based on a hash algorithm, which reduces storage device requirements and improves storage efficiency.
  • the present invention provides a data storage method based on a hash algorithm, the method comprising:
  • the data in the Hash table preset by the backend storage module is not stored, and the data to be stored and the corresponding primary key value are stored.
  • the determining that the data to be stored is not stored in the Hash table preset by the backend storage module, and storing the data to be stored and the corresponding primary key value specifically includes:
  • the step of performing the step of determining whether the primary key value corresponding to the data to be stored is stored in the hash table set in advance by the backend storage module is returned.
  • the preset step size is multiplied by the number of preset steps, and the multiplied product is subjected to a modulo operation on the number of back-end memory modules, and the remainder obtained by performing the modulo operation is 0.
  • the method further includes: expanding the number of the backend storage modules in a manner of doubling each time. Further includes:
  • the obtaining the primary key value corresponding to the query request according to the query request specifically includes:
  • Obtaining a query request determining whether the query request carries data or an already-identified primary key value; if it is data, calculating a primary key value corresponding to the data, and using the calculated primary key value as a primary key value corresponding to the query request; If it is an already identified primary key value, the identified primary key value is used as the primary key value corresponding to the query request.
  • the searching for the hash table and obtaining the data to be queried specifically include:
  • the searching the hash table and obtaining the data to be queried specifically include:
  • a data storage device based on a hash algorithm comprising: a plurality of backend storage modules, a mapping relationship storage module, a primary key value calculation module, and a modulo operation unit, wherein
  • mapping relationship storage module configured to store a mapping relationship between the backend storage module identifier and the modulo L operation, where L is the number of the backend storage modules;
  • a primary key value calculation module configured to calculate a primary key value of the data to be stored according to the Hash algorithm, and output the signal to the modulo operation unit;
  • the modulo operation unit is configured to: according to the number of the backend storage modules, modulate the obtained primary key value, obtain the backend storage module identifier of the remainder mapping of the modulo from the mapping relationship storage module according to the remainder of the modulo, and perform the modulo operation
  • the primary key value and the corresponding data are output to the corresponding identified backend storage module;
  • the backend storage module is configured to determine that the pre-set hash table does not store the to-be-stored data, and stores the to-be-stored data and the corresponding primary key value.
  • the backend storage module is a random access memory, a flash memory, a rewritable memory, or a hard disk.
  • the backend storage module includes: a primary key value query unit, a hash table storage unit, a data matching unit, and a primary key value conflict processing unit, where
  • the primary key value query unit is configured to sequentially determine whether the data pair to be stored is stored in the hash table. The primary key value of the response, if not, output the primary key value and the data corresponding to the primary key value to
  • the Hash table is stored; if yes, the primary key value and the data corresponding to the primary key value are output to the data matching unit;
  • a data matching unit configured to match the received data with the data stored in the Hash table, if the same is the same, no processing; otherwise, setting a conflict flag on the stored data, and outputting the primary key value to the primary key value conflict processing unit ;
  • a primary key value conflict processing unit configured to add the received primary key value to a preset step size, determine whether the number of times of the preset step size exceeds a preset threshold, and if yes, do not process; otherwise, add The primary key value of the preset step size is output to the primary key value query unit.
  • the data storage method and device based on the hash algorithm provided by the present invention pre-set the mapping relationship between the L backend storage modules and the backend storage module identifier and the modulo L operation; according to the Hash algorithm Calculating the primary key value of the data to be stored; performing the modulo operation on the number of the storage module at the end of the acquired primary key value, and performing the mapping of the backend storage module identifier and the modulo L operation, and performing the primary key value of the modulo L operation and The corresponding data is output to the corresponding identified backend storage module.
  • the data stored in the Hash table preset by the backend storage module is not stored, and the data to be stored and the corresponding primary key value are stored. In this way, by using a distributed storage method and setting a plurality of back-end storage modules, the storage device requirements can be reduced, the time required for storage is effectively reduced, and the storage efficiency is improved.
  • FIG. 2 is a schematic flowchart of a data storage method based on a hash algorithm according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of selecting a backend storage module for storing data according to a data primary key value and a number of backend storage modules according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a hash table according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a process for determining that a data to be stored, a data to be stored, and a corresponding primary key value are not stored in a hash table preset by the backend storage module according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of querying data according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a data storage device based on a hash algorithm according to an embodiment of the present invention. Mode for carrying out the invention
  • FIG. 2 is a schematic flowchart of a data storage method based on a hash algorithm according to an embodiment of the present invention. Referring to Figure 2, the process includes:
  • Step 201 pre-setting L back-end storage modules and a back-end storage module identifier that is mapped to the modulo L;
  • the backend storage module may be a storage unit built in the client, such as a random access memory, a flash memory, a rewritable memory, a hard disk, or the like, or may be a storage unit in an external independent server.
  • the number of the back-end storage modules is a prime number (L), for example, L is a prime number 3, and the corresponding back-end storage module identifiers are mapped to the modulo L for the set three back-end storage modules. Can be set to 0, 1, 2, respectively.
  • the mapping relationship between the backend storage module identifier and the modulo L operation may be: if the remainder of the operation with the modulo L is 0, the corresponding storage is stored to the backend storage module whose backend storage module identifier is 0, and the remainder of the operation with the modulo L For 1 data, Corresponding to the back-end storage module stored to the back-end storage module ID 1, and so on.
  • Step 202 calculating a primary key value KEY of the data to be stored according to the Hash algorithm
  • Step 203 Perform a modulo operation on the obtained primary key value by using L as a modulo, and output the primary key value and the corresponding data of the modulo L operation to the corresponding identified backend storage module according to the mapping relationship;
  • the modulo operation is performed by using the number of back-end storage modules (L), that is, the obtained primary key value KEY, and the number of the back-end storage modules is used as a modulus, and the KEY is passed.
  • L the number of back-end storage modules
  • MOD L obtains the backend storage module identifier mapped to the modulo L, thereby selecting the corresponding backend storage module.
  • FIG. 3 is a schematic diagram of selecting a backend storage module for storing data according to a data primary key value and a number of backend storage modules according to an embodiment of the present invention.
  • Module 2
  • Step 204 Determine that the to-be-stored data is not stored in the Hash table preset by the back-end storage module, and store the to-be-stored data and the corresponding primary key value.
  • the number of Hash tables preset in the backend storage module is a prime number.
  • the prime number can take a larger value.
  • the Hash table uses multiple Hash buckets side by side according to the preset prime number.
  • FIG. 4 is a schematic structural diagram of a hash table according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of the process of determining that the data to be stored and the data to be stored and the corresponding primary key value are not stored in the Hash table preset by the backend storage module according to the embodiment of the present invention.
  • the process includes:
  • Step 501 judging whether the primary key value corresponding to the data to be stored is stored in the Hash table preset by the backend storage module, if not, executing step 502, otherwise, performing step 503;
  • Step 502 Store the primary key value and data corresponding to the primary key value.
  • the next column in which the data is last stored in the hash table stores the primary key value and The data corresponding to the primary key value.
  • the primary key value is stored in the hash table, indicating that the data corresponding to the primary key value has been stored in the hash table, it is necessary to further determine whether the primary key value corresponds to the stored data and the data to be stored. If the match is the same as the primary key value corresponding to the data to be stored, The primary key value corresponding to the stored data is reset to uniquely identify the data to be stored, and the primary key value is added to the preset step size and the matching is continued. At the same time, in conflict with the data to be stored A conflict flag flag is placed in the stored data structure to indicate that the stored data has ever collided. 504. Determine whether the number of times the preset step is added exceeds a preset threshold, and if yes, end the process, otherwise, return to step 501.
  • the product of the preset step size and the preset number of steps and the preset number of back-end memory modules N have a remainder of 0.
  • the pre-set step size is multiplied by the preset number of steps, and the multiplied product is subjected to a modulo operation on the number of back-end memory modules.
  • the remainder obtained by performing the modulo operation is 0, and the calculation formula is:
  • Key is the primary key value corresponding to the data to be stored
  • N is the number of backend storage modules
  • n is the number of preset steps
  • Step is the preset step size.
  • the storage method is such that each stored data has a unique primary key value, and can ensure that in a distributed system, conflicting data can be deployed on the same back-end storage module for subsequent query and reading;
  • the depth of the bucket in the Hash table is the number of steps set, which effectively reduces the space required for the storage of the hash table.
  • the step size can be determined.
  • the parallel expansion scheme of the data storage can be determined, which can effectively meet the requirements in the case of parallel expansion.
  • FIG. 6 is a schematic flowchart of querying data according to an embodiment of the present invention. See Figure 6, the process includes:
  • Step 600 obtaining a query request, determining whether the data is carried in the query request or the primary key value that has been identified, if the data is ,, step 601 is performed, if it is the primary key value that has been identified, step 611 is performed;
  • Step 601 Calculate a primary key value of the data to be queried according to the Hash algorithm
  • Step 602 Obtain a backend storage module corresponding to the primary key value.
  • the primary key value is used to obtain the backend storage module identifier, and the mapping relationship between the backend storage module identifier and the modulo operation is obtained, thereby obtaining the main The backend storage module address stored by the data corresponding to the key value.
  • Step 603 sequentially search the Hash table for the primary key value corresponding to the data to be queried, if not, go to step 604, otherwise, go to step 605;
  • Step 604 returning the query request failure information, and ending the process
  • Step 605 Determine whether a conflicting flag is set in the data structure corresponding to the stored primary key value. Note, if not, go to step 606, otherwise, go to step 607;
  • Step 606 returning the query request success information, carrying the data corresponding to the primary key value;
  • step 608 it is judged whether the number of times of the preset step is more than a preset threshold. If yes, go to step 609, otherwise, go back to step 603.
  • Step 609 returning the query request failure information, and ending the process
  • Step 611 Perform a modulo operation on the number of the storage modules at the end of the identified primary key value, and obtain a backend storage module corresponding to the primary key value according to the mapping relationship between the identifier of the backend storage module and the modulo operation;
  • Step 612 searching for a primary key value in the hash table, if not, executing step 613, otherwise, performing step 614;
  • Step 613 returning the query request failure information, and ending the process
  • Step 614 returning the query request success information, and carrying the data corresponding to the identifierd primary key value.
  • FIG. 7 is a schematic structural diagram of a data storage device based on a hash algorithm according to an embodiment of the present invention. Referring to FIG. 7, the device includes: a plurality of backend storage modules, a mapping relationship storage module, a primary key value calculation module, and a modulo operation unit, where
  • mapping relationship storage module configured to store a mapping relationship between the backend storage module identifier and the modulo L operation
  • a primary key value calculation module configured to calculate a primary key value KEY of the data to be stored according to the Hash algorithm, and output the signal to the modulo operation unit;
  • the modulo operation unit is configured to: according to the number of the backend storage modules, modulate the obtained primary key value, obtain the backend storage module identifier of the remainder mapping of the modulo from the mapping relationship storage module according to the remainder of the modulo, and perform the modulo operation
  • the primary key value and the corresponding data are output to the corresponding identified backend storage module;
  • the backend storage module is configured to determine that the pre-set hash table does not store the to-be-stored data, and stores the to-be-stored data and the corresponding primary key value.
  • the backend storage module may be a random access memory, a flash memory, a rewritable memory, or a hard disk.
  • the backend storage module includes: a primary key value query unit, a hash table storage unit, a data matching unit, and a primary key value conflict processing unit, where
  • the primary key value query unit is configured to sequentially determine whether the primary key value corresponding to the data to be stored is stored in the Hash table storage unit Hash table, and if not, output the primary key value and the data corresponding to the primary key value to the hash table. Store; if yes, output the primary key value and the data corresponding to the primary key value to the data matching unit;
  • a data matching unit configured to match the received data with the data stored in the Hash table storage unit Hash table, if the same, no processing; otherwise, set a conflict flag on the stored data, and output the primary key value to the primary key value Conflict handling unit;
  • a primary key value conflict processing unit configured to add the received primary key value to a preset step size, It is judged whether the number of times of the preset step is more than a preset threshold, and if so, no processing is performed; otherwise, the primary key value added with the preset step size is output to the primary key value query unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种基于哈希算法的数据存储方法及装置。包括:预先设置L个后端存储模块以及后端存储模块标识与模L运算的映射关系;根据Hash算法计算待存储数据的主键值;对获取的主键值以后端存储模块数量为模执行模运算,根据后端存储模块标识与模L运算的映射关系,将执行模L运算的主键值及对应的数据输出至相应标识的后端存储模块;确定后端存储模块预先设置的Hash表中没有存储待存储数据,存储待存储数据及对应的主键值。应用本发明,可以降低存储设备要求、提高存储效率。

Description

一种基于哈希算法的数据存储方法及装置 本申请要求于 2010 年 09 月 13 日提交中国专利局、 申请号为 201010281747.0、 发明名称为 "一种基于哈希算法的数据存储方法及装 置" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及计算机数据存储技术, 特別涉及一种基于哈希算法的数 据存储方法及装置。 发明背景
即时通讯(IM, Instant Messaging )工具由于具有准入技术低, 可以 即时通过较少的语句来表达自己情感, 与关注自己的用户分享, 因而, 信息传递的效率较高, 其应用也越来越广泛。
现有的即时通讯用户收听人列表在理论上没有任何限制, 用户通过 各类客户端就可以实时接收到自己关注的收听人发表或者转播的消息, 因此, 对应接收到的消息数据数量将十分庞大, 如何对接收的消息等数 据进行有效地存储以及对存储的数据进行快速地查询, 是即时通讯技术 发展亟需解决的技术问题。
现有技术中, 即时通讯客户端常采用哈希(Hash )算法, 利用 Hash 表来实现对数据的快速存储, Hash 算法一般包括: 循环冗余校验码 ( CRC, Cyclic Redundancy Check ) 算法 32、 信息 -摘要算法 ( Message-Digest Algorithm ) 5以及安全哈希算法 ( SHA, Secure Hash Algorithm ),采用 Hash算法对数据串进行数字化后生成一个主键 ( ey ) 值, 再用 Key值对一个较大的质数 M取余, 这样, 可以使数据均匀地 分布在大小为 M的 Hash表上。
图 1为现有技术基于哈希算法的数据存储结构示意图。 参见图 1 , 利用 Hash算法, 例如, Md5对数据进行数字化后取前 8字节生成一个 Key值, 将该 Key值对预先设定的一个较大的质数 M取余, 然后将该 数据及其对应的 Key值存储至取余映射的 Hash表中, M可根据实际需 要以及对数据进行 Hash后得到的 Key值确定。
当对数据进行 Hash后得到的 Key值相同时, 即主键值发生冲突, 则在 Hash表中采用链表的方式将 Key值相同的所有的数据组织起来, 如图 1 中 datal00 ~ datal02, 其 Key值对 M取余后为 10, datal l0 ~ datal , 其 Key值对 M取余后为 11 , 则分别以链表的方式依次存储。
当用户需要查询数据时,首先对需要查询的数据利用 Hash算法进行 处理, 得到 Key值, 接着对存储的 Hash表采用的质数 M进行取余定位 该数据在 Hash表中的位置, 然后在定位的位置查询链表, 如果链表中 存储的数据与需查询的数据相匹配, 则获取 Key值对应的数据并向用户 返回相应信息。
由上述可见, 由于将所有数据存储在一张 Hash表中,所需存储空间 大, 对存储设备要求高; 同时, 对于存储时发生冲突的主键值对应的数 据, Hash表釆用链表的方式进行存储, 每个数据具有相同的主键值, 造 成后续查询和读取的困难, 而对于未发生冲突的主键值对应的数据 , 还 需要为 Hash表预留与发生冲突的主键值时对应的存储空间, 以及, 需 要在采用质数 M的 Hash表中进行遍历, 以确定没有相同的数据时才能 进行存储, 使得存储效率较低; 进一步地, 对于 Hash表中存储的未发 生冲突的数据, 其查询的复杂度(效率)与 Hash表采用的质数 M相关, 而对于 Hash表中存储的发生冲突的数据, 查询数据的复杂度是 O(n) , 其中 n是冲突链表上存储的数据个数, 例如, 以查询图 1中数据 datalll 为例, 首先获取 datalll的 Key值, 接着, 计算 Key%M, 获取其取余位 置, 即索引位置, 也就是图 1 中的 11位置处, 然后在索引位置的链表 上进行遍历, 直到查询的数据与 Hash表中存储的 datalll匹配为止, 再 将存储的 datalll向用户返回。 这样, 数据访问速度慢、 访问复杂度高、 查询效率 K
发明内容
有鉴于此, 本发明的主要目的在于提出一种基于哈希算法的数据存 储方法, 降低存储设备要求、 提高存储效率。
本发明的另一目的在于提出一种基于哈希算法的数据存储装置, 降 低存储设备要求、 提高存储效率。
为达到上述目的,本发明提供了一种基于哈希算法的数据存储方法, 该方法包括:
预先设置 L个后端存储模块以及后端存储模块标识与模 L运算的映 射关系, L为大于 1的自然数;
根据 Hash算法计算待存储数据的主键值;
对获取的主键值以后端存储模块数量为模执行模运算, 根据后端存 储模块标识与模 L运算的映射关系,将执行模 L运算的主键值及对应的 数据输出至相应标识的后端存储模块;
确定后端存储模块预先设置的 Hash表中没有存储待存储数据,存储 待存储数据及对应的主键值。
所述确定后端存储模块预先设置的 Hash表中没有存储待存储数据, 存储待存储数据及对应的主键值具体包括:
依序判断后端存储模块预先设置的 Hash表中是否存储有待存储数 据对应的主键值, 如果没有, 在该 Hash表中存储该主键值以及该主键 值对应的数据; 否则, 将 Hash表中存储的数据与该主键值对应的数据 进行匹配;
判断 Hash表中存储的数据与该主键值对应的数据不相匹配,对 Hash 表中存储的数据设置冲突标记, 将该主键值加上预先设置的步长;
判断加上预先设置的步长的次数没有超过预先设置的阈值, 返回执 行所述依序判断后端存储模块预先设置的 Hash表中是否存储有待存储 数据对应的主键值的步骤。
将所述预先设置的步长与预先设置的步长的次数进行相乘, 并将相 乘得到的乘积对后端存储模块数量执行模运算, 执行模运算得到的余数 为 0。
进一步包括:所述后端存储模块的数量以每次翻倍的方式进行扩容。 进一步包括:
根据查询请求获取查询请求对应的主键值;
对获取的主键值以后端存储模块数量为模执行模运算, 根据后端存 储模块标识与模 L运算的映射关系, 获取主键值对应的后端存储模块; 搜索后端存储模块中的 Hash表, 获取待查询数据。
所述根据查询请求获取查询请求对应的主键值具体包括:
获取查询请求, 判断查询请求中携带的是数据还是已经标识化的主 键值, 如果是数据, 计算该数据对应的主键值, 将计算得到的主键值作 为查询请求对应的主键值; 如果是已经标识化的主键值, 将该标识化的 主键值作为查询请求对应的主键值。
当所述查询请求中携带的是数据时,所述搜索 Hash表,获取待查询 数据具体包括:
搜索 Hash表, 确定有待查询数据对应的主键值; 判断存储的该主键值对应的数据结构中是否置有冲突标记, 如果没 有, 返回查询请求成功信息, 携带该主键值对应的数据; 如果有, 将当 前带查询数据对应的主键值加上预先设置的步长;
确定加上预先设置的步长的次数没有超过预先设置的阈值, 返回执 行所述搜索 Hash表, 确定有待查询数据对应的主键值的步骤。
当所述查询请求中携带的是标识化的主键值时, 所述搜索 Hash表, 获取待查询数据具体包括:
搜索 Hash表中是否有标识化的主键值,如果有,返回查询请求成功 信息, 携带该标识化的主键值对应的数据。
一种基于哈希算法的数据存储装置, 该装置包括: 多个后端存储模 块、 映射关系存储模块、 主键值计算模块以及模运算单元, 其中,
映射关系存储模块, 用于存储后端存储模块标识与模 L运算的映射 关系, L为后端存储模块数量;
主键值计算模块,用于根据 Hash算法计算待存储数据的主键值,输 出至模运算单元;
模运算单元, 用于根据后端存储模块数量, 对获取的主键值取模, 根据取模的余数从映射关系存储模块获取取模的余数映射的后端存储 模块标识, 将执行取模运算的主键值及对应的数据输出至相应标识的后 端存储模块;
后端存储模块, 用于确定预先设置的 Hash表中没有存储待存储数 据, 存储待存储数据及对应的主键值。
所述后端存储模块为随机存储器、 闪存、 可擦写存储器或硬盘。 所述后端存储模块包括: 主键值查询单元、 Hash表存储单元、 数据 匹配单元以及主键值沖突处理单元, 其中,
主键值查询单元,用于依序判断 Hash表中是否存储有待存储数据对 应的主键值, 如果没有, 将该主键值以及该主键值对应的数据输出至
Hash表中进行存储; 如果有, 将该主键值以及该主鍵值对应的数据输出 至数据匹配单元;
数据匹配单元, 用于将接收的数据与 Hash表中存储的数据进行匹 配, 如杲相同, 不作处理; 否则, 对存储的数据设置冲突标记, 将该主 鍵值输出至主键值冲突处理单元;
主键值冲突处理单元, 用于将接收的主键值加上预先设置的步长, 判断加上预先设置的步长的次数是否超过预先设置的阈值, 如果是, 不 作处理; 否则, 将加上预先设置步长的主键值输出至主键值查询单元。
由上述的技术方案可见, 本发明提供的一种基于哈希算法的数据存 储方法及装置, 通过预先设置 L个后端存储模块以及后端存储模块标识 与模 L运算的映射关系; 根据 Hash算法计算待存储数据的主键值; 对 获取的主键值以后端存储模块数量为模执行模运算, 根据后端存储模块 标识与模 L运算的映射关系,将执行模 L运算的主键值及对应的数据输 出至相应标识的后端存储模块; 确定后端存储模块预先设置的 Hash表 中没有存储待存储数据, 存储待存储数据及对应的主键值。 这样, 采用 分布式存储方法, 设置多个后端存储模块, 可以降低存储设备要求, 有 效地减少了存储所需的时间, 提高了存储效率。 附图简要说明
图 1为现有技术基于哈希算法的数据存储结构示意图。
图 2为本发明实施例基于哈希算法的数据存储方法流程示意图。 图 3为本发明实施例根据数据主键值以及后端存储模块数量选择用 于存储数据的后端存储模块的示意图。
图 4为本发明实施例 Hash表的结构示意图。 图 5为本发明实施例确定后端存储模块预先设置的 Hash表中没有存 储待存储数据, 存储待存储数据及对应的主键值流程示意图。
图 6为本发明实施例查询数据的流程示意图。
图 7为本发明实施例基于哈希算法的数据存储装置结构示意图。 实施本发明的方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图及 具体实施例对本发明作进一步地详细描述。
本发明实施例中,采用分布式存储方法,对待存储的数据进行分类, 将分类的数据分別存储至对应的分布式存储装置中以降低对装置的存 储空间要求; 同时, 对于现有发生冲突的主键值对应的数据, 本发明实 施例采用特定的方式生成 Hash 的主键值并设置冲突次数, 使得每个数 据对应的主键值唯一以提高后续查询的效率。
图 2为本发明实施例基于哈希算法的数据存储方法流程示意图。 参 见图 2, 该流程包括:
步驟 201 , 预先设置 L个后端存储模块及与模 L成映射关系的后端 存储模块标识;
本步驟中, 后端存储模块可以是随机存储器、 闪存、 可擦写存储器、 硬盘等内置于客户端的存储单元, 也可以是外置的相互独立的服务器中 的存储单元。
较佳地, 后端存储模块的数量为质数(L ) 个, 例如, L为质数 3 , 则对于设置的 3个后端存储模块, 其相应的与模 L成映射关系的后端存 储模块标识可以分别设置为 0、 1、 2。 后端存储模块标识与模 L运算的 映射关系可以是, 如果与模 L运算的余数为 0的数据, 则对应存储至后 端存储模块标识为 0的后端存储模块, 与模 L运算的余数为 1的数据, 对应存储至后端存储模块标识为 1的后端存储模块, 以此类推。
步骤 202, 根据 Hash算法计算待存储数据的主键值 KEY;
本步骤中, Hash算法般包括: CRC 32、 MD5以及 SHA, 本发明实 施例中, 采用 MD5算法进行运算。
步骤 203, 对获取的主键值以 L为模执行模运算, 根据映射关系, 将执行模 L运算的主键值及对应的数据输出至相应标识的后端存储模 块;
本步骤中, 根据步骤 202获取的主键值 KEY, 以后端存储模块数量 ( L ) 为模执行模运算, 即对获取的主键值 KEY, 以后端存储模块数量 为模进行取余, 通过 KEY MOD L, 获取与模 L成映射关系的后端存储 模块标识, 从而来选择相应的后端存储模块。
图 3为本发明实施例根据数据主键值以及后端存储模块数量选择用 于存储数据的后端存储模块的示意图。 参见图 3, 以 L =3为例, 将 Key mod 3 ==0对应的主键值及主键值对应的数据输出至后端存储模块 0(后 端存储模块标识为 0 ) 中, 将 Key mod 3 ==1对应的主键值及主键值对 应的数据输出至后端存储模块 1中, 将 Key mod 3 ==2对应的主键值及 主键值对应的数据输出至后端存储模块 2中。
步驟 204,确定后端存储模块预先设置的 Hash表中没有存储该待存 储数据, 存储该待存储数据及对应的主键值。
本步骤中,确定 Hash表中没有存储与主键值匹配的数据且与待存储 数据相同的数据, 存储该主键值及对应的数据。 后端存储模块预先设置 的 Hash表个数为质数, 其中, 质数可以取较大值, Hash表根据预设的 质数采用多个 Hash桶并排的方式。
图 4为本发明实施例 Hash表的结构示意图。参见图 4,较佳地, Hash 表采用 3个 Hash桶并排的方式, 即 Hash表的桶数为 3 , 例如, 对于设 置的后端存储模块数量为 3个、 将 Key mod 3 ==0对应的主键值及主键 值对应的数据输出至后端存储模块 0的情形, Hash桶的标识分别为 0、 3、 6, 分别对应主键值为 0、 3、 6, 每个 Hash桶的深度为 5。
图 5为本发明实施例确定后端存储模块预先设置的 Hash表中没有存 储待存储数据, 存储待存储数据及对应的主键值流程示意图。 参见图 5 , 该流程包括:
步驟 501,依序判断后端存储模块预先设置的 Hash表中是否存储有 待存储数据对应的主键值, 如果没有, 执行步骤 502, 否则, 执行步骤 503;
本步骤中,依序搜索后端存储模块预先设置的 Hash表,也就是从图 4中 Hash表的第一行开始依序搜索。
步骤 502, 存储该主键值以及该主键值对应的数据;
本步骤中,如果预先设置的 Hash表中未存储有该主键值,表明未对 该主键值对应的数据进行存储, 则在 Hash表中最后存储有数据的下一 列存储该主键值以及该主键值对应的数据。
步驟 503 ,将 Hash表中存储的数据与该主键值对应的数据进行匹配, 如杲相同, 结束流程, 否则, 对 Hash表中存储的数据设置冲突标记 ( Flag ), 将该主键值加上预先设置的步长;
本步骤中, 如果 Hash表中存储有该主键值, 表明 Hash表中已对该 主键值对应的数据进行过存储, 则需要进一步判断该主键值对应存储的 数据与待存储的数据是否匹配, 如杲匹配, 表明存储的数据即为待存储 的数据, 不需要再行存储, 如果不匹配, 表明存储的数据对应的主键值 与待存储的数据对应的主键值发生冲突, 需要对待存储的数据对应的主 键值进行重新设置以便可以唯一标识该待存储的数据, 将该主键值加上 预先设置的步长并继续进行匹配。 同时在与待存储的数据发生冲突的存 储的数据结构中置一个冲突标记 flag, 表示该存储的数据曾经冲突过。 504,判断加上预先设置的步长的次数是否超过预先设置的阈值,如 果是, 结束流程, 否则, 返回执行步驟 501。
本步骤中, 预先设置的步长与预先设置的步长的次数的乘积与预设 的后端存储模块数量 N取余的余数为 0。 即将预先设置的步长与预先设 置的步长的次数进行相乘, 并将相乘得到的乘积对后端存储模块数量执 行模运算, 执行模运算得到的余数为 0, 计算公式为:
Key mod N = (Key+m*step)modN=0, 或
(m*step)modN=0
式中,
Key为待存储数据对应的主键值;
N为后端存储模块数量;
m为预先设置的步长的次数;
step为预先设置的步长。
至此, 基于哈希算法的数据存储方法流程结束。
由上述可见, 本发明实施例的基于哈希算法的数据存储方法, 采用 分布式存储方法, 预先设置多个后端存储模块, 根据待存储数据的主键 值以及后端存储模块的个数对待存储的数据进行分类, 将分类的数据分 别存储至对应的后端存储模块, 降低了对装置的存储空间要求; 同时, 对于存储时发生冲突的主键值对应的数据, Hash表采用步长递进的方式 进行存储, 使得每个存储的数据具有唯一的主键值, 并能保证在分布式 系统中, 冲突的数据能够部署在同一后端存储模块上以便于后续查询和 读取; 进一步地, Hash表中桶的深度为设置的步长的次数, 有效减少了 Hash表存储所需的空间。
本发明实施例中, 当需要对数据存储进行平行扩容时, 例如, 增加 并行的后端存储模块个数, 只需要满足增加的后端存储模块个数为初始 后端存储模块个数的倍数关系即可, 并将待存储数据对应的主键值与更 新后的后端存储模块数量执行模运算, 举例来说, 后端存储模块 L以每 次翻倍的方式扩容, 则满足(m*step)mOd(2n*L)=0 ( n=0, l,2,3... ), 根据该式 可以确定步长, 当步长确定后,数据存储的平行扩容方案也就可以确定, 可以有效地满足平行扩容情况下的需求。
下面再对后续用户查询数据的流程进行说明。
图 6为本发明实施例查询数据的流程示意图。 参见图 6 , 该流程包 括:
步骤 600, 获取查询请求, 判断查询请求中携带的是数据还是已经 标识化的主键值, 如杲是数据, 执行步骤 601 , 如果是已经标识化的主 键值, 执行步驟 611;
本步骤中,判断查询请求中携带的是数据还是已经标识化的主键值, 属于现有技术, 具体可参见相关技术文献, 在此不再赘述。
步骤 601 , 根据 Hash算法计算待查询数据的主键值;
步骤 602, 获取主键值对应的后端存储模块;
本步骤中, 根据获取的主键值, 以后端存储模块数量为模, 对主键 值进行取余, 获取后端存储模块标识, 根据后端存储模块标识与模运算 的映射关系, 从而获取主键值对应的数据所存储的后端存储模块地址。
步骤 603 , 依序搜索 Hash表中是否有待查询数据对应的主鍵值, 如 果没有, 执行步驟 604, 否则, 执行步驟 605;
步驟 604, 返回查询请求失败信息, 结束流程;
本步骤中, 如果在 Hash表中没有搜索到待查询数据对应的主键值, 表明该待查询数据没有存储在 Hash表中。
步骤 605, 判断存储的该主键值对应的数据结构中是否置有冲突标 记, 如果没有, 执行步骤 606, 否则, 执行步骤 607;
步骤 606, 返回查询请求成功信息, 携带该主鍵值对应的数据; 步骤 607 , 将当前带查询数据对应的主键值加上预先设置的步长; 本步骤中, Key =Key+Step。 在将主键值加上预先设置的步长后, 判断 存储的该加上预先设置的步长的主键值对应的数据结构中是否置有冲 突标记。
步骤 608, 判断加上预先设置的步长的次数是否超过预先设置的阈 值, 如杲是, 执行步骤 609, 否则, 返回执行步骤 603。
步骤 609, 返回查询请求失败信息, 結束流程;
步骤 611 , 对标识化的主键值以后端存储模块数量为模执行模运算, 根据后端存储模块标识与模运算的映射关系, 获取主键值对应的后端存 储模块;
步骤 612, 搜索 Hash表中是否有标识化的主键值, 如果没有, 执行 步骤 613, 否则, 执行步骤 614;
步驟 613 , 返回查询请求失败信息, 结束流程;
步骤 614, 返回查询请求成功信息, 携带该标识化的主键值对应的 数据。
至此, 该查询数据的流程结束。
由上可见,本实施例的查询数据的方法,由于采用分布式 Hash算法 , 首先根据查询数据对应的主键值选取查询的后端存储模块标识, 再通过 相应后端存储模块中的 Hash表进行搜索查询, 有效减少了查询的复杂 度, 提高了数据访问速度: 对于数据的查询请求, 在发生 Hash冲突的 情况下, 其查询的复杂度为 0(m), 其中, m为预先设置的步长的次数, 因而,可以极大地提高查询响应速度; 而对于标识化的主键值查询请求, 其查询复杂度为 0(1)。 图 7为本发明实施例基于哈希算法的数据存储装置结构示意图。 参 见图 7, 该装置包括: 多个后端存储模块、 映射关系存储模块、 主键值 计算模块、 模运算单元, 其中,
映射关系存储模块, 用于存储后端存储模块标识与模 L运算的映射 关系;
主键值计算模块, 用于根据 Hash 算法计算待存储数据的主键值 KEY, 输出至模运算单元;
模运算单元, 用于根据后端存储模块数量, 对获取的主键值取模, 根据取模的余数从映射关系存储模块获取取模的余数映射的后端存储 模块标识, 将执行取模运算的主键值及对应的数据输出至相应标识的后 端存储模块;
后端存储模块, 用于确定预先设置的 Hash表中没有存储待存储数 据, 存储待存储数据及对应的主键值。
本发明实施例中, 后端存储模块可以是随机存储器、 闪存、 可擦写 存储器或硬盘。
后端存储模块包括: 主键值查询单元、 Hash表存储单元、 数据匹配 单元以及主键值冲突处理单元, 其中,
主键值查询单元, 用于依序判断 Hash表存储单元 Hash表中是否存 储有待存储数据对应的主键值, 如果没有, 将该主键值以及该主键值对 应的数据输出至 Hash表进行存储; 如果有, 将该主键值以及该主键值 对应的数据输出至数据匹配单元;
数据匹配单元, 用于将接收的数据与 Hash表存储单元 Hash表中存 储的数据进行匹配, 如果相同, 不作处理; 否则, 对存储的数据设置冲 突标记, 将该主键值输出至主键值冲突处理单元;
主键值冲突处理单元, 用于将接收的主键值加上预先设置的步长, 判断加上预先设置的步长的次数是否超过预先设置的阈值, 如果是, 不 作处理; 否则, 将加上预先设置步长的主键值输出至主键值查询单元。
以上所述仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换以 及改进等, 均应包含在本发明的保护范围之内。

Claims

权利要求书
1、 一种基于哈希算法的数据存储方法, 其特征在于, 该方法包括: 预先设置 L个后端存储模块以及后端存储模块标识与模 L运算的映 射关系, L为大于 1的自然数;
根据 Hash算法计算待存储数据的主键值;
对获取的主键值以后端存储模块数量为模执行模运算, 根据后端存 储模块标识与模 L运算的映射关系,将执行模 L运算的主键值及对应的 数据输出至相应标识的后端存储模块;
确定后端存储模块预先设置的 Hash表中没有存储待存储数据,存储 待存储数据及对应的主键值。
2、 如权利要求 1所述的方法, 其特征在于, 所述确定后端存储模块 预先设置的 Hash表中没有存储待存储数据, 存储待存储数据及对应的 主键值具体包括:
依序判断后端存储模块预先设置的 Hash表中是否存储有待存储数 据对应的主键值, 如果没有, 在该 Hash表中存储该主键值以及该主键 值对应的数据; 否则, 将 Hash表中存储的数据与该主键值对应的数据 进行匹配;
判断 Hash表中存储的数据与该主键值对应的数据不相匹配,对 Hash 表中存储的数据设置沖突标记, 将该主键值加上预先设置的步长;
判断加上预先设置的步长的次数没有超过预先设置的阈值, 返回执 行所述依序判断后端存储模块预先设置的 Hash表中是否存储有待存储 数据对应的主键值的步骤。
3、 如权利要求 2所述的方法, 其特征在于, 将所述预先设置的步长 与预先设置的步长的次数进行相乘, 并将相乘得到的乘积对后端存储模 块数量执行模运算, 执行模运算得到的余数为 0。
4、如权利要求 1至 3任一项所述的方法,其特征在于,进一步包括: 所述后端存储模块的数量以每次翻倍的方式进行扩容。
5、如权利要求 1至 3任一项所述的方法,其特征在于,进一步包括: 根据查询请求获取查询请求对应的主键值;
对获取的主键值以后端存储模块数量为模执行模运算, 根据后端存 储模块标识与模 L运算的映射关系, 获取主键值对应的后端存储模块; 搜索后端存储模块中的 Hash表, 获取待查询数据。
6、 如权利要求 5所述的方法, 其特征在于, 所述根据查询请求获取 查询请求对应的主键值具体包括:
获取查询请求, 判断查询请求中携带的是数据还是已经标识化的主 键值, 如果是数据, 计算该数据对应的主键值, 将计算得到的主键值作 为查询请求对应的主键值; 如果是已经标识化的主键值, 将该标识化的 主键值作为查询请求对应的主键值。
7、 如权利要求 6所述的方法, 其特征在于, 当所述查询请求中携带 的是数据时, 所述搜索 Hash表, 获取待查询数据具体包括:
搜索 Hash表, 确定有待查询数据对应的主键值;
判断存储的该主键值对应的数据结构中是否置有冲突标记, 如果没 有, 返回查询请求成功信息, 携带该主键值对应的数据; 如果有, 将当 前带查询数据对应的主键值加上预先设置的步长;
确定加上预先设置的步长的次数没有超过预先设置的阔值, 返回执 行所述搜索 Hash表, 确定有待查询数据对应的主键值的步骤。
8、 如权利要求 6所述的方法, 其特征在于, 当所述查询请求中携带 的是标识化的主键值时, 所述搜索 Hash表, 获取待查询数据具体包括: 搜索 Hash表中是否有标识化的主键值,如杲有,返回查询请求成功 信息, 携带该标识化的主键值对应的数据。
9、 一种基于哈希算法的数据存储装置, 其特征在于, 该装置包括: 多个后端存储模块、 映射关系存储模块、 主键值计算模块以及模运算单 元, 其中,
映射关系存储模块, 用于存储后端存储模块标识与模 L运算的映射 关系, L为后端存储模块数量;
主键值计算模块,用于根据 Hash算法计算待存储数据的主键值,输 出至模运算单元;
模运算单元, 用于根据后端存储模块数量, 对获取的主键值取模, 根据取模的余数从映射关系存储模块获取取模的余数映射的后端存储 模块标识, 将执行取模运算的主键值及对应的数据输出至相应标识的后 端存储模块;
后端存储模块, 用于确定预先设置的 Hash表中没有存储待存储数 据, 存储待存储数据及对应的主键值。
10、 如权利要求 9所述的装置, 其特征在于, 所述后端存储模块为 随机存储器、 闪存、 可擦写存储器或硬盘。
11、 如权利要求 9所述的装置, 其特征在于, 所述后端存储模块包 括: 主键值查询单元、 Hash表存储单元、 数据匹配单元以及主键值沖突 处理单元, 其中,
主键值查询单元,用于依序判断 Hash表中是否存储有待存储数据对 应的主键值, 如果没有, 将该主键值以及该主键值对应的数据输出至 Hash表中进行存储; 如果有, 将该主键值以及该主键值对应的数据输出 至数据匹配单元;
数据匹配单元, 用于将接收的数据与 Hash表中存储的数据进行匹 配, 如杲相同, 不作处理; 否则, 对存储的数据设置冲突标记, 将该主 键值输出至主键值冲突处理单元; 主键值沖突处理单元, 用于将接收的主键值加上预先设置的步长, 判断加上预先设置的步长的次数是否超过预先设置的阈值, 如果是, 不 作处理; 否则, 将加上预先设置步长的主键值输出至主键值查询单元。
PCT/CN2011/078564 2010-09-13 2011-08-18 一种基于哈希算法的数据存储方法及装置 Ceased WO2012034470A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
RU2013114990/08A RU2586010C2 (ru) 2010-09-13 2011-08-18 Способ и устройство для сохранения данных с использованием хэширования
US13/610,876 US9104676B2 (en) 2010-09-13 2012-09-12 Hash algorithm-based data storage method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010281747.0A CN102402394B (zh) 2010-09-13 2010-09-13 一种基于哈希算法的数据存储方法及装置
CN201010281747.0 2010-09-13

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/610,876 Continuation US9104676B2 (en) 2010-09-13 2012-09-12 Hash algorithm-based data storage method and system

Publications (1)

Publication Number Publication Date
WO2012034470A1 true WO2012034470A1 (zh) 2012-03-22

Family

ID=45830998

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/078564 Ceased WO2012034470A1 (zh) 2010-09-13 2011-08-18 一种基于哈希算法的数据存储方法及装置

Country Status (4)

Country Link
US (1) US9104676B2 (zh)
CN (1) CN102402394B (zh)
RU (1) RU2586010C2 (zh)
WO (1) WO2012034470A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681414A (zh) * 2016-01-14 2016-06-15 深圳市博瑞得科技有限公司 一种避免Hbase数据热点的方法及系统

Families Citing this family (47)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821138B (zh) * 2012-07-09 2015-06-24 广州鼎鼎信息科技有限公司 一种适用于云存储系统的元数据分布式存储方法
CN103905332B (zh) * 2012-12-31 2017-06-09 华为技术有限公司 一种确定缓存策略的方法及设备
CN104298687B (zh) * 2013-07-18 2018-04-03 阿里巴巴集团控股有限公司 一种哈希分区管理方法及装置
CN104376025B (zh) * 2013-08-16 2017-10-10 华为技术有限公司 分布式数据库的数据存储方法和装置
CN103593477A (zh) 2013-11-29 2014-02-19 华为技术有限公司 一种哈希数据库的配置方法和装置
CN104077374B (zh) * 2014-06-24 2018-09-11 华为技术有限公司 一种实现ip盘文件存储的方法及装置
US9846642B2 (en) * 2014-10-21 2017-12-19 Samsung Electronics Co., Ltd. Efficient key collision handling
CN105530162A (zh) * 2014-10-21 2016-04-27 中兴通讯股份有限公司 离线消息处理方法及装置
CN104461817B (zh) * 2014-11-26 2017-08-11 华为技术有限公司 一种检测键的方法和服务器
CN104361119B (zh) * 2014-12-02 2018-03-06 中国农业银行股份有限公司 一种数据清理的方法及系统
CN104539660B (zh) * 2014-12-09 2018-09-11 珠海金山网络游戏科技有限公司 一种系统扩容时零数据迁移的数据分布存储方法及系统
CN104461920B (zh) * 2014-12-09 2019-04-12 杭州华为数字技术有限公司 一种存储数据的方法及装置
CN104503708B (zh) * 2014-12-29 2018-05-22 成都极驰科技有限公司 数据散列存储的方法及装置
CN106991088B (zh) * 2016-01-20 2021-02-09 创新先进技术有限公司 数据获取方法和装置
CN106777178A (zh) * 2016-12-22 2017-05-31 上海大汉三通无线通信有限公司 一种手机号码的存储方法及查询方法
US10785193B2 (en) * 2017-03-30 2020-09-22 Seagate Technology Llc Security key hopping
CN107707346A (zh) * 2017-04-10 2018-02-16 浙江九州量子信息技术股份有限公司 一种基于数据库的密钥存储、获取方法
JP6934068B2 (ja) * 2017-06-08 2021-09-08 ヒタチ ヴァンタラ コーポレーションHitachi Vantara Corporation 分散されたイレイジャーコーディングされたオブジェクトの重複排除
US10540370B2 (en) 2017-06-26 2020-01-21 Huawei Technologies Co., Ltd. Self-balancing binary search capable distributed database
CN107562775B (zh) * 2017-07-14 2020-04-24 创新先进技术有限公司 一种基于区块链的数据处理方法及设备
CN107579814A (zh) * 2017-08-03 2018-01-12 北京比特大陆科技有限公司 工作量证明的计算方法的装置、计算芯片、挖矿机
CN108064374B (zh) * 2017-08-10 2021-04-09 华为技术有限公司 一种数据访问方法、装置和系统
CN107798257B (zh) * 2017-11-17 2020-04-03 郑州云海信息技术有限公司 一种md5值存储方法及存储系统
CN110019275A (zh) * 2017-12-31 2019-07-16 中国移动通信集团安徽有限公司 主键生成方法、装置、设备及介质
CN120952783A (zh) * 2018-02-28 2025-11-14 海峡小鹿有限公司 工作量证明的计算方法和系统、电子设备、程序和介质
CN108376121B (zh) * 2018-03-01 2021-10-22 曲阜师范大学 一种Flash存储器的数据存储方法
CN110399530A (zh) * 2018-04-20 2019-11-01 杭州海康威视数字技术股份有限公司 数据匹配方法、装置及计算机设备
CN110750529B (zh) * 2018-07-04 2022-09-23 百度在线网络技术(北京)有限公司 数据处理方法、装置、设备及存储介质
CN109558423A (zh) * 2018-10-31 2019-04-02 深圳壹账通智能科技有限公司 一种基于键值对的数据查找方法、装置及设备
US10992563B2 (en) * 2019-04-30 2021-04-27 Google Llc Systems and methods of monitoring network devices
CN110489405B (zh) * 2019-07-12 2024-01-12 平安科技(深圳)有限公司 数据处理的方法、装置和服务器
EP3859551A4 (en) * 2019-07-24 2021-11-24 Huawei Technologies Co., Ltd. METHOD AND DEVICE FOR INDEX DETERMINING DATA
CN110457324A (zh) * 2019-08-09 2019-11-15 泰康保险集团股份有限公司 数据存储方法和装置
CN110727702B (zh) * 2019-09-16 2024-01-26 平安科技(深圳)有限公司 数据查询方法、装置、终端和计算机可读存储介质
CN110716965B (zh) * 2019-09-25 2022-02-25 蚂蚁区块链科技(上海)有限公司 一种块链式账本中的查询方法、装置及设备
CN111078132B (zh) * 2019-10-15 2024-09-13 中国平安财产保险股份有限公司 基于Redis集群的数据均匀缓存方法、装置、终端及存储介质
CN110968265B (zh) * 2019-11-05 2023-08-08 北京字节跳动网络技术有限公司 分片扩容方法、装置及电子设备
CN111078672B (zh) * 2019-12-20 2023-06-02 中国建设银行股份有限公司 数据库的数据对比方法及装置
CN115136562A (zh) 2020-02-11 2022-09-30 哲库科技有限公司 硬件实现的表以及使用该表对数据包进行分类和冲突解决的方法
CN111552695A (zh) * 2020-06-04 2020-08-18 支付宝(杭州)信息技术有限公司 数据存储和查询的方法、装置以及机器可读存储介质
CN111881317B (zh) * 2020-07-31 2021-08-20 北京达佳互联信息技术有限公司 基于键值系统的数据存储方法、装置、电子设备及介质
US11375013B2 (en) 2020-09-25 2022-06-28 Microsoft Technology Licensing, Llc Deterministic mapping and uniform routing of items to physical resources using hash values
CN112235104B (zh) * 2020-10-23 2022-12-23 苏州浪潮智能科技有限公司 一种数据加密传输方法、系统、终端及存储介质
CN113111127B (zh) * 2021-04-15 2025-08-26 深圳市腾讯网络信息技术有限公司 数据存储的方法、装置、电子设备和可读介质
CN113609130B (zh) * 2021-07-30 2023-06-13 中电金信软件有限公司 获取网关接入数据的方法、装置、电子设备及存储介质
CN113810477A (zh) * 2021-08-30 2021-12-17 深圳壹账通智能科技有限公司 一种文件上传方法、装置、设备及存储介质
CN115757406A (zh) * 2022-11-15 2023-03-07 北京爱奇艺科技有限公司 数据存储方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143168A1 (en) * 2004-12-29 2006-06-29 Rossmann Albert P Hash mapping with secondary table having linear probing
CN101140592A (zh) * 2007-09-30 2008-03-12 华为技术有限公司 关键字存储、查找方法和设备
CN101331496A (zh) * 2005-12-15 2008-12-24 国际商业机器公司 用于在数据处理系统中将安全信息与信息对象关联起来的系统和方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5914938A (en) * 1996-11-19 1999-06-22 Bay Networks, Inc. MAC address table search unit
AU754166B2 (en) * 1997-03-21 2002-11-07 Nagra France Sas Broadcast and reception system, and conditional access system therefor
US5960434A (en) * 1997-09-26 1999-09-28 Silicon Graphics, Inc. System method and computer program product for dynamically sizing hash tables
US7185041B1 (en) * 2001-10-05 2007-02-27 Unisys Corporation Circuit and method for high-speed execution of modulo division
US7606916B1 (en) * 2003-11-10 2009-10-20 Cisco Technology, Inc. Method and apparatus for load balancing within a computer system
US8219637B2 (en) * 2004-05-14 2012-07-10 Pixar Storage management for renderfarm
US7370048B2 (en) * 2005-05-27 2008-05-06 International Business Machines Corporation File storage method and apparatus
US20070083531A1 (en) * 2005-10-12 2007-04-12 Daniar Hussain Data storage method and apparatus utilizing evolution and hashing
US7827146B1 (en) * 2007-03-30 2010-11-02 Symantec Operating Corporation Storage system
CN100561482C (zh) * 2008-01-29 2009-11-18 北京北方烽火科技有限公司 一种嵌入式系统数据库的实现方法
CN101247349A (zh) * 2008-03-13 2008-08-20 华耀环宇科技(北京)有限公司 一种网络流量快速分配方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143168A1 (en) * 2004-12-29 2006-06-29 Rossmann Albert P Hash mapping with secondary table having linear probing
CN101331496A (zh) * 2005-12-15 2008-12-24 国际商业机器公司 用于在数据处理系统中将安全信息与信息对象关联起来的系统和方法
CN101140592A (zh) * 2007-09-30 2008-03-12 华为技术有限公司 关键字存储、查找方法和设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681414A (zh) * 2016-01-14 2016-06-15 深圳市博瑞得科技有限公司 一种避免Hbase数据热点的方法及系统
CN105681414B (zh) * 2016-01-14 2019-01-01 深圳市博瑞得科技有限公司 一种避免Hbase数据热点的方法及系统

Also Published As

Publication number Publication date
US9104676B2 (en) 2015-08-11
US20130007008A1 (en) 2013-01-03
CN102402394A (zh) 2012-04-04
RU2013114990A (ru) 2014-10-20
RU2586010C2 (ru) 2016-06-10
CN102402394B (zh) 2014-10-22

Similar Documents

Publication Publication Date Title
WO2012034470A1 (zh) 一种基于哈希算法的数据存储方法及装置
CN108153757B (zh) 一种哈希表管理的方法和装置
CN102682116B (zh) 基于哈希表的表项处理方法及其装置
CN104572983B (zh) 基于内存的散列表的构建方法、文本查找方法及相应装置
CN107330047B (zh) 一种基于完美哈希算法的fpga训练及查询电路实现方法
US11182365B2 (en) Systems and methods for distributed storage of data across multiple hash tables
CN107783980B (zh) 索引数据生成及数据查询方法及装置、存储和查询系统
WO2008119269A1 (en) Method and engine device for storing and looking up information
US20100070698A1 (en) Content addressable storage systems and methods employing searchable blocks
CN106326309B (zh) 一种数据查询方法和装置
CN104866502A (zh) 数据匹配的方法及装置
CN110597852B (zh) 数据处理方法、装置、终端及存储介质
CN105426408A (zh) 一种多索引的数据处理方法及装置
CN110769079A (zh) 一种检索ip对应地理位置的方法及装置
CN109830285B (zh) 一种医学影像文件处理方法和装置
CN109165222A (zh) 一种基于协处理器的HBase二级索引创建方法以及系统
WO2009046669A1 (en) Method and device for storing and searching keyword
WO2017012243A1 (zh) 语音识别方法、装置、终端设备及存储介质
CN107567621A (zh) 用于执行数字搜索的方法、系统和计算机程序产品
WO2023165272A1 (zh) 数据存储及查询
CN110019054B (zh) 日志去重方法和系统、内容分发网络系统
WO2020024446A1 (zh) 数据的存储方法及装置、存储介质、计算机设备
CN102467458A (zh) 建立数据区块的索引方法
JP2019512143A5 (zh)
CN116775701A (zh) 数据存储方法、装置及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11824540

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2013114990

Country of ref document: RU

Kind code of ref document: A

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 250713)

122 Ep: pct application non-entry in european phase

Ref document number: 11824540

Country of ref document: EP

Kind code of ref document: A1