[go: up one dir, main page]

CN105512216A - Data storage and reading method, device and system - Google Patents

Data storage and reading method, device and system Download PDF

Info

Publication number
CN105512216A
CN105512216A CN201510853977.2A CN201510853977A CN105512216A CN 105512216 A CN105512216 A CN 105512216A CN 201510853977 A CN201510853977 A CN 201510853977A CN 105512216 A CN105512216 A CN 105512216A
Authority
CN
China
Prior art keywords
data
key
database
level key
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510853977.2A
Other languages
Chinese (zh)
Inventor
严峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Original Assignee
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Intelligent Home Appliance Technology Co Ltd filed Critical Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Priority to CN201510853977.2A priority Critical patent/CN105512216A/en
Publication of CN105512216A publication Critical patent/CN105512216A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种数据存储和读取方法、装置及系统。该数据读取方法包括:获取数据库中第一级关键词key对应的数据值value,获取第二级key;根据获取的参数N将第二级key分为N份,其中,每份第二级key对应一个计算单元的输入,N大于等于1且小于等于第二级key的个数;通过计算单元并发读取相应的第二级key所对应的value。借助于本发明的技术方案,扩展了hadoop?MR的数据访问范围,将设置为二级模式的数据库也纳入了大数据处理范围中,使得hadoop?MR能够直接大批量从数据库读取数据,提升了hadoopMR的运行效率。

The invention discloses a data storage and reading method, device and system. The data reading method includes: obtaining the data value value corresponding to the first-level keyword key in the database, and obtaining the second-level key; dividing the second-level key into N shares according to the obtained parameter N, wherein each second-level key The key corresponds to the input of a calculation unit, and N is greater than or equal to 1 and less than or equal to the number of second-level keys; the value corresponding to the corresponding second-level key is read concurrently through the calculation unit. By means of the technical solution of the present invention, hasoop? In the data access scope of MR, the database set in the secondary mode is also included in the scope of big data processing, making Hadoop? MR can directly read data in large batches from the database, improving the operating efficiency of hadoopMR.

Description

数据存储和读取方法、装置及系统Data storage and reading method, device and system

技术领域technical field

本发明涉及数据库技术领域,特别是涉及一种数据存储和读取方法、装置及系统。The invention relates to the technical field of databases, in particular to a data storage and reading method, device and system.

背景技术Background technique

Hadoop是目前业界使用最多,最成熟的开源大数据存储和计算平台,它包含了很多组件,其中MapReduce(即MR)是hadoop平台上的编程模型。适用于大数据量下的分布式计算。Redis是一种开源的索引/值(key/value)内存数据库,支持多种数据格式的存储。Hadoop is currently the most used and mature open source big data storage and computing platform in the industry. It includes many components, among which MapReduce (ie MR) is the programming model on the Hadoop platform. It is suitable for distributed computing under large amount of data. Redis is an open source index/value (key/value) memory database that supports storage in multiple data formats.

HadoopMR提供了很多数据源的读取实现,如文件,hbase数据库等,但对直接从redis读取大批量数据并没有很好的支持,具体地,HadoopMR是大数据分布式计算的利器,输入一般是hdfs文件。redis是key/value的内存数据库,一般是根据单个key来读取单个value。因此目前缺少直接大批量从redis读取数据到hadoopMR的方式。HadoopMR provides many data source reading implementations, such as files, hbase databases, etc., but it does not have good support for reading large batches of data directly from redis. Specifically, HadoopMR is a powerful tool for distributed computing of big data, and the input is generally It is a hdfs file. Redis is a key/value memory database, which generally reads a single value based on a single key. Therefore, there is currently no way to directly read data from redis to hadoopMR in large batches.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的数据存储和读取方法、装置及系统。In view of the above problems, the present invention is proposed to provide a data storage and reading method, device and system that overcome the above problems or at least partially solve the above problems.

本发明提供一种数据存储方法,包括:The invention provides a data storage method, comprising:

