CN109902015A - A kind of intelligence contract emulation test method, device, system and storage medium - Google Patents

A kind of intelligence contract emulation test method, device, system and storage medium Download PDF

Info

Publication number
CN109902015A
CN109902015A CN201910157376.6A CN201910157376A CN109902015A CN 109902015 A CN109902015 A CN 109902015A CN 201910157376 A CN201910157376 A CN 201910157376A CN 109902015 A CN109902015 A CN 109902015A
Authority
CN
China
Prior art keywords
intelligent contract
cloud server
data
emulation
simulation result
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
CN201910157376.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.)
Eight Component Mdt Infotech Ltd Of Beijing
Peking University
Beijing Octa Innovations Information Technology Co Ltd
Original Assignee
Eight Component Mdt Infotech Ltd Of Beijing
Peking 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 Eight Component Mdt Infotech Ltd Of Beijing, Peking University filed Critical Eight Component Mdt Infotech Ltd Of Beijing
Priority to CN201910157376.6A priority Critical patent/CN109902015A/en
Publication of CN109902015A publication Critical patent/CN109902015A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a kind of intelligent contract emulation test method, device, system and storage mediums, it is related to block chain network technical field, the method is applied to block chain network, the method is executed by cloud server, which comprises builds emulation testing network frame according to program instruction;The setting load entrance on emulation testing network frame, the load entrance include that intelligent contract load entrance and sample data load entrance;Intelligent contract and sample data are loaded into emulation testing frame by load entrance;Emulation detection is carried out to sample data;Output simulation result is simultaneously evaluated.The present invention is able to solve solves the problems, such as that bring intelligence contract error result is irreversible due to manual operation mistake without avoiding measures in the prior art.

Description

