CN107103054B - A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain - Google Patents

A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain Download PDF

Info

Publication number
CN107103054B
CN107103054B CN201710234347.6A CN201710234347A CN107103054B CN 107103054 B CN107103054 B CN 107103054B CN 201710234347 A CN201710234347 A CN 201710234347A CN 107103054 B CN107103054 B CN 107103054B
Authority
CN
China
Prior art keywords
block
state
node
contract
executor
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.)
Active
Application number
CN201710234347.6A
Other languages
Chinese (zh)
Other versions
CN107103054A (en
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.)
Yunnan Innovation Institute of Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201710234347.6A priority Critical patent/CN107103054B/en
Publication of CN107103054A publication Critical patent/CN107103054A/en
Application granted granted Critical
Publication of CN107103054B publication Critical patent/CN107103054B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

The present invention provides a kind of intelligent contract asynchronous execution storage systems of privately owned block chain, comprising: execution state machine, the transaction processor of privately owned block chain execute state machine, can support the storage organization module of SCAM.Additionally provide a kind of implementation method of the intelligent contract asynchronous execution storage system of privately owned block chain.By system above and implementation method, the execution efficiency of intelligent contract is improved, intelligent contract is further increased as the safety that code on the chain of block chain executes and the consistency problem of intelligent contract code and text is addressed.

Description

