[go: up one dir, main page]

CN105511801A - Data storage method and apparatus - Google Patents

Data storage method and apparatus Download PDF

Info

Publication number
CN105511801A
CN105511801A CN201510810711.XA CN201510810711A CN105511801A CN 105511801 A CN105511801 A CN 105511801A CN 201510810711 A CN201510810711 A CN 201510810711A CN 105511801 A CN105511801 A CN 105511801A
Authority
CN
China
Prior art keywords
data
rack
storage
storage space
storage area
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.)
Granted
Application number
CN201510810711.XA
Other languages
Chinese (zh)
Other versions
CN105511801B (en
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.)
Jilin Kasite Technology Co ltd
Original Assignee
Changchun University of Science and Technology
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 Changchun University of Science and Technology filed Critical Changchun University of Science and Technology
Priority to CN201510810711.XA priority Critical patent/CN105511801B/en
Publication of CN105511801A publication Critical patent/CN105511801A/en
Application granted granted Critical
Publication of CN105511801B publication Critical patent/CN105511801B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0667Virtualisation aspects at data level, e.g. file, record or object virtualisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data storage method and apparatus. The method comprises the following steps of acquiring to-be-stored data, determining a rack corresponding to the data in storage space via Hash calculation, acquiring a data copy corresponding to the data and determining a storage area of a data node of the data copy on the rack via Hash calculation, and storing the data copy in the storage area, wherein the storage space is annular storage space; the data node is corresponding to a plurality of virtual data nodes; and the storage space charged by the plurality of virtual data nodes are evenly divided into a plurality of storage areas. By the use of the data storage method and apparatus, data can be evenly distributed and quickly stored; and system processing performance can be improved.

Description

数据存储的方法和装置Method and device for data storage

技术领域technical field

本发明涉及数据存储领域,具体而言,涉及一种数据存储的方法和装置。The present invention relates to the field of data storage, in particular to a data storage method and device.

背景技术Background technique

分布式集群存储是一种大数据存储管理的关键技术,其中HDFS(HadoopDistributedFileSystem,Hadoop分布式文件系统)因其高传输率和高容错性成为解决大数据高效存储应用的有效方法。Distributed cluster storage is a key technology for big data storage management, among which HDFS (Hadoop Distributed File System, Hadoop Distributed File System) has become an effective method to solve high-efficiency storage applications of big data due to its high transmission rate and high fault tolerance.

现有的一种实现方式是将最优缓存容量设计问题描述为整数规划问题,但是现有的HDFS数据放置策略在选择数据可靠性提升的同时,没有兼顾到数据均衡问题和系统执行性能,造成数据存储缓慢且系统处理性能低。An existing implementation method is to describe the optimal cache capacity design problem as an integer programming problem, but the existing HDFS data placement strategy does not take into account the data balance problem and system execution performance while selecting data reliability improvement, resulting in Data storage is slow and system processing performance is low.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容Contents of the invention

本发明实施例提供了一种数据存储的方法和装置,能够在保证数据均衡分布的同时,快速完成数据存储,提升系统处理性能。The embodiments of the present invention provide a data storage method and device, which can quickly complete data storage while ensuring balanced distribution of data, and improve system processing performance.

根据本发明实施例的一个方面,提供了一种数据存储的方法,包括:获取待存储的数据;通过哈希运算在存储空间内确定所述数据对应的机架;获取所述数据对应的数据副本,并通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域;其中,所述存储空间为环形存储空间,所述数据节点对应多个虚拟数据节点,所述多个虚拟数据节点负责的存储空间由多个均分的存储区域组成;将所述数据副本存储在所述存储区域内。According to an aspect of an embodiment of the present invention, a data storage method is provided, including: obtaining data to be stored; determining the rack corresponding to the data in the storage space through a hash operation; obtaining the data corresponding to the data Copy, and determine the storage area corresponding to the data node on the rack of the data copy through a hash operation; wherein, the storage space is a ring storage space, the data node corresponds to a plurality of virtual data nodes, and the The storage space responsible for multiple virtual data nodes is composed of multiple equally divided storage areas; the data copy is stored in the storage areas.

可选地,在荻取待存储的数据前,所述方法还包括:将所述存储空间进行均分操作得到多个均分的存储区域。Optionally, before acquiring the data to be stored, the method further includes: performing an equal division operation on the storage space to obtain a plurality of equally divided storage areas.

可选地,在所述获取所述数据对应的数据副本前,所述方法还包括:确定所述机架是否异常;所述获取所述数据对应的数据副本包括:在确定所述机架正常时,获取所述数据对应的数据副本;在确定所述机架异常时,按照顺时针顺序在所述存储空间内搜索下一机架。Optionally, before acquiring the data copy corresponding to the data, the method further includes: determining whether the rack is abnormal; the acquiring the data copy corresponding to the data includes: determining that the rack is normal , obtain the data copy corresponding to the data; when it is determined that the rack is abnormal, search for the next rack in the storage space in a clockwise order.

可选地,在所述将所述数据副本存储在所述存储区域内之前,所述方法还包括:在通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域后,确定所述机架上的数据节点是否异常;在确定所述数据节点异常时,按照顺时针顺序在所述存储空间内搜索下一机架;在确定所述数据节点正常时,确定所述数据节点对应的存储区域是否充足;所述将所述数据副本存储在所述存储区域内包括:在确定所述存储区域充足时,将所述数据副本存储在所述存储区域内;在确定所述存储区域不充足时,按照顺时针顺序在所述存储空间内搜索所述机架上的下一数据节点。Optionally, before storing the data copy in the storage area, the method further includes: determining the storage area corresponding to the data node of the data copy on the rack through a hash operation Afterwards, determine whether the data node on the rack is abnormal; when it is determined that the data node is abnormal, search the next rack in the storage space in a clockwise order; when it is determined that the data node is normal, determine the Whether the storage area corresponding to the data node is sufficient; the storing the data copy in the storage area includes: when determining that the storage area is sufficient, storing the data copy in the storage area; When the storage area is insufficient, search the next data node on the rack in the storage space in a clockwise order.

可选地,在将所述数据副本存储在所述存储区域内之后,所述方法还包括:确定全部数据副本是否存储完成;在确定全部数据副本未存储完成时,按照顺时针顺序在所述存储空间内搜索下一机架。Optionally, after storing the data copies in the storage area, the method further includes: determining whether all data copies have been stored; Search for the next rack in the storage space.

