WO2021120585A1 - 数据存储方法、装置、设备及存储介质 - Google Patents

数据存储方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021120585A1
WO2021120585A1 PCT/CN2020/099380 CN2020099380W WO2021120585A1 WO 2021120585 A1 WO2021120585 A1 WO 2021120585A1 CN 2020099380 W CN2020099380 W CN 2020099380W WO 2021120585 A1 WO2021120585 A1 WO 2021120585A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage node
target
data
network connection
processing result
Prior art date
Application number
PCT/CN2020/099380
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 WO2021120585A1 publication Critical patent/WO2021120585A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Definitions

  • This application relates to the field of distributed storage technology, and in particular to a data storage method, device, device, and storage medium.
  • Erasure Code (EC) technology mainly encodes original data to obtain redundancy through an erasure code algorithm, and stores the data and redundancy together to achieve the purpose of fault tolerance.
  • the erasure code-based method has the advantages of low redundancy and high disk utilization, and has become a major mainstream of distributed storage systems.
  • Global Erasure (GlobalEC) technology is an extended application of erasure coding technology.
  • Figure 1 shows the process of Global EC.
  • GlobalEC divides the data uploaded by a user into 2 data blocks, and uses the erasure code algorithm to calculate and generate 1 check block based on these 2 data blocks; at the same time, the 2 data blocks and 1
  • Each check block is stored in the object storage clusters of three different data centers (labeled AZ, AZ1, AZ2, AZ3 as shown in Figure 1). In this way, when a single AZ fails, data blocks can also be taken out from the remaining two AZs to generate the user's source data and return it to the user. Users upload and download data through the service call portal in the figure.
  • Circumstances for example, the network cable was cut by the construction team.
  • the data cannot be written to 3 AZs at the same time; and, due to network abnormality, the request to write to the abnormal AZ will time out, but it will take a while to be discovered.
  • the reliability of uploading the Global EC object storage service will be significantly reduced, and it will take a long time for the abnormality to be discovered, which greatly reduces the user experience.
  • the purpose of this application is to provide a data storage method and device, a data storage device, an electronic device, and a computer-readable storage medium.
  • the first aspect of this application provides a data storage method, including:
  • a second aspect of the present application provides a data storage device, including:
  • the network detection module is used to obtain network connection status information between the storage node and each target storage node;
  • the obtaining module is used to obtain the target data to be stored
  • a processing module configured to perform block processing on the target data in an erasure code manner to obtain a processing result corresponding to the target data, the processing result including at least two data blocks and at least one check block;
  • the storage module is configured to determine a storage strategy for the processing result according to the network connection status information, and store the processing result according to the storage strategy, the storage strategy indicating the at least two data blocks and at least The storage node corresponding to a check block.
  • a third aspect of the present application provides a data storage device, including: a network detection unit, an acquisition unit, a processing unit, and a storage unit; wherein,
  • the network detection unit is used to obtain network connection status information between the storage node and each target storage node;
  • the obtaining unit is used to obtain the target data to be stored
  • a processing unit configured to perform block processing on the target data in an erasure coding manner to obtain a processing result corresponding to the target data, the processing result including at least two data blocks and at least one check block;
  • the storage unit is configured to determine a storage strategy for the processing result according to the network connection status information, and store the processing result according to the storage strategy, the storage strategy indicating the at least two data blocks and at least The storage node corresponding to a check block.
  • a fourth aspect of the present application provides an electronic device including: a memory, a processor, and a computer program stored on the memory and capable of running on the processor, and the processor executes the following operations when the computer program is running :
  • a fifth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the following operations:
  • the data storage method, device, device, and storage medium provided in this application obtain the target data to be stored, and use the erasure code algorithm to block the target data to obtain the corresponding data block and check block , And then store the data block and check block to the corresponding storage node according to the network connection state information between the storage node and each target storage node.
  • the storage strategy is formulated based on the network connection status information between the storage nodes, the above method can ensure that when user data is uploaded, no matter what abnormality occurs in the network between the storage nodes, it can be successfully written without writing.
  • phenomena such as entry failure and write waiting timeout have significantly improved the reliability of data storage services and improved user experience.
  • the block chain is used to store data, which further ensures the security of users' data.
  • Figure 1 shows the existing data storage process based on global erasure technology
  • Figure 2 shows a flowchart of a data storage method provided by some embodiments of the present application
  • FIG. 3 shows a schematic diagram of a data storage device provided by some embodiments of the present application.
  • FIG. 4 shows a schematic diagram of a data storage device provided by other embodiments of the present application.
  • FIG. 5 shows a schematic diagram of an electronic device provided by some embodiments of the present application.
  • Fig. 6 shows a schematic diagram of a computer-readable storage medium provided by some embodiments of the present application.
  • first and second are used to distinguish different objects, rather than to describe a specific order.
  • the terms “including” and “having” and any variations of them are intended to cover non-exclusive inclusions.
  • a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent to these processes, methods, products or equipment.
  • the user sends a file upload request to AZ1, uploading the file file1;
  • Global EC of AZ1 will use erasure coding algorithm to split file1 into data block file1-data-part1, data block file1-data-part2 and check block file1-checksum; and file1-data-part1 Save to the object storage cluster of AZ1, send a network request to save file1-data-part2 to the object storage cluster of AZ2, and send a network request to save file1-checksum to the object storage cluster of AZ3;
  • the Global EC of AZ1 returns to the user a message of successful upload
  • embodiments of the present application provide a data storage method and device, an electronic device, and a computer-readable storage medium. The description is given below in conjunction with the drawings.
  • FIG. 2 shows a flowchart of a data storage method provided by some embodiments of the present application.
  • the data storage method can be applied to any storage in a distributed storage system.
  • Nodes, or other storage systems can include the following steps:
  • Step S101 Obtain network connection state information between the storage node and each target storage node.
  • the target storage node may be a storage node other than the storage node in the distributed storage system.
  • the network connection status information can be divided into normal and abnormal, and the storage node can be the data center AZ, for example, the current storage node is AZ1, and the target storage nodes are AZ2 and AZ3.
  • the following methods can be used to determine the network connection status between the current storage node and each target storage node:
  • the storage node sends a signal packet to each target storage node.
  • the signal packet transmission fails for a preset number of consecutive times, it is judged whether the storage node and the corresponding target storage node have failed.
  • the state of the network connection between the two is abnormal; otherwise, it is judged to be normal.
  • the "Global EC" component of AZ1 periodically (assuming every 5 seconds) sends signal packets to the designated ports of the "Object Storage Cluster” of AZ2 and AZ3.
  • the signal packet transmission under normal network conditions is successful, and the signal packet transmission under abnormal network conditions fails.
  • Network abnormality judgment rule If there are two consecutive failures to send signal packets within 20 seconds, the network between the two AZs is considered to be abnormal.
  • Step S102 Obtain target data to be stored.
  • Step S103 Perform block processing on the target data in an erasure code manner to obtain a processing result corresponding to the target data, where the processing result includes at least two data blocks and at least one check block.
  • the user uploads target data (such as file1) to AZ1
  • the "Global EC” component of AZ1 obtains the target data uploaded by the user
  • the "Global EC” component of AZ1 uses an erasure code algorithm to split file1 into data blocks file1 -data-part1, data block file1-data-part2 and check block file1-checksum, namely two data blocks and one check block.
  • Step S104 Determine a storage strategy for the processing result according to the network connection status information, and store the processing result according to the storage strategy, the storage strategy indicating the at least two data blocks and at least one calibration The storage node corresponding to the verification block.
  • the number of target storage nodes is two, which can be a first target storage node and a second target storage node; the target data is divided into blocks by using erasure codes to obtain two processing results Data block and a check block.
  • step S104 can be implemented as follows:
  • the network connection status between the storage node and the first target storage node is normal, and the network connection status with the second target storage node is abnormal, store a data block and the check block in the storage
  • the node stores another data block and the check block in the first target storage node.
  • the "Global EC" of AZ1 will set the data block file1-data-part1 ,
  • the check block file1-checksum is written to the object storage cluster of AZ1, the data block file1-data-part2 and the check block file1-checksum are written to AZ2, and the file1-checksum is written temporarily in AZ1 and AZ2.
  • file1-data-part1, file1-data-part2, and file1-checksum are all written successfully, a message indicating that the user data has been successfully stored is returned.
  • the above data storage method further includes the following steps:
  • step S104 can also be implemented as follows:
  • both the two data blocks and one check block are stored in the current storage node.
  • the "Global EC" of AZ1 will write file1-data-part1, file1-data-part2, file1-checksum at the same time AZ1.
  • the above data storage method further includes the following steps:
  • file1-data-part1, file1-data-part2, file1-checksum are all stored in the object storage cluster of AZ1, and the network between AZ1 and AZ2, AZ3 is restored to normal, AZ1 will file1-data -Part2 data is copied to the object storage cluster in AZ2, and then file1-data-part2 in AZ1 is deleted. At the same time, copy the file1-checksum data to the AZ3 object storage cluster, and then delete the file1-checksum in AZ1.
  • the data still maintains AZ-level security, and finally uses 1.5 times the storage capacity; moreover, during the entire process, the user upload data request will not be abnormal, and will not wait for the service to time out. After that, the failure was notified.
  • each storage node in this application is a blockchain node, and each processing result is stored in the blockchain, that is, each part of the data in the processing result is stored in a block manner In the blockchain. Due to the decentralization, immutability, and traceability of the blockchain, the data security of users is further ensured.
  • the foregoing method may be implemented as multiple software or software modules, or may be implemented as a single software or software module. There is no specific limitation here.
  • the above-mentioned data storage method obtains the target data to be stored, uses an erasure code algorithm to block the target data, obtains the corresponding data block and the check block, and then obtains the corresponding data block and the check block according to the present invention.
  • the network connection state information between the storage node and each target storage node stores the data block and the check block to the corresponding storage node. Because the storage strategy is formulated based on the network connection status information between the storage nodes, the above method can ensure that when user data is uploaded, no matter what abnormality occurs in the network between the storage nodes, it can be successfully written without writing.
  • phenomena such as entry failure and write waiting timeout have significantly improved the reliability of data storage services and improved user experience.
  • the block chain is used to store data, which further ensures the security of users' data.
  • a data storage method is provided.
  • this application also provides a data storage device.
  • the data storage device provided in the embodiment of the present application can implement the above-mentioned data storage method, and the data storage device can be implemented by software, hardware, or a combination of software and hardware.
  • the data storage device may include integrated or separate functional modules or units to execute the corresponding steps in the foregoing methods.
  • FIG. 3 shows a schematic diagram of a data storage device provided by some embodiments of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
  • the device embodiments described below are merely illustrative.
  • the data storage device 10 may include:
  • the network detection module 101 is used to obtain network connection status information between the storage node and each target storage node;
  • the obtaining module 102 is used to obtain target data to be stored
  • the processing module 103 is configured to perform block processing on the target data in an erasure coding manner to obtain a processing result corresponding to the target data, and the processing result includes at least two data blocks and at least one check block;
  • the storage module 104 is configured to determine a storage strategy for the processing result according to the network connection status information, and store the processing result according to the storage strategy, and the storage strategy indicates the at least two data blocks and The storage node corresponding to at least one check block.
  • the network detection module 101 is specifically configured to:
  • the storage node sends a signal packet to each target storage node
  • the signal packet transmission fails for a preset number of consecutive times, it is determined that the network connection status between the current storage node and the corresponding target storage node is abnormal; otherwise, it is normal.
  • the number of the target storage nodes is two; the processing result includes two data blocks and one check block.
  • the storage module 104 is specifically configured to:
  • the network connection status between the storage node and the first target storage node is normal, and the network connection status with the second target storage node is abnormal, store a data block and the check block in the storage
  • the node stores another data block and the check block in the first target storage node.
  • FIG. 4 shows a schematic diagram of a data storage device provided by other embodiments of the present application.
  • the data storage device 10 may further include:
  • the data compensation module 105 is configured to store the check block in the second target storage node and delete the local storage node when the network connection state between the current storage node and the second target storage node returns to normal. A check block stored in the storage node and the first target storage node.
  • the storage module 104 is specifically configured to:
  • both the two data blocks and one check block are stored in the current storage node.
  • the data compensation module 105 is specifically configured to:
  • a network detection module 101 and a data repair module 105 are added to the data storage device 10 of the present application, and files are optimized. Storage method.
  • each storage node in the present application is a blockchain node, and each processing result is stored in the blockchain. Due to the decentralization, immutability, and traceability of the blockchain, the data security of users is further ensured.
  • the data storage device 10 provided in the embodiment of the present application is based on the same inventive concept as the data storage method provided in the foregoing embodiment of the present application, and has the same beneficial effects.
  • This application also provides a data storage device.
  • the data storage device provided in the embodiment of the present application can implement the above-mentioned data storage method. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
  • the data storage device may include: a network detection unit, an acquisition unit, a processing unit, and a storage unit; wherein,
  • the network detection unit is used to obtain network connection status information between the storage node and each target storage node;
  • the obtaining unit is used to obtain the target data to be stored
  • a processing unit configured to perform block processing on the target data in an erasure coding manner to obtain a processing result corresponding to the target data, the processing result including at least two data blocks and at least one check block;
  • the storage unit is configured to determine a storage strategy for the processing result according to the network connection status information, and store the processing result according to the storage strategy, the storage strategy indicating the at least two data blocks and at least The storage node corresponding to a check block.
  • the network detection unit is specifically configured to:
  • the storage node sends a signal packet to each target storage node
  • the signal packet transmission fails for a preset number of consecutive times, it is determined that the network connection status between the current storage node and the corresponding target storage node is abnormal; otherwise, it is normal.
  • the number of the target storage nodes is two; the processing result includes two data blocks and one check block.
  • the storage unit is specifically used for:
  • the network connection status between the storage node and the first target storage node is normal, and the network connection status with the second target storage node is abnormal, store a data block and the check block in the storage
  • the node stores another data block and the check block in the first target storage node.
  • the check block is stored in the second target storage node, and the storage node and the first storage node are deleted.
  • the check block stored in the target storage node.
  • the storage unit is specifically used for:
  • both the two data blocks and one check block are stored in the current storage node.
  • each storage node in the present application is a blockchain node, and each processing result is stored in the blockchain. Due to the decentralization, immutability, and traceability of the blockchain, the data security of users is further ensured.
  • the data storage device provided in the embodiment of the present application is based on the same inventive concept as the data storage method provided in the foregoing embodiment of the present application, and has the same beneficial effects.
  • the embodiment of the present application also provides an electronic device corresponding to the data storage method provided in the foregoing embodiment.
  • the electronic device may be a mobile phone, a notebook computer, a tablet computer, a desktop computer, etc., to execute the above data storage method.
  • FIG. 5 shows a schematic diagram of an electronic device provided by some embodiments of the present application.
  • the electronic device 20 includes a processor 200, a memory 201, a bus 202, and a communication interface 203.
  • the processor 200, the communication interface 203, and the memory 201 are connected through the bus 202; the memory 201 stores There is a computer program that can run on the processor 200, and the processor 200 executes the data storage method provided in any of the foregoing embodiments of the present application when the processor 200 runs the computer program.
  • the memory 201 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • the communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the Internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
  • the bus 202 may be an ISA bus, a PCI bus, an EISA bus, or the like.
  • the bus can be divided into an address bus, a data bus, a control bus, and so on.
  • the memory 201 is used to store a program, and the processor 200 executes the program after receiving an execution instruction.
  • the data storage method disclosed in any one of the foregoing embodiments of the present application can be applied to the processor 200, Or implemented by the processor 200.
  • the processor 200 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 200 or instructions in the form of software.
  • the aforementioned processor 200 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201, and completes the steps of the foregoing method in combination with its hardware.
  • the electronic device provided in the embodiment of the present application and the data storage method provided in the embodiment of the present application are based on the same inventive concept, and have the same beneficial effects as the method adopted, operated, or implemented.
  • the embodiment of the present application also provides a computer-readable storage medium corresponding to the data storage method provided in the foregoing embodiment. Please refer to FIG. 6.
  • the computer-readable storage medium shown is an optical disc 30 on which a computer program is stored. (Ie, a program product), when the computer program is run by a processor, it will execute the data storage method provided by any of the foregoing embodiments.
  • the computer-readable storage medium may be non-volatile or volatile.
  • Examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory (RAM). ), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be repeated here.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other optical and magnetic storage media, which will not be repeated here.
  • the computer-readable storage medium provided by the foregoing embodiments of the present application and the data storage method provided by the embodiments of the present application are based on the same inventive concept, and have the same beneficial effects as the method adopted, executed, or implemented by the stored application program.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the module, program segment, or part of the code contains one or more functions for realizing the specified logic function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Abstract

