Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A block chain data-based offline synchronization method and device

A synchronization device and blockchain technology, applied in the blockchain field, can solve the problems of inconvenient data statistics, speed up block data query and statistics, blockchain inconvenience, etc., and achieve the effect of reducing operations and speeding up query and statistics

Inactive Publication Date: 2019-04-02
浙江华信区块链科技服务有限公司
View PDF6 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In order to solve the technical problem that the block chain is not convenient for data interval query and data statistics, the purpose of the present invention is to provide a method and device for synchronizing block chain data to the off-chain database, so as to accelerate block data Query and statistics

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
  • A block chain data-based offline synchronization method and device
  • A block chain data-based offline synchronization method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0039] This embodiment provides a specific implementation process of a downlink synchronization method based on blockchain data, such as figure 1 shown, including the following steps:

[0040] Before program execution, it is necessary to create corresponding tables in the database according to the block data to be synchronized, and create indexes according to business needs. In this embodiment, the block chain has block data, transaction data, and log data. Using the MySQL database, create block tables, transaction tables, and log tables, and give the field hash and number of the block table, and the hash and block_number of the transaction table field, the address field of the account table, the block_number field of the log table plus an index, the index type is ordinary index, and the index method is BTREE. The choice of database and the method of indexing are not limited.

[0041] Step 1: Read block data.

[0042] Specifically, the program establishes a connection with ...

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 invention discloses a block chain data-based offline synchronization method and device. The synchronization method comprises the following steps of (1) creating a data table corresponding to a block chain data structure in an offline database, and adding an index to the data table according to a service demand; (2) reading block data in the block chain; (3) analyzing the read block data, and decomposing the block data into corresponding element object groups according to service functions; (4) inserting the data in the one or more object groups into corresponding data tables in an offlinedatabase in sequence; (5) monitoring the updating of the block chain data, and synchronizing the newly added block data on the block chain to the offline database; and then updating the confirmation state of the unconfirmed block data in the offline database. According to the invention, when the blockchain data needs to be queried, the operation on blockchain nodes is reduced, the dimensions of data query and statistics are increased, and the execution speed of the query and statistics operations is greatly improved.

Description

technical field [0001] The present invention relates to the technical field of block chains, in particular to a method and device for synchronizing block chain data to an off-chain database to speed up data query and statistics. Background technique [0002] The blockchain-based business data storage structure is a document-type database of key-value pairs. If the key is known, the query speed is fast and convenient, but there are also the following problems: (1) When searching for the range of the key, only the range can be cycled, and only one key can be obtained on the blockchain each time For example, to find the key data from 1 to 10, you need to do 10 query operations; (2) When you need to make statistics on a certain value, you can only traverse all the data. At the same time, if you don't know the key, you can only traverse all the data to determine whether the data can be found. [0003] The existence of the above problems makes the application developed based on ...

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): G06F16/23G06F16/27G06F16/22
Inventor 刘驭雨范晓洋闫洪坤
Owner 浙江华信区块链科技服务有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products