根据本发明实施例的另一方面,还提供了一种数据存储的装置,包括:获取单元,用于获取待存储的数据;处理单元,用于通过哈希运算在存储空间内确定所述数据对应的机架,并获取所述数据对应的数据副本,并通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域;其中,所述存储空间为环形存储空间,所述数据节点对应多个虚拟数据节点,所述多个虚拟数据节点负责的存储空间由多个均分的存储区域组成;存储单元,用于将所述数据副本存储在所述存储区域内。According to another aspect of the embodiments of the present invention, there is also provided a data storage device, including: an acquisition unit, configured to acquire data to be stored; a processing unit, configured to determine the data in the storage space through a hash operation The corresponding rack, and obtain the data copy corresponding to the data, and determine the storage area corresponding to the data node on the rack of the data copy through a hash operation; wherein, the storage space is a ring storage space, The data node corresponds to a plurality of virtual data nodes, and the storage space responsible for the plurality of virtual data nodes is composed of a plurality of equally divided storage areas; a storage unit is configured to store the data copy in the storage area.

可选地,所述处理单元,还用于在获取待存储的数据前,将所述存储空间进行均分操作得到多个均分的存储区域。Optionally, the processing unit is further configured to perform an equal division operation on the storage space to obtain a plurality of equally divided storage areas before acquiring the data to be stored.

可选地,所述装置还包括:第一判断单元,用于在所述获取所述数据对应的数据副本前,确定所述机架是否异常:所述处理单元,用于在所述第一判断单元确定所述机架正常时,获取所述数据对应的数据副本;在所述第一判断单元确定所述机架异常时,按照顺时针顺序在所述存储空间内搜索下一机架。Optionally, the device further includes: a first judging unit, configured to determine whether the rack is abnormal before acquiring the data copy corresponding to the data: the processing unit, configured to When the judging unit determines that the rack is normal, obtain the data copy corresponding to the data; when the first judging unit determines that the rack is abnormal, search for the next rack in the storage space in a clockwise order.

可选地,所述装置还包括:第二判断单元,用于在所述将所述数据副本存储在所述存储区域内之前,在通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域之后,确定所述机架上的数据节点是否异常;所述处理单元,用于在所述第二判断单元确定所述数据节点异常时,按照顺时针顺序在所述存储空间内搜索下一机架;第二判断单元,还用于在确定所述数据节点正常时,确定所述数据节点对应的存储区域是否充足;所述存储单元,用于在所述第二判断单元确定所述存储区域充足时,将所述数据副本存储在所述存储区域内;所述处理单元,用于在所述第二判断单元确定所述存储区域不充足时,按照顺时针顺序在所述存储空间内搜索所述机架上的下一数据节点。Optionally, the device further includes: a second judging unit, configured to, before storing the data copy in the storage area, determine through a hash operation that the data copy is on the rack After the storage area corresponding to the data node of the data node, determine whether the data node on the rack is abnormal; the processing unit is configured to, when the second judging unit determines that the data node is abnormal, perform a clockwise sequence on the Search the next rack in the storage space; the second judging unit is also used to determine whether the storage area corresponding to the data node is sufficient when determining that the data node is normal; When the judging unit determines that the storage area is sufficient, store the copy of the data in the storage area; the processing unit is configured to, when the second judging unit determines that the storage area is not sufficient, in a clockwise order Searching for the next data node on the rack in the storage space.

可选地,所述装置还包括:第三判断单元,在将所述数据副本存储在所述存储区域内之后,确定全部数据副本是否存储完成;所述处理单元,用于在确定全部数据副本未存储完成后,按照顺时针顺序在所述存储空间内搜索下一机架。Optionally, the device further includes: a third judging unit, after storing the data copy in the storage area, determines whether all data copies have been stored; the processing unit is configured to determine whether all data copies After the storage is completed, search for the next rack in the storage space in a clockwise order.

在本发明实施例中,获取待存储的数据;通过哈希运算在存储空间内确定数据对应的机架;获取数据对应的数据副本,并通过哈希运算确定内数据副本在机架上的数据节点对应的存储区域;其中,存储空间为环形存储空间,数据节点对应多个虚拟节点,多个虚拟节点负责的存储空间由多个均分的存储区域组成;将数据副本存储在存储区域内,这样,本发明通过哈希算法并引入虚拟数据节点与等分存储区域完成数据存储,从而能够在保证数据均衡分布的同时,快速完成数据存储,提升系统处理性能的技术问题。In the embodiment of the present invention, the data to be stored is obtained; the rack corresponding to the data is determined in the storage space through a hash operation; the data copy corresponding to the data is obtained, and the data on the rack of the internal data copy is determined through a hash operation The storage area corresponding to the node; among them, the storage space is a ring storage space, the data node corresponds to multiple virtual nodes, and the storage space responsible for multiple virtual nodes is composed of multiple equally divided storage areas; the data copy is stored in the storage area, In this way, the present invention completes data storage through a hash algorithm and introduces virtual data nodes and equally divided storage areas, so that data storage can be quickly completed while ensuring balanced distribution of data, and the technical problem of improving system processing performance is achieved.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:

图1是根据本发明实施例的一种可选的数据存储方法的流程示意图;Fig. 1 is a schematic flow chart of an optional data storage method according to an embodiment of the present invention;

图2是根据本发明实施例的一种可选的机架迁移的示意图;Fig. 2 is a schematic diagram of an optional rack migration according to an embodiment of the present invention;

图3是根据本发明实施例的一种可选的机架备份分布示意图;FIG. 3 is a schematic diagram of an optional rack backup distribution according to an embodiment of the present invention;

图4是根据本发明实施例的一种可选的数据连接查询运行时间对比图;Fig. 4 is a comparison diagram of running time of an optional data connection query according to an embodiment of the present invention;

图5是根据本发明实施例的一种可选的实际备份分布情况及运行时间对比图;FIG. 5 is a comparison diagram of an optional actual backup distribution and running time according to an embodiment of the present invention;

图6是根据本发明实施例的一种可选的数据节点调整后备份分布情况图;FIG. 6 is an optional diagram of backup distribution of data nodes after adjustment according to an embodiment of the present invention;