A kind of intelligence contract emulation test method, device, system and storage medium
Technical field
The present embodiments relate to block chain network technical fields, and in particular to a kind of intelligence contract emulation test method, Device, system and storage medium.
Background technique
Intelligent contract is a kind of particular protocol, it is desirable to provide, verifying and execute contract.Specifically, intelligent contract is area Block chain is referred to as " decentralization " major reason, it allows us in the case where not needing third-party situation, execute it is traceable, Irreversible and safe transaction.Intelligent contract contains all information in relation to trading, and can just hold only after meeting the requirements Row results operation.The difference of intelligent contract and traditionally on paper contract is that intelligent contract is generated by computer.Therefore, code Itself explain the correlation obligation of participant.
In fact, the participant of intelligent contract is usually the stranger on internet, it is limited by binding digitlization Agreement.Substantially, intelligent contract is otherwise a digital contract unless meeting the requirements will not generate result.But just as it is any its His new system protocol is the same, and intelligent contract is simultaneously imperfect.Intelligent contract can not need to appoint using the process being fully automated Who as long as meeting requirement listed by intelligent contract code, can save the time, reduce cost, trade more quasi- to participate in Really, it and can not change.Although many people regard the irreversible characteristic of intelligent contract as its key benefit, also someone recognizes Once to go wrong and can not modify.Because the mankind can make mistakes, same when creating intelligent contract, some binding protocols can It can include mistake, and they can not be reversed.However the measure of the above problem is not avoided in the prior art.
Summary of the invention
For this purpose, the embodiment of the present invention provides one kind, to solve the problems, such as in the prior art due to caused by.
To achieve the goals above, the embodiment of the present invention provides the following technical solutions:
According to a first aspect of the embodiments of the present invention,
A kind of intelligent contract emulation test method is provided, the method is applied to block chain network, and the method is by cloud Server executes, which comprises builds emulation testing network frame according to program instruction;On emulation testing network frame Setting load entrance, the load entrance include that intelligent contract load entrance and sample data load entrance;By loading entrance Intelligent contract and sample data are loaded into emulation testing frame;Emulation detection is carried out to sample data;Export simulation result And it is evaluated.
Further, the method for carrying out emulation detection to sample data includes: to be analyzed and processed to sample data, Generate trust data packet;Parameter configuration is carried out to trust data packet;Simulated program is run according to intelligent contract rule;Detect sample Parameters of the data in simulation process.
Further, the output simulation result and the method evaluated include: by simulation result and default result into Row compares, and provides comparison result, and analyze comparison result by evaluation unit, provides evaluation number, and pass through data Simulation result and evaluation number are fed back to mobile terminal by output unit.
According to a second aspect of the embodiments of the present invention,
A kind of cloud server is provided, the cloud server includes: global control unit, for building emulation testing net Network frame, setting load entrance, and load intelligent contract and sample data;Information configuration unit, for being carried out to sample data Parameter configuration;Simulation run unit generates simulation result for running intelligent contract simulated program according to intelligent contract rule; Evaluation unit generates evaluation number for evaluation to be compared to simulation result;Data outputting unit, for by simulation result and Evaluation number feeds back to mobile terminal.
Further, the cloud server further includes data analysis unit, and the data analysis unit is used for sample Data are analyzed and processed, and generate trust data packet, then carry out parameter by data of the information configuration unit to trust data packet and match It sets.
Further, the evaluation unit is specifically used for: the intelligent contract default result of sample data is stored in advance, then leads Enter simulation result, simulation result is compared with default result, provides the comparison result of each item data, and single by evaluation Member analyzes comparison result, provides evaluation number, the calculating accuracy rate for aided assessment intelligence contract.
In the third aspect of embodiments of the present invention,
A kind of intelligent contract emulation test system is provided, the system comprises: cloud server, terminal device and network frame Frame node server, the cloud server and terminal device and network frame node server, which are established, to be communicated to connect, the cloud End server is for executing the method according to claim 1;The network frame node server is used for and cloud End server collectively constitutes intelligent contract emulation detection framework;The terminal device is for showing simulation result and evaluation number.
In the fourth aspect of embodiments of the present invention,
There is provided a kind of computer storage medium, which is characterized in that include one or more in the computer storage medium Program instruction, one or more of program instructions are used to be executed a kind of intelligent contract that first aspect is introduced by server and imitate Method step either in true test method.
The embodiment of the present invention has the advantages that
The present invention constructs intelligent contract emulation detection network frame by cloud server, by imitating sample data True detection plays the role of detecting in advance, can be avoided intelligent contract to reach the test effect before intelligent contract use The irreversible situation of error result.
Detailed description of the invention
It, below will be to embodiment party in order to illustrate more clearly of embodiments of the present invention or technical solution in the prior art Formula or attached drawing needed to be used in the description of the prior art are briefly described.It should be evident that the accompanying drawings in the following description is only It is merely exemplary, it for those of ordinary skill in the art, without creative efforts, can also basis The attached drawing of offer, which is extended, obtains other implementation attached drawings.
Fig. 1 is a kind of intelligent contract emulation test method flow diagram provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of cloud server provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of intelligent contract emulation test system provided in an embodiment of the present invention.
In figure: global control unit 01, data analysis unit 02, information configuration unit 03, simulation run unit 04, evaluation Unit 05, data outputting unit 06, cloud server 07, terminal device 08, network frame node server 09.
Specific embodiment
Embodiments of the present invention are illustrated by particular specific embodiment below, those skilled in the art can be by this explanation Content disclosed by book is understood other advantages and efficacy of the present invention easily, it is clear that described embodiment is the present invention one Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
The present embodiment provides a kind of intelligent contract emulation test method, the method is applied to block chain network, is applied to The network scenarios in need realized by intelligent contract, the method executed by cloud server 07, it is described with reference to Fig. 1 Method includes:
Step S1 builds emulation testing network frame according to program instruction.
Specifically, each node in analog block chain network builds emulation testing network frame, to guarantee intelligent contract Program can operate normally, emulation testing network frame generally comprise data Layer, network layer, common recognition layer, excitation layer, contract layer and Application layer, data Layer encapsulate bottom data block and the technologies such as relevant data encryption and timestamp;Network layer then includes Distributed networking mechanism, data dissemination mechanism and data authentication mechanism etc.;All kinds of common recognitions of common recognition layer predominant package network node Algorithm;Economic factor is integrated into block chain technical system by excitation layer, main issuing mechanism including economic incentives and point With mechanism etc.;All kinds of scripts of contract layer predominant package, algorithm and intelligent contract, are the bases of block chain programmable features;Using Layer then encapsulates the various application scenarios and case of block chain.
Step S2, the setting load entrance on emulation testing network frame.
Specifically, the load entrance includes that intelligent contract load entrance and sample data load entrance, and intelligent contract adds It is loaded into mouth to be used to intelligent contract rule being loaded into block chain, and is sent to each node, guarantee that each node can This intelligent contract rule is received, sample data loads entrance, for sample data to be loaded into block chain network, for triggering intelligence The trigger condition of energy contract.
Intelligent contract and sample data are loaded into emulation testing frame by step S3 by load entrance.
Specifically, intelligent contract is participated and draw jointly by multiple users in block chain, can be used for any between user Trading activity.The rights and duties of both sides are specified in intelligent contract, developer is by these rights and duties with electronization Mode is programmed, comprising that can trigger the condition that contract executes automatically in code;Once coding is completed, this part of intelligent contract just by It uploads in block chain network, i.e., the whole network verifying node can all receive this contract;Intelligent contract can periodically check whether exist Dependent event and trigger condition;The event for meeting condition will be pushed in queue to be verified;Verifying node on block chain Signature verification first is carried out to sample event, to ensure its validity, after waiting most of verifying nodes to reach common understanding the event, intelligence Successful execution is notified user by energy contract;The contract of successful execution will remove block, and the contract being not carried out then continues waiting for Next round processing, until successful execution.
Step S4 carries out emulation detection to sample data.
Further, sample data is analyzed and processed first, generates trust data packet, that is, is authenticated, it is ensured that its Validity;Then parameter configuration is carried out to trust data packet, assigned it in corresponding contract rule;Then it is closed according to intelligence About rule operation simulated program, i.e. triggering contract, fulfil rule and are calculated, and it is each in simulation process to detect sample data Item parameter.
Step S5 exports simulation result and is evaluated.
Specifically, before being emulated, it is believed that calculate the notional result that sample data should obtain, form default result In typing block chain, after sample data generates actual emulation result during actual emulation, by the simulation result and preset As a result it is compared, provides comparison result, and analyze comparison result by evaluation unit, provide evaluation number, and logical It crosses data outputting unit and simulation result and evaluation number is fed back into terminal device 08, evaluate holding for the intelligence contract for natural person Row accuracy rate.
Corresponding with above-described embodiment, with reference to Fig. 2, the present invention also provides a kind of cloud server 07, the cloud services Device 07 includes:
Global control unit 01, for building emulation testing network frame, setting load entrance, and load intelligent contract and Sample data;
Information configuration unit 03, for carrying out parameter configuration to sample data;
Simulation run unit 04 generates simulation result for running intelligent contract simulated program according to intelligent contract rule;
Evaluation unit 05 generates evaluation number for evaluation to be compared to simulation result;
Data outputting unit 06, for simulation result and evaluation number to be fed back to terminal device 08.
Wherein, cloud server 07 further includes data analysis unit 02, and the data analysis unit 02 is used for sample number According to being analyzed and processed, trust data packet is generated, then carry out parameter by data of the information configuration unit 03 to trust data packet and match It sets.
Further, evaluation unit 05 is specifically used for: the intelligent contract default result of sample data is stored in advance, then imports Simulation result is compared with default result, provides the comparison result of each item data, and passes through evaluation unit by simulation result 05 pair of comparison result is analyzed, and evaluation number is provided, the calculating accuracy rate for aided assessment intelligence contract.
Function performed by each component has hereinbefore been done in a kind of cloud server 07 provided in an embodiment of the present invention It is discussed in detail, therefore does not do excessively repeat here.
Corresponding with above-described embodiment, with reference to Fig. 3, the present invention provides a kind of intelligent contract emulation test system, described System includes: cloud server 07, terminal device 08 and network frame node server 09, the cloud server 07 and terminal Equipment 08 and network frame node server 09 establish communication connection, and the cloud server 07 is for executing such as claim 1- 3 described in any item methods;The network frame node server 09 is used to collectively constitute intelligent contract with cloud server 07 Emulate detection framework;The terminal device includes the display such as computer for showing simulation result and evaluation number, terminal device Equipment.
Corresponding with above-described embodiment, the embodiment of the present invention also provides a kind of computer storage medium, which is characterized in that Comprising one or more program instructions in the computer storage medium, one or more of program instructions are used for by server It executes such as a kind of intelligent contract emulation test method as described above.
Although above having used general explanation and specific embodiment, the present invention is described in detail, at this On the basis of invention, it can be made some modifications or improvements, this will be apparent to those skilled in the art.Therefore, These modifications or improvements without departing from theon the basis of the spirit of the present invention are fallen within the scope of the claimed invention.