将数据库中的关键词key按照粒度大小分为两级,其中,粒度较大的第一级key对应的数据值value为粒度较小的第二级key;The keyword key in the database is divided into two levels according to the size of the granularity, wherein the data value corresponding to the first-level key with a larger granularity is the second-level key with a smaller granularity;

将需要存储的数据作为第二级key的value保存。Save the data to be stored as the value of the second-level key.

本发明还提供了一种数据读取方法,用于Hadoop编程模型MR从数据库读取数据,包括:The present invention also provides a kind of data reading method, is used for Hadoop programming model MR to read data from database, comprises:

获取数据库中第一级关键词key对应的数据值value,获取第二级key;Obtain the data value value corresponding to the first-level keyword key in the database, and obtain the second-level key;

根据获取的参数N将第二级key分为N份,其中,每份第二级key对应一个计算单元的输入,N大于等于1且小于等于第二级key的个数;Divide the second-level key into N shares according to the obtained parameter N, where each second-level key corresponds to the input of a computing unit, and N is greater than or equal to 1 and less than or equal to the number of second-level keys;

通过计算单元并发读取相应的第二级key所对应的value。The value corresponding to the corresponding second-level key is read concurrently through the computing unit.

本发明还提供了一种数据存储装置,包括:The present invention also provides a data storage device, comprising:

分级模块,用于将数据库中的关键词key按照粒度大小分为两级,其中,粒度较大的第一级key对应的数据值value为粒度较小的第二级key;The grading module is used to divide the keyword key in the database into two levels according to the granularity, wherein the data value value corresponding to the first-level key with a larger granularity is the second-level key with a smaller granularity;

存储模块,用于将需要存储的数据作为第二级key的value保存。The storage module is used to save the data to be stored as the value of the second-level key.

本发明还提供了一种数据读取装置,设置于Hadoop编程模型MR,包括:The present invention also provides a kind of data reading device, is arranged on Hadoop programming model MR, comprises:

获取模块,用于获取数据库中第一级关键词key对应的数据值value,获取第二级key;The obtaining module is used to obtain the data value value corresponding to the first-level keyword key in the database, and obtain the second-level key;

切分模块,用于根据获取的参数N将第二级key分为N份,其中,每份第二级key对应一个计算单元的输入,N大于等于1且小于等于第二级key的个数;The segmentation module is used to divide the second-level key into N shares according to the obtained parameter N, wherein each second-level key corresponds to the input of a computing unit, and N is greater than or equal to 1 and less than or equal to the number of second-level keys ;

读取模块,用于通过计算单元并发读取相应的第二级key所对应的value。The reading module is used to concurrently read the value corresponding to the corresponding second-level key through the computing unit.

本发明还提供了一种数据存储读取系统,包括上述的数据存储装置、以及上述的数据读取装置。The present invention also provides a data storage and reading system, comprising the above-mentioned data storage device and the above-mentioned data reading device.

本发明有益效果如下:The beneficial effects of the present invention are as follows:

通过将数据库设置为二级模式,扩展了hadoopMR的数据访问范围,将设置为二级模式的数据库也纳入了大数据处理范围中,使得hadoopMR能够直接大批量从数据库读取数据,提升了hadoopMR的运行效率。By setting the database to the secondary mode, the data access scope of hadoopMR is expanded, and the database set to the secondary mode is also included in the scope of big data processing, so that hadoopMR can directly read data from the database in large quantities, which improves the performance of hadoopMR. operating efficiency.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:

图1是本发明实施例的数据存储方法的流程图;Fig. 1 is the flowchart of the data storage method of the embodiment of the present invention;

图2是本发明实施例的Redis数据库的示意图;Fig. 2 is the schematic diagram of the Redis database of the embodiment of the present invention;

图3是本发明实施例的数据读取方法的流程图;Fig. 3 is the flowchart of the data reading method of the embodiment of the present invention;

图4是本发明实施例的hadoopMR从redis数据库读取数据的示意图;Fig. 4 is the schematic diagram that HadoopMR of the embodiment of the present invention reads data from redis database;

