WO2016082560A1 - 一种检测键的方法和服务器 - Google Patents

一种检测键的方法和服务器 Download PDF

Info

Publication number
WO2016082560A1
WO2016082560A1 PCT/CN2015/083887 CN2015083887W WO2016082560A1 WO 2016082560 A1 WO2016082560 A1 WO 2016082560A1 CN 2015083887 W CN2015083887 W CN 2015083887W WO 2016082560 A1 WO2016082560 A1 WO 2016082560A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
hard disk
hash value
server
hash
Prior art date
Application number
PCT/CN2015/083887
Other languages
English (en)
French (fr)
Inventor
张雷
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016082560A1 publication Critical patent/WO2016082560A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/28Error detection; Error correction; Monitoring by checking the correct order of processing

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a method and a server for detecting a key.
  • a protocol for interconnecting networks (English: Internet Protocol; IP for short) is a hard disk that provides physical communication through the IP protocol. It eliminates the traditional serial connection (English: Serial Attached SCSI; SAS) / Serial Advanced Technology Attachment (English: Serial SATA) interface, making the connection between the host and the hard disk easier. There is almost no limit to the distance.
  • IP hard disks are stored in a Key-Value, key-value pair structure.
  • Key is a key, usually a string
  • Value is the value corresponding to the key, also known as data or data content
  • KV data Key-Value data
  • the offset of the Value storage address and the key Key are stored together in the index area, and the value corresponding to the Key is stored in the data area.
  • the server of the distributed system accesses the key, traverses the index area, and accesses the value corresponding to the Key according to the Key index to the offset.
  • a key in a distributed system is stored in multiple IP hard disks, that is, multiple copies are stored.
  • the key of one partition is stored on multiple IP hard disks, and the key of multiple partitions may be stored on one IP hard disk. If a Key is damaged due to bad sectors of the IP hard disk, the distributed system may not be able to access the corresponding storage in the IP hard disk. Value.
  • the existing method is that a server in a distributed system acquires a copy of all Keys of the partition stored on a plurality of IP hard disks corresponding to a partition, wherein the partitions are logically divided by logical units in the distributed system.
  • the copy data size of a Key is usually megabytes, and sometimes even ten megabytes. Therefore, transferring multiple Key copies consumes a lot of network resources and the transmission speed is very slow.
  • the server After receiving a copy of each IP hard disk transfer, the server compares. If one of the multiple copies of the same Key is different from the other copies, the Key is considered to be corrupted in the IP hard disk of the different copy. In this way, the damaged Key is detected, the transmission speed is slow, and the detection efficiency is low.
  • the invention provides a method and a server for detecting a key for detecting a damaged key in an IP hard disk and improving detection efficiency.
  • the first aspect of the present application provides a method for detecting a key, where the method is applied to a storage system, where the storage system includes a server and a plurality of IP hard disks, including:
  • the server sends a detection instruction to the first IP hard disk of the plurality of IP hard disks, where the detection instruction includes an identifier of a to-be-detected partition, and the to-be-detected partition includes a plurality of keys;
  • the server determines, according to the multiple second hash values corresponding to the identifiers sent by the other IP hard disks of the plurality of IP hard disks, whether each second hash value has an equal first hash value;
  • the method further includes:
  • the multiple IP hard disks are IP hard disks corresponding to the to-be-detected partitions.
  • the second aspect of the present application provides a method for generating a hash value, which is applied to an IP hard disk, where the IP hard disk includes a plurality of keys, and the method includes:
  • the method further includes:
  • the method further includes: receiving a second key sent by the server, and storing the second key, The second key is not included in the plurality of keys.
  • a third aspect of the present application provides a server, including:
  • a communication interface configured to send a detection instruction to the first IP hard disk of the plurality of IP hard disks, the detection instruction includes an identifier of the to-be-detected partition, the to-be-detected partition includes a plurality of keys, and the first IP hard disk sends the a plurality of first hash values corresponding to the identifiers;
  • a processor configured to determine, according to the multiple second hash values corresponding to the identifier sent by other IP hard disks of the plurality of IP hard disks, whether each second hash value has an equal first hash And determining, when the target hash value of the plurality of second hash values is not included in the plurality of first hash values, determining that the first IP hard disk stores the target hash value The keys are damaged.
  • the communication interface is further configured to:
  • the multiple IP hard disks are IP hard disks corresponding to the to-be-detected partitions.
  • the fourth aspect of the present application provides an IP hard disk, including:
  • a storage unit for storing a plurality of keys
  • a processor configured to perform a hash operation on each of the plurality of keys to obtain a hash value corresponding to each of the keys
  • An interface configured to receive a detection instruction sent by the server, where the detection instruction includes an identifier of a to-be-detected partition, the to-be-detected partition includes the multiple keys, and send, to the server, a identifier corresponding to the identifier Multiple hashes.
  • the storage unit is further configured to save a correspondence between each of the keys and a hash value
  • the interface is further configured to receive a first hash value sent by the server, where the first hash value is one of the saved hash values;
  • the processor is further configured to: determine, according to the correspondence relationship and the first hash value, a first key corresponding to the first hash value; and acquire the first key;
  • the interface is further configured to send the first key to the server.
  • the interface is further configured to receive a second key that is sent by the server;
  • the storage unit is further configured to store the second key, and the second key is not included in the plurality of keys.
  • the server sends a detection instruction to the first IP hard disk of the plurality of IP hard disks, the detection instruction includes an identifier of a to-be-detected partition, the to-be-detected partition includes a plurality of keys, and the server receives the first IP a plurality of first hash values corresponding to the identifiers sent by the hard disk; the server determining, according to the plurality of second hash values corresponding to the identifiers sent by the other IP hard disks of the plurality of IP hard disks Each second hash value has an equal first hash value; when the target hash value of the plurality of second hash values is not included in the plurality of first hash values, the server Determining that a key corresponding to the target hash value stored in the first IP hard disk is damaged.
  • the target hash value when the target hash value is not included in the first hash value, it may be determined that the key corresponding to the first hash value stored in the first IP hard disk has been damaged. Moreover, the hash value is smaller than the key itself, so the transmission efficiency ratio is The transfer key itself is faster. Therefore, the detection efficiency of the damaged key in the IP hard disk is improved.
  • FIG. 1 is a flow chart of a method for detecting a key in an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for generating a hash value according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a server according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an IP hard disk according to an embodiment of the present invention.
  • the invention provides a method and a server for detecting a key for detecting a damaged key in an IP hard disk and improving detection efficiency.
  • the technical solution in the embodiment of the present invention is to solve the above technical problem, and the method for detecting a key in the present invention includes the following contents:
  • the server sends a detection instruction to the first IP hard disk of the plurality of IP hard disks, the detection instruction includes an identifier of a to-be-detected partition, the to-be-detected partition includes a plurality of keys, and the server receives the first IP a plurality of first hash values corresponding to the identifiers sent by the hard disk; the server determining, according to the plurality of second hash values corresponding to the identifiers sent by the other IP hard disks of the plurality of IP hard disks Each second hash value has an equal first hash value; when the target hash value of the plurality of second hash values is not included in the plurality of first hash values, the server Determining that a key corresponding to the target hash value stored in the first IP hard disk is damaged.
  • the target hash value when the target hash value is not included in the first hash value, it may be determined that the key corresponding to the first hash value stored in the first IP hard disk has been damaged. Moreover, the hash value is smaller than the key itself, so the transmission efficiency ratio is The transfer key itself is faster. Therefore, the detection efficiency of the damaged key in the IP hard disk is improved.
  • the first aspect of the present application provides a method for detecting a key.
  • the method includes:
  • S101 The server sends a detection instruction to a first one of the plurality of IP hard disks.
  • the server receives a plurality of first hash values corresponding to the identifiers sent by the first IP hard disk.
  • S103 The server determines, according to the multiple second hash values corresponding to the identifier sent by the other IP hard disks of the plurality of IP hard disks, whether each second hash value has an equal first hash. value.
  • the storage system includes a server and multiple IP hard disks, and multiple IP hard disks are connected to the server.
  • the IP hard disk provides a storage function, which stores a key Key and a data value corresponding to the key.
  • the server manages multiple IP hard disks, for example, writes keys and data input by the user into the storage system into one or more IP hard disks, or deletes, modifies, and updates keys and data in the IP hard disk according to user requirements.
  • the user and the upper layer application control and management of the IP hard disk are implemented by the server.
  • Key is called a key, which is also called a primary key; Value is a value corresponding to a key, and can also be called data and data content.
  • a key or Key refers to the same, and values, data, and data contents all refer to Value.
  • a partition includes a plurality of keys, and each key is stored in a plurality of IP hard disks, such as three, that is, a complete key is stored in the first IP hard disk, in two A complete key is stored in the IP hard disk, and a complete key is also stored in the third IP hard disk. And each of the IP hard disks stored in each key in the same partition is the same multiple IP hard disks. And an IP hard disk can store keys for one or more partitions.
  • a record table is maintained in the storage system.
  • a plurality of IP hard disks corresponding to one partition are recorded in the record table.
  • the corresponding IP hard disk can be recorded by recording the IP address, index, port number, and the like of the IP hard disk.
  • the query record table can determine which of the plurality of IP hard disks corresponding to the to-be-detected partition are specifically.
  • the first IP hard disk is one of a plurality of IP hard disks.
  • a detection instruction is transmitted to the first IP hard disk in S101.
  • the detecting instruction includes the partition to be detected, because the key and the data of the plurality of partitions may be stored on each of the IP hard disks.
  • logo According to the identifier, the first IP hard disk can determine a plurality of keys included in the to-be-detected partition.
  • the first IP hard disk determines a plurality of first hash values corresponding to the to-be-detected partition from the stored hash values according to the identifier in the detection instruction. Then return multiple first hash values to the server. Further, in S102, the server receives the plurality of first hash values sent by the first IP hard disk.
  • S103 is executed, that is, the server determines, according to the plurality of second hash values corresponding to the identifiers sent by the other IP hard disks in the plurality of IP hard disks, whether each second hash value has an equal first hash value. .
  • the IP hard disk determines whether the plurality of first hash values or the plurality of second hash values are obtained by the IP hard disk by hashing the stored keys. Also, since each key stored on the IP hard disk is different, the hash value obtained after the hash operation is different. When the key in the IP hard disk is not damaged, the corresponding hash value is obtained; when the IP hard disk has bad sectors and the key is in the bad track, the keys in the bad track will not be read, and thus It is impossible to hash the damaged key to get a hash value.
  • the plurality of keys of the to-be-detected partition stored in the plurality of IP hard disks are the same, so when the target hash value of the plurality of second hash values is not included in the plurality of first hash values, indicating the target The key corresponding to the hash value is normal in other IP hard disks, and the first IP hard disk is damaged.
  • partition 1 corresponding to three IP hard disks, namely IP hard disk A, IP hard disk B, and IP hard disk C.
  • Partition 1 includes 10 keys, namely Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, and Key10.
  • the server hardens to IP Any one of the disk A, the IP hard disk B, and the IP hard disk C transmits a detection command, which is assumed to be the IP hard disk A.
  • the detection instruction includes the identity of the partition 1.
  • the IP hard disk A After receiving the detection command, the IP hard disk A returns a plurality of first hash values corresponding to the plurality of keys in the partition 1 to the server according to the identifier of the partition 1.
  • the first hash value returned by IP hard disk A is:
  • the multiple second hash values sent by IP hard disk C are:
  • the hash_treeA_Key1(10) represents the first hash value of the corresponding Key1 returned by the IP hard disk A, and the hash value of Key1 is specifically 10. Other hash values mean similar meanings, and are not repeated here.
  • each of the second hash values has an equal first hash value.
  • the target hash value is determined as hash_treeB_Key1 (10) and hash_treeC_Key1 (10)
  • hash_treeA_Key1(10) is equal to hash_treeB_Key1(10) and hash_treeC_Key1(10), so Key1 is not corrupted in the first IP hard disk.
  • the target hash values are hash_treeB_Key2(6) and hash_treeC_Key2(6) among the plurality of first hash values
  • there is no equal first hash value so it is determined that the Key2 stored in the first IP hard disk is damaged.
  • the first hash values of Key3, Key4, Key5, Key6, Key7, Key8, Key9, and Key10 that are equal in the corresponding plurality of second hash values are included in the plurality of first hash values. Therefore, the above 9 keys are also not damaged.
  • the method further includes:
  • the server sends the target hash value to the other IP hard disk.
  • the server may send the target hash value only to one IP hard disk of the other IP hard disk, or may send the target hash value to the IP hard disk of the other IP hard disk whose target hash value is not damaged. There is no restriction on this application.
  • one or more of the other IP hard disks After receiving the target hash value, one or more of the other IP hard disks determine the key corresponding to the target hash value according to the corresponding relationship stored in the IP hard disk, obtain a copy of the key, and then send it to the server. The server then sends the key to the first IP hard disk to allow the IP hard disk to repair the damaged key.
  • the server After determining that the Key 2 in the IP hard disk A is damaged, the server obtains a copy of the Key 2 from the IP hard disk B and then transmits it to the IP hard disk A. IP hard disk A stores Key2, thus repairing Key2.
  • the second aspect of the present application provides a method for generating a hash value, as shown in FIG. 2, including:
  • S201 Perform a hash operation on each of the plurality of keys to obtain a hash value corresponding to each of the keys.
  • S203 Send, to the server, multiple hash values corresponding to the identifier.
  • the IP hard disk stores a plurality of keys included in the partition to be detected. In addition, keys corresponding to other partitions are also stored.
  • the IP hard disk performs a hash operation on each of the plurality of keys to obtain a hash value corresponding to each key.
  • the process of hashing each key is similar to the principle and algorithm of the hash operation in the prior art, so it will not be described here.
  • the hash value is one-to-one corresponding to the keys stored in the IP hard disk.
  • the corresponding hash value is obtained; when the IP hard disk has a bad track and the key is in the bad track, the keys in the bad track will not be read, and thus It is impossible to hash the damaged key to get a hash value.
  • the IP hard disk may perform hash operations on other keys stored, thereby obtaining hash values corresponding to other keys, which is not specifically limited in this application.
  • the IP hard disk receives a detection command sent from the server.
  • the detection instruction includes an identifier of the to-be-detected partition. According to the identifier in the detection instruction, the IP hard disk can determine the partition to which the instruction to be detected is directed, and the plurality of keys of the to-be-detected partition stored in the IP hard disk.
  • the IP hard disk sends a plurality of hash values corresponding to the identifier to the server.
  • the method further includes:
  • the IP hard disk further obtains each key and hash value after obtaining the hash value corresponding to each key. The correspondence is saved.
  • the IP hard disk may receive the first hash value sent by the server.
  • the IP hard disk determines the first key corresponding to the first hash value according to the correspondence.
  • the first hash value is one of a plurality of hash values stored in the IP hard disk.
  • the IP hard disk searches for the saved correspondence. Finding a correspondence of the first hash value in the correspondence relationship, thereby determining a first key corresponding to the first hash value.
  • the IP hard disk obtains the first key and sends a first key to the server for the first key to be repaired by one or more other IP hard disks.
  • the method further includes:
  • the second key can also be obtained from the other IP hard disks whose second key is not damaged and sent to the IP hard disk in the embodiment of the present invention. .
  • the second key is not included in the plurality of keys, and the second key is damaged in the IP hard disk. Since the IP hard disk cannot perform hashing on the second key when performing the hash operation, the second hash value corresponding to the second key is not included in the saved hash value.
  • the IP hard disk After receiving the second key sent by the server, the IP hard disk stores the second key to repair the damaged second key. Further, in order to facilitate subsequent operations, the IP hard disk can still perform a hash operation on the second key to obtain a hash value corresponding to the second key.
  • a third aspect of the present application provides a server, as shown in FIG. 3, including:
  • the communication interface 101 is configured to send a detection instruction to the first IP hard disk of the plurality of IP hard disks, where the detection instruction includes an identifier of the to-be-detected partition, the to-be-detected partition includes a plurality of keys, and the first IP hard disk sends a plurality of first hash values corresponding to the identifiers;
  • the processor 102 is configured to determine, according to the multiple second hash values corresponding to the identifier sent by the other IP hard disks of the plurality of IP hard disks, whether each second hash value has an equal first hash. a value of the target hash value stored in the first IP hard disk when the target hash value of the plurality of second hash values is not included in the plurality of first hash values The corresponding key is damaged.
  • the communication interface 101 is further configured to:
  • IP hard disks are IP hard disks corresponding to the partition to be detected.
  • bus 100 can include any number of interconnected buses and bridges, and bus 100 will include one or more processors and memory 103 represented by processor 102. The various circuits of the memory are linked together.
  • the bus 100 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art and, therefore, will not be further described herein.
  • Bus interface 104 provides an interface between bus 100 and communication interface 101.
  • Communication interface 101 may include a receive interface and a transmit interface, as well as a transceiver interface, providing means for communicating with various other devices on a transmission medium.
  • the processor 102 is responsible for managing the bus 100 and the usual processing, and the memory 103 can be used to store data used by the processor 102 when performing operations.
  • the fourth aspect of the present application provides an IP hard disk, as shown in FIG. 4, including:
  • a storage unit 201 configured to store a plurality of keys
  • the processor 202 is configured to perform a hash operation on each of the plurality of keys to obtain a hash value corresponding to each of the keys;
  • the interface 203 is configured to receive a detection instruction sent by the server, where the detection instruction includes an identifier of a to-be-detected partition, where the to-be-detected partition includes the multiple keys, and send, to the server, multiple Greek value.
  • the storage unit 201 is further configured to save a correspondence between each of the keys and a hash value
  • the interface 203 is further configured to receive a first hash value sent by the server, where the first hash value is one of the saved hash values;
  • the processor 202 is further configured to: determine, according to the correspondence relationship and the first hash value, a first key corresponding to the first hash value; and acquire the first key;
  • the interface 203 is further configured to send the first key to the server.
  • the interface 203 is further configured to receive a second key sent by the server.
  • the storage unit 201 is further configured to store the second key, and the second key is not included in the plurality of keys.
  • the storage unit 201 includes a memory and a disk in an IP hard disk.
  • the plurality of keys in the embodiment of the present invention may be stored in a memory or a magnetic disk.
  • the person skilled in the art can make settings according to actual needs, and the present application does not specifically limit the present application.
  • bus 200 can include any number of interconnected buses and bridges, bus 200 will include one or more processors represented by processor 202, interface 203 One or more interfaces, storage unit 201 are linked together.
  • the bus 200 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is known in the art, and therefore, will not be further described herein.
  • the interface 203 is specifically an Ethernet interface, and the IP hard disk is used to exchange data between the IP hard disk and the server, other external devices, networks, or applications.
  • the processor 202 is responsible for managing the bus 200 and the usual processing, and the storage unit 201 is also used to store data used by the processor 202 when performing operations.
  • the server sends a detection instruction to the first IP hard disk of the plurality of IP hard disks, the detection instruction includes an identifier of a to-be-detected partition, the to-be-detected partition includes a plurality of keys, and the server receives the first IP a plurality of first hash values corresponding to the identifiers sent by the hard disk; the server determining, according to the plurality of second hash values corresponding to the identifiers sent by the other IP hard disks of the plurality of IP hard disks Each second hash value has an equal first hash value; when the target hash value of the plurality of second hash values is not included in the plurality of first hash values, the server Determining that a key corresponding to the target hash value stored in the first IP hard disk is damaged.
  • the target hash value when the target hash value is not included in the first hash value, it may be determined that the key corresponding to the first hash value stored in the first IP hard disk has been damaged. Also, the hash value is smaller than the key itself, so the transfer efficiency is faster than the transfer key itself. Therefore, the detection efficiency of the damaged key in the IP hard disk is improved.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

