WO2020244242A1 - 一种区块链数据存储方法及装置 - Google Patents
一种区块链数据存储方法及装置 Download PDFInfo
- Publication number
- WO2020244242A1 WO2020244242A1 PCT/CN2020/071558 CN2020071558W WO2020244242A1 WO 2020244242 A1 WO2020244242 A1 WO 2020244242A1 CN 2020071558 W CN2020071558 W CN 2020071558W WO 2020244242 A1 WO2020244242 A1 WO 2020244242A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- storage
- device group
- performance device
- blockchain
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0647—Migration mechanisms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0683—Plurality of storage devices
- G06F3/0685—Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays
Definitions
- the embodiments of this specification relate to the field of information technology, and in particular, to a blockchain data storage method and device.
- each node in the blockchain network needs to store consistent blockchain data.
- the node can choose to use distributed storage to meet the needs of massive blockchain data storage.
- the distributed storage mode means that the data that needs to be stored is stored on multiple storage devices, and multiple storage devices are used to share the storage load.
- the storage medium of some storage devices that belong to the node may be a hard disk drive (HDD), while other storage devices may be solid state drives ( Solid State Drives, SSD).
- HDD hard disk drive
- SSD Solid State Drives
- a blockchain data storage method based on distributed storage is provided.
- multiple storage devices deployed for the node are divided into high-performance devices Group and low-performance device group, wherein the storage medium of each storage device in the high-performance device group is a solid-state hard disk, and the storage medium of each storage device in the low-performance device group is a mechanical hard disk;
- the method includes:
- the node When the node obtains the block chain data to be stored, it allocates the block chain data to be stored to the high-performance device group for storage;
- the expired blockchain data is transferred from the high-performance device group to the low-performance device group for storage; the expired blockchain data is the time period stored in the high-performance device group is greater than the preset time length Blockchain data.
- a blockchain data storage device based on distributed storage is provided, the device being any node of a blockchain network;
- the multiple storage devices to be deployed in the apparatus are divided into a high-performance device group and a low-performance device group, where the storage medium of each storage device in the high-performance device group is a solid-state hard disk, and the low-performance device group
- the storage medium of each storage device in is a mechanical hard disk
- the device includes:
- the transfer storage module transfers expired blockchain data from the high-performance device group to the low-performance device group for storage; the expired blockchain data is that the time period stored in the high-performance device group is greater than Blockchain data of preset duration.
- a blockchain data storage system based on distributed storage including a blockchain network composed of multiple nodes and multiple node devices deployed for each node;
- the multiple storage devices are divided into a high-performance device group and a low-performance device group, where the storage medium of each storage device in the high-performance device group is a solid state Hard disk, the storage medium of each storage device in the low-performance device group is a mechanical hard disk;
- any node of the blockchain network obtains the blockchain data to be stored, allocate the blockchain data to be stored to the high-performance device group for storage; and store the expired blockchain data Transfer from the high-performance device group to the low-performance device group for storage; the expired blockchain data is the blockchain data stored in the high-performance device group for a duration greater than a preset duration.
- the technical solutions provided by the embodiments of this specification are directed to any node of the blockchain network, and multiple storage devices deployed for the node are divided into a high-performance device group and a low-performance device group.
- the storage medium of each storage device in the high-performance device group is a solid-state hard disk
- the storage medium of each storage device in the low-performance device group is a mechanical hard disk.
- the storage device which is the storage medium, is used for the storage of newly generated blockchain data, which can give full play to the high-performance advantages of solid state drives and increase the chain speed of blockchain data.
- the migration of expired blockchain data to low-performance device groups for storage that is, the use of lower-cost mechanical hard drives for storage of expired blockchain data, and storage allocation is also optimized.
- Figure 1 is a schematic diagram of an existing blockchain data storage method
- Figure 2 is a schematic diagram of a blockchain data storage method provided by an embodiment of this specification.
- FIG. 3 is a schematic flowchart of a method for storing data on a blockchain according to an embodiment of this specification
- FIG. 4 is a schematic structural diagram of a blockchain data storage device provided by an embodiment of this specification.
- Fig. 5 is a schematic structural diagram of a computer device used to configure the apparatus in the embodiments of this specification.
- FIG 1 is a schematic diagram of an existing blockchain data storage method.
- the blockchain network consists of nodes 1 to 4.
- nodes 1 to 3 are similar
- 5 storage devices are deployed for node 4 so that node 4 can store the blockchain data generated by the blockchain network.
- the 5 storage devices there are 2 storage devices using SSD as the storage medium, and 3 storage devices using HDD as the storage medium.
- node 4 obtains the blockchain data to be stored, it needs to fragment the blockchain data (divide into 5 data fragments), and then store each data fragment in 5 storage devices.
- the speed of blockchain data uploading can be improved by improving the performance utilization of existing storage devices using SSD as storage media.
- Fig. 2 is a schematic diagram of a blockchain data storage method provided by an embodiment of this specification. As shown in Figure 2, multiple existing storage devices can be grouped, and the storage devices using SSD as the storage medium can be used to store the blockchain data to be stored, and the expired blockchain data (already Blockchain data that has been stored for a period of time) is transferred to a storage device using HDD as the storage medium for storage.
- multiple existing storage devices can be grouped, and the storage devices using SSD as the storage medium can be used to store the blockchain data to be stored, and the expired blockchain data (already Blockchain data that has been stored for a period of time) is transferred to a storage device using HDD as the storage medium for storage.
- the SSD storage device can store and write the newly generated blockchain data on the chain as soon as possible; for the blockchain data that has been stored for a period of time, it is transferred to the HDD The storage device performs storage to free up valuable SSD storage space for writing more newly generated blockchain data.
- Fig. 3 is a schematic flowchart of a blockchain data storage method provided by an embodiment of this specification, including the following steps:
- the multiple storage devices deployed for that node are divided into a high-performance device group and a low-performance device group, wherein each of the high-performance device groups
- the storage medium of each storage device is a solid state hard disk SSD
- the storage medium of each storage device in the low-performance device group is a mechanical hard disk HDD.
- the multiple storage devices deployed for the node include not only a storage device with at least one storage medium being an SSD, but also a storage device with at least one storage medium being an HDD.
- the purpose of the present invention is to increase the chain speed of newly generated blockchain data under the premise of fixed cost, that is, without adding storage devices. This requires improving the performance utilization of storage devices with SSDs as storage media, and using SSDs to store newly generated blockchain data to prevent the high-speed data read and write performance supported by SSDs from being idle.
- data writing refers to storing data in the hard disk of the storage device, or modifying the data stored in the hard disk of the storage device, or modifying the data stored in the hard disk of the storage device.
- delete refers to reading out the data stored in the hard disk of the storage device.
- the higher data read and write speed of SSD means that the efficiency of storing data in storage devices that use SSD as hard disk is higher, and the efficiency of modifying data stored in storage devices that use SSD as hard disk is higher. The efficiency of the data stored in the storage device of the hard disk is also higher.
- the node obtains the blockchain data to be stored, which can specifically be obtained by obtaining the block to be published to the blockchain and the usage determined based on the block.
- the state update data used to update the state of the blockchain world is used as the blockchain data to be stored.
- the blockchain data to be stored may also only include the blocks to be published to the blockchain.
- the node stores the block locally, which means publishing the block to the blockchain.
- each storage device in the high-performance device group is an SSD, it can support the high-speed writing of blockchain data and complete the persistent storage of blockchain data as soon as possible.
- S302 Transfer expired blockchain data from the high-performance device group to the low-performance device group for storage.
- the storage space that can be provided is also limited. Therefore, with the accumulation of blockchain data, the limited SSD storage space is not enough to store more blockchain data. For this reason, in the embodiment of this specification, the block chain data stored in the high-performance device group with a duration greater than the preset duration is used as the expired block chain data, and the expired block chain data is migrated to the low-performance device Group for storage.
- the expired blockchain data Since the expired blockchain data has been published to the blockchain, it cannot be deleted or modified, and the frequency of reading expired blockchain data is not high. Therefore, the expired blockchain data does not need to occupy precious SSD Storage space. Migrate expired blockchain data to HDD storage space for storage, which can optimize storage configuration.
- a node can trigger the transfer and storage of expired blockchain data whenever a specified condition is met.
- the node may determine expired blockchain data from the blockchain data stored in the high-performance device group every time a specified period has elapsed, and send the determined expired blockchain data from the high-performance device The group is transferred to the low-performance device group for storage.
- the read frequency of recently written blockchain data is greater than the read frequency of expired blockchain data.
- the nodes in the blockchain network will store the transfer records of each transfer and the changes in the account balances of the two users making the transfer as blockchain data. For each transfer, users generally check the transfer record shortly after the transfer occurs to ensure that the transfer is successful; users generally rarely check the transfer record after the transfer takes a long time.
- the recent blockchain data is stored in the high-performance device group, so that users can read in the blockchain data at high speed; the expired blockchain data is stored in the low-performance device group, If you occasionally need to read out-of-date blockchain data, then a lower data read speed is acceptable in practice.
- FIG. 4 is a schematic structural diagram of a blockchain data storage device provided by an embodiment of this specification, and the device is any node of a blockchain network;
- the multiple storage devices to be deployed in the apparatus are divided into a high-performance device group and a low-performance device group, where the storage medium of each storage device in the high-performance device group is a solid-state hard disk, and the low-performance device group
- the storage medium of each storage device in is a mechanical hard disk
- the device includes:
- the transfer storage module 402 transfers expired blockchain data from the high-performance device group to the low-performance device group for storage; the expired blockchain data is the length of time stored in the high-performance device group Blockchain data longer than the preset duration.
- the initialization storage module 401 obtains the block to be published to the blockchain and the state update data determined based on the block for updating the world state of the blockchain as the block chain data to be stored.
- the transfer storage module 402 determines expired blockchain data from the blockchain data stored in the high-performance device group every time a specified period has elapsed, and removes the determined expired blockchain data from the The high-performance device group is transferred to the low-performance device group for storage.
- the preset duration is positively correlated with the number of storage devices in the high-performance device group.
- a blockchain data storage system including a blockchain network composed of multiple nodes and multiple node devices deployed for each node;
- the multiple storage devices are divided into a high-performance device group and a low-performance device group, where the storage medium of each storage device in the high-performance device group is a solid state Hard disk, the storage medium of each storage device in the low-performance device group is a mechanical hard disk;
- any node of the blockchain network obtains the blockchain data to be stored, allocate the blockchain data to be stored to the high-performance device group for storage; and store the expired blockchain data Transfer from the high-performance device group to the low-performance device group for storage; the expired blockchain data is the blockchain data stored in the high-performance device group for a duration greater than a preset duration.
- the embodiments of this specification also provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method shown in FIG. 3 when the program is executed.
- FIG. 5 shows a more specific hardware structure diagram of a computing device provided by an embodiment of this specification.
- the device may include a processor 1410, a memory 1420, an input/output interface 1430, a communication interface 1440, and a bus 1450.
- the processor 1410, the memory 1420, the input/output interface 1430, and the communication interface 1440 realize the communication connection between each other in the device through the bus 1450.
- the processor 1410 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for execution related Program to implement the technical solutions provided in the embodiments of this specification.
- a general-purpose CPU Central Processing Unit, central processing unit
- microprocessor microprocessor
- application specific integrated circuit Application Specific Integrated Circuit, ASIC
- ASIC Application Specific Integrated Circuit
- the memory 1420 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc.
- the memory 1420 may store an operating system and other application programs. When the technical solutions provided in the embodiments of the present specification are implemented through software or firmware, related program codes are stored in the memory 1420 and called and executed by the processor 1410.
- the input/output interface 1430 is used to connect an input/output module to realize information input and output.
- the input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions.
- the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
- the communication interface 1440 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices.
- the communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
- the bus 1450 includes a path to transmit information between various components of the device (for example, the processor 1410, the memory 1420, the input/output interface 1430, and the communication interface 1440).
- the above device only shows the processor 1410, the memory 1420, the input/output interface 1430, the communication interface 1440, and the bus 1450, in the specific implementation process, the device may also include the necessary equipment for normal operation. Other components.
- the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of the present specification, rather than all the components shown in the figures.
- the embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the function of the method shown in FIG. 3 is realized.
- Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
- the information can be computer-readable instructions, data structures, program modules, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
- a typical implementation device is a computer.
- the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
公开了一种区块链数据存储方法及装置。针对区块链网络的任一节点,将为该节点部署的多个存储设备划分为高性能设备组和低性能设备组。高性能设备组中的每个存储设备的存储介质是固态硬盘,低性能设备组中的每个存储设备的存储介质是机械硬盘。对于待存储的区块链数据,该节点会将其分配给高性能设备组进行存储;而对于已经存储了一段时间的过期的区块链数据,该节点会将其由高性能设备组转移至低性能设备组进行存储。
Description
本说明书实施例涉及信息技术领域,尤其涉及一种区块链数据存储方法及装置。
众所周知,区块链网络中的各节点需要分别存储一致的区块链数据。对于区块链网络中的任一节点而言,该节点可以选择采用分布式存储方式,以满足海量区块链数据存储的需求。其中,分布式存储方式是指将需要存储的数据分散存储在多台存储设备上,利用多台存储设备分担存储负荷。
在实践中,以区块链网络中的任一节点为例,从属于该节点的有些存储设备的存储介质可能是机械硬盘(Hard Disk Drive,HDD),而另一些存储设备可能是固态硬盘(Solid State Drives,SSD)。采用HDD的成本较低,但是数据读写速度也较慢;采用SSD的成本较高,但是数据读写速度也较快。
基于现有技术,需要一种更高效的区块链数据存储方法。
发明内容
为了解决现有的区块链数据存储方法比较低效的问题,本说明书实施例提供一种区块链数据存储方法及装置,技术方案如下:
根据本说明书实施例的第1方面,提供一种基于分布式存储的区块链数据存储方法,针对区块链网络的任一节点,将为该节点部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;
所述方法包括:
该节点当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;
以及
将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述 过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
根据本说明书实施例的第2方面,提供一种基于分布式存储的区块链数据存储装置,所述装置为区块链网络的任一节点;
将为所述装置部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;
所述装置包括:
初始化存储模块,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;
转移存储模块,将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
根据本说明书实施例的第3方面,提供一种基于分布式存储的区块链数据存储系统,包括由多个节点组成的区块链网络以及为每个节点部署的多个节点设备;
针对所述区块链网络的任一节点,将所述多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;
所述区块链网络的任一节点,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;以及将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
本说明书实施例所提供的技术方案,针对区块链网络的任一节点,将为该节点部署的多个存储设备划分为高性能设备组和低性能设备组。高性能设备组中的每个存储设备的存储介质是固态硬盘,低性能设备组中的每个存储设备的存储介质是机械硬盘。对于待存储的区块链数据,该节点会将其分配给高性能设备组进行存储;而对于已经存储了一段时间的过期的区块链数据,该节点会将其由高性能设备组转移至低性能设备组进行存储。
通过本说明书实施例,由于一方面,新产生的区块链数据需要尽快存储(即尽快发 布至区块链),另一方面,固态硬盘的数据写入速度较快,因此,将以固态硬盘为存储介质的存储设备集中用于新产生的区块链数据的存储,可以充分发挥固态硬盘的高性能优势,提升区块链数据的上链速度。此外,将过期的区块链数据迁移至低性能设备组进行存储,也即将成本较低的机械硬盘用于过期的区块链数据的存储,也优化了存储分配。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要通过的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。
图1是现有的区块链数据存储方法的示意图;
图2是本说明书实施例提供的区块链数据存储方法的示意图;
图3是本说明书实施例提供的一种区块链数据存储方法的流程示意图;
图4是本说明书实施例提供的一种区块链数据存储装置的结构示意图;
图5是用于配置本说明书实施例装置的一种计算机设备的结构示意图。
图1是现有的区块链数据存储方法的示意图。如图1所示,区块链网络由节点1~4组成。以节点4为例(节点1~3类似),为节点4部署5个存储设备,以便节点4存储区块链网络产生的区块链数据。5个存储设备中,有2个以SSD为存储介质的存储设备,有3个以HDD为存储介质的存储设备。节点4当获取到待存储的区块链数据时,需要对区块链数据进行分片(分成5个数据碎片),然后将各数据碎片分别存储于5个存储设备。
继续参见图1,显然,以SSD为存储介质的存储设备写入数据碎片的速度较快,而以HDD为存储介质的存储设备写入数据碎片的速度较慢。在实践中,在存储成本固定 (即不增加以SSD为存储介质的存储设备)的前提下,提升区块链数据上链的速度,是个丞待解决的技术问题。
在存储成本固定的前提下,为解决上述技术问题,可以通过提升对已有的以SSD为存储介质的存储设备的性能利用率,来提升区块链数据上链的速度。
图2是本说明书实施例提供的区块链数据存储方法的示意图。如图2所示,可以将已有的多个存储设备进行分组,将以SSD为存储介质的存储设备集中用于待存储的区块链数据的存储,而将过期的区块链数据(已经被存储了一段时间的区块链数据)转移给以HDD为存储介质的存储设备继续存储。
也就是说,对于新产生的区块链数据,仅由SSD存储设备进行存储写入,使得新产生的区块链数据尽快上链;对于被存储了一段时间的区块链数据,转移至HDD存储设备进行存储,以便腾出宝贵的SSD存储空间,用于写入更多新产生的区块链数据。
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。
以下结合附图,详细说明本说明书各实施例提供的技术方案。
图3是本说明书实施例提供的一种区块链数据存储方法的流程示意图,包括如下步骤:
S300:针对区块链网络的任一节点,该节点当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储。
在本说明书实施例中,针对区块链网络的任一节点,将为该节点部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘SSD,所述低性能设备组中的每个存储设备的存储介质为机械硬盘HDD。
需要说明的是,为该节点部署的多个存储设备中既包括至少一个存储介质为SSD的存储设备,也包括至少一个存储介质为HDD的存储设备。而本发明的目的在于,在成本固定的前提下,即在不再增加存储设备的前提下,提升新产生的区块链数据的上链速度。这就需要提升对存储介质为SSD的存储设备的性能利用率,将SSD集中用于存储新产生的区块链数据,避免SSD所支持的高速数据读写性能被闲置。
需要说明的是,在本文中,数据写入是指将数据存储于存储设备的硬盘中,或者,对存储设备的硬盘中存储的数据进行修改,或者,对存储设备的硬盘中存储的数据进行删除。数据读取是指将存储设备的硬盘中存储的数据读取出来。SSD的数据读写速度较高,意味着将数据存储于以SSD为硬盘的存储设备的效率较高,对以SSD为硬盘的存储设备所存储的数据进行修改的效率较高,读取以SSD为硬盘的存储设备所存储的数据的效率也较高。
在本说明书实施例中,针对区块链网络的任一节点,该节点获取待存储的区块链数据,具体可以是获取待发布至区块链的区块与基于所述区块确定的用于对区块链世界状态进行更新的状态更新数据,作为待存储的区块链数据。此外,在有些场景下,待存储的区块链数据也可以仅包括待发布至区块链的区块。
在实际应用中,节点将区块存入本地,就意味着将区块发布至区块链。区块发布至区块链的速度越快,就可以越早向用户反馈确定性的业务处理结果。
由于高性能设备组中的每个存储设备的存储介质都是SSD,因此,可以支持区块链数据的高速写入,可以尽快完成区块链数据的持久化存储。
S302:将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储。
由于SSD的成本较高,可以提供的存储空间也是有限的。因此,随着区块链数据的累积,有限的SSD存储空间不足以存储更多的区块链数据。为此,在本说明书实施例中,将存储于所述高性能设备组的时长大于预设时长的区块链数据作为过期的区块链数据,将过期的区块链数据迁移到低性能设备组进行存储。
其中,高性能设备组中存储设备的数量越多,说明SSD存储空间越大,可以存储的区块链数据就越多,这也就意味着,所述预设时长可以更长。
由于过期的区块链数据已经发布至区块链,不可被删除与修改,并且,读取过期的区块链数据的频率也不高,因此,过期的区块链数据没有必要占用宝贵的SSD存储空间,将过期的区块链数据迁移到HDD存储空间中进行存储,可以优化存储配置。
此外需要说明的是,在本说明书实施例中,节点可以每当满足指定条件时,触发对过期的区块链数据的转移存储。例如,节点可以每当经过指定周期时,从存储于所述高性能设备组的区块链数据中确定过期的区块链数据,并将确定的过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储。
通过图3所示的方法,由于一方面,新产生的区块链数据需要尽快存储(即尽快发 布至区块链),另一方面,固态硬盘的数据写入速度较快,因此,将以固态硬盘为存储介质的存储设备集中用于新产生的区块链数据的存储,可以充分发挥固态硬盘的高性能优势,提升区块链数据的上链速度。此外,将过期的区块链数据迁移至低性能设备组进行存储,也即将成本较低的机械硬盘用于过期的区块链数据的存储,也优化了存储分配。
此外,在实际应用中,一般而言,对近期写入的区块链数据的读取频率要大于对过期的区块链数据的读取频率。例如,在用户间转账的场景下,区块链网络中的节点会将每笔转账的转账记录以及进行转账的两个用户的账户余额的变动情况作为区块链数据进行存储。对于每笔转账而言,用户一般会在这笔转账发生不久后查看转账记录,以确保转账成功;用户一般很少在这笔转账发生较长时间后再查看转账记录。
因此,在本说明书实施例中,将近期的区块链数据存储于高性能设备组,以便用户可以高速读取进去的区块链数据;将过期的区块链数据存储于低性能设备组,如果偶尔需要读取过期的区块链数据,那么较低的数据读取速度在实践中也是可以接受的。
图4是本说明书实施例提供的一种区块链数据存储装置的结构示意图,所述装置为区块链网络的任一节点;
将为所述装置部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;
所述装置包括:
初始化存储模块401,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;
转移存储模块402,将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
所述初始化存储模块401,获取待发布至区块链的区块与基于所述区块确定的用于对区块链世界状态进行更新的状态更新数据,作为待存储的区块链数据。
所述转移存储模块402,每当经过指定周期时,从存储于所述高性能设备组的区块链数据中确定过期的区块链数据,并将确定的过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储。
所述预设时长与所述高性能设备组中存储设备的数量正相关。
一种区块链数据存储系统,包括由多个节点组成的区块链网络以及为每个节点部署的多个节点设备;
针对所述区块链网络的任一节点,将所述多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;
所述区块链网络的任一节点,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;以及将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图3所示方法的功能。
图5示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器1410、存储器1420、输入/输出接口1430、通信接口1440和总线1450。其中处理器1410、存储器1420、输入/输出接口1430和通信接口1440通过总线1450实现彼此之间在设备内部的通信连接。
处理器1410可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。
存储器1420可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1420可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1420中,并由处理器1410来调用执行。
输入/输出接口1430用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。
通信接口1440用于连接通信模块(图中未示出),以实现本设备与其他设备的通信 交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。
总线1450包括一通路,在设备的各个组件(例如处理器1410、存储器1420、输入/输出接口1430和通信接口1440)之间传输信息。
需要说明的是,尽管上述设备仅示出了处理器1410、存储器1420、输入/输出接口1430、通信接口1440以及总线1450,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图3所示方法的功能。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或 者这些设备中的任意几种设备的组合。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于方法和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。
Claims (10)
- 一种区块链数据存储方法,针对区块链网络的任一节点,将为该节点部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;所述方法包括:该节点当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;以及将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
- 如权利要求1所述的方法,获取待存储的区块链数据,具体包括:获取待发布至区块链的区块与基于所述区块确定的用于对区块链世界状态进行更新的状态更新数据,作为待存储的区块链数据。
- 如权利要求1所述的方法,将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储,具体包括:每当经过指定周期时,从存储于所述高性能设备组的区块链数据中确定过期的区块链数据,并将确定的过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储。
- 如权利要求1所述的方法,所述预设时长与所述高性能设备组中存储设备的数量正相关。
- 一种区块链数据存储装置,所述装置为区块链网络的任一节点;将为所述装置部署的多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;所述装置包括:初始化存储模块,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;转移存储模块,将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
- 如权利要求5所述的装置,所述初始化存储模块,获取待发布至区块链的区块与基于所述区块确定的用于对区块链世界状态进行更新的状态更新数据,作为待存储的区块链数据。
- 如权利要求5所述的装置,所述转移存储模块,每当经过指定周期时,从存储于所述高性能设备组的区块链数据中确定过期的区块链数据,并将确定的过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储。
- 如权利要求5所述的装置,所述预设时长与所述高性能设备组中存储设备的数量正相关。
- 一种区块链数据存储系统,包括由多个节点组成的区块链网络以及为每个节点部署的多个节点设备;针对所述区块链网络的任一节点,将所述多个存储设备划分为高性能设备组与低性能设备组,其中,所述高性能设备组中的每个存储设备的存储介质为固态硬盘,所述低性能设备组中的每个存储设备的存储介质为机械硬盘;所述区块链网络的任一节点,当获取到待存储的区块链数据时,将待存储的区块链数据分配给所述高性能设备组进行存储;以及将过期的区块链数据从所述高性能设备组转移至所述低性能设备组进行存储;所述过期的区块链数据为,存储于所述高性能设备组的时长大于预设时长的区块链数据。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1~4任一项所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/803,469 US20200192596A1 (en) | 2019-06-03 | 2020-02-27 | Blockchain data storage method and apparatus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910475986.0 | 2019-06-03 | ||
| CN201910475986.0A CN110362272A (zh) | 2019-06-03 | 2019-06-03 | 一种区块链数据存储方法及装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US16/803,469 Continuation US20200192596A1 (en) | 2019-06-03 | 2020-02-27 | Blockchain data storage method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020244242A1 true WO2020244242A1 (zh) | 2020-12-10 |
Family
ID=68215458
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/071558 Ceased WO2020244242A1 (zh) | 2019-06-03 | 2020-01-11 | 一种区块链数据存储方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110362272A (zh) |
| WO (1) | WO2020244242A1 (zh) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110362272A (zh) * | 2019-06-03 | 2019-10-22 | 阿里巴巴集团控股有限公司 | 一种区块链数据存储方法及装置 |
| CN113032484B (zh) * | 2021-03-16 | 2024-01-02 | 中国互联网络信息中心 | 一种基于区块链的数据系统拥塞管理方法及系统 |
| CN113641583B (zh) * | 2021-08-16 | 2025-01-14 | 拉扎斯网络科技(上海)有限公司 | 数据处理方法、装置、电子设备、存储介质及程序产品 |
| CN113961149B (zh) * | 2021-10-29 | 2024-01-26 | 国网江苏省电力有限公司营销服务中心 | 一种电力信息系统多态数据存储系统及存储方法 |
| CN114493602B (zh) * | 2022-04-08 | 2022-07-22 | 恒生电子股份有限公司 | 区块链交易的执行方法、装置、电子设备和存储介质 |
| CN115237344A (zh) * | 2022-07-14 | 2022-10-25 | Oppo广东移动通信有限公司 | 数据存储方法、装置、电子设备以及存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160259937A1 (en) * | 2015-03-02 | 2016-09-08 | Dell Products L.P. | Device reporting and protection systems and methods using a secure distributed transactional ledger |
| CN108519862A (zh) * | 2018-03-30 | 2018-09-11 | 百度在线网络技术(北京)有限公司 | 区块链系统的存储方法、装置、系统和存储介质 |
| CN109145053A (zh) * | 2018-08-01 | 2019-01-04 | 阿里巴巴集团控股有限公司 | 数据处理方法和装置、客户端、服务器 |
| CN109144414A (zh) * | 2018-07-27 | 2019-01-04 | 阿里巴巴集团控股有限公司 | 区块链数据的多级存储方法和装置 |
| CN109274752A (zh) * | 2018-10-10 | 2019-01-25 | 腾讯科技(深圳)有限公司 | 区块链数据的访问方法及装置、电子设备、存储介质 |
| CN109522366A (zh) * | 2018-11-12 | 2019-03-26 | 长沙创恒机械设备有限公司 | 一种基于区块链的数据处理方法、装置及计算机可读存储介质 |
| CN110362272A (zh) * | 2019-06-03 | 2019-10-22 | 阿里巴巴集团控股有限公司 | 一种区块链数据存储方法及装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109101514A (zh) * | 2017-06-21 | 2018-12-28 | 北京国双科技有限公司 | 数据导入方法及装置 |
| US10296258B1 (en) * | 2018-03-09 | 2019-05-21 | Pure Storage, Inc. | Offloading data storage to a decentralized storage network |
| CN109165221A (zh) * | 2018-08-16 | 2019-01-08 | 北京京东尚科信息技术有限公司 | 区块链的数据存储方法、装置、区块链节点及存储介质 |
-
2019
- 2019-06-03 CN CN201910475986.0A patent/CN110362272A/zh active Pending
-
2020
- 2020-01-11 WO PCT/CN2020/071558 patent/WO2020244242A1/zh not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160259937A1 (en) * | 2015-03-02 | 2016-09-08 | Dell Products L.P. | Device reporting and protection systems and methods using a secure distributed transactional ledger |
| CN108519862A (zh) * | 2018-03-30 | 2018-09-11 | 百度在线网络技术(北京)有限公司 | 区块链系统的存储方法、装置、系统和存储介质 |
| CN109144414A (zh) * | 2018-07-27 | 2019-01-04 | 阿里巴巴集团控股有限公司 | 区块链数据的多级存储方法和装置 |
| CN109145053A (zh) * | 2018-08-01 | 2019-01-04 | 阿里巴巴集团控股有限公司 | 数据处理方法和装置、客户端、服务器 |
| CN109274752A (zh) * | 2018-10-10 | 2019-01-25 | 腾讯科技(深圳)有限公司 | 区块链数据的访问方法及装置、电子设备、存储介质 |
| CN109522366A (zh) * | 2018-11-12 | 2019-03-26 | 长沙创恒机械设备有限公司 | 一种基于区块链的数据处理方法、装置及计算机可读存储介质 |
| CN110362272A (zh) * | 2019-06-03 | 2019-10-22 | 阿里巴巴集团控股有限公司 | 一种区块链数据存储方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110362272A (zh) | 2019-10-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020244242A1 (zh) | 一种区块链数据存储方法及装置 | |
| US10133484B2 (en) | Tier based data file management | |
| CN105637470B (zh) | 用于脏数据管理的方法和计算设备 | |
| CN113986134B (zh) | 存储数据的方法、读取数据的方法和装置 | |
| CN103500072A (zh) | 数据迁移方法及数据迁移装置 | |
| US20200042641A1 (en) | Distributed search framework with virtual indexing | |
| CN110046175A (zh) | 一种缓存更新、数据返回方法及装置 | |
| CN116483553A (zh) | 计算设备、数据处理方法、系统及相关设备 | |
| CN110347497B (zh) | 一种将多个存储设备划分设备组的方法及装置 | |
| CN115543965A (zh) | 跨机房数据处理方法、设备、存储介质及程序产品 | |
| US11347778B2 (en) | Scale-out indexing for a distributed search engine | |
| CN108959313A (zh) | 面向海量小文件的并发处理方法、装置和存储介质 | |
| US12210883B1 (en) | Accelerating windows fast startup for dram-less SSD | |
| CN111913807A (zh) | 一种基于多个存储区域的事件处理方法、系统及装置 | |
| WO2021082877A1 (zh) | 访问固态硬盘的方法及装置 | |
| CN113127438B (zh) | 用于存储数据的方法、装置、服务器和介质 | |
| CN110704334A (zh) | 一种重要产品数据管理的方法、系统及设备 | |
| US12093528B2 (en) | System and method for managing data access in distributed systems | |
| JP7323769B2 (ja) | ストレージ装置、ストレージシステムおよびプログラム | |
| CN107656702A (zh) | 加速硬盘读写的方法及其系统、以及电子设备 | |
| US11354055B2 (en) | Method and device for dividing storage devices into device groups | |
| CN113297232A (zh) | 一种基于数据库分区的数据更新方法、装置及系统 | |
| JP6377304B1 (ja) | データ書き込み装置及び方法 | |
| HK40016249A (zh) | 一种区块链数据存储方法及装置 | |
| US20200192596A1 (en) | Blockchain data storage method and apparatus |
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: 20819295 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: 20819295 Country of ref document: EP Kind code of ref document: A1 |