图7是根据本发明实施例的另一种可选的数据存储方法的流程示意图;FIG. 7 is a schematic flowchart of another optional data storage method according to an embodiment of the present invention;

图8是根据本发明实施例的一种可选的数据存储方法的流程示意图;FIG. 8 is a schematic flowchart of an optional data storage method according to an embodiment of the present invention;

图9是根据本发明实施例的一种可选的数据存储装置的结构示意图;FIG. 9 is a schematic structural diagram of an optional data storage device according to an embodiment of the present invention;

图10是根据本发明实施例的另一种可选的数据存储装置的结构示意图;FIG. 10 is a schematic structural diagram of another optional data storage device according to an embodiment of the present invention;

图11是根据本发明实施例的第三种可选的数据存储装置的结构示意图。Fig. 11 is a schematic structural diagram of a third optional data storage device according to an embodiment of the present invention.

具体实施方式detailed description

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is an embodiment of a part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

图1是根据本发明实施例的一种数据存储的方法,如图1所示,本发明实施例的执行主体为数据存储的装置,该方法包括如下步骤:Fig. 1 is a method for data storage according to an embodiment of the present invention. As shown in Fig. 1, the execution subject of the embodiment of the present invention is a data storage device, and the method includes the following steps:

步骤S101、获取待存储的数据。Step S101, acquiring data to be stored.

步骤S102、通过哈希运算在存储空间内确定该数据对应的机架。Step S102, determine the rack corresponding to the data in the storage space through a hash operation.

步骤S103、获取该数据对应的数据副本,并通过哈希运算确定该数据副本在该机架上的数据节点对应的存储区域。Step S103. Obtain the data copy corresponding to the data, and determine the storage area corresponding to the data node on the rack for the data copy through a hash operation.

其中,该存储空间为环形存储空间,该数据节点对应多个虚拟数据节点,该多个虚拟数据节点负责的存储空间由多个均分的存储区域组成。Wherein, the storage space is a ring-shaped storage space, and the data node corresponds to a plurality of virtual data nodes, and the storage space responsible for the plurality of virtual data nodes is composed of a plurality of evenly divided storage areas.

进一步地,在获取待存储的数据前,将该存储空间进行均分操作得到多个均分的存储区域。Further, before the data to be stored is acquired, the storage space is divided equally to obtain multiple equally divided storage areas.

其中,将环形存储空间进行均分操作,此时存储空间中的所有虚拟节点都包含多个均分存储区域,即每一个虚拟节点负责的存储空间都由多个均分区域组成。当数据节点通过哈希运算映射到存储空间后,定址找到数据节点所处位置的第一个均分区域为此节点的映射位置,若位置冲突则使用线性探测再散列的方法顺时针方向继续查找下一个均分区域,直到每个数据节点负责的存储空间都由多个等分区域构成。Wherein, the ring-shaped storage space is divided equally. At this time, all virtual nodes in the storage space include multiple equally divided storage areas, that is, the storage space in charge of each virtual node is composed of multiple equally divided areas. After the data node is mapped to the storage space through the hash operation, address the first equally divided area where the data node is located. This is the mapping position of the node. If the position conflicts, use the method of linear detection and hashing to continue clockwise Find the next evenly divided area until the storage space that each data node is responsible for consists of multiple equally divided areas.

可选地,在该获取该数据对应的数据副本前,确定该机架是否异常;在确定该机架正常时,获取该数据对应的数据副本;在确定该机架异常时,按照顺时针顺序在该存储空间内搜索下一机架。Optionally, before obtaining the data copy corresponding to the data, determine whether the rack is abnormal; when it is determined that the rack is normal, obtain the data copy corresponding to the data; when it is determined that the rack is abnormal, in a clockwise order Search for the next rack within the storage space.

可选地,在该将该数据副本存储在该存储区域内之前,在通过哈希运算确定该数据副本在该机架上的数据节点对应的存储区域后,确定该机架上的数据节点是否异常;在确定该数据节点异常时,按照顺时针顺序在该存储空间内搜索下一机架;在确定该数据节点正常时,确定该数据节点对应的存储区域是否充足;在确定该存储区域充足时,将该数据副本存储在该存储区域内;在确定该存储区域不充足时,按照顺时针顺序在该存储空间内搜索该机架上的下一数据节点。Optionally, before storing the data copy in the storage area, after determining the storage area corresponding to the data node on the rack for the data copy through a hash operation, determine whether the data node on the rack Abnormal; when it is determined that the data node is abnormal, search the next rack in the storage space in a clockwise order; when it is determined that the data node is normal, determine whether the storage area corresponding to the data node is sufficient; when it is determined that the storage area is sufficient , store the data copy in the storage area; when it is determined that the storage area is not sufficient, search for the next data node on the rack in the storage space in a clockwise order.

步骤S104、将该数据副本存储在该存储区域内。Step S104, storing the data copy in the storage area.

在本步骤中,数据按照划分好的存储空间可以完成分组存储,当集群中有机器添加或者删除时,通过按顺时针迁移的一致性哈希算法规则,在保持单调性的同时,减少了数据的迁移量和服务器的压力。In this step, the data can be grouped and stored according to the divided storage space. When machines are added or deleted in the cluster, the consistent hash algorithm rules of clockwise migration can reduce the data while maintaining monotonicity. The amount of migration and the pressure on the server.

进一步地,在将该数据副本存储在该存储区域内之后,确定全部数据副本是否存储完成;在确定全部数据副本未存储完成时,按照顺时针顺序在该存储空间内搜索下一机架。Further, after the data copy is stored in the storage area, it is determined whether all the data copies have been stored; when it is determined that all the data copies have not been stored, the next rack is searched clockwise in the storage space.

需要说明的是,本发明实施例对于多个数据副本,通过哈希运算函数映射存储到n个机架,设定顺时针方向依次在k个机架中的每个机架内选取两个不同数据节点存储两个副本,在n-k个机架中的每个依次连接的机架内选取合适的数据节点用来存储剩余的副本。通过两次哈希运算映射方式在环状存储空间寻找机架的数据节点,具体流程如图1所示。It should be noted that, in the embodiment of the present invention, for multiple data copies, the hash operation function is used to map and store n racks, and the clockwise direction is set to sequentially select two different The data node stores two copies, and selects a suitable data node in each sequentially connected rack of n-k racks to store the remaining copies. The data nodes of the rack are searched in the annular storage space through two hash operation mapping methods, and the specific process is shown in Figure 1.