图5是本发明实施例的数据存储装置的结构示意图;5 is a schematic structural diagram of a data storage device according to an embodiment of the present invention;

图6是本发明实施例的数据读取装置的结构示意图;6 is a schematic structural diagram of a data reading device according to an embodiment of the present invention;

图7是本发明实施例的数据存储读取系统的结构示意图。FIG. 7 is a schematic structural diagram of a data storage and reading system according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

为了解决现有技术中hadoopMR不能够直接大批量从Redis数据库读取数据的问题,本发明提供了一种数据存储和读取方法、装置及系统,以下结合附图以及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不限定本发明。In order to solve the problem that hadoopMR cannot directly read data from the Redis database in large quantities in the prior art, the present invention provides a data storage and reading method, device and system. The present invention is further described below in conjunction with the accompanying drawings and embodiments Detailed description. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

方法实施例一Method embodiment one

根据本发明的实施例,提供了一种数据存储方法,图1是本发明实施例的数据存储方法的流程图,如图1所示,根据本发明实施例的数据存储方法包括如下处理:According to an embodiment of the present invention, a data storage method is provided. FIG. 1 is a flow chart of the data storage method according to an embodiment of the present invention. As shown in FIG. 1 , the data storage method according to an embodiment of the present invention includes the following processing:

步骤101,将数据库中的关键词key按照粒度大小分为两级,其中,粒度较大的第一级key对应的数据值value为粒度较小的第二级key;优选地,所述粒度大小包括:时间范围的大小。也就是说,第一级存储的key是小时的时间范围,如某个小时的数据,value是第二级存储key的列表;第二级存储的key是分钟的时间范围,如某1分钟内的数据,value是上报数据。Step 101, divide the keyword key in the database into two levels according to the granularity, wherein the data value value corresponding to the first-level key with a larger granularity is the second-level key with a smaller granularity; preferably, the granularity Including: the size of the time range. That is to say, the key of the first-level storage is the time range of hours, such as the data of a certain hour, and the value is the list of the keys of the second-level storage; the key of the second-level storage is the time range of minutes, such as within 1 minute The data, value is the reported data.

步骤102,将需要存储的数据作为第二级key的value保存。Step 102, save the data to be stored as the value of the second-level key.

优选地,在本发明实施例中,所述数据库为Redis数据库。也就是说,本发明实施例的技术方案在Redis中采用两级key/value关联的方式来适应批量读取操作。图2是本发明实施例的Redis数据库的示意图,如图2所示,第一级存储的key下的value是第二级存储key的列表,如key1,key2,……,keyn。第二级存储的key的value是上报数据,例如,key1的value为数据组dataset1,key2的value为数据组dataset2。Preferably, in the embodiment of the present invention, the database is a Redis database. That is to say, the technical solution of the embodiment of the present invention adopts a two-level key/value association in Redis to adapt to batch read operations. Fig. 2 is the schematic diagram of the Redis database of the embodiment of the present invention, as shown in Fig. 2, the value under the key stored in the first level is the list of keys stored in the second level, such as key1, key2, ..., keyn. The value of the key stored in the second level is the reported data. For example, the value of key1 is dataset1, and the value of key2 is dataset2.

本发明实施例的技术方案将Redis中的数据分两级存储,使得hadoopMR能够直接批量读取redis中的存储数据,从而对redis中存储数据进行分布式计算。hadoopMR能够直接批量读取redis中的存储数据在方法实施例二中进行详细说明。In the technical solution of the embodiment of the present invention, the data in Redis is stored in two levels, so that hadoopMR can directly read the stored data in Redis in batches, so as to perform distributed calculation on the stored data in Redis. The fact that hadoopMR can directly read the stored data in redis in batches is described in detail in the second method embodiment.

方法实施例二Method embodiment two

