Construction method based on hash table of memory, text searching method and corresponding device

Active Publication Date: 2015-04-29
RUN TECH CO LTD BEIJING
View PDF7 Cites 18 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Using the above-mentioned chain address method to build a hash table for searching massive text in memory, although the memory utili

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
  • Construction method based on hash table of memory, text searching method and corresponding device
  • Construction method based on hash table of memory, text searching method and corresponding device
  • Construction method based on hash table of memory, text searching method and corresponding device

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0036] Example one

[0037] figure 1 It is a schematic flow chart of a method for constructing a memory-based hash table provided by the first embodiment of the present invention. This embodiment is applicable to the case of constructing a hash table for finding whether text data exists in the memory. In the embodiment of the present invention, the text data may be data in any text format such as microblog comments. This method can be executed by a memory-based hash table construction device, which can be implemented by software and / or hardware. In view of the memory shortage problem when the traditional chain address method constructs a hash table of massive texts, this embodiment constructs each single-linked table in the chain address method by using multiple hash functions to achieve the purpose of further saving memory.

[0038] See figure 1 The method for constructing a memory-based hash table provided by this embodiment specifically includes the following operations:

[003...

Example Embodiment

[0055] Example two

[0056] Figure 2A It is a schematic flow diagram of a method for constructing a memory-based hash table provided in the second embodiment of the present invention. This embodiment provides a preferred embodiment on the basis of the first embodiment above. The method for constructing a memory-based hash table provided in this embodiment can be performed under the windows2008server system of an intel core i7 CPU with a main frequency of 2.2 GHz, a hardware environment with a memory of 32 GB, and a development environment based on Visual C++. See Figure 2A The method for constructing a memory-based hash table provided by this embodiment specifically includes the following operations:

[0057] Operation 210: Determine whether there is unobtained text data for searching in a preset data set. If yes, perform operation 220, otherwise end the process.

[0058] Operation 220: Obtain a piece of text data for searching from the data set. Perform operation 230.

[0059] ...

Example Embodiment

[0080] Example three

[0081] image 3 It is a schematic flowchart of a text search method provided in the third embodiment of the present invention. This embodiment further provides a method for searching text data after the method for constructing a memory-based hash table is executed. The method can be executed by a text search device, which is implemented by software and / or hardware. See image 3 , The text search method provided in this embodiment specifically includes the following operations:

[0082] Operation 310: Obtain the text data to be searched this time.

[0083] Operation 320: Use the preset main hash function to calculate the main hash value corresponding to the text data to be searched this time, and determine the hash table entry address corresponding to the main hash value according to the set mapping algorithm.

[0084] Operation 330: Use at least one preset slave hash function to calculate a slave hash value corresponding to the text data to be searched this tim...

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 embodiment of the invention discloses a construction method based on a hash table of a memory, a text searching method and a corresponding device, wherein the construction method based on the hash table of the memory comprises the following steps: obtaining text data for searching; using a preset main hash function, calculating a main hash value corresponding to the text data, determining a hash table inlet address corresponding to the has table inlet address in the memory according to a preset mapping algorithm; using at least one preset secondary hash function to calculate a corresponding secondary hash value of the text data, obtaining a target hash value from a secondary hash value; storing the target hash value into a corresponding one-way linked list corresponding to the hash table inlet address in the memory to construct a hash table. According to the technical scheme provided by the embodiment of the invention, the memory utilization rate can be increased better, and the memory is relatively saved.

Description

technical field [0001] The embodiment of the present invention relates to the field of computer technology, and in particular to a method for constructing a memory-based hash table, a method for searching files, and a corresponding device. Background technique [0002] A hash function is a method of creating small digital "fingerprints" from any kind of data, compressing any kind of data (such as a message) into a digest. The summary, that is, the hash value, its basic characteristics include: if the two hash values ​​are different, then the corresponding two original data are also different (same hash function), if the two hash values ​​are the same, Then the two original data may be the same or different; typical hash functions have an infinite domain and a limited value domain, and the length of the general hash value is smaller than the length of the original value. [0003] Hash table technology is a main application of hash function, which is often used for fast data ...

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): G06F17/30G06F12/08G06F12/1018
CPCG06F12/1018G06F16/137G06F2212/40
Inventor 肖冰
Owner RUN TECH CO LTD BEIJING
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products