针对数据节点的添加和删除,本发明实施例可以依照顺时针迁移规则使用一致性哈希运算映射得到环状存储空间上新的数据节点,此时数据在单个机架中的等分区域内发生映射变化,存储数据可能保持原有存储位置或者产生小范围迁移;存储数据备份依照一致性哈希运算映射被连续的存储在环状空间毗邻的机架上,当集群添加机架或者遇到故障退出机架时,与之相邻的机架的数据都需要进行迁移。机架进入环状存储空间时,变化机架前后几个与备份数据相关的机架的迁移状况如图2所示,由图2可以看出,使用此种算法处理分布式集群数据存储问题能够继承一致性哈希算法在保持单调性的同时,可以避免大量数据迁移而加大服务器压力的优点。For the addition and deletion of data nodes, the embodiment of the present invention can use consistent hash operation mapping to obtain new data nodes on the ring storage space according to the clockwise migration rule. At this time, the data occurs in the equally divided areas in a single rack When the mapping changes, the stored data may maintain the original storage location or have a small-scale migration; the stored data backup is continuously stored on the adjacent racks in the ring space according to the consistent hash operation mapping. When the cluster adds a rack or encounters a failure When a rack exits, the data in the adjacent racks needs to be migrated. When the rack enters the ring storage space, the migration status of several racks related to backup data before and after the rack change is shown in Figure 2. It can be seen from Figure 2 that using this algorithm to deal with the distributed cluster data storage problem can Inheriting the consistent hash algorithm can avoid the advantages of increasing the pressure on the server due to massive data migration while maintaining monotonicity.

下面针对上述方法进行验证说明;The following is a verification description for the above method;

在局域网中搭建HDFS存储集群,操作系统使用Ubuntu14.04,安装Hadoop云平台计算,英特尔至强4核CPU,8G内存,1TBSATA硬盘,千兆网卡配置用于存储集群数据节点的连接,模拟6个机架(每个机架分别有6、8、12、9、8、10个数据节点)。Build an HDFS storage cluster in the local area network, use Ubuntu 14.04 as the operating system, install Hadoop cloud platform computing, Intel Xeon 4-core CPU, 8G memory, 1TB SATA hard disk, and Gigabit network card configuration for the connection of storage cluster data nodes, simulating 6 Racks (6, 8, 12, 9, 8, 10 data nodes per rack).

获取的数据见表1,数据节点的性能是相同的,数据节点需要依据实际的存储集群情况进行配置,使用网卡物理地址与局域网IP联合作为唯一标识位置,映射函数使用一致性哈希的Chord算法,等分存储空间大小设定为64MB,上传数据规模为50GB,存储约1200个存储区域。The obtained data is shown in Table 1. The performance of the data nodes is the same. The data nodes need to be configured according to the actual storage cluster conditions. The combination of the network card physical address and the LAN IP is used as the unique identification location, and the mapping function uses the Chord algorithm of consistent hashing. , the equal storage space size is set to 64MB, the uploaded data size is 50GB, and about 1200 storage areas are stored.

文件document 数据副本数Number of data copies 文件大小File size 占用空间take up space 记录条数Number of records 用户信息User Info 33 1MB1MB 3MB3MB 21302130 发布消息make an announcement 33 16GB16 GB 45GB45GB 512k512k 环境数据environmental data 33 640MB640MB 1900MB1900MB 96809680

表1Table 1

使用上述设置完成多机架连接测试并行性能变化趋势实验,验证多机架并行连接与备份分配比重关系。这里认为各个数据节点均衡分布且个体性能差异不大,理论上各机架中数据节点按照一致性哈希算法被分配数据备份的机会均等。从图3中可以看出,按照数据的负载均衡理论实际情况中机架的数据节点备份应与理论情况相近,能够保证机架之间数据的平衡性存储。图4所示为运行时间对比情况,使用一致性哈希优化算法与标准hadoop平台下的约减端连接查询处理算法对数据进行连接查询,对比可知,映射任务在本地完成数据连接比从映射端到约减端的数据传输花费时间明显缩短,且缩减了数据传输的启动开销。Use the above settings to complete the multi-rack connection test parallel performance trend experiment, and verify the relationship between multi-rack parallel connection and backup allocation ratio. Here, it is considered that each data node is evenly distributed and there is little difference in individual performance. In theory, the data nodes in each rack have an equal chance of being allocated data backup according to the consistent hash algorithm. It can be seen from Figure 3 that according to the data load balancing theory, the data node backup of the rack in the actual situation should be similar to the theoretical situation, which can ensure the balanced storage of data between the racks. Figure 4 shows the comparison of running time. The data is connected and queried using the consistent hash optimization algorithm and the reduced-side connection query processing algorithm under the standard hadoop platform. The comparison shows that the mapping task is completed locally than from the mapping side. The time spent on data transfer to the reduction side is significantly shortened, and the startup overhead of data transfer is reduced.

使用数据上传实验将数据集从本地文件系统上传至HDFS,验证优化存储策略与数据上传速度的关系,通过考虑机架数据节点中的备份数分配情况,了解数据节点之间的数据均衡性能。理论上,认为数据节点分布在均匀区域内,且性能差异不大,那么数据节点会有均等的机会被分配机架获取的备份。由图5所示可以看出,随着数据规模的增长,数据传输的最终通信时间能够基本保持稳定(51.5s左右且浮动振幅不大),机架中各个数据节点获取备份的概率均能保持在理论值(10%)上下浮动,表明机架中的数据节点在被分配备份时能够保证负载均衡。Use the data upload experiment to upload the data set from the local file system to HDFS, verify the relationship between the optimized storage strategy and the data upload speed, and understand the data balance performance between data nodes by considering the distribution of backup numbers in the rack data nodes. Theoretically, it is considered that the data nodes are distributed in a uniform area, and the performance difference is not large, then the data nodes will have an equal chance to be allocated to the backup obtained by the rack. As shown in Figure 5, it can be seen that with the increase of data scale, the final communication time of data transmission can basically remain stable (about 51.5s and the fluctuation amplitude is not large), and the probability of each data node in the rack to obtain backup can be maintained. It fluctuates around the theoretical value (10%), indicating that the data nodes in the rack can ensure load balancing when they are assigned backups.

