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 dat

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

Example Embodiment

[0026] Example one

[0027] Figure 1A This is a flowchart of a blockchain data storage method provided in the first embodiment of the present invention. This embodiment is suitable for LSM-Tree-based database storage engines, such as LevelDB storage engines or RocksDB storage engines, to perform blockchain data In order to facilitate the description of the storage situation, the following takes the LevelDB storage engine as an example. The solution of the embodiment of the present invention is applied to nodes in a 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 software and / or hardware, and can be integrated In the computing device that carries the blockchain network node. 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 ...

Example Embodiment

[0041] Example two

[0042] figure 2 This is a flowchart of a blockchain data storage method provided in the second embodiment of the present invention. This embodiment is further optimized on the basis of the above-mentioned embodiment. See figure 2 , The method specifically includes:

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

[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 writing the same transaction request data. Disk write conditions refer to the preset conditions for transaction data in the memory to reach the disk storage threshold; the storage threshold is preset and can be modi...

Example Embodiment

[0058] Example three

[0059] image 3 This is a flowchart of a blockchain data storage method provided in the third embodiment of the present invention. On the basis of the foregoing embodiment, this embodiment further compares the number of the SST disk storage file to be written and the current SST file storage The number of directory paths and the number of directories to be written into the SST file are explained. 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, the number of new current directory paths is determined according to the number of current directory paths and the number of expanded directory paths.

[0061] Among them, 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 expanded directory paths is M, then t...

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