Block-chain data storage method, device, equipment and medium

A data storage and blockchain technology, applied in the blockchain field, can solve the problems of different operation data storage states, the inability to guarantee the atomicity of blockchain transaction writing, and the inability to achieve dynamic expansion, etc., to ensure atomicity Effect

Active Publication Date: 2018-12-25
BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF8 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, the disadvantage of dividing multiple KV instances at the application layer is that different KV instances are independent, and the atomicity of writing blockchain transactions cannot be guaranteed. There may be different storage states of different operation data of a transaction.
There are two disadvantages of the disk array method: first, the software array solution only supports a maximum storage capacity of 16TB; second, the disk array solution cannot dynamically expand capacity, and needs to stop the service and redo the disk array

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Block-chain data storage method, device, equipment and medium
  • Block-chain data storage method, device, equipment and medium
  • Block-chain data storage method, device, equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0027] Figure 1A It is a flow chart of a blockchain data storage method provided by Embodiment 1 of the present invention. This embodiment is applicable to a storage engine of a LSM-Tree-based database, such as a LevelDB storage engine or a RocksDB storage engine, to store blockchain data For the storage situation, in order to facilitate the description, the LevelDB storage engine will be used as an example to illustrate. The solution of the embodiment of the present invention is applied to the nodes in the blockchain network. The method can be executed by the blockchain data storage device provided by the embodiment of the present invention. The device can be implemented in the form of software and / or hardware, and can be integrated In computing devices that host blockchain network nodes. see Figure 1A , the method specifically includes:

[0028] S110. Determine the directory number of the SST file to be written according to the number of the SST file to be written and the...

Embodiment 2

[0042] figure 2 It is a flow chart of a blockchain data storage method provided by Embodiment 2 of the present invention. This embodiment is further optimized on the basis of the foregoing embodiments. see figure 2 , the method specifically includes:

[0043] S210, if it is detected that the transaction data stored in the internal memory of the local node satisfies the writing condition, generate an SST file to be written; or, generate an SST file to be written in response to a reconstruction operation on a pre-stored SST file.

[0044] Among them, the transaction data stored in the memory is formed by packing each group of transaction data associated with the same transaction request into the same batch, so as to ensure the atomicity of data writing in the same transaction request. Disk write condition refers to the pre-set condition that the transaction data in the memory reaches the storage threshold for writing to the disk; the storage threshold is preset and can be mo...

Embodiment 3

[0059] image 3 It is a flow chart of a blockchain data storage method provided by Embodiment 3 of the present invention. On the basis of the above embodiments, this embodiment further analyzes the number of storage files to be written to the SST disk and the current value of the SST file that can be stored. The number of directory paths, which determines the number of the directory to be written into the SST file for explanation. see image 3 , the method specifically includes:

[0060] S310, if it is detected that the directory path that can store the SST file is expanded, then determine a new number of current directory paths according to the number of current directory paths and the number of expanded directory paths.

[0061] Wherein, the expansion of the directory path refers to the increase of the directory path that can be used to store the SST file in the local node. Specifically, if the number of current directory paths is N, and the number of directory paths to b...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses a block chain data storage method, a device, equipment and a storage medium. The method is executed by a node in a block chain network. The method comprises the following steps: determining a directory number of the SST file to be written according to the number of the SST disk storage file to be written and the current directory path number of the SST file to be stored; the SST file to be written being stored in a directory path corresponding to the directory number by an atomic operation. The technical proposal provided by the embodiment of the invention guarantees the atomicity of the block chain data writing, and supports multi-disk storage of the block chain data by optimizing the bottom KV storage.

Description

technical field [0001] Embodiments of the present invention relate to the technical field of blockchain, and in particular, to a blockchain data storage method, device, equipment, and storage medium. Background technique [0002] Blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. [0003] In a conventional blockchain network, blocks are continuously created by block generation nodes and added to the end of the blockchain to form a blockchain. Once a block is added to the chain, it cannot be deleted or modified. Therefore, as time goes by, more and more data on the blockchain will become impossible to store on a single disk. At present, the mainstream blockchain public chains: Bitcoin and Ethereum all need hundreds of GB of storage space for all nodes, and the scale increases by several GB every day. [0004] Among the commonly used existing technologie...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
Inventor 孙君意肖伟
Owner BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products