Data storage method and device based on memory database

A data storage and database technology, applied in the direction of database indexing, structured data retrieval, special data processing applications, etc., can solve the problems of read amplification and waste of resources, and achieve the effect of reducing read amplification, avoiding retrieval, and optimizing data storage structure

Inactive Publication Date: 2020-10-13
CHENGDU SEFON SOFTWARE CO LTD
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the present invention is to provide a data storage method and device based on an in-memory database, to solve the problem of screening required

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 based on memory database
  • Data storage method and device based on memory database
  • Data storage method and device based on memory database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0035] A data storage method based on an in-memory database comprises the following steps:

[0036] Divide the data into blocks according to the set number and store them;

[0037] Build a multi-level index, and build a reverse index in each level of index.

[0038] Such as figure 1 As shown, set 1000 pieces of data as a data block, and then cache the data block in the memory; optimize the data storage structure by storing in blocks, and then build an index, and there are reverse indexes in all levels of indexes; when reading It will directly search for the corresponding data in the data block according to the index, reducing read amplification and avoiding the reading of useless data.

Embodiment 2

[0040] Such as image 3 As shown, this embodiment is further based on Embodiment 1, and the process of establishing a multi-level index is as follows:

[0041] S101. Establish a Manifest Block, one Manifest Block, which stores the maximum value of the index in each Index Block and a pointer to the Index Block;

[0042] S102, for the Manifest Block in step S101, a plurality of lower-level Index Blocks are established according to the set threshold, and the IndexBlock stores the maximum value of the index in each Data Block, and a pointer to the Data Block;

[0043] S103. Establish multiple lower-level Data Blocks according to the set thresholds in step S102, and the Data Blocks store indexes and real data.

[0044] When reading, it will first search for the index in the Manifest Block, then search for the index in the Index Block, and finally obtain the data in the corresponding Block cache according to the index of the Data Block and return it; the reading process is more acc...

Embodiment 3

[0046] In this embodiment, on the basis of Embodiment 1, an inverted index is established according to the fixed columns of data, and the fixed columns are spliced ​​into primary keys; this is helpful for partial search and reduces read amplification.

[0047] Such as figure 2 As shown, if the location is used as a fixed column to build a reverse index, the model is used as a fixed column to build a reverse index, and the number is used as a fixed column to build a reverse index.

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 data storage method and device based on a memory database, and mainly solves the problems of reading amplification and resource waste due to the fact that required data needsto be screened in a memory and a lot of useless data needs to be read during data query of an existing memory database in the prior art. The data storage method based on the memory database comprisesthe following steps: partitioning data according to a set column number, and then storing the partitioned data; and establishing a multi-level index, and establishing a reverse index in each level ofindex. Through the scheme, the purposes of avoiding retrieval of useless data, reducing read amplification and reducing memory consumption are achieved, and the method has very high practical value and promotional value.

Description

technical field [0001] The invention relates to the technical field of memory data storage, in particular to a data storage method and device based on a memory database. Background technique [0002] The database is a warehouse for storing data, and this warehouse organizes, stores and manages data according to the data structure we set, so that it is more convenient to retain and use the data; according to the different data storage locations, from the general direction The database is divided into disk database and memory database, and the memory database basically completely replaces the disk data. [0003] Existing in-memory databases use multiple columns to form an index to sort data, and read data according to the index; that is, multiple columns form a primaryKey. When querying some columns, the data will be obtained according to the combined primarykey, and then the data will be processed according to the specified column. Screening; when querying, all the data of t...

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): G06F16/22
CPCG06F16/2228
Inventor 张艳清肖杰张永飞杨尧胥莉君
Owner CHENGDU SEFON SOFTWARE CO LTD
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