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

Data storage method and device, and data query method and device

A data storage and data query technology, applied in the computer field, can solve the problems of discrete data storage, inconvenient fast loading and fast migration, etc., and achieve the effect of fast loading

Active Publication Date: 2018-11-23
GUANGDONG SHENMA SEARCH TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, in the hash table of the prior art, its data storage form is a combination of an array and a linked list, and its data storage is discrete, which is not convenient for fast loading and fast migration

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 device, and data query method and device
  • Data storage method and device, and data query method and device
  • Data storage method and device, and data query method and device

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0035] This embodiment provides a data storage method, please refer to figure 2 , the method includes:

[0036] Step S110: Receive a plurality of stored data, wherein each stored data corresponds to a hash value.

[0037] The multiple stored data are data to be stored that need to be stored. Understandably, each stored data may correspond to a hash (hash) value, which may be obtained through calculation.

[0038]Step S120: Store the plurality of storage data respectively in a plurality of consecutive different first storage units in the first storage area.

[0039] The first storage area includes a plurality of continuous first storage units. After receiving the storage data, the storage data are respectively stored in different first storage units, that is, the storage data corresponds to the first storage units one by one.

[0040] Further, because there may be a hash value corresponding to multiple different stored data, that is, multiple stored data correspond to the s...

no. 2 example

[0074] This embodiment provides a data query method, which is applied to data query in a data storage device that stores data according to the method provided in the first embodiment. Please refer to Figure 8 , the method includes:

[0075] Step S210A: Calculate the hash value according to the received query value.

[0076] A query value is received. Usually, the query value is a key code value, and a hash value can be calculated according to the query value. For example, a value is obtained by calculating md5sum once for the key value, and then the value is moduloed by the number of the second storage unit to obtain the hash value corresponding to the key value.

[0077] Step S220A: Determine the second storage unit in the second storage area according to the calculated hash value.

[0078] Since each second storage unit in the second storage area corresponds to a hash value, the second storage unit may be determined according to the calculated hash value.

[0079] The me...

no. 3 example

[0109] This embodiment provides a data storage device 300, please refer to Figure 11 , the device 300 includes:

[0110] The data receiving module 310 is configured to receive a plurality of stored data, wherein each stored data corresponds to a hash value; the first storage module 320 is configured to store the plurality of stored data in consecutive Among the multiple different first storage units; the second storage module 330 is configured to, according to the positions of the first storage units respectively corresponding to the multiple stored data in the first storage area, store the multiple stored data The corresponding multiple position data are respectively stored in the second storage units of the second storage area, wherein the second storage area includes a plurality of continuous second storage units, each second storage unit corresponds to a hash value, and each The hash value corresponding to the second storage unit stored in the location data is equal to t...

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 device, and a data query method and device, and relates to the field of computers. The data storage method comprises the following steps that: receiving multiple pieces of storage data, wherein each piece of storage data corresponds to one hash value; respectively storing the multiple pieces of storage data in a plurality of different continuous first storage units in a first storage area; respectively storing multiple pieces of position data corresponding to the multiple pieces of storage data in the second storage unit of a second storage area, wherein the second storage area comprises a plurality of continuous second storage units, each second storage unit corresponds to one hash value, and the hash value which is stored in each piece ofposition data and corresponds to the second storage unit is equal to the hash value corresponding to the storage data corresponding to the position data; and storing the spatial information of the first storage area and the second storage area in a third storage area. In the scheme, the data is stored in the continuous storage space, and therefore, the storage data can be quickly loaded and migrated.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a data storage method, a data query method and a device. Background technique [0002] In the case of increasing machine memory, data storage and search are usually performed by exchanging space for time. Among them, Hash table (Hash table) is very common in use because the time complexity of data search is O(1). [0003] In the implementation of the hash table in the prior art, the implementation of the hash table in the SGI STL is typical. However, in the hash table of the prior art, its data storage form is a combination of an array and a linked list, and its data storage is discrete, which is not convenient for fast loading and fast migration. Contents of the invention [0004] In view of this, an embodiment of the present invention provides a data storage method, a data query method, and a device to improve the above problems. [0005] In order to achieve the a...

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 Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/00
Inventor 傅建强卢申朋褚建辉王新栋刘东辉
Owner GUANGDONG SHENMA SEARCH TECH CO LTD