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 utilization rate has been improved to a certain extent, the improvement effect is not very significant, and it still takes up more memory

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

Embodiment 1

[0037] figure 1 It is a schematic flowchart of a method for constructing a memory-based hash table provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of constructing a hash table for searching whether text data exists in memory. In the embodiment of the present invention, the text data may be data in any text format such as Weibo comments. The method can be executed by a device for constructing a memory-based hash table, and the device can be implemented by software and / or hardware. Aiming at the problem of memory shortage in the traditional chain address method when constructing a hash table of a large amount of text, this embodiment uses multiple hash functions to construct each single-linked list in the chain address method to achieve the purpose of further saving memory.

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

[0039...

Embodiment 2

[0056] Figure 2A It is a schematic flowchart of a method for constructing a memory-based hash table provided in Embodiment 2 of the present invention. This embodiment provides a preferred embodiment on the basis of the first embodiment above. The construction method of the memory-based hash table provided by the present embodiment can be carried out under the windows2008server system of the intel core i7CPU with the main frequency of 2.2GHz, the hardware environment of 32GB of internal memory and the development environment based on Visual C++. see Figure 2A The method for constructing a memory-based hash table provided in this embodiment specifically includes the following operations:

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

[0058] Operation 220, acquire a piece of text data for searching from the data set. Execute operation 230 .

[0059] Ope...

Embodiment 3

[0081] image 3 It is a schematic flowchart of a text search method provided in Embodiment 3 of the present invention. After the construction method of the memory-based hash table is executed, this embodiment further provides a method for searching text data, which can be executed by a text searching device, and the device 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, acquire the text data to be searched this time.

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

[0084] Operation 330: Using at least one preset secondary hash function, calculate a secondary hash value corresponding to the text data to be sear...

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