一种检测键的方法和服务器,用于检测IP硬盘中被损坏的键,提高检测效率。所述方法应用于包括服务器和多个IP硬盘的存储系统,所述方法包括:所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令(S101),所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值(S102);所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值(S103);当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏(S104)。

Description

一种检测键的方法和服务器
本申请要求于2014年11月26日提交中国专利局、申请号为201410696743.7、发明名称为“一种检测键的方法和服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及电子技术领域,尤其涉及一种检测键的方法和服务器。
背景技术
网络之间互连的协议(英文:Internet Protocol;简称:IP)硬盘为通过IP协议提供物理通信的硬盘。它摈弃了传统的串行连接(英文:Serial Attached SCSI;简称:SAS)/串行高级技术附件(英文:Serial Advanced Technology Attachment;简称:SATA)接口,使得主机和硬盘之间的连接更加简单,几乎没有距离的限制。
IP硬盘是以Key-Value,即键值对的结构进行数据存储的。其中Key为键,通常是一个字符串,而Value为键对应的值,也称为数据或数据内容,Key-Value数据简称KV数据。通常Value存储地址的偏移量以及键Key一起存放在索引区中,而Key对应的值Value则存放在数据区。在需要数据时,分布式系统的服务器使用Key进行访问,遍历索引区,根据Key索引到偏移量,从而访问到Key对应的Value。通常,为了提高数据可靠性,分布式系统中的一个Key会存储在多个IP硬盘中,即存储多个副本。换言之,一个分区的Key保存在多个IP硬盘上,而一个IP硬盘上可能保存有多个分区的Key。如果某个Key由于IP硬盘的坏道而损坏,那么分布式系统可能无法访问到这个IP硬盘中存储的对应 Value。
现有的做法是,分布式系统中的服务器获取一个分区对应的多个IP硬盘上存储的这个分区全部的Key的副本,其中,分区由分布式系统中的逻辑单元从逻辑上划分。但是一个Key的副本数据大小通常为兆级,有时甚至达到十兆级,所以传输多个Key副本会占用很多网络资源,且传输速度很慢。收到每个IP硬盘传输的副本后,服务器进行对比。如果同一个Key对应多个副本中有一个副本与其它副本不一样,则认为Key在这个不同副本的IP硬盘中被损坏。通过这样的方式来检测损坏的Key,传输速度慢,且检测效率低。
发明内容
本发明提供了一种检测键的方法和服务器,用于检测IP硬盘中被损坏的键,提高检测效率。
本申请第一方面提供了一种检测键的方法,所述方法应用于存储系统中,所述存储系统包括服务器和多个IP硬盘,包括:
所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;
所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;
所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;
当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损 坏。
结合第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:
所述服务器向所述其他IP硬盘发送所述目标哈希值;
接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述多个IP硬盘是所述待检测分区对应的IP硬盘。
本申请第二方面提供了一种生成哈希值的方法,应用于IP硬盘,所述IP硬盘包括多个键,所述方法包括:
对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值;
接收服务器发送的检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括所述多个键;
向所述服务器发送与所述标识对应的多个哈希值。
结合第二方面,在第二方面的第一种可能的实现方式中,所述方法还包括:
保存所述每个键与哈希值之间的对应关系;
接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;
获取所述第一键,并向所述服务器发送所述第一键。
结合第二方面的第一种可能的实现方式,在第二方面第二种可能的实现方式中,所述方法还包括:接收所述服务器发送的第二键,并存储所述第二键, 所述多个键中不包含所述第二键。
本申请第三方面提供了一种服务器,包括:
通信接口,用于向多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;并所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;
处理器,用于根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
结合第三方面,在第三方面的第一种可能的实现方式中,所述通信接口还用于:
向所述其他IP硬盘发送所述目标哈希值;
接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述多个IP硬盘是所述待检测分区对应的IP硬盘。
本申请第四方面提供了一种IP硬盘,包括:
存储单元,用于存储多个键;
处理器,用于对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值;
接口,用于接收服务器发送的检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括所述多个键;并向所述服务器发送与所述标识对应 的多个哈希值。
结合第四方面,在第四方面的第一种可能的实现方式中,所述存储单元还用于保存所述每个键与哈希值之间的对应关系;
所述接口还用于接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
所述处理器还用于根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;以及获取所述第一键;
所述接口还用于向所述服务器发送所述第一键。
结合第四方面的第一种可能的实现方式,在第四方面第二种可能的实现方式中,所述接口还用于接收所述服务器发送的第二键;
所述存储单元还用于存储所述第二键,所述多个键中不包含所述第二键。
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:
所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。所以,在本发明实施例中,当目标哈希值未包含在第一哈希值中时,就可以确定第一IP硬盘中存储的第一哈希值对应的键已被损坏。并且,哈希值与键本身相比,数据量要小,因此传输效率比 传输键本身更快。所以,提高了IP硬盘中损坏键的检测效率。
附图说明
图1为本发明实施例中检测键的方法流程图;
图2为本发明实施例中生成哈希值的方法流程图;
图3为本发明实施例中服务器的结构示意图;
图4为本发明实施例中IP硬盘的结构示意图。
具体实施方式
本发明提供了一种检测键的方法和服务器,用于检测IP硬盘中被损坏的键,提高检测效率。
本发明实施例中的技术方案为解决上述的技术问题,本发明中的检测键的方法包括如下内容:
所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。所以,在本发明实施例中,当目标哈希值未包含在第一哈希值中时,就可以确定第一IP硬盘中存储的第一哈希值对应的键已被损坏。并且,哈希值与键本身相比,数据量要小,因此传输效率比 传输键本身更快。所以,提高了IP硬盘中损坏键的检测效率。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图对本发明的实施方式进行详细说明。
本申请第一方面提供一种检测键的方法,请参考图1,包括:
S101:所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令。
S102:所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值。
S103:所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值。
S104:当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
为了清楚说明本发明实施例的技术方案,首先对存储系统进行一介绍。存 储系统包括服务器和多个IP硬盘,多个IP硬盘与服务器连接。IP硬盘提供存储功能,存储有键Key,以及键对应的数据Value。服务器对多个IP硬盘进行管理,例如将用户输入存储系统的键和数据写入其中一个或多个IP硬盘中,或根据用户需求对IP硬盘中的键和数据进行删除、修改和更新等。用户以及上层应用对IP硬盘的控制管理,通过服务器实现。
在本申请所属的技术领域中,Key,称为键,也称为主键;Value为键对应的值,同时也可称为数据、数据内容。在下述描述中,键或Key指代相同,值,数据和数据内容均指Value。
具体来讲,在存储系统中,一个分区包括多个键,每一个键会保存在多个IP硬盘中,如3个,即在第1个IP硬盘中存储一份完整的键,在2个IP硬盘中存储一份完整的键,在第3个IP硬盘中也存储一份完整的键。并且同一个分区中的每一个键所存储的多个IP硬盘是相同的多个IP硬盘。而一个IP硬盘上可以存储一个或多个分区的键。
存储系统中维护有一记录表。记录表中记录有一个分区所对应的多个IP硬盘。举例来说,记录表中可以通过记录IP硬盘的IP地址、索引、端口编号等来记录所对应的多个IP硬盘。本申请所属领域的技术人员可以根据实际需要进行选择,本申请不做具体限制。
因此,在S101之前,要检测待检测分区在第一IP硬盘存储的键是否被损坏,查询记录表就可以确定与待检测分区对应的多个IP硬盘具体为哪几个。而第一IP硬盘为多个IP硬盘中的一个。
在S101中向第一IP硬盘发送检测指令。由于每个IP硬盘上可能存储有多个分区的键和数据,所以,在本发明实施例中,检测指令中包括待检测分区的 标识。根据标识,第一IP硬盘可以确定出待检测分区所包括的多个键。
接下来,第一IP硬盘根据检测指令中的标识,从存储的哈希值中确定出待检测分区对应的多个第一哈希值。然后将多个第一哈希值返回服务器。进而在S102中,服务器接收到第一IP硬盘发送的多个第一哈希值。
接下来,执行S103,即服务器根据多个IP硬盘中的其他IP硬盘发送的与标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值。
然后,执行S104:当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
具体来讲,无论是多个第一哈希值或多个第二哈希值,都是IP硬盘通过对存储的键进行哈希运算后获得的。并且,由于IP硬盘上存储的每一个键是不同的,因此,进行哈希运算后获得的哈希值也就不同。当IP硬盘中的键未损坏时,就会获得对应的哈希值;而当IP硬盘存在坏道,而键恰好在这个坏道中时,那么这些处于坏道中的键将无法读取,进而也就无法对损坏的键进行哈希运算而获得哈希值了。
而多个IP硬盘中存储的待检测分区的多个键是相同的,所以,当多个第二哈希值中的目标哈希值没有包含在多个第一哈希值中时,表明目标哈希值对应的键在其他IP硬盘中正常,而第一IP硬盘中被损坏。
举例来说,假设待检测分区为分区1,对应3个IP硬盘,分别为IP硬盘A、IP硬盘B和IP硬盘C。分区1中包括10个键,分别为Key1,Key2,Key3,Key4,Key5,Key6,Key7,Key8,Key9,Key10。在S101中,服务器向IP硬 盘A、IP硬盘B和IP硬盘C中的任意一个发送检测指令,假设是IP硬盘A。检测指令包括分区1的标识。IP硬盘A接收到检测指令后,根据分区1的标识,将分区1中多个键对应的多个第一哈希值返回服务器。为了方便说明,假设IP硬盘A返回的多个第一哈希值为:
hash_treeA_Key1(10),hash_treeA_Key3(53),hash_treeA_Key4(24),hash_treeA_Key5(1),hash_treeA_Key6(36),hash_treeA_Key7(12),hash_treeA_Key8(2),hash_treeA_Key9(52),hash_treeA_Key10(3)。
同时,假设IP硬盘B发送的多个第二哈希值分别为:
hash_treeB_Key1(10),hash_treeB_Key2(6),hash_treeB_Key3(53),hash_treeB_Key4(24),hash_treeB_Key5(1),hash_treeB_Key6(36),hash_treeB_Key7(12),hash_treeB_Key8(2),hash_treeB_Key9(52),hash_treeB_Key10(3)。
IP硬盘C发送的多个第二哈希值分别为:
hash_treeC_Key1(10),hash_treeC_Key2(6),hash_treeC_Key3(53),hash_treeC_Key4(24),hash_treeC_Key5(1),hash_treeC_Key7(12),hash_treeC_Key8(2),hash_treeC_Key9(52),hash_treeC_Key10(3)。
其中,hash_treeA_Key1(10)表示IP硬盘A返回的对应Key1的第一哈希值,Key1的哈希值具体为10。其他哈希值表示意义类似,这里就不再一一赘述了。
接下来,判断每个第二哈希值是否均存在相等的第一哈希值。首先,IP硬盘B和IP硬盘C发送的多个第二哈希值中,将目标哈希值确定为hash_treeB_Key1(10)和hash_treeC_Key1(10),在多个第一哈希值中, hash_treeA_Key1(10)与hash_treeB_Key1(10)和hash_treeC_Key1(10)相等,所以,Key1在第一IP硬盘中未被损坏。而多个第一哈希值中,目标哈希值为hash_treeB_Key2(6)和hash_treeC_Key2(6)时,却不存在相等的第一哈希值,所以确定第一IP硬盘中存储的Key2被损坏。同时,可以看出,Key3、Key4、Key5、Key6、Key7、Key8、Key9和Key10在对应的多个第二哈希值相等的第一哈希值都包含在多个第一哈希值中,所以上述9个键也未被损坏。
同样的方法,当IP硬盘C作为第一IP硬盘,即判断IP硬盘C中是否有键损坏时,也可以确定出Key6被损坏。具体过程这里就不再一一赘述了。
由上述描述可以看出,在本发明实施例中,通过多个第二哈希值与多个第一哈希值是否相等就可以判断第一IP硬盘中的键是否被损坏,不再需要通过网络传输所有键的内容,仅传输数据大小为Kbyte级的哈希值即可。因此与现有技术相比,提高了检测效率。
进一步,在S104之后,为了修复第一IP硬盘中损坏的键,还包括:
所述服务器向所述其他IP硬盘发送所述目标哈希值;
接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
具体来讲,当检测出目标哈希值对应的键被损坏后,为了方便用户访问第一IP硬盘中损坏键对应的数据,在本发明实施例中,将会修复损坏的键。首先,为了修复被损坏的键,服务器将目标哈希值发送至其他IP硬盘。在具体实现过程中,服务器可以仅向其他IP硬盘中的一个IP硬盘发送目标哈希值,也可以向所有其他IP硬盘中,目标哈希值对应的键未损坏的IP硬盘发送目标哈希值,对此本申请不做限制。
其他IP硬盘中的一个或多个接收到目标哈希值后,根据存储在IP硬盘中的对应关系,确定目标哈希值对应的键,获取键的副本,然后发送到服务器。服务器再将键发送到第一IP硬盘中,以使IP硬盘修复损坏的键。
沿用上述例子来说明。在确定IP硬盘A中的Key2被损坏后,服务器从IP硬盘B中获取Key2的副本,然后发送到IP硬盘A中。IP硬盘A存储Key2,从而修复Key2。
本申请第二方面提供了一种生成哈希值的方法,如图2所示,包括:
S201:对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值。
S202:接收服务器发送的检测指令。
S203:向所述服务器发送与所述标识对应的多个哈希值。
首先,在本发明实施例中,IP硬盘上存储有待检测分区包括的多个键。另外,还存储有其他分区对应的键。在S201中,IP硬盘对多个键中的每个键进行哈希运算,获得每个键所对应的哈希值。其中,对每个键进行哈希运算的过程,与现有技术中哈希运算的原理和算法类似,因此这里就不再赘述了。
由于多个键各不相同,所以,获得的哈希值也就各不相同了。因此,哈希值和表征IP硬盘中存储的键是一一对应的。当IP硬盘中的键未损坏时,就会获得对应的哈希值;当IP硬盘存在坏道,而有键恰好在这个坏道中时,那么这些处于坏道中的键将无法读取,进而也就无法对损坏的键进行哈希运算而获得哈希值了。
当然,除了对待检测分区包括的多个键进行哈希运算,IP硬盘还可以对存储的其他键进行哈希运算,进而获得其他键对应的哈希值,对此本申请不做具体限制。
在S202中,IP硬盘接收服务器发送而来的检测指令。检测指令中包括了待检测分区的标识,根据检测指令中的标识,IP硬盘能够确定待检测指令所针对的分区,以及存储在IP硬盘中的待检测分区的多个键。
接下来,IP硬盘向服务器发送与标识对应的多个哈希值。
可选的,在本发明实施例中,还包括:
保存所述每个键与哈希值之间的对应关系;
接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;
获取所述第一键,并向所述服务器发送所述第一键。
具体来讲,为了方便IP硬盘确定每个键在多个哈希值中对应的哈希值,IP硬盘在获得每个键对应的哈希值后,会进一步将每个键与哈希值的对应关系保存。
当服务器发现其他一个或多个IP硬盘中的第一键损坏,而本发明实施例中的IP硬盘的第一键未损坏时,IP硬盘可能接收到服务器发送的第一哈希值。IP硬盘根据对应关系确定出第一哈希值所对应的第一键。具体来讲,第一哈希值为IP硬盘中保存的多个哈希值中的一个。IP硬盘接收到第一哈希值后,在保存的对应关系进行查找。在对应关系中查找到第一哈希值的对应关系,从而确定第一哈希值所对应的第一键。
接着,IP硬盘获得第一键,并向服务器发送第一键,以供一个或多个其他IP硬盘修复第一键。
可选的,在本发明实施例中,还包括:
接收所述服务器发送的第二键,并存储所述第二键,所述多个键中不包含所述第二键。
另外,当服务器发现本发明实施例中的IP硬盘中的第二键损坏时,也可以从第二键未被损坏的其他IP硬盘中获取第二键并发送至本发明实施例中的IP硬盘。具体来讲,第二键并不包括在多个键中,第二键在IP硬盘中被损坏。由于IP硬盘在进行哈希运算时,无法对第二键进行哈希运算,因此,第二键对应的第二哈希值也就不包括在保存的哈希值中。
IP硬盘接收到服务器发送的第二键后,将第二键存储,从而修复损坏的第二键。进一步,为了方便后续操作,IP硬盘仍然可以对第二键进行哈希运算,获得第二键对应的哈希值。
本申请第三方面提供了一种服务器,如图3所示,包括:
通信接口101,用于向多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;并所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;
处理器102,用于根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
可选的,通信接口101还用于:
向所述其他IP硬盘发送所述目标哈希值;
接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
在本发明实施例中,多个IP硬盘是待检测分区对应的IP硬盘。
其中,在图3中,总线架构(用总线100来代表),总线100可以包括任意数量的互联的总线和桥,总线100将包括由处理器102代表的一个或多个处理器和存储器103代表的存储器的各种电路链接在一起。总线100还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口104在总线100和通信接口101之间提供接口。通信接口101可以包括接收接口和发送接口,也可以是收发接口,提供用于在传输介质上与各种其他装置通信的单元。
处理器102负责管理总线100和通常的处理,而存储器103可以被用于存储处理器102在执行操作时所使用的数据。
前述实施例中描述的检测键执行过程的各种变化方式和具体实例同样适用于本实施例的服务器,通过前述对检测键执行过程的详细描述,本领域技术人员可以清楚的知道本实施例中服务器的实施方法,所以为了说明书的简洁,在此不再详述。
本申请第四方面提供了一种IP硬盘,如图4所示,包括:
存储单元201,用于存储多个键;
处理器202,用于对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值;
接口203,用于接收服务器发送的检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括所述多个键;并向所述服务器发送与所述标识对应的多个哈希值。
可选的,存储单元201还用于保存所述每个键与哈希值之间的对应关系;
接口203还用于接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
处理器202还用于根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;以及获取所述第一键;
接口203还用于向所述服务器发送所述第一键。
可选的,接口203还用于接收所述服务器发送的第二键;
存储单元201还用于存储所述第二键,所述多个键中不包含所述第二键。
在具体实现过程中,存储单元201包括IP硬盘中的内存和磁盘。本发明实施例中的多个键,存储在内存或磁盘均可。本申请所属技术人员可以根据实际需要来进行设置,本申请不作具体的限制。
其中,在图4中,总线架构(用总线200来代表),总线200可以包括任意数量的互联的总线和桥,总线200将包括由处理器202代表的一个或多个处理器、接口203代表的一个或多个接口、存储单元201链接在一起。总线200还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。
在具体实现过程中,接口203具体为以太网接口,通过以太网协议实现IP硬盘与服务器、其他外部设备、网络或应用交互数据。
处理器202负责管理总线200和通常的处理,而存储单元201还被用于存储处理器202在执行操作时所使用的数据。
前述实施例中描述的生成哈希值过程的各种变化方式和具体实例同样适用于本实施例的IP硬盘,通过前述对生成哈希值执行过程的详细描述,本领域技 术人员可以清楚的知道本实施例中IP硬盘的实施方法,所以为了说明书的简洁,在此不再详述。
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:
所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。所以,在本发明实施例中,当目标哈希值未包含在第一哈希值中时,就可以确定第一IP硬盘中存储的第一哈希值对应的键已被损坏。并且,哈希值与键本身相比,数据量要小,因此传输效率比传输键本身更快。所以,提高了IP硬盘中损坏键的检测效率。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或 方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (12)

  1. 一种检测键的方法,其特征在于,所述方法应用于存储系统中,所述存储系统包括服务器和多个IP硬盘,包括:
    所述服务器向所述多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;
    所述服务器接收所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;
    所述服务器根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;
    当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,所述服务器确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    所述服务器向所述其他IP硬盘发送所述目标哈希值;
    接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
    将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
  3. 如权利要求1或2所述的方法,其特征在于,所述多个IP硬盘是所述待检测分区对应的IP硬盘。
  4. 一种生成哈希值的方法,其特征在于,应用于IP硬盘,所述IP硬盘包括多个键,所述方法包括:
    对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值;
    接收服务器发送的检测指令,所述检测指令包括待检测分区的标识,所述 待检测分区包括所述多个键;
    向所述服务器发送与所述标识对应的多个哈希值。
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    保存所述每个键与哈希值之间的对应关系;
    接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
    根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;
    获取所述第一键,并向所述服务器发送所述第一键。
  6. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    接收所述服务器发送的第二键,并存储所述第二键,所述多个键中不包含所述第二键。
  7. 一种服务器,其特征在于,包括:
    通信接口,用于向多个IP硬盘中的第一IP硬盘发送检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括多个键;并所述第一IP硬盘发送的与所述标识对应的多个第一哈希值;
    处理器,用于根据所述多个IP硬盘中的其他IP硬盘发送的与所述标识对应的多个第二哈希值,判断是否每个第二哈希值均存在相等的第一哈希值;当所述多个第二哈希值中的目标哈希值没有包含在所述多个第一哈希值时,确定所述第一IP硬盘中存储的与所述目标哈希值对应的键被损坏。
  8. 如权利要求7所述的服务器,其特征在于,所述通信接口还用于:
    向所述其他IP硬盘发送所述目标哈希值;
    接收所述其他IP硬盘发送的所述目标哈希值对应的所述键;
    将所述键发送至所述第一IP硬盘,以使所述第一IP硬盘修复所述键。
  9. 如权利要求7或8所述的服务器,其特征在于,所述多个IP硬盘是所述待检测分区对应的IP硬盘。
  10. 一种IP硬盘,其特征在于,包括:
    存储单元,用于存储多个键;
    处理器,用于对多个键中的每个键进行哈希运算,获得所述每个键对应的哈希值;
    接口,用于接收服务器发送的检测指令,所述检测指令包括待检测分区的标识,所述待检测分区包括所述多个键;并向所述服务器发送与所述标识对应的多个哈希值。
  11. 如权利要求10所述的IP硬盘,其特征在于,所述存储单元还用于保存所述每个键与哈希值之间的对应关系;
    所述接口还用于接收所述服务器发送的第一哈希值,所述第一哈希值是所述保存的哈希值中的其中一个;
    所述处理器还用于根据所述对应关系和所述第一哈希值,确定与所述第一哈希值所对应的第一键;以及获取所述第一键;
    所述接口还用于向所述服务器发送所述第一键。
  12. 如权利要求11所述的IP硬盘,其特征在于,所述接口还用于接收所述服务器发送的第二键;
    所述存储单元还用于存储所述第二键,所述多个键中不包含所述第二键。