A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain
Technical field
The present invention relates to a kind of intelligent contract technical fields, execute and storage more particularly to contract intelligent on block chain Systematical design idea method.
Background technique
Contract is the basis of economic activity in society, it is two aspects or several respects in common cooperation, in order to true The provision abided by jointly determining respective rights and duties and concluding.Contract defines target, content, time and the execution of transaction Agreement etc., and there is legal assurance, both sides or promise of meeting one's engagements in the state of trust or distrust in many ways, there is method can According to, have according to can seek.Contract is by normative commitment and executes contract process, to guarantee the orderly progress of transaction.Currently, people Class society develops to digital society, and virtual economy is the key activities of digital society, and a huge challenge is exactly will be real Middle people's economic activity is transferred to network virtual in the world.The concept of intelligent contract was mentioned in 1994 by Nick Szabo for the first time Out.Intelligent contract is the computable trade agreement program code that can execute agreement terms automatically, it and block chain (Blockchain) combination of technology forms the digital contract of value Transfer or code i.e. contract (Code as on sincere network A Contract), just becoming the important means that people maintain secure digital relationship in virtual world, is being future digital society Basic agreement, therefore the correlative study of intelligent contract is of great significance.
Intelligent Contract Theory almost occurs with Internet technology (World Wide Web) simultaneously, but application practice is always Theory is seriously lagged behind, is lacked the clear path of this theory transformation reality.Two aspect problems are mainly faced, first is that intelligence Energy contract does not have effective means to control physical assets, guarantees the execution of contract, as commodity by being stored in by vending machine Internal control property right, but computer program is difficult to control the assets in the real world such as cash, share;Second is that single Computer is it is difficult to ensure that execute these clauses to obtain the trust of contract side, contract side needs reliable explanation and executes code Trusted context, it can not check problematic computer in person, also can not directly observe and move with the execution for verifying other contract sides Make, third party is only allowed to audit the record that each side's contract executes.And the appearance of block chain technology solves these problems, establishes The basis of intelligent contract application, meanwhile, the application range of block chain has also been enlarged in intelligent contract.Block chain is fully digitalization money The record of production and transfer are laid a good foundation, and by the assets of fully digitalization, block chain is directly controlled to computer code offer The method of assets, so that intelligent contract has implementation capacity.On block chain, the control of assets is exactly to control the corresponding key of assets Permission, rather than any material object.Block chain makes computing system become trust system, it has been not limited only to the function of database Can, while still can execute code and record the distributed computer of digital asset ownership, digital asset ownership can To be uploaded and be stored in block chain, and according to instruction execution, once block chained record contract code, contract side Determine that contract will not be modified.2015 ether mill (Ethereum) block chain technology and intelligent Contract Theory are combined, design Programmable contract language and executable infrastructure are realized, the huge applications based on contract intelligent on block chain have been started Scene.In Ethereum, intelligent contract is stored in the script on block chain, in a distributed fashion by block chain node It executes, is equivalent to the executor of law during business transaction, supervision and management, regulation.Block chain with sequentially, safely, can verify that Mode guarantee the execution of contract.The behavior of lending for being related to user, car dealer and bank and formality compared to current complexity, Intelligent contract is the computer program that can execute agreement terms automatically, it can improve existing business model, prior It is that they may overturn existing business model, also greatly reduces the expense of third party intermediary.
But the existing intelligent contract technology based on block chain still has many problems not have also also in a primary stage There is solution, if execution efficiency is low, although Ethereum improves the publicly-owned chain algorithm of bit coin, it also requires 15 seconds/block, this Also it is unable to satisfy the demand of actual production;The safety problem that intelligent contract is executed as code on the chain of block chain;And intelligence Contract code and the consistency problem of text etc..Still have currently based on the design of the intelligent contract of block chain with technology and further grinds Study carefully and improved space, it is necessary to further intelligent contract technology of the research based on block chain.
The combination of block chain and intelligent contract is included in the speed of transaction to block chain and the scalability of intelligent contract all can It has an impact.The intelligent contract of current Ethereum, which executes model, reduces the speed that block chain is included in transaction.
Intelligent contract is exactly one section of code by negotiating, its execution should be distributed, observable and can verify that , code is deployed on sharing, duplication account book, it can maintain the state of oneself, the assets that draw oneself up (state, Assets are stored on account book as code), additionally it is possible to the external information received is responded.Intelligence contract is put Execute on block chain is exactly the consistency for guaranteeing contract implementing result using the consistency algorithm that block chain itself carries.
Fig. 1 is the principle schematic diagram of intelligent contract Yu block chain combination, wherein block chain is safe distributed data Library, intelligent contract promote the execution of contract with uniformity with user interface by agreement, observability, verifiability, improve oneself Property processed and access control.Code/program is stored in the form of text on different nodes, adds breakpoint to code/program, and right The program state of breakpoint carries out consistency checking, can only pass through the information space of message alteration program, contract and its state recording In block chain, the change of contract state intelligently passes through message and goes to trigger.
Summary of the invention
In view of this, the present invention devises intelligent contract asynchronous execution storage system and the realization side of a kind of privately owned block chain Method.
Firstly, providing a kind of intelligent contract asynchronous execution storage system of privately owned block chain, comprising: privately owned block chain is held Row state machine, transaction processor execute state machine, can support SCAM (Smart Contract Asynchronous Model, I.e. intelligent contract asynchronous execution model) storage organization module.
Preferably, using execution state machine MnodeThe execution state machine for indicating privately owned block chain in SCAM, is one five yuan Group (qnodemodenode,snode,Fnode), qnodeIt is the state set of privately owned block chain interior joint, ∑modeIt is input (thing Part) set, δnodeIt is the set of transfer function, snodeIt is original state, FnodeIt is the set of final stateAnd Fnode={ 1 }.
Preferably, using execution state machine MexecutorIt indicates that transaction processor executes state machine in SCAM, is one five yuan Group (qexecutor,∑executorexecutor,sexecutor,Fexecutor), qexecutorIt is the state set of transaction processor state machine. ∑executorIt is the set for inputting (event).δexecutorIt is the set of transfer function.sexecutorIt is initial state value, FexecutorEventually The only set of stateF hereinexecutor={ sexecutor}。
Preferably, the storage organization module that can support SCAM includes relevant database and kv (key- Value) database, the relevant database are used for memory block chain, and the kv database is used for the node of storage state tree, And for supported protocol, multiple variables are set in kv.
Preferably, the form that the relevant database is stored using block head table and two tables of transaction data table, Middle block head table is using block Hash as major key, and transaction data table is using Hash of trading as major key, at the same store transaction when It waits, increases a field for the block Hash where store transaction.
Preferably, the multiple variables being arranged in the kv include: 1) " State_root ", to indicate the shape of newest processing transaction State tree root;2) " State_height " indicates newest processing exchange in the height of block;3) " State_tx " is indicated newest Exchange is handled in the serial number of block;4) " State_latest " indicates the height of the newest processing of transaction processor;5) " block:i tran:j " indicates that record block height is i, state root and knot after the trading processing success of transaction serial number j Fruit;6) " blocktrans:* " indicates the key value of the transaction of block *;7) " Customs Assigned Number " indicates corresponding storage user information; 8) " calculate node " records the address list of block chain calculate node, as the contract account safeguarded jointly in many ways, when having When calculate node needs to update, it is necessary to the agreement Jing Guo most of management nodes could update, this ensure that update Synchronism;9) " third party's number ", for distributing permission to monitoring party;10) " contract number " stores the information of contract, including Code, contract state;11) " name registration ", for giving contract register name, convenient for inquiry.
Preferably, the transaction processor execution module provides bond service in the form of Services Composition, is divided into actuator For communicating with node, calculator Compute is handed over for calculating by Executor and calculator Compute, actuator Executor Easily, it is executed in order to which security consideration contract code execution part can be put into docker, the service of calculator Compute is in docker Starting, calculator Compute is responsible for executing contract code, and returns to calculated result and give actuator Executor, holds in docker Row is to guarantee that contract execution will not bring danger to node.
The present invention also provides a kind of implementation methods of the intelligent contract asynchronous execution storage system of privately owned block chain, including Step:
1) privately owned block chain execution module is established firstly, entering in firstTimeSetup;
2) while starting, using onMessage monitoring information, the monitoring information includes: reception new block NewBlock message, block ballot vote message, block storage recblock message and block request missingblock message;
3) receiveNewBlock function is entered when receiving new block, block is handled, first judges block Source and validity then vote to effective block;
4) ballot message enter recBlockVoteDmg function, when block affirmative vote or negative vote be more than certain amount, Then according to result memory block;
5) block request message enters recBlockRequestDmg function, and the block that other nodes need is put by node It is sent in message;
6) block storage message enters recBlocksDmg function, and block can be stored into account book, be traded simultaneously by node Processor calculates transaction.
Preferably, when actuator Executor is initialized every time, all can the first reading state value from database, continue Work after last time, the state value include: " state_root ", " state_height ", " state_tx ", " Result_root ", " state_latest ", " block:*tran:* ", " blocktrans:* ", " cache " and " Resultcache ", and after transaction has been calculated every time, it can all update these values, during operating status, actuator Untreated transaction is constantly sent to calculator Computor and handled by Execuotr.
Preferably, the service of the transaction processor execution module is realized by using gRPC, and the gRPC allows to use Family defines a service, specifies it can be by the method for far call and its parameter and return type.
Using system and method for the invention, the execution efficiency of intelligent contract is improved, intelligent contract is as block chain The safety that code executes on chain further increases and the consistency problem of intelligent contract code and text is addressed.
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter The above and other objects, advantages and features of the present invention.
Detailed description of the invention
Some specific embodiments of the present invention is described in detail by way of example and not limitation with reference to the accompanying drawings hereinafter. Identical appended drawing reference denotes same or similar part or part in attached drawing.It should be appreciated by those skilled in the art that these What attached drawing was not necessarily drawn to scale.Target and feature of the invention will be apparent from view of following description taken together with the accompanying drawings, In attached drawing:
Fig. 1 is the intelligent contract of the prior art and the principle schematic diagram of block chain combination;
Fig. 2 is the intelligence according to an embodiment of the present invention based on block chain and about SCAM model schematic;
Fig. 3 is that privately owned block chain executes method flow diagram in SCAM according to an embodiment of the present invention;
Fig. 4 is that privately owned block chain according to an embodiment of the present invention executes state machine diagram;
Fig. 5 is that transaction processor according to an embodiment of the present invention executes state machine diagram;
Fig. 6 is the intelligent contract state storage model schematic diagram according to an embodiment of the present invention based on block chain;
Fig. 7 is the implementation method mould of privately owned block chain intelligence contract asynchronous execution storage system according to an embodiment of the present invention Block figure.
Specific embodiment
Ethereum is the first system that distributed virtual machine is combined with block chain, intelligent contract on privately owned block chain The design of asynchronous execution model intelligent Contract Design in Ethereum.The block chain of Ethereum not only stores friendship Easily, newest account status information is also stored, account is divided into two kinds: one is contract accounts, and wherein contract account just has accordingly Code, one is external account, this account does not have code.Each account has corresponding address, includes: nonce (account In nonce be the equal of the number of deals done the account, the nonce of account is denoted as), balance (account balance is denoted as), Contract code (contract account just has, and is denoted as) and storage (being denoted as).Contract code is stored in contract account, and contract is to need to hand over Easily triggering executes, and the address of contract account is filled in transaction, and such calculate node will go inquiry to correspond to after receiving transaction Code, in addition data information in transaction is as input to execute contract.Transaction includes following element: nonce is (in transaction Nonce is the equal of processed mark of trading, and is denoted as), gasPrice (since Ethereum is publicly-owned chain, need to pass through receipts Take calculating expense not attacked to protect, be denoted as), gasLimit (calculating the upper limit of expense, be denoted as) and to (reception of transaction Side, is denoted as), value (amount of money is denoted as) and v, r, s is used for signature verification.
After Ethereum first calculates the All Activity in new block, state root is put into the head of block, calculates block Behind head, then new block is broadcasted, the calculating time of contract is caused to be included in the Production Time of block, so The speed of Ethereum is very slow, moreover, a possibility that publicly-owned chain store historical data rollback, so being difficult to accomplish block meter Calculate the separation calculated with transaction.The block of privately owned chain provides block and calculates and trade what calculating separated with termination property immediately Possibility,
The general introduction of intelligent contract asynchronous execution method on privately owned block chain is given below in the present embodiment.
Intelligent contract asynchronous execution is exactly under the premise of not influencing contract state consistency, by the calculating of contract from block Calculating extract.Basic thinking: the block of privately owned chain has instantaneity, is exactly, Ethereum different from Ethereum Due to the consistency of itself, may stateful rollback possibility, and the block being verified in privately owned chain be will not be by Rollback, so, can allow block chain that all sources are correctly traded and all be put into block chain, transaction can with asynchronous process, The result of processing is also stored in bearing-age tree, then the root of bearing-age tree is put into the head of block, block when knowing together, Consistency check only is carried out to the current transaction being processed.Transaction executed by transaction processor, transaction processor from Not processed transaction and execution are taken out in block chain database.
Fig. 2 is intelligent contract asynchronous execution model (the Smart Contract Asynchronous based on block chain Model, SCAM), block chain node is responsible for entering the correct chain transaction in source in chain, so that the sequence solidification of transaction, is then handed over Easy to handle device handles transaction by the sequence traded in block chain one by one, is all to trade when doing block every time to newest processing State does consistency synchronization.Last state is indicated that state_height indicates that exchange processed is in block by three variables Highly, state_tx expression serial number processed of trading, state_root indicate the root of last state tree).
Fig. 3 shows the implementation procedure of privately owned block chain in SCAM, and block chain is responsible for the fixation that will trade when doing block Transaction is not handled in chain, only whether the source of verifying transaction is correct, but can know together to the stateful transaction of newest processing.Afterwards Face transaction processor is responsible for the trading processing in block chain, and last state value is provided when calculating new block, i.e., These three variables of state_height, state_tx and state_root check these three variables when verifying block Value.
Trade fair is broadcast to all calculate nodes, and node passes through compute_right (tx, height, time_ Interval it) calculates whether to have permission and calculates new block, the node having permission calculates new block, and at this moment node needs pass through State=querystate () inquires last state to transaction processor, is broadcast to other calculating after calculating new block Node.After calculate node receives new block, need transaction processor proofing state whether correct, block is verified, then extensively Affirmative vote is broadcast, negative vote is otherwise sent.When the affirmative vote or negative vote quantity of the block that node receives are more than the 1/ of number of nodes 3, then synchronize calculating, and memory block.Privately owned block chain executes system packet in intelligent contract asynchronous execution model (SCAM) Include: privately owned block chain state executes state machine, transaction processor executes state machine, can support the storage organization module of SCAM with And intelligent contract module.
Each component part of system is illustrated separately below:
1) in SCAM privately owned block chain execution state machine
Execute state machine MnodeThe execution state machine for indicating privately owned block chain in SCAM, is a five-tuple (qnode, ∑modenode,snode,Fnode), qnodeIt is the state set of privately owned block chain interior joint, as shown in table 1.∑modeIt is input (thing Part) set, δnodeIt is the set of transfer function.snodeIt is original state, FnodeIt is the set of final stateAnd Fnode={ 1 }.
Table 1
Privately owned block chain node executes the state transition function such as table 2 of state machine.
Table 2
Privately owned block chain node executes state machine ∑modeDefinition such as table 3.
Table 3
Consolidated statement 1-3, state machine transition diagram are as shown in Figure 4.
Find out from privately owned block chain implementation procedure, four interfaces that transaction processor must satisfy be querystate, Verifystate, newblock and computestate.
2) transaction processor executes state machine in SCAM
Execute state machine MexecutorIt indicates that transaction processor executes state machine in SCAM, is a five-tuple (qexecutor, Σexecutorexecutor,sexecutor,Fexecutor), qexecutorIt is the state set such as table 4 of transaction processor state machine. ΣexecutorIt is the set for inputting (event).δexecutorIt is the set of transfer function.sexecutorIt is initial state value, FexecutorEventually The only set of stateAnd Fexecutor={ sexecutor}。。
Table 4
When no untreated transaction, transaction processor is constantly in waiting listening state, and different message can be touched The behavior for sending out different, δexecutorDefinition is as shown in table 5.
Table 5
ΣexecutorThe event of definition is as shown in table 6.
Table 6
Consolidated statement 4-6, the state machine transition diagram of our available such as Fig. 5.
3) the storage organization module of SCAM can be supported
The storage organization mould that can support SCAM is obtained according to the memory requirement and feature of privately owned block chain and intelligent contract Block.The feature that is stored with of privately owned block chain is exactly that block once stores that there is no need to change, it is possible to by block chain It is stored in relevant database, saves as two tables, block head table and transaction data table, wherein block head table is breathed out with block It wishes as major key, and transaction data table increases a field for depositing using Hash of trading as major key, while when store transaction Store up exchange block Hash.
The storage characteristics of intelligent contract global state are that update is more, and asynchronous execution needs many ground temporarily stored Side, so storage is very suitably, to use the node of kv database storing state tree here in the form of key-value.
Fig. 6 indicates the intelligent contract state node store structure design module based on block chain, in order to support asynchronous execution agreement, Following variable is needed in kv:
1) " State_root ", the state tree root of newest processing transaction;
2) " State_height ", height of the newest processing exchange in block;
3) " State_tx ", serial number of the newest processing exchange in block;
4) " State_latest ", the height of the newest processing of transaction processor;
5) " block:i tran:j ", record block height are i, the state after the trading processing success of transaction serial number j Root and result;
6) " blocktrans:* ", the key value of the transaction of block *;
7) " Customs Assigned Number ", corresponding storage user information;
8) " calculate node " records the address list of block chain calculate node, this is the contract safeguarded jointly in many ways Account, when thering is calculate node to need to update, it is necessary to which the agreement Jing Guo most of management nodes could update, and protect in this way The synchronism updated is demonstrate,proved;
9) " third party's number ", for distributing permission to monitoring party;
10) " contract number " stores the information of contract, including code, contract state;
11) " name registration ", for giving contract register name, convenient for inquiry.
Fig. 7 indicates a kind of implementation method module map of the intelligent contract asynchronous execution storage system of privately owned block chain.Firstly, Program entry is in firstTimeSetup, and while starting, there are also onMessage (to receive new block for monitoring information NewBlock message, block ballot vote message, block storage recblock message and block request missingblock disappear Breath).ReceiveNewBlock function will be entered when receiving new block, block is handled, first judges coming for block It then votes to effective block with validity in source;Message of voting can enter recBlockVoteDmg function, when block Affirmative vote or negative vote are more than certain amount, then according to result memory block;Block request message can enter The block that other nodes need is put into message and sends by recBlockRequestDmg function, node;Block storage disappears Breath can enter recBlocksDmg function, and node can store block into account book, and transaction processor goes to calculate transaction simultaneously.
When transaction processor initializes every time, all can the first reading state value from database, after continuing last time Work: " state_root ", " state_height ", " state_tx ", " result_root ", " state_latest ", " Block:*tran:* ", " blocktrans:* ", " cache " and " resultcache ".And every time transaction has been calculated after, all can Update these values.During operating status, transaction processor constantly calculates untreated transaction.
4) intelligent contract module:
Bond service is provided in the form of Services Composition, it is divided into actuator Executor and calculator Compute, actuator Executor is responsible for communicating with node, and calculator Compute is responsible for calculating transaction.Intelligent contract module service is to pass through herein Realized using gRPC (gRPC allows us to define a service, specify its can by the method for far call and its parameter with return Return type).Executor is transaction actuator, is executed in order to which security consideration contract code execution part can be put into docker, institute With there are one calculating service Compute to start in docker, Compute is responsible for executing contract code, and returns to calculating knot Fruit can guarantee that contract execution will not bring danger to node to Executor, in docker execution.Executor service will mention Whole services of confession include query, verify, newblock and querytrie, definition such as table 7.
Table 7
Compute only has compute service, service definition such as table 8, and requests transaction includes the content of transaction, returning as a result Content not only including result is returned, further includes the variation of state value.
Table 8
Due to being that will calculate service and be placed in docker to execute, so contract implementation procedure needs to inquire block chain state simultaneously It returns the result, transaction processor receives the return of result, then will be updated state.Stub indicates transaction processor and calculates to service (docker) centre, Stud object contain the behavior between the service of calculating and transaction processor, can when contract is write To call directly the interface of Stub, Stub definition such as table 9.
Table 9
Although the present invention is described by reference to specific illustrative embodiments, these embodiments are not will receive Restriction and only limited by accessory claim.It should be understood by those skilled in the art that can be without departing from of the invention Change and modification are able to carry out to the embodiment of the present invention in the case where protection scope and spirit.