一种数据存储方法、装置、电子设备及计算机可读介质。其中,所述方法包括:获取本存储节点与各目标存储节点之间的网络连接状态信息(S101);获取待存储的目标数据(S102);采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块(S103);根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点(S104)。通过上述方法能够保障用户数据在上传时,可以成功写入,提高了用户体验,同时采用区块链的方式存储数据,进一步保证了用户的数据安全。

Description

数据存储方法、装置、设备及存储介质
本申请要求于2020年05月29日提交中国专利局、申请号为202010479118.2、申请名称为“数据存储方法、装置、电子设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及分布式存储技术领域,具体涉及一种数据存储方法、装置、设备及存储介质。
背景技术
纠删码(Erasure Code,简称EC)技术主要是通过纠删码算法将原始的数据进行编码得到冗余,并将数据和冗余一并存储起来,以达到容错的目的。基于纠删码的方法与多副本方法相比具有冗余度低、磁盘利用率高等优点,成为分布式存储系统的一大主流。
全局纠删(GlobalEC)技术,是纠删码技术的扩展应用。图1所示为Global EC的过程。如图1所示,GlobalEC是将一个用户上传的数据分成2个数据块,并使用纠删码算法根据这2个数据块计算生成1个校验块;同时,将这2个数据块和1个校验块分别存入到3个不同的数据中心(标记为AZ,如图1所示的AZ1、AZ2、AZ3)的对象存储集群中。这样,当单个AZ出现故障时,还可以从剩余的两个AZ中取出数据块,生成用户的源数据,并返回给用户。用户通过图中的服务调用入口上传和下载数据。
发明人发现上述过程中,3个AZ(即,AZ1、AZ2、AZ3)之间通过专线通讯,但因为相互距离比较远(同城或者跨地域),很容易出现网络状态不好,甚至网络断开的情况(例如,网线被施工队挖断)。此时,当用户上传数据,数据将不能同时写到3个AZ中;并且,由于网络异常,将使得写到异常AZ的请求出现超时,但需要一段时间后才会被发现。如此一来,将明显降低上传Global EC对象存储服务的可靠性,同时要经过很长时间才被发现异常,也大大降低了用户体验。
发明内容
本申请的目的是提供一种数据存储方法及装置、一种数据存储设备、一种电子设备以及一种计算机可读存储介质。
本申请第一方面提供一种数据存储方法,包括:
获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取待存储的目标数据;
采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
本申请第二方面提供一种数据存储装置,包括:
网络探测模块,用于获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取模块,用于获取待存储的目标数据;
处理模块,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
存储模块,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
本申请第三方面提供一种数据存储设备,包括:网络探测单元、获取单元、处理单元和存储单元;其中,
网络探测单元,用于获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取单元,用于获取待存储的目标数据;
处理单元,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
存储单元,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
本申请第四方面提供一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器运行所述计算机程序时执行以下操作:
获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取待存储的目标数据;
采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
本申请第五方面提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现以下操作:
获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取待存储的目标数据;
采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
相较于现有技术,本申请提供的数据存储方法、装置、设备及存储介质,获取待存储的目标数据,采用纠删码算法对目标数据进行分块处理,得到对应数据块和校验块,然后根据本存储节点与各目标存储节点之间的网络连接状态信息,存储所述数据块和校验块至对应的存储节点。由于是根据各存储节点之间的网络连接状态信息制定的存储策略,因此,通过上述方法可以保障用户数据在上传时,无论存储节点间网络发生什么异常,都可以成功写入,不会出现写入失败及写入等待超时等现象,相较于现有技术,明显地提高了数据存储服务的可靠性,提高了用户体验。同时采用区块链的方式存储数据,进一步保证了用户的数据安全。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了现有的基于全局纠删技术的数据存储过程;
图2示出了本申请的一些实施方式所提供的一种数据存储方法的流程图;
图3示出了本申请的一些实施方式所提供的一种数据存储装置的示意图;
图4示出了本申请的另一些实施方式所提供的一种数据存储装置的示意图;
图5示出了本申请的一些实施方式所提供的一种电子设备的示意图;
图6示出了本申请的一些实施方式所提供的一种计算机可读存储介质的示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施方式。虽然附图中显示了本公开的示例性实施方式,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
需要注意的是,除非另有说明,本申请使用的技术术语或者科学术语应当为本申请所属领域技术人员所理解的通常意义。
另外,术语“第一”和“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,参照图1,对现有的基于Global EC的数据存储过程进一步介绍如下:
第一步,用户往AZ1发送文件上传请求,上传文件file1;
第二步,AZ1的Global EC会使用纠删码算法将文件file1拆分成数据块file1-data-part1,数据块file1-data-part2和校验块file1-checksum;并将file1-data-part1存往AZ1的对象存储集群,发出网络请求将file1-data-part2存往AZ2的对象存储集群,发出网络请求将file1-checksum存往AZ3的对象存储集群;
第三步,一旦AZ1、AZ2和AZ3的对象存储集群都写成功,AZ1的Global EC返回给用户上传成功的消息;
此时,实际存入底层对象存储集群的只有1.5倍源文件,但任意一个AZ不可用,都可以通过剩余的两个AZ中的数据恢复成完整的源文件返回给用户。
为了解决上述过程中出现的AZ间网络异常而造成数据存储服务可靠性低,用户体验差的问题,本申请实施例提供一种数据存储方法及装置、一种电子设备以及计算机可读存储介质,下面结合附图进行说明。
请参考图2,其示出了本申请的一些实施方式所提供的一种数据存储方法的流程图,如图所示,所述数据存储方法,可以应用于分布式存储系统中的任一存储节点,或者其它存储系统中,可以包括以下步骤:
步骤S101:获取本存储节点与各目标存储节点之间的网络连接状态信息。
其中,所述目标存储节点可以为分布式存储系统中除了本存储节点之外的存储节点。
其中,网络连接状态信息可以分为正常和异常,存储节点可以是数据中心AZ,例如本存储节点为AZ1,目标存储节点为AZ2和AZ3。可选的,可以通过以下方法判断本存储节点与各目标存储节点之间的网络连接状态:
按照预设周期,由本存储节点向各目标存储节点发送信号包,对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则判断为正常。
例如,AZ1的“Global EC”组件定期(假设每隔5秒)向AZ2和AZ3的“对象存储集群”的指定端口发送信号包。正常网络情况下的信号包发送成功,异常网络情况下的信号包发送失败。网络异常判断规则:若20秒内连续出现2次信号包发送失败,则认为两个AZ之间的网络异常。
步骤S102:获取待存储的目标数据。
步骤S103:采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块。
例如,用户上传目标数据(例如文件file1)到AZ1,AZ1的“Global EC”组件获取到了用户上传的目标数据,AZ1的“Global EC”组件使用纠删码算法将文件file1拆分成数据块file1-data-part1、数据块file1-data-part2和校验块file1-checksum,即两个数据块和一个校验块。
步骤S104:根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
根据本申请的一个实施方式中,目标存储节点的数量为两个,可以是第一目标存储节点和第二目标存储节点;采用纠删码方式对目标数据进行分块处理得到处理结果为两个数据块和一个校验块。
具体的,步骤S104可以实现如下:
若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点。
例如,若本存储节点AZ1与目标存储节点AZ2之间的网络连接状态为正常,且与目标存储节点AZ3之间的网络连接状态为异常,AZ1的“Global EC”将数据块file1-data-part1、校验块file1-checksum写往AZ1的对象存储集群,将数据块file1-data-part2、校验块file1-checksum写往AZ2,并且在AZ1、AZ2中记录:file1-checksum为临时写入。当file1-data-part1、file1-data-part2、file1-checksum都写成功后,返回用户数据存储成功的消息。
当探测到AZ1与AZ3之间的网络恢复正常后,再将file1-checksum写入到AZ3,因此,根据本申请的一个实施方式中,上述数据存储方法还包括以下步骤:
当本存储节点与第二目标存储节点之间的网络连接状态恢复为正常时,将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
也就是,当AZ1与AZ3之间的网络恢复正常后,将file1-data-checksum写入到AZ3,同时删除AZ1和AZ2中的file1-data-checksum,恢复成正常的数据存储模式。
具体的,步骤S104还可以实现如下:
若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点。
例如,若本存储节点AZ1与各目标存储节点AZ2和AZ3之间的网络连接状态均为异常,AZ1的“Global EC”将file1-data-part1、file1-data-part2、file1-checksum同时写入AZ1。
当探测到AZ1与AZ2和AZ3之间的网络恢复正常后,再恢复成正常的数据存储模式,因此,根据本申请的一个实施方式中,上述数据存储方法还包括以下步骤:
当本存储节点与各目标存储节点之间的网络连接状态恢复为正常时,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
也就是,此时,file1-data-part1、file1-data-part2、file1-checksum都存储在AZ1的对象存储集群中,并且AZ1和AZ2、AZ3之间的网络恢复正常,AZ1会将file1-data-part2数据复制到AZ2的对象存储集群中,再删掉AZ1中的file1-data-part2。同时将file1-checksum数据复制到AZ3的对象存储集群中,再删掉AZ1中的file1-checksum。
可见,本申请的数据存储方法的整个过程中,数据仍然保持AZ级安全,并最终使用1.5倍的存储容量;而且,整个过程中,用户上传数据请求不会出现异常,也不会等待服务超时后,才告知失败。
根据本申请的一个实施方式中,本申请中的各存储节点均为区块链节点,各处理结果均存储在区块链中,也就是将处理结果中的各部分数据按照区块的方式存储于区块链中。由于区块链去中心化、不可篡改、可回溯等特性,进一步保证了用户的数据安全。
本申请实施例中,上述方法可以实现成多个软件或软件模块,也可以实现 成单个软件或软件模块。在此不做具体限定。
相较于现有技术,本申请实施例提供的上述数据存储方法,获取待存储的目标数据,采用纠删码算法对目标数据进行分块处理,得到对应数据块和校验块,然后根据本存储节点与各目标存储节点之间的网络连接状态信息,存储所述数据块和校验块至对应的存储节点。由于是根据各存储节点之间的网络连接状态信息制定的存储策略,因此,通过上述方法可以保障用户数据在上传时,无论存储节点间网络发生什么异常,都可以成功写入,不会出现写入失败及写入等待超时等现象,相较于现有技术,明显地提高了数据存储服务的可靠性,提高了用户体验。同时采用区块链的方式存储数据,进一步保证了用户的数据安全。
在上述的实施例中,提供了一种数据存储方法,与之相对应的,本申请还提供一种数据存储装置。本申请实施例提供的数据存储装置可以实施上述数据存储方法,该数据存储装置可以通过软件、硬件或软硬结合的方式来实现。例如,该数据存储装置可以包括集成的或分开的功能模块或单元来执行上述各方法中的对应步骤。请参考图3,其示出了本申请的一些实施方式所提供的一种数据存储装置的示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。
如图3所示,所述数据存储装置10,可以包括:
网络探测模块101,用于获取本存储节点与各目标存储节点之间的网络连接状态信息;
获取模块102,用于获取待存储的目标数据;
处理模块103,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
存储模块104,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
在本申请实施例的一些实施方式中,所述网络探测模块101,具体用于:
按照预设周期,由本存储节点向各目标存储节点发送信号包;
对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则正常。
在本申请实施例的一些实施方式中,所述目标存储节点的数量为两个;所述处理结果包括两个数据块和一个校验块。
在本申请实施例的一些实施方式中,所述存储模块104,具体用于:
若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点。
请参考图4,其示出了本申请的另一些实施方式所提供的一种数据存储装置的示意图,如图所示,所述数据存储装置10还可以包括:
数据补偿模块105,用于当本存储节点与所述第二目标存储节点之间的网络连接状态恢复为正常时,则将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
在本申请实施例的一些实施方式中,所述存储模块104,具体用于:
若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点。
在本申请实施例的一些实施方式中,所述数据补偿模块105,具体用于:
当本存储节点与各目标存储节点之间的网络连接状态恢复为正常,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
为了解决出现AZ间网络异常而造成服务可靠性低,用户体验差的问题,相较于现有技术,本申请数据存储装置10中增加了网络探测模块101、数据修复模块105,并优化了文件存储方式。
根据本申请的一个实施方式中,本申请中的各存储节点均为区块链节点,各处理结果均存储在区块链中。由于区块链去中心化、不可篡改、可回溯等特性,进一步保证了用户的数据安全。
本申请实施例提供的数据存储装置10,与本申请前述实施例提供的数据存储方法出于相同的发明构思,具有相同的有益效果。
本申请还提供一种数据存储设备。本申请实施例提供的数据存储设备可以实施上述数据存储方法。由于设备实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的设备实施例仅仅是示意性的。
所述数据存储设备,可以包括:网络探测单元、获取单元、处理单元和存储单元;其中,
网络探测单元,用于获取本存储节点与各目标存储节点之间的网络连接状 态信息;
获取单元,用于获取待存储的目标数据;
处理单元,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
存储单元,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
在本申请实施例的一些实施方式中,所述网络探测单元,具体用于:
按照预设周期,由本存储节点向各目标存储节点发送信号包;
对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则正常。
在本申请实施例的一些实施方式中,所述目标存储节点的数量为两个;所述处理结果包括两个数据块和一个校验块。
在本申请实施例的一些实施方式中,所述存储单元,具体用于:
若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点。
当本存储节点与所述第二目标存储节点之间的网络连接状态恢复为正常时,则将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
在本申请实施例的一些实施方式中,所述存储单元,具体用于:
若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点。
当本存储节点与各目标存储节点之间的网络连接状态恢复为正常,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
根据本申请的一些实施方式中,本申请中的各存储节点均为区块链节点,各处理结果均存储在区块链中。由于区块链去中心化、不可篡改、可回溯等特性,进一步保证了用户的数据安全。
本申请实施例提供的数据存储设备,与本申请前述实施例提供的数据存储方法出于相同的发明构思,具有相同的有益效果。
本申请实施方式还提供一种与前述实施方式所提供的数据存储方法对应的电子设备,所述电子设备可以是手机、笔记本电脑、平板电脑、台式机电脑等,以执行上述数据存储方法。
请参考图5,其示出了本申请的一些实施方式所提供的一种电子设备的示意图。如图5所示,所述电子设备20包括:处理器200,存储器201,总线202和通信接口203,所述处理器200、通信接口203和存储器201通过总线202连接;所述存储器201中存储有可在所述处理器200上运行的计算机程序,所述处理器200运行所述计算机程序时执行本申请前述任一实施方式所提供的数据存储方法。
其中,存储器201可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口203(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网、广域网、本地网、城域网等。
总线202可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。其中,存储器201用于存储程序,所述处理器200在接收到执行指令后,执行所述程序,前述本申请实施例任一实施方式揭示的所述数据存储方法可以应用于处理器200中,或者由处理器200实现。
处理器200可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器200中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器200可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器201,处理器200读取存储器201中的信息,结合其硬件完成上述方法的步骤。
本申请实施例提供的电子设备与本申请实施例提供的数据存储方法出于相同的发明构思,具有与其采用、运行或实现的方法相同的有益效果。
本申请实施方式还提供一种与前述实施方式所提供的数据存储方法对应的 计算机可读存储介质,请参考图6,其示出的计算机可读存储介质为光盘30,其上存储有计算机程序(即程序产品),所述计算机程序在被处理器运行时,会执行前述任意实施方式所提供的数据存储方法。
需要说明的是,所述计算机可读存储介质可以是非易失性,也可以是易失性。所述计算机可读存储介质的例子还可以包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他光学、磁性存储介质,在此不再一一赘述。
本申请的上述实施例提供的计算机可读存储介质与本申请实施例提供的数据存储方法出于相同的发明构思,具有与其存储的应用程序所采用、运行或实现的方法相同的有益效果。
需要说明的是,附图中的流程图和框图显示了根据本申请的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围,其均应涵盖在本申请的权利要求和说明书的范围当中。

Claims (20)

  1. 一种数据存储方法,其中,包括:
    获取本存储节点与各目标存储节点之间的网络连接状态信息;
    获取待存储的目标数据;
    采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
    根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
  2. 根据权利要求1所述的方法,其中,所述获取本存储节点与各目标存储节点之间的网络连接状态信息,包括:
    按照预设周期,由本存储节点向各目标存储节点发送信号包;
    对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则正常。
  3. 根据权利要求1或2所述的方法,其中,所述目标存储节点的数量为两个,分别为第一目标存储节点和第二目标存储节点;所述处理结果包括两个数据块和一个校验块。
  4. 根据权利要求3所述的方法,其中,所述根据所述网络连接状态信息,确定对所述处理结果的存储策略,包括:
    若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点;
    当本存储节点与所述第二目标存储节点之间的网络连接状态恢复为正常时,将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
  5. 根据权利要求3所述的方法,其中,所述根据所述网络连接状态信息,确定对所述处理结果的存储策略,包括:
    若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点;
    当本存储节点与各目标存储节点之间的网络连接状态恢复为正常,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
  6. 根据权利要求1或2所述的方法,其中,各存储节点为区块链节点,所述处理结果存储在区块链中。
  7. 一种数据存储设备,其中,包括:网络探测单元、获取单元、处理单元和存储单元;其中,
    网络探测单元,用于获取本存储节点与各目标存储节点之间的网络连接状态信息;
    获取单元,用于获取待存储的目标数据;
    处理单元,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
    存储单元,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
  8. 根据权利要求7所述的设备,其中,所述网络探测单元,具体用于:
    按照预设周期,由本存储节点向各目标存储节点发送信号包;
    对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则正常。
  9. 根据权利要求7或8所述的设备,其中,所述目标存储节点的数量为两个,分别为第一目标存储节点和第二目标存储节点;所述处理结果包括两个数据块和一个校验块。
  10. 根据权利要求9所述的设备,其中,所述存储单元,具体用于:
    若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点;
    当本存储节点与所述第二目标存储节点之间的网络连接状态恢复为正常时,将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
  11. 根据权利要求9所述的设备,其中,所述存储单元,具体用于:
    若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点;
    当本存储节点与各目标存储节点之间的网络连接状态恢复为正常,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
  12. 根据权利要求7或8所述的设备,其中,各存储节点为区块链节点,所述处理结果存储在区块链中。
  13. 一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器运行所述计算机程序时执行以下操作:
    获取本存储节点与各目标存储节点之间的网络连接状态信息;
    获取待存储的目标数据;
    采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
    根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
  14. 根据权利要求13所述的电子设备,其中,所述处理器在获取本存储节点与各目标存储节点之间的网络连接状态信息时,具体用于:
    按照预设周期,由本存储节点向各目标存储节点发送信号包;
    对于本存储节点与任一目标存储节点,若连续预设次数出现信号包发送失败,则判断本存储节点与相应目标存储节点之间的网络连接状态为异常;反之,则正常。
  15. 根据权利要求13或14所述的电子设备,其中,所述目标存储节点的数量为两个,分别为第一目标存储节点和第二目标存储节点;所述处理结果包括两个数据块和一个校验块。
  16. 根据权利要求15所述的电子设备,其中,所述处理器在根据所述网络连接状态信息,确定对所述处理结果的存储策略时,具体用于:
    若本存储节点与第一目标存储节点之间的网络连接状态为正常,且与第二目标存储节点之间的网络连接状态为异常,则将一个数据块和所述校验块存储于本存储节点,将另一个数据块和所述校验块存储于第一目标存储节点;
    当本存储节点与所述第二目标存储节点之间的网络连接状态恢复为正常时,将所述校验块存储于所述第二目标存储节点,并删除本存储节点和所述第一目标存储节点中存储的校验块。
  17. 根据权利要求15所述的电子设备,其中,所述处理器在根据所述网络连接状态信息,确定对所述处理结果的存储策略,具体用于:
    若本存储节点与各目标存储节点之间的网络连接状态均为异常,则将所述两个数据块和一个校验块都存储于本存储节点;
    当本存储节点与各目标存储节点之间的网络连接状态恢复为正常,则将所述两个数据块中的一个存储于第一目标存储节点,将所述校验块存储于第二目标存储节点。
  18. 根据权利要求13或14所述的电子设备,其中,各存储节点为区块链节点,所述处理结果存储在区块链中。
  19. 一种计算机可读存储介质,其中存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现以下操作:
    获取本存储节点与各目标存储节点之间的网络连接状态信息;
    获取待存储的目标数据;
    采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
    根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储 策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
  20. 一种数据存储装置,其中,包括:
    网络探测模块,用于获取本存储节点与各目标存储节点之间的网络连接状态信息;
    获取模块,用于获取待存储的目标数据;
    处理模块,用于采用纠删码方式对所述目标数据进行分块处理,以得到所述目标数据对应的处理结果,所述处理结果包括至少两个数据块和至少一个校验块;
    存储模块,用于根据所述网络连接状态信息,确定对所述处理结果的存储策略,并按照所述存储策略存储所述处理结果,所述存储策略指示了所述至少两个数据块和至少一个校验块对应的存储节点。
PCT/CN2020/099380 2020-05-29 2020-06-30 数据存储方法、装置、设备及存储介质 WO2021120585A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010479118.2A CN111818124B (zh) 2020-05-29 2020-05-29 数据存储方法、装置、电子设备及介质
CN202010479118.2 2020-05-29

Publications (1)

Publication Number Publication Date
WO2021120585A1 true WO2021120585A1 (zh) 2021-06-24

Family

ID=72847815

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099380 WO2021120585A1 (zh) 2020-05-29 2020-06-30 数据存储方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN111818124B (zh)
WO (1) WO2021120585A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783688B (zh) * 2021-02-10 2022-06-03 上海交通大学 一种基于可用分区级的纠删码数据恢复方法及装置
CN113419684B (zh) * 2021-07-09 2023-02-24 深圳大普微电子科技有限公司 一种数据处理方法、装置、设备及可读存储介质
CN113626649A (zh) * 2021-08-02 2021-11-09 Oppo广东移动通信有限公司 数据存储方法、装置、存储介质以及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160062674A1 (en) * 2014-09-02 2016-03-03 Netapp, Inc. Data storage architecture for storing metadata with data
CN106662983A (zh) * 2015-12-31 2017-05-10 华为技术有限公司 分布式存储系统中的数据重建的方法、装置和系统
CN109885256A (zh) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 一种基于数据分片的数据存储方法、设备及介质
CN110502365A (zh) * 2019-07-11 2019-11-26 平安科技(深圳)有限公司 数据存储及恢复的方法、装置及计算机设备
CN110535965A (zh) * 2019-09-03 2019-12-03 北京元安物联技术有限公司 一种数据处理方法及装置、存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10003357B2 (en) * 2015-08-28 2018-06-19 Qualcomm Incorporated Systems and methods for verification of code resiliency for data storage
CN110753198B (zh) * 2018-07-24 2021-12-14 杭州海康威视数字技术股份有限公司 存储图像数据的方法和装置
CN109491968B (zh) * 2018-11-13 2021-01-22 恒生电子股份有限公司 一种文件处理方法、装置、设备及计算机可读存储介质
CN109871366B (zh) * 2019-01-17 2021-09-10 华东师范大学 一种基于纠删码的区块链分片存储与查询方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160062674A1 (en) * 2014-09-02 2016-03-03 Netapp, Inc. Data storage architecture for storing metadata with data
CN106662983A (zh) * 2015-12-31 2017-05-10 华为技术有限公司 分布式存储系统中的数据重建的方法、装置和系统
CN109885256A (zh) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 一种基于数据分片的数据存储方法、设备及介质
CN110502365A (zh) * 2019-07-11 2019-11-26 平安科技(深圳)有限公司 数据存储及恢复的方法、装置及计算机设备
CN110535965A (zh) * 2019-09-03 2019-12-03 北京元安物联技术有限公司 一种数据处理方法及装置、存储介质

Also Published As

Publication number Publication date
CN111818124B (zh) 2022-09-02
CN111818124A (zh) 2020-10-23

Similar Documents

Publication Publication Date Title
WO2021120585A1 (zh) 数据存储方法、装置、设备及存储介质
US10120596B2 (en) Adaptive extra write issuance within a dispersed storage network (DSN)
US20170052842A1 (en) Using reason codes to determine how to handle memory device error conditions
US10305989B2 (en) Finding alternate storage locations to support failing disk migration
US11307776B2 (en) Method for accessing distributed storage system, related apparatus, and related system
JP6677417B2 (ja) ロックステップ構成の動的変更
JP6452712B2 (ja) 分散データ・ストレージ・システムにおけるデータ回復を向上させる方法、システム、およびコンピュータ・プログラム
KR102378466B1 (ko) 메모리 장치 및 모듈
CN109814807B (zh) 一种数据存储方法及装置
WO2018121456A1 (zh) 一种数据存储方法、服务器以及存储系统
US8954808B1 (en) Systems and methods for performing input/output path failovers
CN110825698B (zh) 元数据管理方法及相关装置
CN109661665B (zh) 标准和非标准分散存储网络数据访问
US10379942B2 (en) Efficient transfer of objects between containers on the same vault
US11650883B2 (en) Batch rebuilding a set of encoded data slices
CN110442601B (zh) 一种Openstack镜像数据并行加速的方法和装置
US20190102089A1 (en) Requester-associated storage entity data
US9037948B2 (en) Error correction for memory systems
US10540247B2 (en) Handling degraded conditions using a redirect module
US10936452B2 (en) Dispersed storage network failover units used to improve local reliability
US9715477B2 (en) Shared-bandwidth multiple target remote copy
US10057351B2 (en) Modifying information dispersal algorithm configurations in a dispersed storage network
US20180109614A1 (en) Adaptive scanning rates
US11770448B1 (en) Rotating offline storage units in a dispersed storage network
JP3434735B2 (ja) 情報処理システム及びそれに用いる障害処理方式

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: 20902746

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: 20902746

Country of ref document: EP

Kind code of ref document: A1