Unlock instant, AI-driven research and patent intelligence for your innovation.

Key word storing method and storing device

A keyword and storage space technology, which is applied in the field of keyword storage methods and storage devices, can solve the problems of keyword storage location conflicts, occupying more system resources, and low probability of conflicts, etc., to achieve easy conflict adjustment, reduce conflict probability, The effect of low chance of conflict

Active Publication Date: 2011-06-08
SHENZHEN IPANEL TECH LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the prior art, in the process of calculating the location of the keyword corresponding to the memory space through the hash function, different inputs may be hashed into the same output, that is, the values ​​hashed by the hash function may be the same, resulting in The storage location of the keyword conflicts. In order to reduce this conflict, the larger the range of the hash value (the base of the Hash function), the lower the probability of conflict. In order to avoid conflict, a large memory needs to be selected, resulting in memory Excessive consumption, occupying too many system resources

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
  • Key word storing method and storing device
  • Key word storing method and storing device
  • Key word storing method and storing device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0023] Embodiment 1. A keyword storage method. This embodiment provides a two-level array to store keywords. The first array user stores the index information of the keyword in the second array, and the second array user stores the keyword and the corresponding Structure information; the specific process is as follows figure 1 shown, including:

[0024] A1, using the number of elements in the first array as the base of the hash function to calculate the hash value of the keyword;

[0025] In the embodiment of the present invention, the keyword is a keyword of a Java script (javascript) or a programming language such as a cascading style sheet (Cascading Style Sheet, CSS).

[0026] A2, judging whether the value of the element corresponding to the hash value in the first array is empty; if it is empty, then obtain the storage space corresponding to the first empty element in the second array, and store the Keywords are stored in the storage space;

[0027] After the keyword ...

Embodiment 2

[0041] Embodiment 2, a method for calculating a keyword hash value, the flow chart is as follows figure 2 mentioned, including:

[0042] B1, preset three hash arrays, including: the first hash array, the second hash array, and the third hash array, each hash array contains 26 elements, and each element has a preset value;

[0043] B2, using the deviation of the first character in each of the characters of the keyword and the English character sequence table as the position number to take out the corresponding first set of values ​​in the first hash array;

[0044] B3, using the deviation of the characters on each of the keywords and the last character in the English character sequence list as the position number to take out the corresponding second group of values ​​in the second hash array;

[0045] B4, using the deviation of the characters on each of the keywords and the second character in the English character sequence list as the position number to take out the correspond...

Embodiment 3

[0065] Embodiment 3, a keyword storage device, the structural diagram is as follows Figure 4 shown, including:

[0066] Hash value calculation unit 410, used to use the number of elements in the first array as the base of the hash function to calculate the hash value of the keyword;

[0067] The storage unit 420 is configured to determine whether the value of the element corresponding to the hash value in the first array is empty; if it is empty, obtain the storage space corresponding to the first empty element in the second array , store the keyword in the storage space, and use the index information of the first empty element in the second array in the second array as the element corresponding to the hash value in the first array The value of is recorded into the array.

[0068] It can be understood that the keyword storage device in this embodiment may further include: a conflict adjustment unit 430 configured to count the occurrence of conflicts, and adjust the hash fun...

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 discloses a key word storing method and a storing device. An embodiment of the invention uses two-stage array, a first array corresponds to a hashing space, a second array corresponds to a storing space, so the hashing space and the storing space are separated. When using hashing function to calculate hashing value, since the hashing space does not store key words, therefore the storing area occupied is small, a hashing space corresponding to a larger radix can be arranged to enable the obtained hashing value to have small collision probability and facilitate later collision adjustment. When performing data storage, the number of elements in the second array can be adjusted according to the number of defined key words, so as to reduce consumption of storing space. Compared with prior art, the technical scheme of the invention not only reduces collision probability, but also reduces consumption of the storing space.

Description

technical field [0001] The invention relates to the technical field of data storage, in particular to a keyword storage method and a storage device. Background technique [0002] Javascript (javascript) keyword: It is the javascript language that specifies a set of strings. Commonly used keywords are "invalid", "true", "false", "agent", "break", "continue", "div", "else", "equiv", "extern", "for", " function", "http", "if" and so on. [0003] The storage of keywords generally adopts the following methods: First, apply for a fixed amount of continuous memory space, which is generally the closest prime number greater than the number of keywords, and then use the hash function to calculate the corresponding memory space of keywords location, if the calculated memory location is empty, store the keyword and attribute information into the corresponding memory space. The Hash function transforms an input of any length into a fixed-length output through a hash algorithm, and the...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/08G06F3/06
Inventor 徐佳宏程伯钦欧杨
Owner SHENZHEN IPANEL TECH LTD