根据本发明的实施例,提供了一种数据读取方法,用于Hadoop编程模型MR从数据库读取数据,图3是本发明实施例的数据读取方法的流程图,如图3所示,根据本发明实施例的数据读取方法包括如下处理:According to an embodiment of the present invention, a kind of data reading method is provided, is used for Hadoop programming model MR to read data from database, and Fig. 3 is the flowchart of the data reading method of the embodiment of the present invention, as shown in Fig. 3, The data reading method according to the embodiment of the present invention includes the following processing:

步骤301,获取数据库中第一级关键词key对应的数据值value,获取第二级key;Step 301, obtain the data value value corresponding to the first-level keyword key in the database, and obtain the second-level key;

步骤302,根据获取的参数N将所述第二级key分为N份,其中,每份第二级key对应一个计算单元的输入,所述N大于等于1且小于等于第二级key的个数;Step 302, dividing the second-level key into N shares according to the obtained parameter N, wherein each second-level key corresponds to an input of a computing unit, and the N is greater than or equal to 1 and less than or equal to the number of second-level keys number;

在步骤302中,优选地,所述获取的参数N具体包括:根据执行并发计算的计算单元的个数,确定参数N。In step 302, preferably, the acquiring the parameter N specifically includes: determining the parameter N according to the number of computing units performing concurrent computing.

步骤303,通过计算单元并发读取相应的第二级key所对应的value。Step 303, concurrently read the value corresponding to the corresponding second-level key through the calculation unit.

以下对Hadoop编程模型MR从redis数据库读取数据进行详细说明。图4是本发明实施例的hadoopMR从redis数据库读取数据的示意图,如图4所示,具体包括如下处理:The following is a detailed description of the Hadoop programming model MR reading data from the redis database. Fig. 4 is a schematic diagram of hadoopMR reading data from a redis database according to an embodiment of the present invention, as shown in Fig. 4 , specifically including the following processing:

步骤1:在hadoopMR中,先根据需要读取的时间拼装一级key(例如,2015111016表示2015年11月10日15点到16点)读取redis中的一级存储,获得对应二级存储的所有key。Step 1: In hadoopMR, first assemble the first-level key according to the time to be read (for example, 2015111016 means November 10, 2015 from 15:00 to 16:00), read the first-level storage in redis, and obtain the corresponding secondary storage All keys.

步骤2:根据外部程序传入的参数N把所有的二级key分为N份,每份对应一个计算单元mapper的输入,其中,N最大等于所有二级key的数目,N表示指定多少个mapper程序来执行并发计算。Step 2: Divide all secondary keys into N shares according to the parameter N passed in by the external program, and each share corresponds to the input of a computing unit mapper, where N is at most equal to the number of all secondary keys, and N indicates how many mappers are specified Programs to perform concurrent computations.

步骤3:hadoopMR的每个mapper读取分配给它的二级key/value;所有的mapper加在一起就能读取完2015年11月10日15点到16点这一个小时内存储在redis中的所有数据。Step 3: Each mapper of hadoopMR reads the secondary key/value assigned to it; all mappers can be read together and stored in redis within the hour from 15:00 to 16:00 on November 10, 2015 all data for .

综上所述,借助于本发明实施例的技术方案,通过将数据库设置为二级模式,扩展了hadoopMR的数据访问范围,将设置为二级模式的数据库也纳入了大数据处理范围中,使得hadoopMR能够直接大批量从数据库读取数据,提升了hadoopMR的运行效率。直接读取内存数据库,比读取文件的性能更高,花费在数据读取上的时间更少。To sum up, with the help of the technical solution of the embodiment of the present invention, by setting the database in the secondary mode, the data access range of hadoopMR is expanded, and the database set in the secondary mode is also included in the scope of big data processing, so that HadoopMR can directly read data in large batches from the database, improving the operating efficiency of hadoopMR. Directly reading the memory database has higher performance than reading files, and takes less time to read data.

装置实施例Device embodiment