Claims (8)

1. a kind of intelligence contract emulation test method, which is characterized in that the method is applied to block chain network, the method by Cloud server executes, which comprises
Emulation testing network frame is built according to program instruction;
The setting load entrance on emulation testing network frame, the load entrance include intelligent contract load entrance and sample number According to load entrance;
Intelligent contract and sample data are loaded into emulation testing frame by load entrance;
Emulation detection is carried out to sample data;
Output simulation result is simultaneously evaluated.
2. a kind of intelligent contract emulation test method as described in claim 1, which is characterized in that described to be carried out to sample data Emulating the method detected includes:
Sample data is analyzed and processed, trust data packet is generated;
Parameter configuration is carried out to trust data packet;
Simulated program is run according to intelligent contract rule;
Detect parameters of the sample data in simulation process.
3. a kind of intelligent contract emulation test method as described in claim 1, which is characterized in that the output simulation result is simultaneously The method evaluated includes: that simulation result is compared with default result, provides comparison result, and pass through evaluation unit pair Comparison result is analyzed, and provides evaluation number, and simulation result and evaluation number are fed back to shifting by data outputting unit Dynamic terminal.
4. a kind of cloud server, which is characterized in that the cloud server includes:
Global control unit for building emulation testing network frame, setting load entrance, and loads intelligent contract and sample number According to;
Information configuration unit, for carrying out parameter configuration to sample data;
Simulation run unit generates simulation result for running intelligent contract simulated program according to intelligent contract rule;
Evaluation unit generates evaluation number for evaluation to be compared to simulation result;
Data outputting unit, for simulation result and evaluation number to be fed back to mobile terminal.
5. a kind of cloud server as claimed in claim 4, which is characterized in that the cloud server further includes data analysis Unit, the data analysis unit generate trust data packet, then by information configuration list for being analyzed and processed to sample data Member carries out parameter configuration to the data of trust data packet.
6. a kind of cloud server as claimed in claim 4, which is characterized in that the evaluation unit is specifically used for: depositing in advance The intelligent contract default result of sample storage notebook data, then simulation result is imported, simulation result is compared with default result, is provided The comparison result of each item data, and comparison result is analyzed by evaluation unit, evaluation number is provided, is commented for assisting Estimate the calculating accuracy rate of intelligent contract.
7. a kind of intelligence contract emulation test system, which is characterized in that the system comprises: cloud server, terminal device and Network frame node server, the cloud server and terminal device and network frame node server, which are established, to be communicated to connect, The cloud server is for executing the method according to claim 1;The network frame node server is used Detection framework is emulated in collectively constituting intelligent contract with cloud server;The terminal device is for showing simulation result and evaluation Index.
8. a kind of computer storage medium, which is characterized in that refer in the computer storage medium comprising one or more programs It enables, one or more of program instructions are used to execute the method according to claim 1 by server.
CN201910157376.6A 2019-03-01 2019-03-01 A kind of intelligence contract emulation test method, device, system and storage medium Pending CN109902015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910157376.6A CN109902015A (en) 2019-03-01 2019-03-01 A kind of intelligence contract emulation test method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910157376.6A CN109902015A (en) 2019-03-01 2019-03-01 A kind of intelligence contract emulation test method, device, system and storage medium