PCT/CN2015/083887 2014-11-26 2015-07-13 一种检测键的方法和服务器 WO2016082560A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410696743.7 2014-11-26
CN201410696743.7A CN104461817B (zh) 2014-11-26 2014-11-26 一种检测键的方法和服务器

Publications (1)

Publication Number Publication Date
WO2016082560A1 true WO2016082560A1 (zh) 2016-06-02

Family

ID=52907912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083887 WO2016082560A1 (zh) 2014-11-26 2015-07-13 一种检测键的方法和服务器

Country Status (2)

Country Link
CN (1) CN104461817B (zh)
WO (1) WO2016082560A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461817B (zh) * 2014-11-26 2017-08-11 华为技术有限公司 一种检测键的方法和服务器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973810A (zh) * 2014-05-22 2014-08-06 华为技术有限公司 基于互联网协议ip盘的数据处理方法和装置
CN103995745A (zh) * 2014-05-22 2014-08-20 华为技术有限公司 一种ip硬盘任务执行方法以及ip硬盘
CN104077239A (zh) * 2014-06-24 2014-10-01 华为技术有限公司 Ip硬盘与存储系统,及其数据操作方法
CN104123102A (zh) * 2014-07-25 2014-10-29 华为技术有限公司 一种ip硬盘及其数据处理方法
CN104461817A (zh) * 2014-11-26 2015-03-25 华为技术有限公司 一种检测键的方法和服务器

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402394B (zh) * 2010-09-13 2014-10-22 腾讯科技(深圳)有限公司 一种基于哈希算法的数据存储方法及装置
CN102591970B (zh) * 2011-12-31 2014-07-30 北京奇虎科技有限公司 一种分布式键-值查询方法和查询引擎系统
CN104050250B (zh) * 2011-12-31 2018-06-05 北京奇虎科技有限公司 一种分布式键-值查询方法和查询引擎系统
CN102780763B (zh) * 2012-06-29 2015-03-04 华中科技大学 一种分布式hss数据存储方法和分布式hss数据提取方法
CN102821138B (zh) * 2012-07-09 2015-06-24 广州鼎鼎信息科技有限公司 一种适用于云存储系统的元数据分布式存储方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973810A (zh) * 2014-05-22 2014-08-06 华为技术有限公司 基于互联网协议ip盘的数据处理方法和装置
CN103995745A (zh) * 2014-05-22 2014-08-20 华为技术有限公司 一种ip硬盘任务执行方法以及ip硬盘
CN104077239A (zh) * 2014-06-24 2014-10-01 华为技术有限公司 Ip硬盘与存储系统,及其数据操作方法
CN104123102A (zh) * 2014-07-25 2014-10-29 华为技术有限公司 一种ip硬盘及其数据处理方法
CN104461817A (zh) * 2014-11-26 2015-03-25 华为技术有限公司 一种检测键的方法和服务器

