CN110489495A - A kind of block chain snapshot production method based on modification collection - Google Patents

A kind of block chain snapshot production method based on modification collection Download PDF

Info

Publication number
CN110489495A
CN110489495A CN201911000289.6A CN201911000289A CN110489495A CN 110489495 A CN110489495 A CN 110489495A CN 201911000289 A CN201911000289 A CN 201911000289A CN 110489495 A CN110489495 A CN 110489495A
Authority
CN
China
Prior art keywords
snapshot
block
block chain
world state
collection
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.)
Pending
Application number
CN201911000289.6A
Other languages
Chinese (zh)
Inventor
邱炜伟
李伟
吴志强
梁秀波
尹可挺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
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 Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN201911000289.6A priority Critical patent/CN110489495A/en
Publication of CN110489495A publication Critical patent/CN110489495A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • General Factory Administration (AREA)

Abstract

The present invention discloses a kind of block chain Snapshot Method based on modification collection, is related to block chain technology, transaction execution field.This method specifically: record all status data changes in block chain implementation procedure first, obtain modification collection, later when needing to carry out snapshot, world state can be initialized, the modification of application block status data collects one by one according to block sequence, obtains final world state, calculate the Hash of final world state, it is compared with the Hash in corresponding block, unanimously then makes snapshot success, it is inconsistent, make snapshot failure.The present invention solves the problems, such as that traditional block chain can not carry out snapshot or snapshot operation limits very big, improves the availability and scalability of block chain, increases practicability.

Description

A kind of block chain snapshot production method based on modification collection
Technical field
The present invention relates to block chain technology, transaction execution field more particularly to a kind of block chain snapshots based on modification collection Production method.
Background technique
Block chain technology, block chain are a kind of novel decentralization agreements, can safely store digital cash transaction or its His data, information can not be forged and be distorted, and the trade confirmation on block chain is completed jointly by all nodes on block chain.And area The feature of block chain limit its data volume be can only be ever-increasing, and in order to guarantee availability, the expansibility of block chain, fastly According to being indispensable function.However current block catenary system does not support snapshot functions or snapshot functions more inflexible, This situation is unfavorable to the development of block chain.
Summary of the invention
In view of the deficiencies of the prior art, it is an object of the present invention to provide it is a kind of based on modification collection block chain Snapshot Method, It is able to ascend availability, the scalability of block chain, increases the practicality.
The present invention is achieved by the following technical solutions: a kind of block chain snapshot production method based on modification collection, should Method specifically comprises the following steps:
(1) in the implementation procedure of entire block chain, the change of all status datas is recorded, and by the change of all status datas Persistent storage obtains modification collection;
(2) when block chain receives snapshot request, judge whether snapshot target block number is legal, such as generated corresponding block Snapshot, it is as illegal, snapshot production failure;Snapshot as do not generated corresponding block, it is as legal, then carry out snapshot It generates;
(3) initialization world state is repaired according to block sequence using the block world state from first block to target block Change collection, obtains final world state;
(4) Hash for calculating final world state, compares with the Hash in corresponding block, and unanimously then snapshot is successful, Inconsistent then snapshot production failure.
Further, when step 2 receives snapshot request, if snapshot target block number is also not carried out, this is requested Caching, when block chain goes to this block, carries out the production of snapshot.
Further, when step 3 initialization world state, if having existed prefix area block number corresponding snapshot, i.e., The world state of corresponding block number is obtained using this snapshot, and the application block world state modification collection on this world state, obtain Obtain snapshot corresponding to target area block number.
Further, it needs to carry out unified brush using batch processing when application block world state modification collection in step 3 Enter.
Further, in entire block chain snapshot manufacturing process, snapshot request that persistence cannot be handled in time.
The beneficial effects of the present invention are: a kind of block chain Snapshot Method based on modification collection of the invention is executed in block chain In the process, it will block chain world state is changed in the execution that parsing trades and trades in virtual machine.In change procedure In, all changes are successively recorded, the modification collection of All Activity can be obtained.When making the snapshot of block chain, from block The original state of chain starts, and successively all world states of application modify collection, it will be able to obtain the world at any one time point State, so that the production of world state becomes simple controllable free.The present invention solve traditional block chain can not carry out snapshot or Person's snapshot operation limits very big problem, allows block catenary system during data are ever-increasing, does not need offline Carry out data snapshot, and can to any one block carry out snapshot production, improve block catenary system availability and can Scalability increases the practicality.
Detailed description of the invention
Fig. 1 is the flow chart of the block chain Snapshot Method of the invention based on modification collection.
Specific embodiment
Below according to attached drawing and preferred embodiment the present invention is described in detail, the objects and effects of the present invention will become brighter White, below in conjunction with drawings and examples, the present invention will be described in further detail.It should be appreciated that described herein specific Embodiment is only used to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, for a kind of flow chart of the block chain snapshot production method based on modification collection of the present invention, this method tool Body includes the following steps:
(1) in the implementation procedure of entire block chain, as unit of block, status data caused by All Activity in block is recorded Change, and the change record of these status datas (i.e. the old value of state and new value) is packaged, persistent storage is modified Collection.
(2) when block chain receives snapshot request, judge whether snapshot target block number is legal, such as generated corresponding The snapshot of block, as illegal, snapshot production failure;Snapshot as do not generated corresponding block, it is as legal, then it carries out fast According to generation.When receiving snapshot request, if snapshot target block number is also not carried out, this request is cached, block is worked as When chain goes to this block, then carry out the production of snapshot.
(3) when the snapshot there is no preposition block did not always carry out snapshot, world state is initialized, According to block sequence, collection is modified using the world state from first block to target block, obtains final world state.And such as When fruit has existed the snapshot of preposition block, then the world state of corresponding block number is obtained using this snapshot, and on this basis Collection is modified using the world state of subsequent block, to avoid whole applications to modification collection, improves the production of block chain snapshot Efficiency.When application block world state is modified and collected, need to carry out unified brush using batch processing to enter, to guarantee world's shape The atomicity of state.
(4) the identical world state Hash calculation method of use and normal blocks chain processing logic, such as Merkel tree or Increment Hash calculates the Hash of final world state, compares with the Hash in corresponding block, unanimously then snapshot is fabricated to Function, inconsistent then snapshot production failure.
In the implementation process of the block chain Snapshot Method entirely based on modification collection, need persistence that cannot handle in time Snapshot request, after preventing system failure from restarting, the loss of snapshot request guarantees the usage experience of user.
The block chain snapshot obtained by this method allows block catenary system during data are ever-increasing, is not required to Data snapshot can be carried out by wanting offline, and the production of snapshot can be carried out to any one block, improve block catenary system Availability and scalability, increase the practicality.
It will appreciated by the skilled person that being not used to limit the foregoing is merely the preferred embodiment of invention System invention, although invention is described in detail referring to previous examples, for those skilled in the art, still It can modify to the technical solution of aforementioned each case history or equivalent replacement of some of the technical features.It is all Within the spirit and principle of invention, modification, equivalent replacement for being made etc. be should be included within the protection scope of invention.