根据数据迁移与备份数比例变化趋势验证一致性哈希算法单调性和负载均衡的特性对集群进行数据节点添加与删除操作,图6中所示为机架经过映射调整后的实际值获取备份情况,可以看出新添加的数据节点获取备份概率较高,出现这种情况的原因是数据在完成映射的过程中需要重新规划数据节点获取备份的概率,但振荡幅值较小在合理范围内(1.8%),并没有影响机架内的整体负载均衡;出现这种情况是因为需要花费另外的时间来选择数据节点。图6给出了采用一致性哈希算法与随机分布的Hadoop平台策略进行数据操作的运行时间对比,可以看出随着数据规模增长运行时间增长幅度较小,数据处理效率较高,说明这种设计算法能够满足较大规模数据的处理。Verify the monotonicity and load balancing characteristics of the consistent hashing algorithm according to the change trend of the data migration and backup numbers. Add and delete data nodes to the cluster. Figure 6 shows the actual value of the rack after mapping and adjustment to obtain backups. , it can be seen that the newly added data nodes have a higher probability of obtaining backups. The reason for this is that the data needs to re-plan the probability of data nodes obtaining backups during the process of completing the mapping, but the oscillation amplitude is small within a reasonable range ( 1.8%), and did not affect the overall load balancing within the rack; this occurred because of the additional time required to select data nodes. Figure 6 shows the comparison of the running time of the data operation using the consistent hash algorithm and the random distribution Hadoop platform strategy. It can be seen that as the data scale increases, the running time increases slightly, and the data processing efficiency is high, indicating that this The design algorithm can meet the processing of large-scale data.

图7为本发明实施例提供的一种数据存储的方法,如图7所示,本发明实施例的执行主体为数据存储的装置,该方法包括:Fig. 7 is a data storage method provided by the embodiment of the present invention. As shown in Fig. 7, the execution subject of the embodiment of the present invention is a data storage device, and the method includes:

步骤S701、获取待存储的数据。Step S701, acquiring data to be stored.

步骤S702、通过哈希运算在存储空间内确定该数据对应的机架。Step S702, determine the rack corresponding to the data in the storage space through a hash operation.

其中,该存储空间为环形存储空间,该数据节点对应多个虚拟数据节点,该多个虚拟数据节点负责的存储空间由多个均分的存储区域组成。Wherein, the storage space is a ring-shaped storage space, and the data node corresponds to a plurality of virtual data nodes, and the storage space responsible for the plurality of virtual data nodes is composed of a plurality of evenly divided storage areas.

步骤S703、确定该机架是否异常;Step S703, determining whether the rack is abnormal;

在确定该机架正常时,执行步骤S704至步骤S706;When it is determined that the rack is normal, execute steps S704 to S706;

在确定该机架异常时,执行步骤S710。When it is determined that the rack is abnormal, step S710 is performed.

步骤S704、获取该数据对应的数据副本。Step S704, acquiring a data copy corresponding to the data.

步骤S705、通过哈希运算确定该数据副本在该机架上的数据节点对应的存储区域。Step S705. Determine the storage area corresponding to the data node on the rack for the data copy through a hash operation.

步骤S706、确定该机架上的数据节点是否异常。Step S706, determining whether the data node on the rack is abnormal.

在确定该机架上的数据节点正常时,执行步骤S707;When it is determined that the data nodes on the rack are normal, perform step S707;

在确定该机架上的数据节点异常时,执行步骤S710。When it is determined that the data node on the rack is abnormal, step S710 is executed.

步骤S707、确定该数据节点对应的存储区域是否充足。Step S707, determine whether the storage area corresponding to the data node is sufficient.

在确定该数据节点对应的存储区域充足时,执行步骤S708。When it is determined that the storage area corresponding to the data node is sufficient, step S708 is executed.

在确定该数据节点对应的存储区域不充足时,执行步骤S711。When it is determined that the storage area corresponding to the data node is not sufficient, step S711 is executed.

步骤S708、将该数据副本存储在该存储区域内。Step S708, storing the data copy in the storage area.

步骤S700、确定全部数据副本是否存储完成。Step S700. Determine whether all data copies have been stored.

在确定全部数据副本存储完成时,则数据存储结束。When it is determined that the storage of all data copies is completed, the data storage ends.

在确定全部数据副本未存储完成时,执行步骤S710。When it is determined that all data copies have not been stored, step S710 is executed.

步骤S710、按照顺时针顺序在该存储空间内搜索下一机架并继续执行步骤S703。Step S710, search for the next rack in the storage space in a clockwise order and continue to execute step S703.

步骤S711、按照顺时针顺序在该存储空间内搜索该机架上的下一数据节点并继续执行步骤S707。Step S711 , search the next data node on the rack in the storage space in a clockwise order and continue to execute step S707 .

这样,本发明通过哈希算法并引入虚拟数据节点与等分存储区域完成数据存储,从而能够在保证数据均衡分布的同时,快速完成数据存储,提升系统处理性能的技术问题。In this way, the present invention completes data storage through a hash algorithm and introduces virtual data nodes and equally divided storage areas, so that data storage can be quickly completed while ensuring balanced distribution of data, and the technical problem of improving system processing performance is achieved.

需要说明的是,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the above method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to In the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

图8为本发明实施例提供的一种数据存储的装置,如图8所示,该装置包括;FIG. 8 is a data storage device provided by an embodiment of the present invention. As shown in FIG. 8, the device includes;

获取单元801,用于获取待存储的数据。The obtaining unit 801 is configured to obtain data to be stored.

处理单元802,用于通过哈希运算在存储空间内确定该数据对应的机架,并获取该数据对应的数据副本,并通过哈希运算确定该数据副本在该机架上的数据节点对应的存储区域.The processing unit 802 is configured to determine the rack corresponding to the data in the storage space through a hash operation, obtain a data copy corresponding to the data, and determine the data copy corresponding to the data node on the rack through a hash operation. storage area.

其中,该存储空间为环形存储空间,该数据节点对应多个虚拟数据节点,该多个虚拟数据节点负责的存储空间由多个均分的存储区域组成。Wherein, the storage space is a ring-shaped storage space, and the data node corresponds to a plurality of virtual data nodes, and the storage space responsible for the plurality of virtual data nodes is composed of a plurality of evenly divided storage areas.

