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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