Claims (5)

1. a kind of block chain snapshot production method based on modification collection, which is characterized in that this method specifically comprises the following steps:
(1) in the implementation procedure of entire block chain, the change of all status datas is recorded, and by the change of all status datas Persistent storage obtains modification collection;
(2) when block chain receives snapshot request, judge whether snapshot target block number is legal, such as generated corresponding block Snapshot, it is as illegal, snapshot production failure;Snapshot as do not generated corresponding block, it is as legal, then carry out snapshot It generates;
(3) world state is initialized, according to block sequence, is modified using the world state from first block to target block Collection, obtains final world state;
(4) Hash for calculating final world state, compares with the Hash in corresponding block, unanimously then makes snapshot success, It is inconsistent, make snapshot failure.
2. block chain snapshot production method according to claim 1, which is characterized in that when step 2 receives snapshot request, if Snapshot target block number is also not carried out, then caches this request, when block chain goes to this block, carry out the system of snapshot Make.
3. block chain snapshot production method according to claim 1, which is characterized in that when step 3 initializes world state, such as When fruit has existed prefix area block number corresponding snapshot, i.e., the world state of corresponding block number is obtained using this snapshot, and herein Application block world state modification collection, obtains snapshot corresponding to target area block number on world state.
4. according to claim 1 or the 3 block chain snapshot production methods, which is characterized in that application block world shape in step 3 When state modification collection, need to carry out unified brush using batch processing to enter.
5. block chain snapshot production method according to claim 1, which is characterized in that in entire block chain snapshot manufacturing process In, snapshot request that persistence cannot be handled in time.
CN201911000289.6A 2019-10-21 2019-10-21 A kind of block chain snapshot production method based on modification collection Pending CN110489495A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911000289.6A CN110489495A (en) 2019-10-21 2019-10-21 A kind of block chain snapshot production method based on modification collection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911000289.6A CN110489495A (en) 2019-10-21 2019-10-21 A kind of block chain snapshot production method based on modification collection

Publications (1)

Publication Number Publication Date
CN110489495A true CN110489495A (en) 2019-11-22

Family