存储单元803,用于将该数据副本存储在该存储区域内。The storage unit 803 is configured to store the data copy in the storage area.

可选地,该处理单元802,还用于在获取待存储的数据前,将该存储空间进行均分操作得到多个均分的存储区域。Optionally, the processing unit 802 is further configured to, before acquiring the data to be stored, perform an equal division operation on the storage space to obtain multiple equally divided storage areas.

可选地,如图9所示,该装置还包括:Optionally, as shown in Figure 9, the device also includes:

第一判断单元804,用于在该获取该数据对应的数据副本前,确定该机架是否异常;The first judging unit 804 is configured to determine whether the rack is abnormal before acquiring the data copy corresponding to the data;

该处理单元801,用于在该第一判断单元804确定该机架正常时,获取该数据对应的数据副本;在该第一判断单元804确定该机架异常时,按照顺时针顺序在该存储空间内搜索下一机架。The processing unit 801 is configured to obtain the data copy corresponding to the data when the first judging unit 804 determines that the rack is normal; Search for the next rack within the space.

可选地,如图10所示,该装置还包括:Optionally, as shown in Figure 10, the device also includes:

第二判断单元805,用于在该将该数据副本存储在该存储区域内之前,在通过哈希运算确定该数据副本在该机架上的数据节点对应的存储区域之后,确定该机架上的数据节点是否异常;The second judging unit 805 is configured to, before storing the data copy in the storage area, after determining the storage area corresponding to the data node on the rack for the data copy through a hash operation, determine the Whether the data node of is abnormal;

该处理单元802,用于在该第二判断单元805确定该数据节点异常时,按照顺时针顺序在该存储空间内搜索下一机架;The processing unit 802 is configured to search the next rack in the storage space in a clockwise order when the second judging unit 805 determines that the data node is abnormal;

第二判断单元805,还用于在确定该数据节点正常时,确定该数据节点对应的存储区域是否充足;The second judging unit 805 is further configured to determine whether the storage area corresponding to the data node is sufficient when determining that the data node is normal;

该存储单元803,用于在该第二判断单元805确定该存储区域充足时,将该数据副本存储在该存储区域内;The storage unit 803 is configured to store the data copy in the storage area when the second judging unit 805 determines that the storage area is sufficient;

该处理单元802,用于在该第二判断单元805确定该存储区域不充足时,按照顺时针顺序在该存储空间内搜索该机架上的下一数据节点。The processing unit 802 is configured to, when the second judging unit 805 determines that the storage area is insufficient, search the storage space for a next data node on the rack in a clockwise order.

可选地,如图11所示,该装置还包括:Optionally, as shown in Figure 11, the device also includes:

第三判断单元806,在将该数据副本存储在该存储区域内之后,确定全部数据副本是否存储完成;The third judging unit 806, after storing the data copy in the storage area, determines whether all the data copies have been stored;

该处理单元802,用于在确定全部数据副本未存储完成后,按照顺时针顺序在该存储空间内搜索下一机架。The processing unit 802 is configured to search the next rack in the storage space in a clockwise order after determining that all data copies have not been stored.

采用本发明实施例提供的数据存储的装置,通过哈希算法并引入虚拟数据节点与等分存储区域完成数据存储,从而能够在保证数据均衡分布的同时,快速完成数据存储,提升系统处理性能的技术问题。Using the data storage device provided by the embodiment of the present invention, the data storage is completed through the hash algorithm and the introduction of virtual data nodes and equal storage areas, so that the data storage can be quickly completed while ensuring the balanced distribution of data, and the system processing performance can be improved. technical problem.

需要说明的是,所属本领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的数据存储的装置的具体工作过程和描述,可以参考前述方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process and description of the data storage device described above can refer to the corresponding process in the foregoing method embodiment. This will not be repeated here.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.

在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be another division method. For example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,RandomAccessMemory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications are also It should be regarded as the protection scope of the present invention.

Claims (10)