根据本发明的实施例,提供了一种数据存储装置,图5是本发明实施例的数据存储装置的结构示意图,如图5所示,根据本发明实施例的数据存储装置包括:分级模块50、以及存储模块52,以下对本发明实施例的各个模块进行详细的说明。According to an embodiment of the present invention, a data storage device is provided. FIG. 5 is a schematic structural diagram of a data storage device according to an embodiment of the present invention. As shown in FIG. 5 , the data storage device according to an embodiment of the present invention includes: a classification module 50 , and the storage module 52, each module of the embodiment of the present invention will be described in detail below.

分级模块50,用于将数据库中的关键词key按照粒度大小分为两级,其中,粒度较大的第一级key对应的数据值value为粒度较小的第二级key;优选地,所述粒度大小包括:时间范围的大小。所述数据库为Redis数据库。The classification module 50 is used to divide the keyword key in the database into two levels according to the granularity, wherein the data value value corresponding to the first-level key with a larger granularity is a second-level key with a smaller granularity; preferably, the The size of granularity mentioned above includes: the size of the time range. The database is a Redis database.

存储模块52,用于将需要存储的数据作为第二级key的value保存。The storage module 52 is configured to store the data to be stored as the value of the second-level key.

本发明实施例各个模块的具体处理已经在方法实施例一中进行了详细的说明,在此不再赘述。The specific processing of each module in the embodiment of the present invention has been described in detail in the first method embodiment, and will not be repeated here.

装置实施例二Device embodiment two

根据本发明的实施例,提供了一种数据读取装置,设置于Hadoop编程模型MR,图6是本发明实施例的数据读取装置的结构示意图,如图6所示,根据本发明实施例的数据读取装置包括:获取模块60、切分模块62、以及读取模块64,以下对本发明实施例的各个模块进行详细的说明。According to an embodiment of the present invention, a data reading device is provided, which is set in the Hadoop programming model MR. FIG. 6 is a schematic structural diagram of a data reading device according to an embodiment of the present invention. As shown in FIG. 6, according to an embodiment of the present invention The data reading device includes: an acquisition module 60, a segmentation module 62, and a reading module 64, each module of the embodiment of the present invention will be described in detail below.

获取模块60,用于获取数据库中第一级关键词key对应的数据值value,获取第二级key;Obtaining module 60, is used for obtaining the data value value corresponding to first level keyword key in the database, obtains second level key;

切分模块62,用于根据获取的参数N将所述第二级key分为N份,其中,每份第二级key对应一个计算单元的输入,所述N大于等于1且小于等于第二级key的个数;所属切分模块62具体用于:根据执行并发计算的计算单元的个数,确定参数N。The segmentation module 62 is configured to divide the second-level key into N shares according to the obtained parameter N, wherein each second-level key corresponds to an input of a computing unit, and the N is greater than or equal to 1 and less than or equal to the second The number of level keys; the segmentation module 62 to which it belongs is specifically configured to: determine the parameter N according to the number of calculation units performing concurrent calculations.

读取模块64,用于通过计算单元并发读取相应的第二级key所对应的value。The reading module 64 is configured to concurrently read the value corresponding to the corresponding second-level key through the calculation unit.

本发明实施例各个模块的具体处理已经在方法实施例一中进行了详细的说明,在此不再赘述。The specific processing of each module in the embodiment of the present invention has been described in detail in the first method embodiment, and will not be repeated here.

系统实施例System embodiment

根据本发明的实施例,提供了一种数据存储读取系统,图7是本发明实施例的数据存储读取系统的结构示意图,如图7所示,根据本发明实施例的数据存储读取系统包括:上述装置实施例一的数据存储装置70、以及上述装置实施例二的数据读取装置72。上述装置已经在相应的装置实施例中进行了详细的说明,在此不再赘述。According to an embodiment of the present invention, a data storage and reading system is provided. FIG. 7 is a schematic structural diagram of a data storage and reading system according to an embodiment of the present invention. As shown in FIG. 7 , the data storage and reading system according to an embodiment of the present invention The system includes: the data storage device 70 of the first embodiment of the device above, and the data reading device 72 of the second embodiment of the device above. The above devices have been described in detail in the corresponding device embodiments, and will not be repeated here.