ID=68544728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911000289.6A Pending CN110489495A (en) 2019-10-21 2019-10-21 A kind of block chain snapshot production method based on modification collection

Country Status (1)

Country Link
CN (1) CN110489495A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737276A (en) * 2020-07-17 2020-10-02 支付宝(杭州)信息技术有限公司 Method and system for modifying block chain data
CN112988469A (en) * 2021-04-27 2021-06-18 支付宝(杭州)信息技术有限公司 State backup method and device in alliance chain and electronic equipment
CN113994324A (en) * 2020-10-27 2022-01-28 支付宝(杭州)信息技术有限公司 Block chain system with efficient world state data structure

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897352A (en) * 2016-12-29 2017-06-27 北京瑞卓喜投科技发展有限公司 The generation method and system of the block chain modified in expansion
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing
CN108023896A (en) * 2017-12-28 2018-05-11 江苏通付盾科技有限公司 Block synchronous method and system
CN108241743A (en) * 2018-01-04 2018-07-03 杭州复杂美科技有限公司 A kind of block chain Snapshot Method
CN109886690A (en) * 2019-03-06 2019-06-14 上海共链信息科技有限公司 A kind of method that block chain synchronizes account book

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897352A (en) * 2016-12-29 2017-06-27 北京瑞卓喜投科技发展有限公司 The generation method and system of the block chain modified in expansion
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing
CN108023896A (en) * 2017-12-28 2018-05-11 江苏通付盾科技有限公司 Block synchronous method and system
CN108241743A (en) * 2018-01-04 2018-07-03 杭州复杂美科技有限公司 A kind of block chain Snapshot Method
CN109886690A (en) * 2019-03-06 2019-06-14 上海共链信息科技有限公司 A kind of method that block chain synchronizes account book

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737276A (en) * 2020-07-17 2020-10-02 支付宝(杭州)信息技术有限公司 Method and system for modifying block chain data
CN111737276B (en) * 2020-07-17 2020-12-04 支付宝(杭州)信息技术有限公司 Method and system for modifying block chain data
CN113994324A (en) * 2020-10-27 2022-01-28 支付宝(杭州)信息技术有限公司 Block chain system with efficient world state data structure
WO2022087837A1 (en) * 2020-10-27 2022-05-05 Alipay (Hangzhou) Information Technology Co., Ltd. Blockchain system having efficient world state data structures
CN113994324B (en) * 2020-10-27 2022-07-05 支付宝(杭州)信息技术有限公司 Block chain system with efficient world state data structure
CN112988469A (en) * 2021-04-27 2021-06-18 支付宝(杭州)信息技术有限公司 State backup method and device in alliance chain and electronic equipment

Similar Documents

Publication Publication Date Title
CN110489495A (en) A kind of block chain snapshot production method based on modification collection
US10643147B2 (en) Coordinated version control system, method, and recording medium for parameter sensitive applications
EP2765524B1 (en) Data processing method and device in cluster system
JP5230645B2 (en) System and method for optimizing data set changes
CN109391645B (en) Block chain lightweight processing method, block chain node and storage medium
US11921687B2 (en) Similarity analysis using enhanced MinHash
CN108427538A (en) Storage data compression method, device and the readable storage medium storing program for executing of full flash array
JP2020522774A (en) Server, financial time-series data processing method, and storage medium
CN111262726B (en) Configuration information updating method and device and computer readable storage medium
US10268776B1 (en) Graph store built on a distributed hash table
US11677712B2 (en) Distributed domain name resolution and method for use of same
CN108829740A (en) Date storage method and device
CN111309976B (en) GraphX data caching method for convergence graph application
CN110147202A (en) A method of reducing block chain intelligence contract code storage volume
CN109358873A (en) A kind of application program update method, storage medium and terminal device
CN108280227A (en) Data information processing method based on caching and device
CN110941619A (en) Method for defining graph data storage model and structure for multiple use scenarios
CN111221639A (en) Block pipeline execution method of block chain platform
CN105917304A (en) Apparatus and method for de-duplication of data
CN107977504A (en) A kind of asymmetric in-core fuel management computational methods, device and terminal device
AU2020100180A4 (en) Effective Doubly-Accelerated Distributed Asynchronous Strategy for General Convex Optimization Problem
CN106850755A (en) Patrol and examine data processing method and system
EP3777047B1 (en) System and method for resource management and resource allocation in a self-optimizing network of heterogeneous processing nodes
CN110928839A (en) Storage method and system of international freight rate data
CN104636345A (en) Database reading and writing method based on distributed cache

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191122

RJ01 Rejection of invention patent application after publication