CN107193672A - A kind of transregional piece of asynchronous call contract system - Google Patents

A kind of transregional piece of asynchronous call contract system Download PDF

Info

Publication number
CN107193672A
CN107193672A CN201710402925.2A CN201710402925A CN107193672A CN 107193672 A CN107193672 A CN 107193672A CN 201710402925 A CN201710402925 A CN 201710402925A CN 107193672 A CN107193672 A CN 107193672A
Authority
CN
China
Prior art keywords
contract
tx
checking
node
unit
Prior art date
Application number
CN201710402925.2A
Other languages
Chinese (zh)
Other versions
CN107193672B (en
Inventor
陈小虎
徐卿
李正鹏
Original Assignee
无锡井通网络科技有限公司
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 无锡井通网络科技有限公司 filed Critical 无锡井通网络科技有限公司
Priority to CN201710402925.2A priority Critical patent/CN107193672B/en
Publication of CN107193672A publication Critical patent/CN107193672A/en
Application granted granted Critical
Publication of CN107193672B publication Critical patent/CN107193672B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

A kind of transregional piece of asynchronous call contract system, the system includes:Distributed system authentication unit:Including one or more service nodes and several checking nodes, checking node is used to verify { TX } known together;{ TX } includes contract call request TX and pays request TX;Distributed contract execution unit:It is located locally or authentication unit distal end, is communicated between authentication unit by predefined agreement, performs information needed to obtain contract, and after contract is finished, result is back to checking node;Contract performs buffer unit:Contract call request including carrying out self-validation node for receiving, sends a request to contract execution unit, receives contract implementing result, returns to current contract and performs state to node is verified, to realize the asynchronous call of contract.The block common recognition of present system can improve the contract quantity that the concurrency and block of contract execution can be supported, improve Fault Tolerance independent of contract implementing result.

Description

A kind of transregional piece of asynchronous call contract system

Technical field

The present invention relates to block chain technical field, and in particular to a kind of transregional piece of asynchronous call contract system.

Background technology

The execution of existing intelligent contract uses the method for synchronization, is called, closed using transaction triggering or automatic triggering contract About when specific perform, the common recognition mechanism of block chain has to wait for contract and performed, and could continue operation after returning result, So as to complete the common recognition to current block.

Above-mentioned intelligent contract executive mode has following defect:

(1) speed that contract is performed has a strong impact on the time of block generation:

Because the result that block common recognition is performed dependent on contract, each node must be reached to the uniformity of the result of contract Common recognition, therefore, the speed of the execution speed of contract directly affects block subsequent operation, causes block to generate the delay of time.

(2) speed that contract is performed has a strong impact on the contract execution concurrency that block chain can be supported:

In the case where the frequency that block chain is generated is generally approximately fixed, within the same period, a contract is performed Speed, will directly influence under the execution of same other contracts of block, extreme case, the contract of a malice may cause system Other contracts can not be handled, cause the concurrency for handling contract to substantially reduce.

(3) fault-tolerant ability in contract implementation procedure is limited:

Because by the way of synchronously performing, processing when contract is performed for various error situations needs to consider comprehensively, And the quick processing of the operation to various time-sensitives is realized, than making corresponding place if desired for the timeout case to various operations Reason.

Some existing solutions, such as ether mill, by the way of gas, the estimation of operand is carried out to each contract, And the total operand for controlling current block to support using the total gas amounts of a system, to ensure being timely completed for common recognition.But It is that the contract sum that system can be supported is limited by this total amount gas, if the code of contract becomes increasingly complex, whole system The contract number that can be supported is just fewer and fewer;The limited time in addition, ether mill is known together, gas peak can not be significantly increased.

The content of the invention

The problem of technology is present is performed for existing intelligent contract, the present invention provides a kind of transregional piece of asynchronous call contract system System, the block common recognition of the system is independent of contract implementing result, and can improve the concurrency and block of contract execution can support Contract quantity, improve Fault Tolerance.

To realize above technical purpose, the technical scheme is that:

A kind of transregional piece of asynchronous call contract system, including with lower unit:

Distributed system authentication unit:Including one or more service nodes and several checking nodes, the service Node is used to receive the transaction request set { TX } that user submits, and the checking node is used to verify { TX } known together; { TX } includes contract call request TX and pays request TX;

Distributed contract execution unit:Be located locally or the distributed system authentication unit distal end, with the distribution Communicated between formula system authentication unit by predefined agreement, perform information needed to obtain contract, and hold in contract After row is finished, result is back to the checking node;

Contract performs buffer unit:Including for receiving the contract call request from the checking node, sending The contract call request receives contract implementing result to the distributed contract execution unit, returns to current contract and performs shape State is to the checking node, to realize the asynchronous call of contract;

Each one or more contracts of checking node correspondence perform buffer unit, and one or more described Distributed contract execution unit;

The network system realization is as follows:

A:The service node receives the transaction request TX that user submits, and each checking node is collected above-mentioned TX and converged Integrated transaction request set { TX }i

B:{TX}iIn the contract call request that includes send to the contract and perform buffer unit, the contract performs slow Memory cell returns to current contract and performs state immediately after above-mentioned request is received;

C:Received { TX } in all checking nodesiAfterwards, described { TX }iCommon recognition, block i are completed in all checking nodes Generation, the checking node is to { TX } described in after common recognitioniVerified, the state write-in block i after checking;While each institute State checking node and create an inquiry and about TXq, and add it to the transaction request set { TX } of block (i+k)(i+k)In;

D:When carrying out B~C, the contract execution buffer unit is called the contract by the way of asynchronous call please Ask transmission to the distributed contract execution unit, contract is performed in backstage, after being finished, the contract performs buffer unit The end product that contract is performed is obtained, waits pending;

E:Block (i+k) process cycle starts, { TX }(i+k)In the contract call request that includes send to the contract Perform buffer unit, the contract, which performs buffer unit and returns to current contract immediately, performs state, meanwhile, the checking node from The inquiry and about TXqIn extract contract relevant information, and perform buffer unit to the contract and send inquiry request, it is described Contract performs the implementing result that buffer unit returns to the contract call request of the block i to the checking node, and more The new inquiry and about TXq

F:Received { TX } in all checking nodes(i+k)Afterwards, the inquiry after renewal and about TXqWith it is described {TX}(i+k)It is combined to form a new set, common recognition, block (i+k) generation, the checking is completed in all checking nodes Node verifies that the state after checking writes block (i+k) to the TX known together;Simultaneously each checking node creates one Individual new inquiry and about TXq, and add it to the transaction request set { TX } of block (i+k+k)(i+k+k)In;

G:When carrying out E~F, the contract execution buffer unit is by the way of asynchronous call by described in { TX }(i+k)In Comprising contract call request send to it is described distribution contract execution unit, in backstage perform contract, after being finished, it is described close About execution unit obtains the end product that contract is performed, and waits pending;

Wherein, the i and k are the integer more than or equal to 1, and the i and k are configured as needed.

Preferably, the distributed contract execution unit is positioned at distributed system authentication unit distal end, with described point The sandbox of cloth system authentication unit uncoupling.

Specifically, the current contract performs state and included but is not limited to:Not yet complete, be normally finished or malfunction.

Preferably, the k=1.

Specifically, the mechanism that the common recognition is used includes but is not limited to:BFT, POW or POS.

Preferably, one contract of each checking node correspondence performs buffer unit and a distribution Contract execution unit.

The present invention performs technology phase using block catenary system and asynchronous call as backstage core technology with existing intelligent contract Than having the advantage that:

(1) completely cut off contract to perform and system common recognition unit, the execution of contract can be in distal end so that the execution of contract is not Occupy the resource of system common recognition again;

(2) uncoupling of contract execution unit and system common recognition unit so that contract performing module is relative with common recognition module It is independent, support hot plug;

(3) contract is set up between common recognition authentication unit and contract execution unit and performs buffer unit, held in whole contract Asynchronous call executive mode is creatively employed during row so that contract is called with implementing result in transregional piece of (block i And block (i+k)) between realize respectively, while can guarantee that again each checking node between complete common recognition;This kind of contract is asynchronous to be adjusted The concurrency of contract execution is improved with execution pattern, the process of common recognition is greatly improved without the implementing result of wait contract is needed The contract quantity that block can be supported.

(4) fault-tolerant ability of whole system is improved, one side system can set suitable timeout treatment mechanism to locate Manage the situation of contract delay, on the other hand, the conjunction that user performs when suitable k values can be configured in contract is called to ensure long About have been properly processed.

Brief description of the drawings

Fig. 1 is performed for contract in transregional piece of asynchronous call contract system of the present embodiment and is called path schematic diagram.

Fig. 2 is transregional piece of asynchronous call contract System Working Principle schematic diagram of the present embodiment.

Embodiment

Below in conjunction with the accompanying drawings, the embodiment of the present invention, but the not power to the present invention are described in detail by embodiment Profit requires to do any restriction.

As shown in Fig. 1~Fig. 2, transregional piece of asynchronous call contract system of the present embodiment is included with lower unit:

Distributed system authentication unit:Including a service node and N number of checking node, service node, which is used to receive, to be used The transaction request set { TX } that family is submitted, checking node is used to verify { TX } known together;{ TX } includes contract call request TX TX is asked with paying;

Distributed contract execution unit:Positioned at the distal end of distributed system authentication unit, to verify single with distributed system The sandbox of first uncoupling;Communicated between the unit and distributed system authentication unit by predefined agreement, to obtain Contract performs information needed, and after contract is finished, result is back into checking node;

Contract performs buffer unit:Contract call request including carrying out self-validation node for receiving, sends contract and calls Request receives contract implementing result to distributed contract execution unit, returns to current contract and performs state to node is verified, with reality The asynchronous call of existing contract;

Each checking node one contract of correspondence performs buffer unit and a distributed contract execution unit;It is shared N number of Node is verified, N number of contract performs buffer unit and N number of distributed contract execution unit.

The implementation method of the present embodiment system is as follows:

A:Service node receives the transaction request TX that user submits, and forwards it to all checking nodes, each tests Card node collects above-mentioned TX and accumulates transaction request set { TX }1

B:{TX}1In the contract call request that includes send to contract and perform buffer unit, contract performs buffer unit and existed Receive and return to current contract after above-mentioned request immediately and perform state (including not yet complete, be normally finished, the state such as error);

C:Received { TX } in all checking nodes1Afterwards, it is to determine due to each contract call request TX return state, Therefore { TX }1Common recognition can be completed in all checking nodes, block 1 is generated, and checking node is to { TX } after common recognition1Carry out one by one Checking, the state write-in block 1 after checking;Each checking node creates an inquiry and about TX simultaneouslyq, and add it to area The transaction request set { TX } of block 22In;

D:Carry out B~C when, contract perform buffer unit by the way of asynchronous call by contract call request send to Distributed contract execution unit, contract is performed in backstage, after being finished, and contract performs buffer unit and obtains contract execution most Result, waits pending afterwards;

E:The process cycle of block 2 starts, { TX }2In the contract call request that includes send to contract and perform buffer unit, Contract performs buffer unit and returns to current contract execution state immediately, meanwhile, verify node from inquiry and about TXqIn extract conjunction About relevant information, and send inquiry request to contract execution buffer unit, contract performs buffer unit and returns to area to checking node The implementing result of the contract call request of block 1, and update inquiry and about TXq

F:Received { TX } in all checking nodes2Afterwards, after renewal inquiry and about TXq{ TX }2It is combined to form one New set, due to each inquiry and about TXqIt is to determine with contract call request TX return state, therefore can be all Verify that node completes common recognition, block 2 is generated, checking node is verified to the TX known together, the state write-in block after checking 2;Each checking node creates a new inquiry and about TX simultaneouslyq, and add it to the transaction request set { TX } of block 33 In;

G:When carrying out E~F, contract performs buffer unit by the way of asynchronous call by { TX }2In the contract that includes Call request is sent to distribution contract execution unit, and contract is performed in backstage, after being finished, and contract execution unit obtains contract The end product of execution, waits pending;

The process cycle of block 3 starts, and it performs method ibid.

In summary, present system uses contract asynchronous call executive mode so that contract is called and implementing result Realized respectively between transregional piece, at the same can guarantee that again each checking node between complete common recognition, improve contract execution and Hair amount, the process of common recognition substantially increases the contract quantity that block can be supported without the implementing result of wait contract is needed, and whole Individual system survivability;In addition, contract execution unit and system common recognition unit uncoupling, relatively independent so that contract is held Row no longer occupies the resource of system common recognition unit.

It is understood that above with respect to the specific descriptions of the present invention, being merely to illustrate the present invention and being not limited to this Technical scheme described by inventive embodiments.It will be understood by those within the art that, still can be to present invention progress Modification or equivalent substitution, to reach identical technique effect;As long as meet use needs, all protection scope of the present invention it It is interior.

Claims (6)

1. a kind of transregional piece of asynchronous call contract system, it is characterised in that including with lower unit:
Distributed system authentication unit:Including one or more service nodes and several checking nodes, the service node For receiving the transaction request set { TX } that user submits, the checking node is used to verify { TX } known together;It is described { TX } includes contract call request TX and pays request TX;
Distributed contract execution unit:Be located locally or the distributed system authentication unit distal end, distributed be with described Communicated between system authentication unit by predefined agreement, perform information needed to obtain contract, and performed in contract Bi Hou, the checking node is back to by result;
Contract performs buffer unit:Including for receiving the contract call request from the checking node, sending described Contract call request receives contract implementing result to the distributed contract execution unit, returns to current contract and performs state extremely The checking node, to realize the asynchronous call of contract;
Each one or more contracts of checking node correspondence perform buffer unit, and one or more distributions Formula contract execution unit;
The network system realization is as follows:
A:The service node receives the transaction request TX that user submits, and each checking node is collected above-mentioned TX and accumulated Transaction request set { TX }i
B:{TX}iIn the contract call request that includes send to the contract and perform buffer unit, the contract performs buffer unit Return to current contract immediately after above-mentioned request is received and perform state;
C:Received { TX } in all checking nodesiAfterwards, described { TX }iCommon recognition is completed in all checking nodes, block i is generated, The checking node is to { TX } described in after common recognitioniVerified, the state write-in block i after checking;Tested described in simultaneously each Demonstrate,prove node and create an inquiry and about TXq, and add it to the transaction request set { TX } of block (i+k)(i+k)In;
D:When carrying out B~C, the contract is performed buffer unit and is sent out the contract call request by the way of asynchronous call The distributed contract execution unit is delivered to, contract is performed in backstage, after being finished, the contract performs buffer unit and obtained The end product that contract is performed, waits pending;
E:Block (i+k) process cycle starts, { TX }(i+k)In the contract call request that includes send to the contract and perform Buffer unit, the contract, which performs buffer unit and returns to current contract immediately, performs state, meanwhile, the checking node is from described Inquiry and about TXqIn extract contract relevant information, and perform buffer unit to the contract and send inquiry request, the contract The implementing result that buffer unit returns to the contract call request of the block i to the checking node is performed, and updates institute State inquiry and about TXq
F:Received { TX } in all checking nodes(i+k)Afterwards, the inquiry after renewal and about TXqWith { TX }(i+k)Close A new set is formed together, completes common recognition in all checking nodes, block (i+k) is generated, the checking node is to altogether The TX known is verified that the state after checking writes block (i+k);Simultaneously each checking node establishment one is new to look into Ask and about TXq, and add it to the transaction request set { TX } of block (i+k+k)(i+k+k)In;
G:When carrying out E~F, the contract execution buffer unit is by the way of asynchronous call by described in { TX }(i+k)In include Contract call request send to it is described distribution contract execution unit, in backstage perform contract, after being finished, the contract is held Row unit obtains the end product that contract is performed, and waits pending;
Wherein, the i and k are the integer more than or equal to 1, and the k is configured as needed.
2. transregional piece of asynchronous call contract system according to claim 1, it is characterised in that:The distributed contract is performed Unit is the sandbox with the distributed system authentication unit uncoupling positioned at distributed system authentication unit distal end.
3. transregional piece of asynchronous call contract system according to claim 1, it is characterised in that:The current contract performs shape State includes but is not limited to:Not yet complete, be normally finished or malfunction.
4. transregional piece of asynchronous call contract system according to claim 1, it is characterised in that:The k=1.
5. transregional piece of asynchronous call contract system according to claim 1, it is characterised in that:The mechanism that the common recognition is used Including but not limited to:BFT, POW or POS.
6. transregional piece of asynchronous call contract system according to claim 1, it is characterised in that:Each checking node pair A contract is answered to perform buffer unit and a distributed contract execution unit.
CN201710402925.2A 2017-05-31 2017-05-31 Cross-block asynchronous contract calling system CN107193672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710402925.2A CN107193672B (en) 2017-05-31 2017-05-31 Cross-block asynchronous contract calling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710402925.2A CN107193672B (en) 2017-05-31 2017-05-31 Cross-block asynchronous contract calling system

Publications (2)

Publication Number Publication Date
CN107193672A true CN107193672A (en) 2017-09-22
CN107193672B CN107193672B (en) 2020-01-14

Family

ID=59876857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710402925.2A CN107193672B (en) 2017-05-31 2017-05-31 Cross-block asynchronous contract calling system

Country Status (1)

Country Link
CN (1) CN107193672B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807991A (en) * 2017-11-07 2018-03-16 泰康保险集团股份有限公司 For handling the method and device of block chain data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN106504091A (en) * 2016-10-27 2017-03-15 上海亿账通区块链科技有限公司 The method and device that concludes the business on block chain
CN106533696A (en) * 2016-11-18 2017-03-22 江苏通付盾科技有限公司 Block chain-based identity authentication methods, authentication server and user terminal
US20170140408A1 (en) * 2015-11-16 2017-05-18 Bank Of America Corporation Transparent self-managing rewards program using blockchain and smart contracts

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170140408A1 (en) * 2015-11-16 2017-05-18 Bank Of America Corporation Transparent self-managing rewards program using blockchain and smart contracts
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN106504091A (en) * 2016-10-27 2017-03-15 上海亿账通区块链科技有限公司 The method and device that concludes the business on block chain
CN106533696A (en) * 2016-11-18 2017-03-22 江苏通付盾科技有限公司 Block chain-based identity authentication methods, authentication server and user terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何广锋,: "区块链渐行渐近", 《中国外汇》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807991A (en) * 2017-11-07 2018-03-16 泰康保险集团股份有限公司 For handling the method and device of block chain data

Also Published As

Publication number Publication date
CN107193672B (en) 2020-01-14

Similar Documents

Publication Publication Date Title
CN105379191B (en) The upgrade method and network function of virtual network function virtualize composer
CN103828305B (en) For parametrization automated system or the system and method for the field apparatus of control system
EP1566069A1 (en) Test system for checking transmission processes in a mobile radio network, and method for authenticating a mobile telephone using one such test system
CN102906579A (en) Method and apparatus for scheduling a use of test resources of a test arrangement for the execution of test groups
US8547125B2 (en) Test apparatus and test module
US8032030B2 (en) Multiple core system
CN1494249A (en) Base station controller/base station receiving/transmitting information apparatus imitator in CDMA system
WO2009097005A2 (en) Fast write operations to a mirrored volume in a volume manager
TWI401914B (en) Test device and test method
Kuliamin et al. Integration of functional and timed testing of real-time and concurrent systems
Güdemann et al. Counterexample guided synthesis of monitors for realizability enforcement
CN103346974B (en) Controlling method of service process and network device
US20020065641A1 (en) Method and apparatus for encoding and generating transaction-based stimulus for simulation of VLSI circuits
CN100349133C (en) Bank host operation pressure test system
CN105227344B (en) Software defined network simulation system and method based on OpenStack
TW200909829A (en) Integrated circuit with self-test feature for validating functionality of external interfaces
CN1819507A (en) Simulated annealing for traffic matrix estimation
TW201508489A (en) PCIE tunneling through SAS
JP2011150514A (en) Program and method for creation of test environment, and test device
CN103248440B (en) Terminal test system and method
CN102193056A (en) Test apparatus and test method
CN1780237A (en) Logic topological network for protocol test and method for realizing protocol test
CN101111076A (en) Hand over control system, mobile communication system and hand over control method for use therewith
CN105721318B (en) The method and apparatus of network topology are found in a kind of software defined network SDN
CN105100232B (en) A kind of method of the serve end program smooth upgrade of continual service

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