Also Published As

Publication number Publication date
CN104461817B (zh) 2017-08-11
CN104461817A (zh) 2015-03-25

Similar Documents

Publication Publication Date Title
US9792306B1 (en) Data transfer between dissimilar deduplication systems
US10534547B2 (en) Consistent transition from asynchronous to synchronous replication in hash-based storage systems
US9727273B1 (en) Scalable clusterwide de-duplication
US20180349396A1 (en) Managing I/O Operations in a Storage Network
US9251201B2 (en) Compatibly extending offload token size
US8370593B2 (en) Method and apparatus to manage groups for deduplication
US10880387B2 (en) Selective token clash checking for a data write
US20150242159A1 (en) Copy-on-write by origin host in virtual machine live migration
US8898269B2 (en) Reconciling network management data
US20130325804A1 (en) Replica identification and collision avoidance in file system replication
US8438130B2 (en) Method and system for replicating data
US8479041B2 (en) Disaster recovery failback
US9946740B2 (en) Handling server and client operations uninterruptedly during pack and audit processes
WO2016026433A1 (zh) 一种数据处理方法和数据处理装置
WO2016066108A1 (zh) 路由访问方法、路由访问系统及用户终端
WO2018233630A1 (zh) 故障发现
WO2017084348A1 (zh) Ip硬盘的管理方法和装置
US20170269957A1 (en) Information processing apparatus, information processing system, non-transitory computer-readable recording medium having stored therein program, and method for processing information
US20200341674A1 (en) Method, device and computer program product for restoring data
US9513996B2 (en) Information processing apparatus, computer-readable recording medium having stored program for controlling information processing apparatus, and method for controlling information processing apparatus
WO2023179077A1 (zh) 一种数据一致性检测和修复的方法、装置及介质
US10678754B1 (en) Per-tenant deduplication for shared storage
WO2019200751A1 (zh) 主备切换方法、装置、计算机设备和存储介质
US11514002B2 (en) Indexing splitter for any pit replication
WO2016082560A1 (zh) 一种检测键的方法和服务器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15862808

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15862808

Country of ref document: EP

Kind code of ref document: A1