综上所述,借助于本发明实施例的技术方案,通过将数据库设置为二级模式,扩展了hadoopMR的数据访问范围,将设置为二级模式的数据库也纳入了大数据处理范围中,使得hadoopMR能够直接大批量从数据库读取数据,提升了hadoopMR的运行效率。直接读取内存数据库,比读取文件的性能更高,花费在数据读取上的时间更少。To sum up, with the help of the technical solution of the embodiment of the present invention, by setting the database in the secondary mode, the data access range of hadoopMR is expanded, and the database set in the secondary mode is also included in the scope of big data processing, so that HadoopMR can directly read data in large batches from the database, improving the operating efficiency of hadoopMR. Directly reading the memory database has higher performance than reading files, and takes less time to read data.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies thereof, the present invention also intends to include these modifications and variations.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的客户端中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个客户端中。可以把实施例中的模块组合成一个模块,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者客户端的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the client in the embodiment can be adaptively changed and installed in one or more clients different from the embodiment. The modules in the embodiments can be combined into one module, and furthermore can be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of the client are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any one of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的加载有排序网址的客户端中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to realize some or all of the functions of some or all of the components in the client loaded with sorted URLs according to embodiments of the present invention . The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (11)

1. a date storage method, is characterized in that, comprising:
Keyword key in database is divided into two-stage according to granule size, and wherein, the data value value that the first order key that granularity is larger is corresponding is the second level key that granularity is less;
The value of the data needing to store as second level key is preserved.
2. the method for claim 1, is characterized in that, described granule size comprises: the size of time range.
3. the method for claim 1, is characterized in that, described database is Redis database.
4. a method for reading data, reads data for Hadoop programming model MR from database, it is characterized in that, comprising:
Obtain the data value value that in database, first order keyword key is corresponding, obtain second level key;
Described second level key is divided into N part by the Parameter N according to obtaining, wherein, the input of every part of corresponding computing unit of second level key, described N is more than or equal to 1 and is less than or equal to the number of second level key;
By the value corresponding to the corresponding second level key of the concurrent reading of computing unit.
5. method as claimed in claim 4, it is characterized in that, the Parameter N of described acquisition specifically comprises:
According to the number of the computing unit that execution concurrence calculates, determine Parameter N.
6. a data storage device, is characterized in that, comprising:
Diversity module, for the keyword key in database is divided into two-stage according to granule size, wherein, the data value value that the first order key that granularity is larger is corresponding is the second level key that granularity is less;
Memory module, for preserving the value of the data needing to store as second level key.
7. device as claimed in claim 6, it is characterized in that, described granule size comprises: the size of time range.
8. device as claimed in claim 6, it is characterized in that, described database is Redis database.
9. a data fetch device, is arranged at Hadoop programming model MR, it is characterized in that,
Acquisition module, for obtaining the data value value that in database, first order keyword key is corresponding, obtains second level key;
Cutting module, for described second level key being divided into N part according to the Parameter N obtained, wherein, the input of every part of corresponding computing unit of second level key, described N is more than or equal to 1 and is less than or equal to the number of second level key;
Read module, for passing through the value corresponding to the corresponding second level key of the concurrent reading of computing unit.
10. device as claimed in claim 9, is characterized in that, affiliated cutting module specifically for:
According to the number of the computing unit that execution concurrence calculates, determine Parameter N.
11. 1 kinds of data store reading system, it is characterized in that, comprise the data storage device according to any one of claim 6-8 and the data fetch device according to any one of claim 9-10.
CN201510853977.2A 2015-11-30 2015-11-30 Data storage and reading method, device and system Pending CN105512216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510853977.2A CN105512216A (en) 2015-11-30 2015-11-30 Data storage and reading method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510853977.2A CN105512216A (en) 2015-11-30 2015-11-30 Data storage and reading method, device and system

Publications (1)

