CN110177079A - The calling system and call method of intelligent contract - Google Patents
The calling system and call method of intelligent contract Download PDFInfo
- Publication number
- CN110177079A CN110177079A CN201910309770.7A CN201910309770A CN110177079A CN 110177079 A CN110177079 A CN 110177079A CN 201910309770 A CN201910309770 A CN 201910309770A CN 110177079 A CN110177079 A CN 110177079A
- Authority
- CN
- China
- Prior art keywords
- node
- block chain
- intelligent contract
- transaction
- input parameter
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3825—Use of electronic signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Software Systems (AREA)
- Strategic Management (AREA)
- Finance (AREA)
- General Business, Economics & Management (AREA)
- General Engineering & Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present invention relates to block chain technical fields, disclose the calling system and call method of a kind of intelligent contract.The calling system includes: resolver, for parsing the input parameter and function signature of the intelligent contract called needed for user's request;Auxiliary device, the auxiliary device include: block chain node health examination unit, for obtaining at random and sending healthy address of node according to the block chain address in the input parameter;And calling device, for the input parameter and the function signature to be sent to the healthy node by calling bridge in the form of preset structure body according to the healthy address of node.The simple calling of intelligent contract can be achieved in the present invention, and can largely maintain the synchronism traded between node, to ensure the consistency of intelligent contract data.
Description
Technical field
The present invention relates to block chain technical fields, more particularly to the calling system and call method of a kind of intelligent contract.
Background technique
Block chain is the novel of the computer technologies such as Distributed Storage, point-to-point transmission, common recognition mechanism, Encryption Algorithm
Application model.If block chain 1.0 is that solve the problems, such as the decentralization of currency and means of payment using bit coin as representative,
So block chain 2.0 is exactly more macroscopical to whole market decentralization (most typical is exactly ETH ether mill), utilizes block chain
Technology converts many different digital assets, and is not limited to bit coin, then different assets are created by transferring the possession of
Value.2.0 epoch of block chain are also referred to as the block chain intelligence contract epoch.
Intelligent contract based on block chain technology can not only play advantage of the intelligent contract in terms of cost efficiency, but also
The interference that contract can be normally executed to avoid malicious act.Intelligent contract is written in block chain in the form of digitized, by
The characteristic guarantee storage of block chain technology, the whole process for reading and executing are transparent traceable and can not hold and change.Meanwhile by block
The included common recognition algorithm of chain constructs a set of state machine system, and intelligent contract is efficiently run.
The representative of intelligent contract is ether mill, and still, there is also many problems for the intelligent contract run on ether mill:
(1) intelligent contract calls complicated, generally uses web3j geth client call, but it is not supported in traditional software exploitation
HTTP request;(2) synchronization traded between block chain node is influenced by many factors such as networks, thus to intelligent contract data
Consistency have an impact.
Summary of the invention
In view of this, the present invention is directed to propose a kind of calling system of intelligence contract, can realize the simple of intelligent contract
It calls, and can largely maintain the synchronism traded between node, to ensure the consistency of intelligent contract data.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
A kind of calling system of intelligence contract, which includes: resolver, is called needed for user's request for parsing
Intelligent contract input parameter and function signature;Auxiliary device, the auxiliary device include: block chain node health examination list
Member, for obtaining at random and sending healthy address of node according to the block chain address in the input parameter;And call dress
It sets, is used for according to the healthy address of node, by the input parameter and the function signature in the form of preset structure body
By calling bridge to be sent to the healthy node.
Optionally, the block chain node health examination unit is also used to, and that inspects periodically the node in block chain goes out block
Situation, and alarm in the case where bifurcated or block exception out occurs in the node.
Optionally, the function signature that the resolver is used to parse the intelligent contract called needed for user's request includes: root
According to the intelligent contract address in the input parameter, acquisition describes corresponding with the intelligent contract method in the input parameter
The function signature.
Optionally, the resolver includes: receiving unit, the call result returned for receiving the calling bridge;And
Resolution unit, for parse user request needed for call intelligent contract input parameter and function signature, and for according to
Preset parameter type parses the call result.
Optionally, the calling device is also used to, and the type of user's request is determined according to the function signature, described
Auxiliary device further include: block chain trading pit monitoring unit, for supervising in the case where user request is the transaction of block chain
Control the caching situation of the healthy node;And/or block chain nonce control unit, for being block chain in user request
In the case where transaction, continuous nonce value is provided according to the time that the transaction generates.
Optionally, the block chain nonce control unit is also used to, and shows the Fail Transaction in the call result parsed
In the case where, the corresponding nonce value of the exchange is distributed into newly generated transaction.
Optionally, the calling system further include: Authority Verification device, for verify interface authority, intelligent contract permission,
It asks for an autograph and/or idempotence.
Compared with the existing technology, the calling system of intelligent contract of the present invention has the advantage that
(1) random to obtain healthy address of node according to the block chain address in the input parameter of parsing acquisition, according still further to
The health address of node, the input parameter and function signature that parsing is obtained pass through calling in the form of preset structure body
Bridge is sent to the healthy node, and therefore, which can realize the simple calling of intelligent contract, and can be largely
The synchronism traded between node is maintained, to ensure the consistency of intelligent contract data.
(2) inspecting periodically for block situation is gone out to node by block chain node health examination unit, block chain can be prevented
The abnormal influence that transaction is generated of node bifurcated or out block.
(3) it in the case where user request is the transaction of block chain, is monitored by block chain trading pit monitoring unit strong
The caching situation of Kang Jiedian enters pond situation so as to control transaction according to the Pressure behaviour of trading pit, improves on the whole
The trading processing ability of node.
(4) in the case where user request is the transaction of block chain, by block chain nonce control unit according to described
The time that transaction generates provides continuous nonce value, so as to provide one for every transaction in the case where a large amount of transaction occur
A nonce value, multiple transaction can be performed simultaneously by being not required to artificially control as a result, and transaction replay also can be effectively prevented.
Another object of the present invention is to propose a kind of call method of intelligent contract, the simple of intelligent contract can be realized
It calls, and can largely maintain the synchronism traded between node, to ensure the consistency of intelligent contract data.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
It is a kind of intelligence contract call method include: parse user request needed for call intelligent contract input parameter and
Function signature;According to the block chain address in the input parameter, obtains at random and send healthy address of node;And according to
The health address of node, by the input parameter and the function signature by calling bridge hair in the form of preset structure body
It send to the healthy node.
Optionally, the call method further include: that inspects periodically the node in block chain goes out block situation;And described
Alarming in the case where bifurcated or out block exception occurs in node.
Optionally, the function signature obtains in the following manner: according to it is described input parameter in intelligent contract address,
It obtains and describes the corresponding function signature with the intelligent contract method in the input parameter.
Optionally, the call method further include: receive the call result for calling bridge to return;And according to preset
Parameter type parses the call result.
Optionally, the call method further include: the type of user's request is determined according to the function signature;And
In the case where user request is the transaction of block chain, the block chain address according in the input parameter is being executed,
After the step of obtaining at random and send healthy node address, following operation: the caching situation of the monitoring healthy node is executed;
And/or according to the continuous nonce value in the time offer preset range of transaction generation.
Optionally, the call method further include:, will in the case where the call result parsed shows the Fail Transaction
The corresponding nonce value of the exchange distributes to newly generated transaction.
Optionally, the call method further include: at least one of following permission is verified: interface authority, intelligence
Can contract permission, ask for an autograph and idempotence inspection.
The call method of the intelligence contract and the call method system of above-mentioned intelligent contract are had compared with the existing technology
Some advantages are identical, and details are not described herein.
Another object of the present invention is to propose a kind of machine readable storage medium, which is characterized in that this is machine readable to deposit
Instruction is stored on storage media, which is used for so that machine executes the call method of above-mentioned intelligent contract.
Another object of the present invention is to propose a kind of processor, for running program, wherein when described program is run
For executing the call method of above-mentioned intelligent contract.
The call method of the machine readable storage medium, the processor and above-mentioned intelligent contract is compared with the existing technology
Possessed advantage is identical, and details are not described herein.
The other feature and advantage of the embodiment of the present invention will the following detailed description will be given in the detailed implementation section.
Detailed description of the invention
Attached drawing is to further understand for providing to the embodiment of the present invention, and constitute part of specification, under
The specific embodiment in face is used to explain the present invention embodiment together, but does not constitute the limitation to the embodiment of the present invention.Attached
In figure:
Fig. 1 is the structure chart of the calling system for the intelligent contract that one embodiment of the invention provides;
Fig. 2 is the structure chart for the auxiliary device that one embodiment of the invention provides;
Fig. 3 is the structure chart of the calling system for the intelligent contract that one embodiment of the invention provides;
Fig. 4 is the flow chart of the calling process for the intelligent contract that one embodiment of the invention provides;And
Fig. 5 is the flow chart of the calling process for the intelligent contract that one embodiment of the invention provides.
Description of symbols
10 resolver, 20 auxiliary device
30 calling device, 40 RESTFul api interface
50 Authority Verification devices 60 call bridge
70 identifications and 80 database of access management apparatus
90 buffers
Specific embodiment
It is described in detail below in conjunction with specific embodiment of the attached drawing to the embodiment of the present invention.It should be understood that this
Locate described specific embodiment and be merely to illustrate and explain the present invention embodiment, is not intended to restrict the invention embodiment.
Fig. 1 is the structure chart of the calling system for the intelligent contract that one embodiment of the invention provides.As shown in Figure 1, the intelligence
The calling system of energy contract can include: resolver 10, the intelligence conjunction for requesting to call needed for (or call request) for parsing user
Input parameter and function signature about;Auxiliary device 20, the auxiliary device 20 can include: block chain node health examination unit
21, for obtaining at random and sending healthy address of node according to the block chain address in the input parameter;And call dress
30 are set, is used for according to the healthy address of node, by the input parameter and the function label in the form of preset structure body
Name is by calling bridge to be sent to the healthy node.
It is usually in the prior art web3.js or geth client for receive user's request, these not mainstreams,
It is also not suitable for production level application.
In view of the foregoing drawbacks, the calling system of the intelligent contract in the present embodiment may also include that RESTFul API connects
Mouth 40, the calling api interface of the intelligent contract for externally providing RESTFul form, to facilitate user to pass through conventional HTTP
POST request calls.The content of conventional HTTP POST request can be the content as shown in the upper right corner in Fig. 3.
In order to guarantee the safety of intelligent contract calling, Authority Verification device can be also set in calling system, can lead to
The Authority Verification device is crossed to verify the identity information of user, content of request etc., only in the case where being proved to be successful,
The calling process of intelligent contract could be executed.
The calling system may also include that Authority Verification device 50, for verifying interface authority, intelligent contract permission, asking
Name of drawing lots before idols and/or idempotence.Wherein, being connect to whether user has using the RESTFul API is referred to the verifying of interface authority
The permission of mouth 40 is verified;Verifying user calls corresponding intelligence to close either with or without permission to be referred to the verifying of intelligent contract permission
About;Permission signature check refer to user to ask for an autograph (content requested) check;And idempotence inspection refers to
The same request of user is received by RESTFul api interface more than 40 times, received request content is checked.
After carrying out good authentication to above-mentioned permission by Authority Verification device 50, user can be requested by resolver 10
(or call request) is parsed, to obtain the information that the user requests the intelligent contract called needed for (or call request).
The resolver 10 can include: resolution unit, for parsing the input of the intelligent contract called needed for user's request
Parameter and function signature.Wherein, the input parameter can include: block chain address (such as address block chain jsonrpc), intelligence are closed
About address, intelligent contract method description are (for example, intelligence contract method description includes method name, parameter name and parameter class
The contents such as type.) etc..Correspondingly, the resolution unit is used to parse the function signature of the intelligent contract called needed for user's request
Particular content can include: according to it is described input parameter in intelligent contract address, obtain with it is described input parameter in intelligence
Contract method describes the corresponding function signature.Wherein, the function signature can include: the type of user's request and user
The parameter type of request.For the user request type, can include: block chain transaction and block chain query;For institute
The parameter type for stating user's request, may include integer, Boolean type and array.
Block chain node after the input parameter of the intelligent contract called needed for being obtained in parsing, in the auxiliary device 20
Health examination unit 21 can obtain at random according to the block chain address in the input parameter and send healthy address of node.
Wherein, the block chain address (for example, the address block chain jsonrpc) can analytically device 10 directly acquire, or analytically device
10 indirect gains (for example, by 30 indirect gain of calling device, as shown in Figure 3).
Specifically, the multiple sections corresponding to the address block chain jsonrpc of block chain node health examination unit 21
In point, one node of random screening (for example, block chain node -3 in Fig. 3), and health examination is carried out to it, if the node
(for example, block chain node -3) passes through health examination (i.e. whether failure), it is determined that the node (for example, block chain node -3) is
Healthy node, and obtain the address of the health node (for example, block chain node -3);If the node is (for example, block chain node-
3) do not given up then, then random screening next node (for example, block chain node -4 in Fig. 3), and by health examination to it
Health examination is carried out, until selecting healthy node.Next, by the healthy node screened (for example, block chain link
Point -3) initiate the transaction of block chain and/or block chain query.
The operation that healthy address of node is obtained above by block chain node health examination unit 21, can execute determination
It is executed before or after the operation of the type of user's request.
After obtaining the function signature in the intelligent contract, firstly, will be by calling device 30 according to the function
Signature determines the type of user's request, wherein the type of user's request can be looked into for the transaction of block chain or block chain
It askes.Then, the type requested according to different users, auxiliary device 20 execute following different operation.
In the case where user request is the transaction of block chain, if auxiliary device 20 has obtained, transaction is to be uploaded to be good for
Health address of node, then execute operations described below;Otherwise, it executes above by the block chain node health examination in auxiliary device 20
Unit 21 obtains the operation of healthy node, repeats no more in this, then executes operations described below.Operations described below is to pass through auxiliary device 20
The caching of the trading pit of the healthy node screened is monitored;And/or it can be provided by auxiliary device 20 to a large amount of transaction
Continuous nonce value.
As shown in Fig. 2, the auxiliary device 20 may also include that block chain trading pit monitoring unit 22, it is described for monitoring
The caching situation of healthy node;And/or block chain nonce control unit 23, for being that block chain is traded in user request
In the case where, nonce value is provided according to the time that the transaction generates.Wherein, the block chain nonce control unit is also used
In in the case where the call result parsed shows the Fail Transaction, the corresponding nonce value of the exchange is distributed to new production
Raw transaction.
It is described in detail separately below for said two units.
For block chain trading pit monitoring unit 22, each block chain node has trading pit caching, and trading pit is slow
After the transaction deposited is more, the processing capacity of node transaction will affect.Block chain trading pit monitoring unit 22 monitors healthy node
Trading pit, with limited or allowed according to the Pressure behaviour of trading pit transaction enter pond.Specifically, if trading pit pressure is more than
Preset pressure threshold value, then information such as feedback trading failure result;Otherwise, permissible to trade into pond.Therefore, improving on the whole should
The trading processing ability of healthy node, i.e. raising block chain number of deals TPS per second.Wherein, the caching in trading pit includes:
Queued, for storing transaction that is following, can not currently executing;And pending, for storing executable transaction.It is described
Block chain trading pit monitoring unit 22 can control above-mentioned two classes caching respectively.
For block chain nonce control unit 23, in the prior art, the account of each user is from the same section
When point initiates transaction, a nonce value is provided by artificial mode, and nonce value is started counting from 0, one transaction of every transmission,
Nonce value is accordingly added 1.After the corresponding transaction of the nonce value of front has been processed into, can just it handle subsequent
The corresponding transaction of nonce value, old friend Yi Buneng are processed in parallel.In addition, due to block chain node be it is distributed, cannot be accurate
Slave single node obtain current account next record transaction needed for nonce value, so when need high concurrent initiation trade when,
Module with regard to needing a strong consistency to provide continuous nonce value to account.The present embodiment is controlled by block chain nonce
Unit 23 distributes one section of continuous nonce value to the time automated intelligent generated according to transaction, the knot traded by background monitoring
Fruit, when transaction results show the Fail Transaction, then block chain nonce control unit 23 is by the corresponding nonce value of the exchange
A newly generated transaction is distributed to, when transaction results show transaction success, then the transaction is cached, later, in the transaction quilt
In the case where being uploaded to block chain, the transaction is deleted.Therefore, in the case where a large amount of transaction occur, multiple transaction can be parallel
Processing, and transaction replay can be effectively prevented.
In the case where user request is block chain query, if auxiliary device 20 has obtained, inquiry is corresponding to be good for
Health address of node is then not required to execute any operation;Otherwise, it executes above by the block chain node health in auxiliary device 20
Inspection unit 21 obtains the operation of healthy node, repeats no more in this.
After obtaining the information such as the input parameter and function signature after the healthy address of node, parsing, calling device
30 based on acquired above- mentioned information, and by calling bridge 60 to call intelligent contract corresponding with user's request.
Calling device 30 according to the healthy node (for example, block chain node -3 in Fig. 3) address, with preset structure
The form of body is by the input parameter and the function signature by calling bridge (go-brige) 60 to be sent to the healthy node.
Wherein, the preset structure body can be expressed as follows:
The area SDK Lai Yu of the Golang language for calling bridge (go-brige) 60 mainly to provide using ether mill official
Block chain node communication, such as initiate the inquiry or transaction request of intelligent contract.
After the input parameter and function signature of the intelligent contract called needed for user is requested are sent to healthy node, block
Chain executes different operations in response to the intelligent contract called.
In the case where user request is the transaction of block chain, healthy node receives the input ginseng of the intelligent contract
After several and function signature, chain can will be passed in the transaction by way of broadcast, and return to the result of transaction.Include in the result
Transaction id, it is subsequent to determine whether transaction is completed by inquiring this transaction id.
In the case where user request is block chain query, the result of inquiry is immediately returned to.
Above-mentioned call result can be by calling bridge 60, calling device 30 to be transferred to resolver 10.The resolver can be to institute
It states call result to be parsed, in order to which user interprets the call result.Specifically, the resolver 10 can also wrap
It includes: receiving unit, the call result returned for receiving the calling bridge 60.Correspondingly, the parsing list in the resolver 10
Member can also be used to parse the call result according to preset parameter type.
It include the label of success or failure in call result after parsing, for identifying the success or failure of calling process.
Correspondingly, the calling system may also include that judgment means (not shown), for reading the call result after parsing, and judge
Whether calling process succeeds.Certainly, the judgment means can be the device being separately provided, and can also be configuration in the resolver
Integrating device.
In addition, the calling system may also include that identification and access management (IAM) device 70, for defining and managing
Role and the access authority of user are managed, and regulation user is authorized the condition of (or being rejected authorization);Database 80, example
Such as, MySQL database;And buffer 90, for caching the information etc. of transaction, which can be Redis buffer, such as
Shown in Fig. 3.
Specifically, the existing calling process with intelligent contract shown in Fig. 4 is specifically described.
Step S401 initiates call request.
Call request is initiated by RESTFul api interface 40, which can be conventional HTTP POST request.
Step S402 carries out Authority Verification, if Authority Verification success, thens follow the steps S403, otherwise, executes step
S414。
Carrying out Authority Verification includes executing at least one of the following: verifying interface authority verifies intelligent contract power
Limit, signature checks and idempotence inspection.
Step S403, parses call request.
Call request is parsed by resolver 10, to obtain the input parameter and letter of the required intelligent contract called
Number signature.
Step S404 judges the type of call request, if call request is block chain query, thens follow the steps S405;If
Call request is the transaction of block chain, thens follow the steps S406;If call request is UNKNOWN TYPE, S414 is thened follow the steps.
Step S405 obtains healthy address of node, and executes step S410.
Step S406 obtains healthy address of node.
It is random to obtain simultaneously by block chain node health examination unit 21 according to the block chain address in the input parameter
Send the address of healthy node (for example, block chain node -3 in Fig. 3).
Step S407 judges whether the pressure of the trading pit of healthy node is more than preset pressure threshold value, if pressure is more than pre-
If pressure threshold thens follow the steps S414;Otherwise, step S408 is executed.
The pressure of the trading pit of healthy node is judged by block chain trading pit monitoring unit 22.
Step S408 obtains Nonce value.
Nonce value corresponding with the transaction of block chain is obtained from block chain nonce control unit 23.
Step S409, caching transaction.
By block chain transaction caching into buffer 90, it is deleted again after confirming that the transaction successfully enters chain.
Step S410 calls intelligent contract corresponding with the call request.
By calling device 30 according to the healthy address of node, by the input parameter in the form of preset structure body
And the function signature is by calling bridge 60 to be sent to the healthy node (for example, block chain node -3 in Fig. 3).
Step S411, parses call result.
Call result is parsed according to preset parameter type by resolver 10, in order to which user interprets.
Wherein, the label of the success (or failure) comprising the success (or failure) for identifying calling process in the call result.
Step S412 judges whether successfully to call intelligent contract according to the call result of parsing, if success, executes step
Rapid S413;Otherwise, step S414 is executed.
According to success or failure label, judge whether calling process succeeds.
Step S413 returns to successful result.
Step S414 returns to failure result.
In the case where the call request is that block chain is traded, block chain nonce control unit 23 will be with this transaction
Corresponding nonce value distributes to newly generated transaction.
In conclusion the present invention is creatively according to the block chain address in the input parameter of parsing acquisition, it is random to obtain
Healthy address of node, according still further to the healthy address of node, the input parameter and function signature that parsing is obtained are with default
The form of structural body, by calling bridge to be sent to the healthy node, therefore, which can realize the simple of intelligent contract
It calls, and can largely maintain the synchronism traded between node, to ensure the consistency of intelligent contract data.
Fig. 5 is a kind of flow chart of the call method of intelligent contract provided in an embodiment of the present invention.The call method can wrap
Include following steps: step S501, the input parameter and function signature of the intelligent contract called needed for parsing user's request;Step
S502 is obtained at random according to the block chain address in the input parameter and is sent healthy address of node;And step
S503 is led to the input parameter and the function signature in the form of preset structure body according to the healthy address of node
It crosses calling bridge and is sent to the healthy node.
The detail and benefit of call method in relation to intelligent contract provided by the invention see above-mentioned for intelligence
The description of the calling system of contract, repeats no more in this.
Correspondingly, the embodiment of the present invention also provides a kind of machine readable storage medium, which is characterized in that this is machine readable to deposit
Instruction is stored on storage media, which is used for so that machine executes the call method of above-mentioned intelligent contract.
Correspondingly, the embodiment of the present invention also provides a kind of processor, for running program, wherein described program is run
When for executing the call method of above-mentioned intelligent contract.
The call method of the machine readable storage medium, the processor and above-mentioned intelligent contract is compared with the existing technology
Possessed advantage is identical, and details are not described herein.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize target information store.Target information can be computer readable instructions, data structure, program device or its
His data.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory
(SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory
(ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only
Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or
Other magnetic storage devices or any other non-transmission medium, can be used for storage can be accessed by a computing device target information.
As defined in this article, computer-readable medium does not include temporary computer readable media (transitory media), is such as adjusted
The data-signal and carrier wave of system.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art,
Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement,
Improve etc., it should be included within the scope of the claims of this application.
Claims (16)
1. a kind of calling system of intelligence contract, which is characterized in that the calling system includes:
Resolver, for parsing the input parameter and function signature of the intelligent contract called needed for user's request;
Auxiliary device, the auxiliary device include: block chain node health examination unit, for according to the area in the input parameter
Block chain address obtains at random and sends healthy address of node;And
Calling device is used for according to the healthy address of node, by the input parameter and institute in the form of preset structure body
Function signature is stated by calling bridge to be sent to the healthy node.
2. the calling system of intelligence contract according to claim 1, which is characterized in that the block chain node health examination
Unit is also used to inspect periodically the block situation out of the node in block chain, and bifurcated or the out feelings of block exception occurs in the node
It alarms under condition.
3. the calling system of intelligence contract according to claim 1, which is characterized in that the resolver is for parsing user
The function signature of intelligent contract called needed for request includes:
According to the intelligent contract address in the input parameter, obtains and describe phase with the intelligent contract method in the input parameter
The corresponding function signature.
4. the calling system of intelligence contract according to claim 1, which is characterized in that the resolver includes:
Receiving unit, the call result returned for receiving the calling bridge;And
Resolution unit, the input parameter and function signature of the intelligent contract for calling needed for parsing user's request, and be used for
The call result is parsed according to preset parameter type.
5. the calling system of intelligence contract according to claim 4, which is characterized in that the calling device is also used to basis
The function signature determines the type of user's request,
The auxiliary device further include:
Block chain trading pit monitoring unit, for monitoring the health in the case where user request is the transaction of block chain
The caching situation of node;And/or
Block chain nonce control unit, for being produced according to the transaction in the case where user request is the transaction of block chain
The raw time provides nonce value.
6. the calling system of intelligence contract according to claim 5, which is characterized in that the block chain nonce control is single
Member is also used to, and in the case where the call result parsed shows the Fail Transaction, the corresponding nonce value of the exchange is distributed
To newly generated transaction.
7. the calling system of intelligence contract according to claim 1, which is characterized in that the calling system further include:
Authority Verification device, for verifying interface authority, intelligent contract permission, asking for an autograph and/or idempotence.
8. a kind of call method of intelligence contract, which is characterized in that the call method includes:
Parse the input parameter and function signature of the intelligent contract called needed for user's request;
According to the block chain address in the input parameter, obtains at random and send healthy address of node;And
According to the healthy address of node, the input parameter and the function signature are passed through in the form of preset structure body
Bridge is called to be sent to the healthy node.
9. the call method of intelligence contract according to claim 8, which is characterized in that the call method further include:
That inspects periodically the node in block chain goes out block situation;And
It alarms in the case where bifurcated or block exception out occurs in the node.
10. the call method of intelligence contract according to claim 8, which is characterized in that the function signature passes through following
Mode obtains:
According to the intelligent contract address in the input parameter, obtains and describe phase with the intelligent contract method in the input parameter
The corresponding function signature.
11. the call method of intelligence contract according to claim 8, which is characterized in that the call method further include:
Receive the call result that the calling bridge returns;And
The call result is parsed according to preset parameter type.
12. the call method of intelligence contract according to claim 11, which is characterized in that the call method further include:
The type of user's request is determined according to the function signature;And
In the case where user request is the transaction of block chain, with executing the block chain according in the input parameter
Location after the step of obtaining at random and sending healthy node address, executes following operation:
Monitor the caching situation of the healthy node;And/or
Continuous nonce value in preset range is provided according to the time that transaction generates.
13. the call method of intelligence contract according to claim 12, which is characterized in that the call method further include:
In the case where the call result parsed shows the Fail Transaction, the corresponding nonce value of the exchange is distributed into new generation
Transaction.
14. the call method of intelligence contract according to claim 8, which is characterized in that the call method further include:
Verify at least one of following permission: interface authority, intelligent contract permission ask for an autograph and idempotence.
15. a kind of machine readable storage medium, which is characterized in that be stored with instruction on the machine readable storage medium, the instruction
For making machine execute the called side of the above-mentioned intelligent contract according to any one of claim 8-14 claim
Method.
16. a kind of processor, for running program, wherein above-mentioned wanted according to right when described program is run for executing
Seek the call method of intelligent contract described in any one of 8-14 claim.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910309770.7A CN110177079B (en) | 2019-04-17 | 2019-04-17 | Calling system and calling method of intelligent contract |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910309770.7A CN110177079B (en) | 2019-04-17 | 2019-04-17 | Calling system and calling method of intelligent contract |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110177079A true CN110177079A (en) | 2019-08-27 |
CN110177079B CN110177079B (en) | 2021-10-15 |
Family
ID=67689510
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910309770.7A Active CN110177079B (en) | 2019-04-17 | 2019-04-17 | Calling system and calling method of intelligent contract |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110177079B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110827034A (en) * | 2019-10-31 | 2020-02-21 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for initiating a blockchain transaction |
CN110908813A (en) * | 2019-11-18 | 2020-03-24 | 深圳前海环融联易信息科技服务有限公司 | Intelligent contract calling method, device, system, computer equipment and storage medium |
CN111290958A (en) * | 2020-02-20 | 2020-06-16 | 联动优势(北京)数字科技有限公司 | Method and device for debugging intelligent contract |
CN111324591A (en) * | 2020-01-20 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Block chain bifurcation detection method and related device |
CN111786798A (en) * | 2020-07-08 | 2020-10-16 | 浪潮云信息技术股份公司 | Rest interface authentication implementation method applied to JavaWeb |
CN112116348A (en) * | 2020-08-12 | 2020-12-22 | 北京智融云河科技有限公司 | Access control method for node resource |
CN112163035A (en) * | 2020-05-15 | 2021-01-01 | 支付宝(杭州)信息技术有限公司 | Method and device for calling intelligent contract |
CN113162848A (en) * | 2020-01-22 | 2021-07-23 | 北京百度网讯科技有限公司 | Method, device, gateway and medium for realizing block chain gateway |
CN113626524A (en) * | 2021-08-12 | 2021-11-09 | 浙江网商银行股份有限公司 | Data processing method and device and data checking system |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107622385A (en) * | 2017-08-28 | 2018-01-23 | 南京邮电大学 | A kind of copyright distributing method based on block chain intelligence contract |
CN107688927A (en) * | 2017-09-19 | 2018-02-13 | 中国银行股份有限公司 | A kind of method and system for calling the intelligent contract on block chain |
CN108009823A (en) * | 2017-11-03 | 2018-05-08 | 厦门快商通信息技术有限公司 | The distributed call method and system for calculating power resource based on block chain intelligence contract |
CN108062672A (en) * | 2017-12-07 | 2018-05-22 | 北京泛融科技有限公司 | A kind of process dispatch method based on block chain intelligence contract |
WO2018126059A1 (en) * | 2016-12-30 | 2018-07-05 | Slock.it, Inc. | Block-chain enabled service provider system |
CN108510389A (en) * | 2018-03-30 | 2018-09-07 | 深圳前海微众银行股份有限公司 | Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
CN108898390A (en) * | 2018-06-27 | 2018-11-27 | 阿里巴巴集团控股有限公司 | Intelligent contract call method and device, electronic equipment based on block chain |
CN109146679A (en) * | 2018-06-29 | 2019-01-04 | 阿里巴巴集团控股有限公司 | Intelligent contract call method and device, electronic equipment based on block chain |
CN109255251A (en) * | 2018-10-31 | 2019-01-22 | 安徽中科智链信息科技有限公司 | File data based on block chain technology protects system and method |
CN109492053A (en) * | 2018-11-08 | 2019-03-19 | 北京百度网讯科技有限公司 | Method and apparatus for accessing data |
CN109583184A (en) * | 2018-10-09 | 2019-04-05 | 阿里巴巴集团控股有限公司 | Auth method and device and electronic equipment |
-
2019
- 2019-04-17 CN CN201910309770.7A patent/CN110177079B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018126059A1 (en) * | 2016-12-30 | 2018-07-05 | Slock.it, Inc. | Block-chain enabled service provider system |
CN107622385A (en) * | 2017-08-28 | 2018-01-23 | 南京邮电大学 | A kind of copyright distributing method based on block chain intelligence contract |
CN107688927A (en) * | 2017-09-19 | 2018-02-13 | 中国银行股份有限公司 | A kind of method and system for calling the intelligent contract on block chain |
CN108009823A (en) * | 2017-11-03 | 2018-05-08 | 厦门快商通信息技术有限公司 | The distributed call method and system for calculating power resource based on block chain intelligence contract |
CN108062672A (en) * | 2017-12-07 | 2018-05-22 | 北京泛融科技有限公司 | A kind of process dispatch method based on block chain intelligence contract |
CN108510389A (en) * | 2018-03-30 | 2018-09-07 | 深圳前海微众银行股份有限公司 | Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
CN108898390A (en) * | 2018-06-27 | 2018-11-27 | 阿里巴巴集团控股有限公司 | Intelligent contract call method and device, electronic equipment based on block chain |
CN109146679A (en) * | 2018-06-29 | 2019-01-04 | 阿里巴巴集团控股有限公司 | Intelligent contract call method and device, electronic equipment based on block chain |
CN109583184A (en) * | 2018-10-09 | 2019-04-05 | 阿里巴巴集团控股有限公司 | Auth method and device and electronic equipment |
CN109255251A (en) * | 2018-10-31 | 2019-01-22 | 安徽中科智链信息科技有限公司 | File data based on block chain technology protects system and method |
CN109492053A (en) * | 2018-11-08 | 2019-03-19 | 北京百度网讯科技有限公司 | Method and apparatus for accessing data |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110827034A (en) * | 2019-10-31 | 2020-02-21 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for initiating a blockchain transaction |
CN110827034B (en) * | 2019-10-31 | 2021-10-22 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for initiating a blockchain transaction |
CN110908813A (en) * | 2019-11-18 | 2020-03-24 | 深圳前海环融联易信息科技服务有限公司 | Intelligent contract calling method, device, system, computer equipment and storage medium |
CN110908813B (en) * | 2019-11-18 | 2022-08-05 | 深圳前海环融联易信息科技服务有限公司 | Intelligent contract calling method, device, system, computer equipment and storage medium |
CN111324591B (en) * | 2020-01-20 | 2021-02-12 | 腾讯科技(深圳)有限公司 | Block chain bifurcation detection method and related device |
CN111324591A (en) * | 2020-01-20 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Block chain bifurcation detection method and related device |
CN113162848B (en) * | 2020-01-22 | 2022-11-01 | 北京百度网讯科技有限公司 | Method, device, gateway and medium for realizing block chain gateway |
CN113162848A (en) * | 2020-01-22 | 2021-07-23 | 北京百度网讯科技有限公司 | Method, device, gateway and medium for realizing block chain gateway |
CN111290958A (en) * | 2020-02-20 | 2020-06-16 | 联动优势(北京)数字科技有限公司 | Method and device for debugging intelligent contract |
CN111290958B (en) * | 2020-02-20 | 2023-05-30 | 联动优势科技有限公司 | Method and device for debugging intelligent contract |
CN112163035A (en) * | 2020-05-15 | 2021-01-01 | 支付宝(杭州)信息技术有限公司 | Method and device for calling intelligent contract |
CN112163035B (en) * | 2020-05-15 | 2024-05-31 | 支付宝(杭州)信息技术有限公司 | Method and device for calling intelligent contract |
CN111786798A (en) * | 2020-07-08 | 2020-10-16 | 浪潮云信息技术股份公司 | Rest interface authentication implementation method applied to JavaWeb |
CN112116348A (en) * | 2020-08-12 | 2020-12-22 | 北京智融云河科技有限公司 | Access control method for node resource |
CN112116348B (en) * | 2020-08-12 | 2024-05-03 | 北京智融云河科技有限公司 | Access control method for node resources |
CN113626524A (en) * | 2021-08-12 | 2021-11-09 | 浙江网商银行股份有限公司 | Data processing method and device and data checking system |
Also Published As
Publication number | Publication date |
---|---|
CN110177079B (en) | 2021-10-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110177079A (en) | The calling system and call method of intelligent contract | |
KR102197371B1 (en) | Identity verification method and device | |
US11727120B2 (en) | Blockchain cybersecurity solutions | |
JP6696001B2 (en) | Method and device for outputting risk information and constructing risk information | |
CN108932348B (en) | Block chain merging processing method and device, block chain node and storage medium | |
CN108595157A (en) | Processing method, device, equipment and the storage medium of block chain data | |
CN112840321A (en) | Application programming interface for automated operations management | |
CN111652615B (en) | Safety identification method based on block chain big data and artificial intelligence cloud service platform | |
CN112785086A (en) | Credit overdue risk prediction method and device | |
CN109727132A (en) | Acquisition methods, device, electronic equipment and the storage medium of block chain common recognition node | |
CN116910707A (en) | Model copyright management method and system based on equipment history record | |
CN106790029A (en) | A kind of big data acquisition methods and system based on identifying code | |
CN114971638A (en) | Transaction authentication method and device based on risk identification | |
CN104376397B (en) | A kind of data real-time analysis method and device | |
CN115599653A (en) | Method, system and medium for constructing welding quality diagnosis model | |
CN117615359B (en) | Bluetooth data transmission method and system based on multiple rule engines | |
CN110414260B (en) | Data access method, device, system and storage medium | |
CN112181599A (en) | Model training method, device and storage medium | |
CN113051603A (en) | Cloud service interaction method combining cloud computing and information digitization and big data platform | |
US20240106866A1 (en) | Machine learning for computer security policy modification | |
CN114491662B (en) | Block chain-based data asset auditing method, system and equipment | |
CN111177320A (en) | Class case simultaneous judging method, equipment and medium based on block chain | |
CN109727121A (en) | Debt-credit matching process, signal auditing method based on block chain network | |
CN114926279A (en) | Terminal payment method and system based on block chain | |
CN108809751A (en) | A kind of policy test method and device |
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 |