1.一种数据存储的方法,其特征在于,包括:1. A method for data storage, comprising: 获取待存储的数据;Get the data to be stored; 通过哈希运算在存储空间内确定所述数据对应的机架;determining the rack corresponding to the data in the storage space through a hash operation; 获取所述数据对应的数据副本,并通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域;其中,所述存储空间为环形存储空间,所述数据节点对应多个虚拟数据节点,所述多个虚拟数据节点负责的存储空间由多个均分的存储区域组成;Obtain the data copy corresponding to the data, and determine the storage area corresponding to the data node on the rack of the data copy through a hash operation; wherein, the storage space is a ring storage space, and the data node corresponds to multiple a virtual data node, the storage space that the multiple virtual data nodes are responsible for consists of a plurality of evenly divided storage areas; 将所述数据副本存储在所述存储区域内。storing the data copy in the storage area. 2.根据权利要求1所述的方法,其特征在于,在获取待存储的数据前,所述方法还包括:将所述存储空间进行均分操作得到多个均分的存储区域。2. The method according to claim 1, characterized in that, before acquiring the data to be stored, the method further comprises: performing an equal division operation on the storage space to obtain a plurality of equally divided storage areas. 3.根据权利要求1所述的方法,其特征在于,在所述获取所述数据对应的数据副本前,所述方法还包括:3. The method according to claim 1, wherein, before said obtaining the data copy corresponding to said data, said method further comprises: 确定所述机架是否异常;determining whether the rack is abnormal; 所述获取所述数据对应的数据副本包括:在确定所述机架正常时,获取所述数据对应的数据副本;The obtaining the data copy corresponding to the data includes: obtaining the data copy corresponding to the data when it is determined that the rack is normal; 在确定所述机架异常时,按照顺时针顺序在所述存储空间内搜索下一机架。When it is determined that the rack is abnormal, the next rack is searched in the storage space in a clockwise order. 4.根据权利要求1所述的方法,其特征在于,在所述将所述数据副本存储在所述存储区域内之前,所述方法还包括:4. The method according to claim 1, wherein before storing the data copy in the storage area, the method further comprises: 在通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域后,确定所述机架上的数据节点是否异常;After determining the storage area corresponding to the data node on the rack of the data copy through a hash operation, determine whether the data node on the rack is abnormal; 在确定所述数据节点异常时,按照顺时针顺序在所述存储空间内搜索下一机架;When it is determined that the data node is abnormal, search the next rack in the storage space in a clockwise order; 在确定所述数据节点正常时,确定所述数据节点对应的存储区域是否充足;When determining that the data node is normal, determine whether the storage area corresponding to the data node is sufficient; 所述将所述数据副本存储在所述存储区域内包括:在确定所述存储区域充足时,将所述数据副本存储在所述存储区域内;The storing the data copy in the storage area includes: storing the data copy in the storage area when it is determined that the storage area is sufficient; 在确定所述存储区域不充足时,按照顺时针顺序在所述存储空间内搜索所述机架上的下一数据节点。When it is determined that the storage area is insufficient, searching the next data node on the rack in the storage space in a clockwise order. 5.根据权利要求1所述的方法,其特征在于,在将所述数据副本存储在所述存储区域内之后,所述方法还包括:5. The method according to claim 1, wherein after storing the data copy in the storage area, the method further comprises: 确定全部数据副本是否存储完成;Determine whether all data copies are stored; 在确定全部数据副本未存储完成时,按照顺时针顺序在所述存储空间内搜索下一机架。When it is determined that all data copies have not been stored, the next rack is searched in the storage space in a clockwise order. 6.一种数据存储的装置,其特征在于,包括:6. A device for data storage, comprising: 获取单元,用于获取待存储的数据;an acquisition unit, configured to acquire data to be stored; 处理单元,用于通过哈希运算在存储空间内确定所述数据对应的机架,并获取所述数据对应的数据副本,并通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域;其中,所述存储空间为环形存储空间,所述数据节点对应多个虚拟数据节点,所述多个虚拟数据节点负责的存储空间由多个均分的存储区域组成;A processing unit, configured to determine the rack corresponding to the data in the storage space through a hash operation, obtain a data copy corresponding to the data, and determine the data of the data copy on the rack through a hash operation A storage area corresponding to the node; wherein, the storage space is a ring-shaped storage space, the data node corresponds to a plurality of virtual data nodes, and the storage space responsible for the plurality of virtual data nodes is composed of a plurality of equally divided storage areas; 存储单元,用于将所述数据副本存储在所述存储区域内。a storage unit, configured to store the data copy in the storage area. 7.根据权利要求6所述的装置,其特征在于,所述处理单元,还用于在获取待存储的数据前,将所述存储空间进行均分操作得到多个均分的存储区域。7 . The device according to claim 6 , wherein the processing unit is further configured to, before obtaining the data to be stored, perform an equal division operation on the storage space to obtain a plurality of equally divided storage areas. 8.根据权利要求6所述的装置,其特征在于,所述装置还包括:8. The device according to claim 6, further comprising: 第一判断单元,用于在所述获取所述数据对应的数据副本前,确定所述机架是否异常;A first judging unit, configured to determine whether the rack is abnormal before acquiring the data copy corresponding to the data; 所述处理单元,用于在所述第一判断单元确定所述机架正常时,获取所述数据对应的数据副本;在所述第一判断单元确定所述机架异常时,按照顺时针顺序在所述存储空间内搜索下一机架。The processing unit is configured to obtain a data copy corresponding to the data when the first judging unit determines that the rack is normal; when the first judging unit determines that the rack is abnormal, in a clockwise order Search for the next rack within the storage space. 9.根据权利要求6所述的装置,其特征在于,所述装置还包括:9. The device according to claim 6, further comprising: 第二判断单元,用于在所述将所述数据副本存储在所述存储区域内之前,在通过哈希运算确定所述数据副本在所述机架上的数据节点对应的存储区域之后,确定所述机架上的数据节点是否异常;The second judging unit is configured to determine, before storing the data copy in the storage area, after determining the storage area of the data copy corresponding to the data node on the rack through a hash operation Whether the data nodes on the rack are abnormal; 所述处理单元,用于在所述第二判断单元确定所述数据节点异常时,按照顺时针顺序在所述存储空间内搜索下一机架;The processing unit is configured to search for the next rack in the storage space in a clockwise order when the second judging unit determines that the data node is abnormal; 第二判断单元,还用于在确定所述数据节点正常时,确定所述数据节点对应的存储区域是否充足;The second judging unit is further configured to determine whether the storage area corresponding to the data node is sufficient when determining that the data node is normal; 所述存储单元,用于在所述第二判断单元确定所述存储区域充足时,将所述数据副本存储在所述存储区域内;The storage unit is configured to store the copy of the data in the storage area when the second judging unit determines that the storage area is sufficient; 所述处理单元,用于在所述第二判断单元确定所述存储区域不充足时,按照顺时针顺序在所述存储空间内搜索所述机架上的下一数据节点。The processing unit is configured to, when the second judging unit determines that the storage area is insufficient, search the storage space for the next data node on the rack in a clockwise order. 10.根据权利要求6所述的装置,其特征在于,所述装置还包括:10. The device according to claim 6, further comprising: 第三判断单元,在将所述数据副本存储在所述存储区域内之后,确定全部数据副本是否存储完成;A third judging unit, after storing the data copy in the storage area, determines whether all the data copies have been stored; 所述处理单元,用于在确定全部数据副本未存储完成后,按照顺时针顺序在所述存储空间内搜索下一机架。The processing unit is configured to search the next rack in the storage space in a clockwise order after determining that all data copies have not been stored.
CN201510810711.XA 2015-11-12 2015-11-12 The method and apparatus of data storage Expired - Fee Related CN105511801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510810711.XA CN105511801B (en) 2015-11-12 2015-11-12 The method and apparatus of data storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510810711.XA CN105511801B (en) 2015-11-12 2015-11-12 The method and apparatus of data storage

Publications (2)

Publication Number Publication Date
CN105511801A true CN105511801A (en) 2016-04-20
CN105511801B CN105511801B (en) 2018-11-16

Family

ID=55719821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510810711.XA Expired - Fee Related CN105511801B (en) 2015-11-12 2015-11-12 The method and apparatus of data storage

Country Status (1)