Publication Number Publication Date
CN105512216A true CN105512216A (en) 2016-04-20

Family

ID=55720198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510853977.2A Pending CN105512216A (en) 2015-11-30 2015-11-30 Data storage and reading method, device and system

Country Status (1)

Country Link
CN (1) CN105512216A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372277A (en) * 2018-12-26 2020-07-03 中兴通讯股份有限公司 Data distribution method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193917A (en) * 2010-03-01 2011-09-21 中国移动通信集团公司 Method and device for processing and querying data
US8375012B1 (en) * 2011-08-10 2013-02-12 Hewlett-Packard Development Company, L.P. Computer indexes with multiple representations
WO2013082507A1 (en) * 2011-11-30 2013-06-06 Decarta Systems and methods for performing geo-search and retrieval of electronic point-of-interest records using a big index
CN103309958A (en) * 2013-05-28 2013-09-18 中国人民大学 OLAP star connection query optimizing method under CPU and GPU mixing framework
CN103678520A (en) * 2013-11-29 2014-03-26 中国科学院计算技术研究所 Multi-dimensional interval query method and system based on cloud computing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193917A (en) * 2010-03-01 2011-09-21 中国移动通信集团公司 Method and device for processing and querying data
US8375012B1 (en) * 2011-08-10 2013-02-12 Hewlett-Packard Development Company, L.P. Computer indexes with multiple representations
WO2013082507A1 (en) * 2011-11-30 2013-06-06 Decarta Systems and methods for performing geo-search and retrieval of electronic point-of-interest records using a big index
CN103309958A (en) * 2013-05-28 2013-09-18 中国人民大学 OLAP star connection query optimizing method under CPU and GPU mixing framework
CN103678520A (en) * 2013-11-29 2014-03-26 中国科学院计算技术研究所 Multi-dimensional interval query method and system based on cloud computing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372277A (en) * 2018-12-26 2020-07-03 中兴通讯股份有限公司 Data distribution method, device and storage medium
CN111372277B (en) * 2018-12-26 2023-07-14 南京中兴新软件有限责任公司 Data distribution method, device and storage medium

Similar Documents

Publication Publication Date Title
US10169409B2 (en) System and method for transferring data between RDBMS and big data platform
US10127275B2 (en) Mapping query operations in database systems to hardware based query accelerators
US9336274B2 (en) Scalable acceleration of database query operations
WO2017096892A1 (en) Index construction method, search method, and corresponding device, apparatus, and computer storage medium
US10838963B2 (en) Optimized access for hierarchical low cardinality value synopsis in analytical databases
CA2776127A1 (en) Data security for a database in a multi-nodal environment
CN107291620A (en) A kind of method for generating test case and device
CN105608143A (en) Detection method and device of consistency of multi-copy data
CN107577590B (en) Method and device for real-time calling of virtual interface based on database service
CN108920601B (en) A data matching method and device
CN104504008B (en) A kind of Data Migration algorithm based on nested SQL to HBase
CN105608159A (en) Data caching method and device
CN110750555A (en) Method, apparatus, computing device, and medium for generating index
CN107256233A (en) A kind of date storage method and device
EP2778962B1 (en) Silo-aware databases
CN103530390A (en) Webpage crawling method and device
WO2016101751A1 (en) Master and slave balancing method and device in distributed storage system
US9760577B2 (en) Write-behind caching in distributed file systems
CN104102557B (en) A kind of cloud computing platform data back up method based on cluster
CN108551478B (en) A transaction processing method, server and transaction processing system
US20180246987A1 (en) Graph database management
CN105512216A (en) Data storage and reading method, device and system
KR101772333B1 (en) INTELLIGENT JOIN TECHNIQUE PROVIDING METHOD AND SYSTEM BETWEEN HETEROGENEOUS NoSQL DATABASES
CN106970998A (en) The update method and device of news data
CN106649584A (en) Index processing method and device in master-slave database system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160420

RJ01 Rejection of invention patent application after publication