Claims (6)

1. a kind of intelligent contract asynchronous execution storage system of privately owned block chain characterized by comprising
Execution state machine, the transaction processor of privately owned block chain execute state machine and can support the storage organization module of SCAM And privately owned block chain intelligence contract module;
Using execution state machine MnodeThe execution state machine for indicating privately owned block chain in SCAM, is a five-tuple (qnode, ∑modenode,snode,Fnode), qnodeIt is the state set of privately owned block chain interior joint, ∑modeIt is the set or event of input Set, δnodeIt is the set of transfer function, snodeIt is original state, FnodeIt is the set of final state, whereinAnd Fnode={ 1 };
Using execution state machine MexecutorIt indicates that transaction processor executes state machine in SCAM, is a five-tuple (qexecutor, ∑executorexecutor,sexecutor,Fexecutor), qexecutorIt is the state set of transaction processor state machine, ∑executorIt is The set of input or the set of event, δexecutorIt is the set of transfer function, sexecutorIt is initial state value, FexecutorIt terminates The set of state, whereinF hereinexecutor={ Sexecutor};
The storage organization module that can support SCAM includes relevant database and kv (key-value) database, institute Relevant database is stated for memory block chain, the kv database is used for the node of storage state tree, and in order to support to assist It discusses, multiple variables is set in kv;
The privately owned block chain intelligence contract module provides bond service in the form of Services Composition, be divided into actuator Executor with Calculator Compute, actuator Executor with node for communicating, and calculator Compute is for calculating transaction, for safety Consider that contract code execution part can be put into docker execution, the service of calculator Compute starts in docker, calculator Compute is responsible for executing contract code, and returns to calculated result and give actuator Executor, executes in docker to guarantee contract Execution will not bring danger to node.
2. a kind of intelligent contract asynchronous execution storage system of privately owned block chain according to claim 1, which is characterized in that described Relevant database is using the form of block head table and the storage of two tables of transaction data table, and wherein block head table is breathed out with block It wishes as major key, and transaction data table increases a field for depositing using Hash of trading as major key, while when store transaction Store up exchange block Hash.
3. a kind of intelligent contract asynchronous execution storage system of privately owned block chain according to claim 1, which is characterized in that described The multiple variables being arranged in kv include: 1) " State_root ", to indicate the state tree root of newest processing transaction;2)"State_ Height " indicates newest processing exchange in the height of block;3) " State_tx " indicates newest processing exchange in block Serial number;4) " State_latest " indicates the height of the newest processing of transaction processor;5) " block:i tran:j " is indicated Record block height is i, state root and result after the trading processing success of transaction serial number j;6) " blocktrans:* ", table Show the key value of the transaction of block *;7) " Customs Assigned Number " indicates corresponding storage user information;8) " calculate node " records block The address list of chain calculate node, the contract account safeguarded jointly in many ways as one, when there is calculate node needs to update It waits, it is necessary to which the agreement Jing Guo most of management nodes could update, this ensure that the synchronism updated;9) " third party compiles Number ", for distributing permission to monitoring party;10) " contract number " stores the information of contract, including code, contract state;11) " name registration ", for giving contract register name, convenient for inquiry.
4. a kind of intelligent contract asynchronous execution storage system of -3 any one of privately owned block chains according to claim 1 Implementation method, which is characterized in that comprising steps of
1) privately owned block chain execution module is established firstly, entering in firstTimeSetup;
2) while starting, using onMessage monitoring information, the monitoring information includes: to receive new block newBlock Message, block ballot vote message, block storage recblock message and block request missingblock message;
3) receiveNewBlock function is entered when receiving new block, block is handled, first judge coming for block Source and validity, then again vote to effective block;
4) ballot message enters recBlockVoteDmg function, when the affirmative vote or negative vote of block are more than certain amount, then root According to result memory block;
5) block request message enters recBlockRequestDmg function, and the block that other nodes need is put into message by node In send;
6) block storage message enters recBlocksDmg function, and node can store block into account book, while trading processing Device calculates transaction.
5. implementation method according to claim 4, which is characterized in that when transaction processor initializes every time, all can first from Reading state value in database, continues the work after last time, and the state value includes: " state_root ", " state_ height”、”state_tx”、”result_root”、”state_latest”、”block:*tran:*”、” Blocktrans:* ", " cache " and " resultcache ", and after transaction has been calculated every time, can all update these values, transport In row state procedure, transaction processor constantly calculates untreated transaction.
6. implementation method according to claim 4, which is characterized in that the service of the privately owned block chain intelligence contract module is logical It crosses and is realized using gRPC, the gRPC allows user to define a service, specifies it can be by the method and its ginseng of far call Several and return type.
CN201710234347.6A 2017-04-12 2017-04-12 A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain Active CN107103054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710234347.6A CN107103054B (en) 2017-04-12 2017-04-12 A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710234347.6A CN107103054B (en) 2017-04-12 2017-04-12 A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain

Publications (2)

Publication Number Publication Date
CN107103054A CN107103054A (en) 2017-08-29
CN107103054B true CN107103054B (en) 2019-03-26

Family

ID=59675005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710234347.6A Active CN107103054B (en) 2017-04-12 2017-04-12 A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain

Country Status (1)

Country Link
CN (1) CN107103054B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3777030A4 (en) * 2019-11-27 2021-04-14 Alipay (Hangzhou) Information Technology Co., Ltd. Asynchronous processing of blockchain blocks
US11853291B2 (en) 2020-07-06 2023-12-26 International Business Machines Corporation Privacy preserving architecture for permissioned blockchains

Families Citing this family (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636592B (en) * 2017-10-20 2023-02-28 北京航空航天大学 High performance intelligent contract design
CN109637637A (en) * 2017-10-20 2019-04-16 北京航空航天大学 Medical management system based on block chain
US10839345B2 (en) * 2017-10-27 2020-11-17 BXB Digital Pty Limited Systems and methods for executing smart contracts using a block chain
WO2019087006A1 (en) * 2017-11-02 2019-05-09 nChain Holdings Limited Computer-implemented systems and methods for combining blockchain technology with digital twins
US9967238B1 (en) * 2017-11-09 2018-05-08 Broadridge Financial Solutions, Inc. Database-centered computer network systems and computer-implemented methods for cryptographically-secured distributed data management
CN108182580B (en) * 2017-12-29 2021-01-01 北京欧链科技有限公司 Block chain-based contract triggering method and device
CN110213304B (en) * 2018-02-28 2021-11-30 成都高新信息技术研究院 Block chain network interconnection method and system
CN108712409B (en) * 2018-05-09 2021-05-25 广西创轩科技有限公司 Electronic bill transaction system based on private block chain
CN108765159B (en) * 2018-06-04 2022-07-15 杭州溪塔科技有限公司 Block chain-based uplink and state processing method and device and interconnection system
CN108990002A (en) * 2018-06-27 2018-12-11 柳州市蓝海数链科技有限公司 A kind of block chain data processing method, device, terminal and storage medium
CN117171274A (en) * 2018-08-08 2023-12-05 华为技术有限公司 Block chain node and transaction method
CN109033426B (en) * 2018-08-10 2020-11-17 杭州数澜科技有限公司 Method and system for storing data operation information based on private block chain network
CN109241032B (en) * 2018-08-16 2021-02-26 北京京东尚科信息技术有限公司 Account book database component, operation method and storage medium
CN109118364A (en) * 2018-08-27 2019-01-01 深圳前海益链网络科技有限公司 Method, apparatus, computer equipment and the storage medium of asynchronous execution intelligence contract
CN110868308B (en) * 2018-08-28 2022-04-01 傲为有限公司 Block chain network access method and system
US20210194890A1 (en) * 2018-09-14 2021-06-24 Telefonaktiebolaget Lm Ericsson (Publ) In a distributed computing system with untrusted entities method and apparatus for enabling coordinated executions of actions
CN112970040A (en) * 2018-09-28 2021-06-15 谢尔特纵姆公司 Intelligent contract
CN109359159A (en) * 2018-09-30 2019-02-19 深圳前海微众银行股份有限公司 Distributed storage method, system and equipment
CN109584063B (en) * 2018-10-25 2020-07-21 阿里巴巴集团控股有限公司 Transaction processing method and device based on block chain and electronic equipment
CN111782724A (en) 2018-10-25 2020-10-16 阿里巴巴集团控股有限公司 Transaction processing method and device based on block chain and electronic equipment
CN110020542B (en) 2018-12-20 2020-05-19 阿里巴巴集团控股有限公司 Data reading and writing method and device and electronic equipment
CN109522328B (en) * 2018-12-27 2021-04-02 石更箭数据科技(上海)有限公司 Data processing method and device, medium and terminal thereof
CN111478932B (en) * 2019-01-24 2023-04-07 北京京东尚科信息技术有限公司 Intelligent contract data processing method, block chain network and storage medium
CN110060155B (en) 2019-01-31 2021-03-23 创新先进技术有限公司 Intelligent contract execution method and device of block chain and electronic equipment
US11138600B2 (en) 2019-02-05 2021-10-05 Capital One Services, Llc Smart contract regulation
EP3715981A1 (en) * 2019-03-27 2020-09-30 Siemens Aktiengesellschaft Method and control system for controlling an execution of transactions
AU2019204729B2 (en) * 2019-04-03 2021-03-11 Advanced New Technologies Co., Ltd. Processing blockchain data based on smart contract operations executed in a trusted execution environment
CN110096550B (en) * 2019-04-17 2023-01-03 天津大学 Design and implementation method of block chain-based storage structure
CN114548993A (en) * 2019-06-06 2022-05-27 杭州趣链科技有限公司 Block chain cross-chain transaction method based on intelligent contract sequencing
CN110309173B (en) * 2019-06-14 2021-08-13 达闼机器人有限公司 Contract data recording method and device, block chain node and storage medium
US11263569B2 (en) 2019-06-18 2022-03-01 Advanced New Technologies Co., Ltd. Blockchain-based information processing method and apparatus, and device
CN110263097A (en) * 2019-06-18 2019-09-20 阿里巴巴集团控股有限公司 Information processing method, device and equipment based on block chain
CN111226199B (en) * 2019-08-27 2022-02-18 创新先进技术有限公司 System and method for blockchain based notification
US11315120B2 (en) * 2019-08-29 2022-04-26 International Business Machines Corporation Implementing a marketplace for risk assessed smart contracts issuers and execution providers in a blockchain
CN110609872B (en) * 2019-09-20 2021-03-05 北京海益同展信息科技有限公司 Method and apparatus for synchronizing node data
CN110602252B (en) * 2019-09-30 2021-06-15 东南大学 Block chain enhanced open Internet of things access architecture
CN110737664B (en) * 2019-10-21 2022-11-25 深圳前海微众银行股份有限公司 Method and device for synchronizing block chain link points
CN110580411B (en) * 2019-11-08 2020-03-06 支付宝(杭州)信息技术有限公司 Permission query configuration method and device based on intelligent contract
CN110908801B (en) * 2019-11-12 2022-07-12 金蝶软件(中国)有限公司 Data processing method and device based on block chain, computer equipment and storage medium
CN110941860B (en) * 2019-12-10 2022-01-04 博雅正链(北京)科技有限公司 Block chain and biological feature based electronic contract associable analysis verification method
CN111274318B (en) * 2020-01-16 2023-04-25 杭州趣链科技有限公司 Block chain state data storage and rollback method, equipment and storage medium
CN111343179B (en) * 2020-02-25 2023-04-07 中国工商银行股份有限公司 Real-time consensus method and device for authenticity of data on link
CN111401900A (en) * 2020-03-20 2020-07-10 深圳市网心科技有限公司 Block chain verifier updating method, device, equipment and readable storage medium
CN111831745B (en) * 2020-06-05 2023-04-18 广东科学技术职业学院 Scheduling method and device of timed intelligent contract
CN112053261A (en) * 2020-08-07 2020-12-08 深圳区块大陆科技有限公司 Method for realizing free arbitration on block chain
CN114153529B (en) * 2021-05-13 2022-07-19 北京天德科技有限公司 Intelligent contract system based on state machine synchronization and control

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893042A (en) * 2016-03-31 2016-08-24 北京航空航天大学 Intelligent contract implementation method based on block chain
CN106528775A (en) * 2016-10-28 2017-03-22 山东明和软件有限公司 Private block chain operation support system that supports logical multi-chain, and working method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150379510A1 (en) * 2012-07-10 2015-12-31 Stanley Benjamin Smith Method and system to use a block chain infrastructure and Smart Contracts to monetize data transactions involving changes to data included into a data supply chain.

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893042A (en) * 2016-03-31 2016-08-24 北京航空航天大学 Intelligent contract implementation method based on block chain
CN106528775A (en) * 2016-10-28 2017-03-22 山东明和软件有限公司 Private block chain operation support system that supports logical multi-chain, and working method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3777030A4 (en) * 2019-11-27 2021-04-14 Alipay (Hangzhou) Information Technology Co., Ltd. Asynchronous processing of blockchain blocks
US11853291B2 (en) 2020-07-06 2023-12-26 International Business Machines Corporation Privacy preserving architecture for permissioned blockchains

Also Published As

Publication number Publication date
CN107103054A (en) 2017-08-29

Similar Documents

Publication Publication Date Title
CN107103054B (en) A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain
Kaur et al. Blockchain: A path to the future
DK3257191T3 (en) REGISTER AND AUTOMATIC PROCEDURE FOR MANAGING BLOCKCHAIN FORCED SMART CONTRACTS
US11606219B2 (en) System and method for controlling asset-related actions via a block chain
CN107807984A (en) A kind of block chain network of subregion and its method for realizing subregion common recognition
CN107766540A (en) A kind of block chain network of subregion and its method for realizing partitioned storage
CN108833081A (en) Block chain-based equipment networking authentication method
CN108898390A (en) Intelligent contract call method and device, electronic equipment based on block chain
CN110335147A (en) A kind of digital asset Information Exchange System and method based on block chain
CN109410076A (en) Agricultural product based on block chain technology, which are traced to the source, insures public service platform
CN109242675A (en) Assets dissemination method and device, electronic equipment based on block chain
CN110008720A (en) Internet of Things dynamic data source tracing method and device based on alliance's chain
CN108881163A (en) A kind of multicenter block catenary system with block issue mechanism
CN109491996A (en) For the block generation method of block chain network, block data access method, calculate equipment, storage medium
CN111369730B (en) Voting processing method and device based on block chain
CN113570065A (en) Data management method, device and equipment based on alliance chain and federal learning
CN110557276B (en) Block chain computer room management system based on Fabric architecture
CN115277122A (en) Cross-border data flow and supervision system based on block chain
Karger et al. Blockchain for AI Data-State of the Art and Open Research.
Cao et al. Decentralized privacy-preserving netting protocol on blockchain for payment systems
Bhanupriya et al. A modified hybrid blockchain framework for secured data transaction
Zhao et al. A Matching Scheme from Supply and Demand Sides of Electronic Health Records Based on Blockchain
CN114826684B (en) Decentralized crowdsourcing method, system and terminal supporting efficient privacy protection
KR102386922B1 (en) Blockchain system
Alja'afreh et al. A review on industrial blockchain

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210526

Address after: No.8, Expo Road, Panlong District, Kunming City, Yunnan Province

Patentee after: Yunnan Institute of innovation Beijing University of Aeronautics and Astronautics

Address before: 100191 No. 37, Haidian District, Beijing, Xueyuan Road

Patentee before: BEIHANG University

TR01 Transfer of patent right