Country Link
CN (1) CN105511801B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915626A (en) * 2016-05-27 2016-08-31 南京邮电大学 Data copy initial placement method for cloud storage
CN106503139A (en) * 2016-10-20 2017-03-15 上海携程商务有限公司 Dynamic data access method and system
CN107171971A (en) * 2017-05-11 2017-09-15 北京云端智度科技有限公司 Network traffic load method in a balanced way is realized using uniformity Hash strategy
CN109388335A (en) * 2017-08-10 2019-02-26 中国移动通信集团宁夏有限公司 A kind of date storage method and system
CN110275873A (en) * 2019-06-28 2019-09-24 重庆紫光华山智安科技有限公司 File memory method, device, storage management apparatus and storage medium
WO2020220540A1 (en) * 2019-04-28 2020-11-05 平安科技(深圳)有限公司 Point-to-point network-based data storage method and apparatus, medium and terminal device
CN112148206A (en) * 2019-06-28 2020-12-29 北京金山云网络技术有限公司 A data reading and writing method, device, electronic device and medium
WO2021227557A1 (en) * 2020-05-15 2021-11-18 苏州浪潮智能科技有限公司 Method and apparatus for storing result of hash algorithm
CN114328563A (en) * 2021-12-31 2022-04-12 北京深演智能科技股份有限公司 Data updating control method and device
CN115297131A (en) * 2022-08-01 2022-11-04 东北大学 Sensitive data distributed storage method based on consistent hash
CN117827850A (en) * 2024-03-06 2024-04-05 深圳钰丰信息技术有限公司 Data storage method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102737127A (en) * 2012-06-20 2012-10-17 厦门聚海源物联网络技术有限公司 Massive data storage method
CN102831120A (en) * 2011-06-15 2012-12-19 腾讯科技(深圳)有限公司 Data processing method and system
CN103761167A (en) * 2014-01-23 2014-04-30 浪潮(北京)电子信息产业有限公司 Method and device for achieving data center backup
US20150271183A1 (en) * 2014-03-18 2015-09-24 nTrust Technology Solutions Corp. Virtual currency system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831120A (en) * 2011-06-15 2012-12-19 腾讯科技(深圳)有限公司 Data processing method and system
CN102737127A (en) * 2012-06-20 2012-10-17 厦门聚海源物联网络技术有限公司 Massive data storage method
CN103761167A (en) * 2014-01-23 2014-04-30 浪潮(北京)电子信息产业有限公司 Method and device for achieving data center backup
US20150271183A1 (en) * 2014-03-18 2015-09-24 nTrust Technology Solutions Corp. Virtual currency system

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915626B (en) * 2016-05-27 2019-02-26 南京邮电大学 A method for initial placement of data copies for cloud storage
CN105915626A (en) * 2016-05-27 2016-08-31 南京邮电大学 Data copy initial placement method for cloud storage
CN106503139A (en) * 2016-10-20 2017-03-15 上海携程商务有限公司 Dynamic data access method and system
CN107171971A (en) * 2017-05-11 2017-09-15 北京云端智度科技有限公司 Network traffic load method in a balanced way is realized using uniformity Hash strategy
CN109388335B (en) * 2017-08-10 2021-10-29 中国移动通信集团宁夏有限公司 A data storage method and system
CN109388335A (en) * 2017-08-10 2019-02-26 中国移动通信集团宁夏有限公司 A kind of date storage method and system
WO2020220540A1 (en) * 2019-04-28 2020-11-05 平安科技(深圳)有限公司 Point-to-point network-based data storage method and apparatus, medium and terminal device
CN110275873A (en) * 2019-06-28 2019-09-24 重庆紫光华山智安科技有限公司 File memory method, device, storage management apparatus and storage medium
CN112148206A (en) * 2019-06-28 2020-12-29 北京金山云网络技术有限公司 A data reading and writing method, device, electronic device and medium
WO2021227557A1 (en) * 2020-05-15 2021-11-18 苏州浪潮智能科技有限公司 Method and apparatus for storing result of hash algorithm
CN114328563A (en) * 2021-12-31 2022-04-12 北京深演智能科技股份有限公司 Data updating control method and device
CN114328563B (en) * 2021-12-31 2023-07-14 北京深演智能科技股份有限公司 Data updating control method and device
CN115297131A (en) * 2022-08-01 2022-11-04 东北大学 Sensitive data distributed storage method based on consistent hash
CN115297131B (en) * 2022-08-01 2023-05-26 东北大学 Sensitive data distributed storage method based on consistent hash
CN117827850A (en) * 2024-03-06 2024-04-05 深圳钰丰信息技术有限公司 Data storage method and system
CN117827850B (en) * 2024-03-06 2024-05-10 深圳钰丰信息技术有限公司 Data storage method and system

Also Published As

Publication number Publication date
CN105511801B (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN105511801B (en) The method and apparatus of data storage
JP5824167B2 (en) Cluster system data processing method and apparatus
CN110489059B (en) Data cluster storage method and device and computer equipment
CN109117275B (en) Account reconciliation method, device, computer equipment and storage medium based on data sharding
CN103929454B (en) The method and system of load balancing storage in a kind of cloud computing platform
CN103136114B (en) Storage means and memory storage
US10824512B2 (en) Managing journaling resources with copies stored in multiple locations
CN103229151B (en) A kind of partition extension method and device
CN108090125B (en) A kind of non-query type deduplication method and device
CN103634401A (en) Data copy storage method and terminal unit, and server unit
CN104298541A (en) Data distribution algorithm and data distribution device for cloud storage system
CN107133228A (en) A kind of method and device of fast resampling
WO2016006050A1 (en) Storage system and memory control method
JP6059558B2 (en) Load balancing judgment system
CN106293537B (en) A lightweight approach to autonomous block management for data-intensive file systems
CN105718485B (en) A method and device for entering data into a database
JP6163187B2 (en) Cluster system data processing method and apparatus
CN108984780B (en) Method and apparatus for managing disk data based on data structure supporting duplicate key-value tree
CN118827333A (en) Blockchain node failure recovery method, device, equipment and storage medium
Xi et al. An efficient hierarchical data placement algorithm for massive spatial data storage systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220316

Address after: 130022 21 / F, Yuanchuang international, Weixing Road, Changchun City, Jilin Province

Patentee after: Jilin Kasite Technology Co.,Ltd.

Address before: 130022 No. 7186 Satellite Road, Changchun, Jilin, Chaoyang District

Patentee before: CHANGCHUN University OF SCIENCE AND TECHNOLOGY

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20181116