Method and device for storing data

A data storage and storage device technology, applied in the database field, can solve the problems of low retrieval efficiency and long time consumption

Active Publication Date: 2014-01-01
LE SHI ZHI ZIN ELECTRONIC TECHNOLOGY (TIANJIN) LTD
View PDF4 Cites 27 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, to query the data in HBase through the hive statement, it is necessary to sc

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
  • Method and device for storing data
  • Method and device for storing data
  • Method and device for storing data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049]Embodiments of the present invention provide data storage methods, such as figure 1 As shown, the method includes:

[0050] S101. The storage device acquires data records to be stored.

[0051] Specifically, when storing data, the storage device first needs to obtain the data record to be stored.

[0052] Wherein, the data record includes at least an event and a time attribute, and the event includes at least one of opening, closing, and triggering.

[0053] S102. The storage device determines the attribute fields in the data record that satisfy a preset condition.

[0054] Wherein, the preset condition includes at least one of time, event, and account, and the event includes at least one of opening, closing, and triggering.

[0055] Specifically, the preset condition is set by the user when analyzing the data.

[0056] Optionally, the preset condition may be a specific condition or a combination of conditions. For example, if the preset condition is time and / or eve...

Embodiment 2

[0071] Embodiments of the present invention provide data storage methods, such as figure 2 As shown, the method includes:

[0072] S201. The storage device acquires data records to be stored.

[0073] Specifically, when storing data, the storage device first needs to obtain the data record to be stored.

[0074] Wherein, the data record includes at least an event and a time attribute, and the event includes at least one of opening, closing, and triggering.

[0075] S202. The storage device determines the attribute fields in the data records that meet the preset conditions.

[0076] Wherein, the preset condition includes at least one of time, event, and account, and the event includes at least one of opening, closing, and triggering.

[0077] Specifically, the preset condition is set by the user when analyzing the data.

[0078] Optionally, the preset condition may be a specific condition or a combination of conditions. For example, if the preset condition is time and / or ...

Embodiment 3

[0115] The present invention provides a storage device, such as image 3 shown, including:

[0116] An acquisition unit 10, configured to acquire data records to be stored;

[0117] The processing unit 11 is configured to determine the attribute field satisfying the preset condition in the data record; use the attribute field satisfying the preset condition as the prefix Head of the row key Rowkey of the HBase database;

[0118] The storage unit 12 is configured to store the Rowkey in the HBase database, so that when the attribute field satisfying the preset condition is queried in the HBase, the prefix of the Rowkey is queried to obtain the attribute field satisfying the preset condition. attribute field.

[0119] Further, the processing unit 11 uses the attribute field satisfying the preset condition as the prefix Head of the row key Rowkey of the HBase database, including:

[0120] Calculate the digest value of the attribute field satisfying the preset condition accordin...

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 method and a device for storing data, and belongs to the technical field of databases. The method includes that enabling a storage device to acquire data records to be stored; determining attribute fields which meet preset conditions in the data records; using the attribute fields which meet the preset conditions as prefixes Head of the row keys Rowkey in a database HBase; storing the row keys Rowkey in the database HBase. The method and the device have the advantages that the row keys Rowkey in the database HBase can be set and stored according to the preset conditions, so that the data query speed can be increased, the retrieval efficiency can be improved, and time consumption can be reduced.

Description

technical field [0001] The invention relates to the technical field of databases, in particular to a data storage method and device. Background technique [0002] Hadoop is a distributed system infrastructure, mainly composed of distributed file system (HDFS, Hadoop Distributed File System), MapReduce and Hbase. Among them, HBase is a distributed, column-oriented open source database. It stores data in the form of a table. The table is composed of rows and columns. The columns are divided into several column clusters. A row is composed of the row key Rowkey, timestamp and several columns. The row key Rowkey is similar to the primary key of a relational database and is used to retrieve records. [0003] Hive is a Hadoop-based data warehouse tool that can map structured data files into a database table and provide a complete Structured Query Language (SQL, Structured Query Language) query function. Its advantage is that the learning cost is low, and simple statistics can be...

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/30
CPCG06F16/221G06F16/2272G06F16/2453
Inventor 张秀伟
Owner LE SHI ZHI ZIN ELECTRONIC TECHNOLOGY (TIANJIN) 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