Publications (1)

Publication Number Publication Date
CN109902015A true CN109902015A (en) 2019-06-18

Family

ID=66946121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910157376.6A Pending CN109902015A (en) 2019-03-01 2019-03-01 A kind of intelligence contract emulation test method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN109902015A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111162970A (en) * 2019-12-30 2020-05-15 支付宝(杭州)信息技术有限公司 Method and device for testing decentralized application server in block chain system
CN113411232A (en) * 2021-06-16 2021-09-17 深圳大学 Block chain simulation test system and application server
CN115774663A (en) * 2022-09-15 2023-03-10 江苏瑞蓝自动化设备集团有限公司 Optimization method, device, equipment and storage medium of LabVIEW test system
CN116306041A (en) * 2023-05-22 2023-06-23 工业和信息化部装备工业发展中心 Multi-scene set multi-engine automatic driving simulation test service platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103473A (en) * 2017-04-27 2017-08-29 电子科技大学 A kind of intelligent contract implementation method based on block chain
CN108011741A (en) * 2016-10-28 2018-05-08 富士通株式会社 For simulating the method and system with the block chain of test distributed network
CN108805562A (en) * 2017-04-27 2018-11-13 中思博安科技(北京)有限公司 The execution method and system of intelligent contract
US20180365686A1 (en) * 2017-06-19 2018-12-20 Hitachi, Ltd. Smart contract lifecycle management
CN109379233A (en) * 2018-11-30 2019-02-22 北京仿真中心 A kind of cloud emulation platform model safety safeguards system, method, server and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108011741A (en) * 2016-10-28 2018-05-08 富士通株式会社 For simulating the method and system with the block chain of test distributed network
CN107103473A (en) * 2017-04-27 2017-08-29 电子科技大学 A kind of intelligent contract implementation method based on block chain
CN108805562A (en) * 2017-04-27 2018-11-13 中思博安科技(北京)有限公司 The execution method and system of intelligent contract
US20180365686A1 (en) * 2017-06-19 2018-12-20 Hitachi, Ltd. Smart contract lifecycle management
CN109379233A (en) * 2018-11-30 2019-02-22 北京仿真中心 A kind of cloud emulation platform model safety safeguards system, method, server and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李光斗: "《区块链财富革命》", 31 December 2018 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111162970A (en) * 2019-12-30 2020-05-15 支付宝(杭州)信息技术有限公司 Method and device for testing decentralized application server in block chain system
CN113411232A (en) * 2021-06-16 2021-09-17 深圳大学 Block chain simulation test system and application server
CN115774663A (en) * 2022-09-15 2023-03-10 江苏瑞蓝自动化设备集团有限公司 Optimization method, device, equipment and storage medium of LabVIEW test system
CN116306041A (en) * 2023-05-22 2023-06-23 工业和信息化部装备工业发展中心 Multi-scene set multi-engine automatic driving simulation test service platform

Similar Documents

Publication Publication Date Title
CN109902015A (en) A kind of intelligence contract emulation test method, device, system and storage medium
WO2020037918A1 (en) Risk control strategy determining method based on predictive model, and related device
CN109495306A (en) A kind of expansion method and equipment of business network
Beuran Introduction to network emulation
CN110493812B (en) Distribution network test processing method, device and system, processor and master control equipment
Cao et al. Automated runtime verification for web services
CN109271762A (en) User authen method and device based on sliding block identifying code
CN109886810B (en) Crowdsourcing transaction method and system, readable storage medium and terminal
CN109831360A (en) Automated testing method and test macro for multi-user concurrent web authentication
CN110490416A (en) Task management method and terminal device
CN109783392A (en) Cloud net fusion architecture system detection method and device
Berger et al. Does my bft protocol implementation scale?
Mouttappa et al. Using passive testing based on symbolic execution and slicing techniques: Application to the validation of communication protocols
Gheorghe-Pop et al. A performance benchmarking methodology for MQTT broker implementations
TWI626538B (en) Infrastructure rule generation
CN111245800B (en) Network security test method and device, storage medium and electronic device
US20210382725A1 (en) Architecture mapping of applications
CN210016474U (en) Distribution network test control equipment and system
CN116319242A (en) Cloud management platform micro-service scheduling method and device based on RPA technology
CN104391782B (en) Network device management software client simulation method based on XML scripts
CN108363922A (en) A kind of automation malicious code emulation detection method and system
Seifi et al. Analysis of two authorization protocols using Colored Petri Nets
CN112015373B (en) Endogenous safety application software formal modeling method based on formalization method
CN112015648A (en) Test method, device, computer equipment and medium based on automation script
Fiterau-Brostean Active model learning for the analysis of network protocols

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190618