CN109543457A - The method and device called between control intelligent contract - Google Patents
The method and device called between control intelligent contract Download PDFInfo
- Publication number
- CN109543457A CN109543457A CN201811321299.5A CN201811321299A CN109543457A CN 109543457 A CN109543457 A CN 109543457A CN 201811321299 A CN201811321299 A CN 201811321299A CN 109543457 A CN109543457 A CN 109543457A
- Authority
- CN
- China
- Prior art keywords
- intelligent contract
- called
- called side
- voucher
- call request
- 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
- 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- 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/3821—Electronic credentials
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides the method and device called between a kind of control intelligent contract.This method comprises: parsing call request when detecting that the first intelligent contract initiates call request to the second intelligent contract, call request includes called side, called side, the first voucher and timestamp;According to the called side in call request and the side that is called, the operational factor of corresponding called side is searched in the registration table of block chain, and the second voucher is obtained according to the operational factor of called side and timestamp;Judge whether the second voucher matches with the first voucher;If the second voucher and the first credential match, executes the first intelligent contract and call the second intelligent contract.To, it can be achieved that management to being called between intelligent contract, guarantee the calling between intelligent contract it is reliable with it is safe.
Description
Technical field
This application involves the method and devices called between information technology field more particularly to a kind of control intelligent contract.
Background technique
Block chain is a kind of decentralization distribution book keeping operation technology from bit coin, by pressing cryptographic block data
Be superimposed according to time sequencing and generate lasting not revisable record, and by record storage block chain network each node
In, so that each node participated in block chain safeguards respective database jointly.As a result, block chain have decentralization,
The technical advantages such as tamper-resistant, data consistency store, transparent procedures is traceable, are considered in finance, reference, Internet of Things, warp
The various fields such as Ji trade settlement, asset management are owned by broad application prospect.
Intelligent contract is the computer program that can accurately run on block chain.User is carried out by using intelligent contract
Transaction, shared data are established and are trusted, and ensure that the storage, reading and execution of data are entire by the characteristic of block chain technology
Transparent procedures is traceable, can not distort.In general, user can pass through the application programming interfaces of calling block chain link point
(Application programming interface, API), creates new intelligent contract.It is each intelligence contract installation and
Operation needs additional resource.Intelligent contract by coding, deployment, test, regulation and etc. finally in block chain play make
With different intelligent contracts is functionally relatively independent, can be realized by the calling between intelligent contract across intelligent contract
Using calling between intelligent contract only need to be introduced required intelligent contract in a manner of file, be called in intelligent contract
The application across intelligent contract can be completed in relevant interface.But in the process if there is skills such as intelligent contract loophole, failures
The interference of art factor, cause the deployment, test, regulation of intelligent contract and etc. occur and the set knot that is not inconsistent of realization treaty content
Fruit will cause strong influence.
Therefore, the management to calling between intelligent contract how is realized, so that guarantee the calling between intelligent contract can
By with safety, be a urgent problem needed to be solved.
Summary of the invention
The application provides the method and device called between a kind of control intelligent contract, it can be achieved that adjusting between intelligent contract
Management, guarantee the calling between intelligent contract it is reliable with it is safe.
In a first aspect, the application provides a kind of method called between control intelligent contract, comprising:
When detecting that the first intelligent contract initiates call request to the second intelligent contract, the call request is parsed, it is described
Call request includes called side, called side, the first voucher and timestamp;
According to the called side in the call request and the side that is called, corresponding call is searched in the registration table of block chain
The operational factor of side, and the second voucher is obtained according to the operational factor of the called side and the timestamp;
Judge whether second voucher matches with first voucher;
If second voucher and first credential match, executes the described first intelligent contract and call second intelligence
It can contract.
Optionally, the operational factor according to the called side and the timestamp obtain the second voucher, comprising:
Preset calculation formula is determined according to the called side in the call request;
According to the operational factor of the called side and the timestamp, described the is obtained by the preset calculation formula
Two vouchers.
Optionally, it is described detect that the first intelligent contract initiates call request to the second intelligent contract before, the side
Method further include:
It is described default for the described first intelligent contract setting when the described first intelligent contract is deployed on the block chain
Operational formula, and generate the operational factor of the described first intelligent contract;
By there are the fortune of the called side of call relation, called side and corresponding called side with the described first intelligent contract
The factor is calculated to be stored in the registration table.
Optionally, first voucher be the described first intelligent contract according to the operational factor of the described first intelligent contract and
The timestamp is generated by the preset operational formula.
It optionally, include the monitor state of called side and the side that is called in the registration table, it is described to be asked according to the calling
Called side in asking is described before the operational factor that corresponding called side is searched in the registration table of block chain with called side
Method further include:
Determine that the monitor state of called side and called side in the registration table in the call request is monitoring state.
Optionally, after the intelligent contract of the execution described first calls the described second intelligent contract, the method is also wrapped
It includes:
The call relation of described first intelligent contract and the second intelligent contract is stored in slow outside the block chain
In deposit data library.
Optionally, the method also includes:
When the call relation of intelligent contract updates, the registration table is modified according to updated call relation, and remove
Corresponding data in the cache database.
Second aspect, the application provide the device called between a kind of control intelligent contract, comprising:
Parsing module, when for detecting that the first intelligent contract initiates call request to the second intelligent contract, described in parsing
Call request, the call request include called side, called side, the first voucher and timestamp;
Processing module, for according in the call request called side and called side, in the registration table of block chain
Search the operational factor of corresponding called side, and according to the operational factor of the called side and the timestamp obtain second with
Card;
Authentication module, for judging whether second voucher matches with first voucher;
Calling module, in second voucher and first credential match, executing the described first intelligent contract
Call the described second intelligent contract.
Optionally, the processing module is specifically used for:
Preset calculation formula is determined according to the called side in the call request;
According to the operational factor of the called side and the timestamp, described the is obtained by the preset calculation formula
Two vouchers.
Optionally, the processing module is also used to:
Before the parsing module detects that the first intelligent contract initiates call request to the second intelligent contract, described
When first intelligent contract is deployed on the block chain, the preset operational formula is set for the described first intelligent contract, and
Generate the operational factor of the described first intelligent contract;
By there are the fortune of the called side of call relation, called side and corresponding called side with the described first intelligent contract
The factor is calculated to be stored in the registration table.
Optionally, first voucher be the described first intelligent contract according to the operational factor of the described first intelligent contract and
The timestamp is generated by the preset operational formula.
Optionally, include the monitor state of called side and the side that is called in the registration table, the processing module is also used to:
According to the called side in the call request and the side that is called, corresponding adjust is searched in the registration table of block chain
Before operational factor with side, the monitoring shape of called side and called side in the registration table in the call request is determined
State is monitoring state.
Optionally, described device further include:
Memory module, for the calling module execute the described first intelligent contract call the described second intelligent contract it
Afterwards, the call relation of the described first intelligent contract and the described second intelligent contract is stored in data cached outside the block chain
In library.
Optionally, the memory module is also used to:
When the call relation of intelligent contract updates, the registration table is modified according to updated call relation, and remove
Corresponding data in the cache database.
The third aspect, the application provide the device called between a kind of control intelligent contract, comprising:
Memory, for storing program instruction;
Processor, for calling and executing the program instruction in the memory, to realize the control intelligent of first aspect
The method called between contract.
Fourth aspect, the application provide a kind of readable storage medium storing program for executing, are stored thereon with computer program, and the program is processed
The method called between the control intelligent contract of first aspect is realized when device executes.
5th aspect, the application provide a kind of program product, which includes computer program, the computer program
It is stored in readable storage medium storing program for executing.At least one processor of the device called between control intelligent contract can be from readable storage
Medium reads the computer program, at least one processor executes what the computer program to call between control intelligent contract
The method called between the control intelligent contract of device implementation first aspect.
The method and device called between control intelligent contract provided by the present application, by detect the first intelligent contract to
When second intelligent contract initiates call request, call request is parsed, according to the called side in call request and the side that is called, in area
It searches the operational factor of corresponding called side in the registration table of block chain, and obtains the according to the operational factor of called side and timestamp
Two vouchers when judging the second voucher and the first credential match, execute the first intelligent contract and call the second intelligent contract.In intelligent conjunction
Before about calling, the reasonability by verifying call request just executes calling, it is ensured that the execution of the calling between intelligent contract
Safety can avoid the case where distorting since registration table is located on block chain, therefore can avoid block chain attacker by intelligence
The calling of energy contract carries out malicious operation to block chain.
Detailed description of the invention
In order to clearly demonstrate the application or technical solution in the prior art, embodiment or the prior art will be retouched below
Attached drawing needed in stating is briefly described, it should be apparent that, the accompanying drawings in the following description is some of the application
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the flow chart for the embodiment of the method called between a kind of control intelligent contract provided by the present application;
Fig. 2 is the flow chart for the embodiment of the method called between a kind of control intelligent contract provided by the present application;
Fig. 3 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application;
Fig. 4 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application;
Fig. 5 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the attached drawing in the application, to this
Technical solution in application is clearly and completely described, it is clear that and described embodiment is some embodiments of the present application,
Instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making creative labor
Every other embodiment obtained under the premise of dynamic, shall fall in the protection scope of this application.
The appearance of block chain technology solves the problems, such as the mutual trust in multi transaction, and distribution account book therein is critically important
One component part.How quickly, it is that block chain technology is unanimously dedicated to solving that data are obtained in the slave account book of safety
Problem.And in the prior art, for the control called between intelligent contract, there are blank, enable block chain attacker can be by intelligence
Calling between energy contract carries out malicious operation to block chain.To solve this problem, the application provides a kind of control intelligent conjunction
The method and device called between about, the data that the method on intelligent contract and operation can be effectively ensured will not be because of human factor
There is mistake, guarantee the accuracy of data on block chain, and the further credibility of enhanced uplink data, block chain is avoided to attack
The person of hitting carries out malicious operation to block chain by the calling between intelligent contract.The skill of the application is described in detail with reference to the accompanying drawing
Art scheme.
The application provides the method and device called between a kind of control intelligent contract, can be applied to different types of area
In block chain network.According to the difference of block chain participant, block chain is typically divided into three type of publicly-owned chain, alliance's chain and privately owned chain
Type.Publicly-owned chain opening, user can access block chain network and block data without any authorization, initiate various friendships
Easily.Alliance's chain limits the member in only alliance and could participate in, the correlation that the operating right on block chain is customized according to alliance
Rule determines.Privately owned chain generally uses inside private organization, the operating right on block chain according to private organization voluntarily
Regulation executes.
The device called between control intelligent contract provided by the present application can be by software and or hardware realization, the device
The a part that can be used as block chain function is also used as a component of block chain network, which can be deployed in
It needs to dispose on the block chain node of intelligent contract.
Fig. 1 is the flow chart for the embodiment of the method called between a kind of control intelligent contract provided by the present application, this implementation
The device that the executing subject of example can be called between control intelligent contract, as shown in Figure 1, the method for the present embodiment can wrap
It includes:
S101, detect that the first intelligent contract to when the second intelligent contract initiation call request, parses call request, calls
Request includes: called side, called side, the first voucher and timestamp.
Specifically, when data manipulation occurs on block chain, start to monitor the calling feelings on block chain between intelligent contract
Condition.Wherein, called side is the first intelligent contract in the call request, and for the second intelligent contract, timestamp is to call for the side that is called
Request corresponding allocating time.When calling the called side in direction to initiate call request, called side is according to the fortune of called side itself
It calculates the factor and timestamp and the first voucher is generated by preset operational formula, first voucher and timestamp are carried at calling and ask
In asking.The device that preset operational formula is called between control intelligent contract is deployed in the block chain in the first intelligent contract
It was the first intelligent contract setting when upper, can be but not limited to existing algorithm, such as hash algorithm (hash algorithm),
MD5 algorithm (Message-Digest Algorithm, Message Digest 5).
S102, according in call request called side and called side, corresponding adjust is searched in the registration table of block chain
With the operational factor of side, and the second voucher is obtained according to the operational factor of called side and timestamp.
Specifically, the operational factor of called side, called side and called side, such as following table are stored in the registration table of block chain
Shown in one:
Table one
Called side | Called side | Operational factor |
A | B | Operational factor 1 |
C | D | Operational factor 2 |
E | F | Operational factor 3 |
After parsing call request obtains called side, called side, the first voucher and the timestamp that call request includes,
In one embodiment, it can first verify the called side in call request and be called side in registration table, for example, being shown with table one
Example, if the called side in call request is A, the side that is called is B, then can determine that the called side in call request and called side exist
In registration table.
After parsing call request, according to the called side in call request and the side that is called, looked into the registration table of block chain
The operational factor of corresponding called side is looked for, and the second voucher is obtained according to the operational factor of called side and timestamp.Wherein, it obtains
Second voucher is specifically as follows: preset calculation formula is determined according to the called side in call request, according to the operation of called side
The factor and timestamp obtain the second voucher by preset calculation formula.Since preset operational formula is control intelligent contract
Between the device that calls in called side when being registered on block chain as the first intelligent contract setting, therefore called side and control intelligence
The equal known calculations voucher institute operational formula to be used of the device that can be called between contract, the dress called between control intelligent contract
Corresponding calculation formula can be determined according to called side by setting.
S103, judge whether the second voucher matches with the first voucher.
Specifically, judge whether the second voucher matches with the first voucher, can be and judge that the second voucher is with the first voucher
It is no identical, it then matches, is mismatched if not identical if they are the same, when determining the first voucher and the second credential match, then judge to adjust
Rationally with request, if the first voucher and calculated voucher mismatch, it can determine whether that call request is unreasonable.
For example, the called side in call request is A, the side that is called is B, then corresponding operational factor is operational factor 1, root
According to the timestamp in operational factor 1 and call request, the second voucher is calculated by preset calculation formula, if the first voucher with
When calculated second credential match, it is determined that call request is reasonable.
In the present embodiment, optionally, detects that the first intelligent contract initiates to call to the second intelligent contract in S101 and ask
Before asking, the method for the present embodiment can also include:
It is that preset operational formula, and life is arranged in the first intelligent contract when the first intelligent contract is deployed on block chain
At the operational factor of the first intelligent contract;By there are the called side of call relation, called side and phases with the first intelligent contract
The operational factor for the called side answered is stored in registration table.The number that operational factor therein is randomly generated, for example can be with
It is cryptographic Hash.For the different settable identical operational formulas of intelligent contract, different operational formulas may also set up, such as shared
Operational formula 1 is arranged in 3 operational formulas, a part intelligence contract, and a part intelligence contract setting 2, last part intelligently closes
Operational formula 3 is about set.
When the above process is that new intelligent contract is deployed on block chain, the mistake of call relation registration between intelligent contract
Journey further, in registration table further includes the monitor state of called side and the side that is called, and will exist with the first intelligent contract and call
When the operational factor of the called side of relationship, called side and corresponding called side is stored in registration table, settable called side
Monitor state with called side is monitoring state, indicates that the call relation is effective in current slot, in a period of time
Afterwards, can also the monitor state of some call relation be set to non-supervised state, indicates the call relation in current slot
It is invalid.
Correspondingly, being searched in the registration table of block chain in S102 according to the called side in call request and the side that is called
Before the operational factor of corresponding called side, can also include:
Determine that the monitor state of called side and called side in registration table in call request is monitoring state.It can be further
Raising judges the whether reasonable accuracy of call request.
If S104, the second voucher and the first credential match, executes the first intelligent contract and call the second intelligent contract.
Specifically, if the second voucher and the first credential match, judge that the call request is reasonable, allow the first intelligent contract
Call the second intelligent contract.If the second voucher and the first voucher mismatch, judge that the call request is unreasonable, then the first intelligence
Contract can not call the second intelligent contract.
Further, after S104, the method for the present embodiment can also include:
S105, the call relation of the first intelligent contract and the second intelligent contract is stored in the cache database outside block chain
In.
By the way that the call relation of the first intelligent contract and the second intelligent contract is stored in the cache database outside block chain
In, it can quickly be identified when there is same call request in order to next time, improve the speed of processing.
Further, after S105, the method for the present embodiment can also include:
S106, when the call relation of intelligent contract updates, registration table is modified according to updated call relation, and is removed
Corresponding data in cache database.To guarantee the correct execution of new intelligent contract.
The method called between control intelligent contract provided in this embodiment, by detecting the first intelligent contract to second
When intelligent contract initiates call request, call request is parsed, according to the called side in call request and the side that is called, in block chain
Registration table in search the operational factor of corresponding called side, and according to the operational factor of called side and timestamp obtain second with
Card when judging the second voucher and the first credential match, executes the first intelligent contract and calls the second intelligent contract.In intelligent contract tune
With before, the reasonability by verifying call request just executes calling, it is ensured that and calling between intelligent contract executes safety,
Since registration table is located on block chain, the case where distorting can avoid, therefore can avoid block chain attacker by intelligent conjunction
Calling about carries out malicious operation to block chain.
A specific embodiment is used below, and the technical solution of embodiment of the method shown in Fig. 1 is described in detail.
Following applicable Sample Scenarios of the method called between control intelligent contract provided by the present application, such as:
For finishing service target T, intelligence and about A and intelligence and about B are write.Successfully to realize T function, it need to meet and execute intelligence conjunction
Execution intelligence and about B, the device portion that will be called between control intelligent contract provided by the present application can be called during about A automatically
It is deployed in block chain network, it, will intelligence and about A and intelligent and about B successful deployment to area as a component of block chain network
In block chain network on a certain block chain node, intelligence and about A are executed, i.e. A initiates call request, control provided by the present application to B
The device called between intelligent contract executes following methods shown in Fig. 2, contract implementing result can be finally checked, so as to check
Intelligence and about A call intelligence and the implementing result of about B.
Fig. 2 is the flow chart for the embodiment of the method called between a kind of control intelligent contract provided by the present application, this implementation
The device that the executing subject of example can be called between control intelligent contract, as shown in Fig. 2, the method for the present embodiment can wrap
It includes:
S201, when the first intelligent contract is deployed on block chain, determine original on the first intelligent contract and block chain
Intelligent contract can be operated normally independently.
In this step, the first intelligent contract is newly deployed intelligent contract, is also possible to adjust between control intelligent contract
When device is deployed on original block chain, determine that original intelligent contract can be independent on the first intelligent contract and block chain
It operates normally.The operating status of intelligent contract can be monitored in this way.
S202, preset operational formula is set for the first intelligent contract, and generates the operational factor of the first intelligent contract, it will
There are the operational factors of the called side of call relation, called side and corresponding called side to be stored in note with the first intelligent contract
In volume table.
Further, called side, the side of being called and corresponding operational factor are stored in registration table, and in registration table
It marks called side and the current monitor state for the side that is called is monitoring state.
S203, detect that the first intelligent contract to when the second intelligent contract initiation call request, parses call request, calls
Request includes: called side, called side, the first voucher and timestamp.
When calling the called side in direction to initiate call request, operational factor and time of the called side according to called side itself
Stamp generates the first voucher by preset operational formula, and first voucher and timestamp are carried in call request.
S204, judge whether call request is reasonable according to the registration table of block chain.
If rationally, executing S205, if unreasonable, S207 is executed.
Specifically, how to judge whether call request is reasonable, firstly, called side and called side in verifying call request
In registration table, if not existing, that is, it can determine that call request is unreasonable.
Then, verify the calling permission of called side, specifically: according in call request called side and called side,
The operational factor of corresponding called side is searched in the registration table of block chain, and is obtained according to the operational factor of called side and timestamp
Second voucher, if when the first voucher and calculated second credential match, can determine whether that called side is true called side, then can sentence
Disconnected call request is reasonable, if the first voucher and calculated second voucher mismatch, can determine whether that call request is unreasonable.
Optionally, before judging whether call request is reasonable according to registration table, the calling in call request can also be determined
Side is monitoring state with monitor state of the called side in registration table.It can further improve and judge that whether reasonable call request is quasi-
True property.
S205, the first intelligent contract of intelligent contract calling second is executed.
S206, the call relation of the first intelligent contract and the second intelligent contract is stored in the cache database outside block chain
In.
By the way that the call relation of the first intelligent contract and the second intelligent contract is stored in the cache database outside block chain
In, it can quickly be identified when there is same call request in order to next time, improve the speed of processing.
S207, prompt call error.
It optionally, can also be according to updated call relation in the present embodiment when the call relation of intelligent contract updates
Intelligent contract call relation table is modified, and removes corresponding data in cache database.To guarantee new intelligent contract just
Really execute.
Fig. 3 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application, such as
Shown in Fig. 3, the device of the present embodiment may include: parsing module 11, processing module 12, authentication module 13 and calling module 14,
Wherein,
When parsing module 11 is for detecting that the first intelligent contract initiates call request to the second intelligent contract, described in parsing
Call request, the call request include called side, called side, the first voucher and timestamp.
Processing module 12 is used for according to the called side in the call request and the side that is called, in the registration table of block chain
Search the operational factor of corresponding called side, and according to the operational factor of the called side and the timestamp obtain second with
Card.
Authentication module 13 is for judging whether second voucher matches with first voucher.
Calling module 14 is used in second voucher and first credential match, executes the described first intelligent contract
Call the described second intelligent contract.
Further, processing module 12 is specifically used for: determining preset calculating according to the called side in the call request
Formula;According to the operational factor of the called side and the timestamp, described second is obtained by the preset calculation formula
Voucher.
Optionally, processing module 12 is also used to:
Before the parsing module 11 detects that the first intelligent contract initiates call request to the second intelligent contract, in institute
When stating the first intelligent contract and being deployed on the block chain, the preset operational formula is set for the described first intelligent contract,
And generate the operational factor of the described first intelligent contract;
By there are the fortune of the called side of call relation, called side and corresponding called side with the described first intelligent contract
The factor is calculated to be stored in the registration table.
Optionally, first voucher be the described first intelligent contract according to the operational factor of the described first intelligent contract and
The timestamp is generated by the preset operational formula.
It optionally, include the monitor state of called side and the side that is called in the registration table, the processing module 12 is also used
In:
According to the called side in the call request and the side that is called, corresponding adjust is searched in the registration table of block chain
Before operational factor with side, the monitoring shape of called side and called side in the registration table in the call request is determined
State is monitoring state.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 1 or Fig. 2, realize former
Manage similar, details are not described herein again.
The device called between control intelligent contract provided in this embodiment detects that the first intelligence is closed by parsing module
When about initiating call request to the second intelligent contract, parse call request, processing module according in call request called side and
Called side, searches the operational factor of corresponding called side, and according to the operational factor of called side in the registration table of block chain
The second voucher is obtained with timestamp, authentication module judges whether the second voucher matches with the first voucher, and calling module is described the
When two vouchers and first credential match, executes the first intelligent contract and call the second intelligent contract.To in intelligent contract tune
With before, the reasonability by verifying call request just executes calling, it is ensured that and calling between intelligent contract executes safety,
Since registration table is located on block chain, the case where distorting can avoid, therefore can avoid block chain attacker by intelligent conjunction
Calling about carries out malicious operation to block chain.
Fig. 4 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application, such as
Shown in Fig. 4, on the basis of the device of the present embodiment device shown in Fig. 3, further, it can also include: memory module 15, deposit
Module 15 is stored up after calling module 14 executes the first intelligent contract of intelligent contract calling second, by the first intelligent contract and second
The call relation of intelligent contract is stored in the cache database outside block chain.
Further, memory module 15 is also used to:
When the call relation of intelligent contract updates, registration table is modified according to updated call relation, and remove caching
Corresponding data in database.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 1 or Fig. 2, realize former
Manage similar, details are not described herein again.
Fig. 5 is the structural schematic diagram for the Installation practice called between a kind of control intelligent contract provided by the present application, such as
Shown in Fig. 5, the device of the present embodiment may include: memory 201 and processor 202,
Memory 201, for storing program instruction, which can be flash (flash memory).
Processor 202, for calling and executing the program instruction in memory, to realize control intelligence shown in fig. 1 or fig. 2
The each step in method called between energy contract.It specifically may refer to the associated description in previous methods embodiment.
It can also include input/output interface 203.Input/output interface 203 may include independent output interface and defeated
Incoming interface, or the integrated integrated interface output and input.Wherein, output interface is used for output data, and input interface is used
In the data for obtaining input, the data of above-mentioned output are the general designation exported in above method embodiment, and the data of input are above-mentioned
The general designation inputted in embodiment of the method.
The application also provides a kind of readable storage medium storing program for executing, is stored with computer program in readable storage medium storing program for executing, when control intelligence
When at least one processor of the device called between energy contract executes the computer program, called between control intelligent contract
The method called between the control intelligent contract of device execution first aspect.
The application also provides a kind of program product, which includes computer program, which is stored in
In readable storage medium storing program for executing.At least one processor of the device called between control intelligent contract can be read from readable storage medium storing program for executing
The computer program is taken, at least one processor executes the computer program and makes the device called between control intelligent contract real
Apply the method called between the control intelligent contract of first aspect.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the application, rather than its limitations;To the greatest extent
Pipe is described in detail the application referring to foregoing embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, each embodiment technology of the application that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
1. a kind of method called between control intelligent contract characterized by comprising
When detecting that the first intelligent contract initiates call request to the second intelligent contract, the call request, the calling are parsed
Request includes called side, called side, the first voucher and timestamp;
According to the called side in the call request and the side that is called, corresponding called side is searched in the registration table of block chain
Operational factor, and the second voucher is obtained according to the operational factor of the called side and the timestamp;
Judge whether second voucher matches with first voucher;
If second voucher and first credential match, executes the described first intelligent contract and second intelligence is called to close
About.
2. the method according to claim 1, wherein the operational factor according to the called side and it is described when
Between stamp obtain the second voucher, comprising:
Preset calculation formula is determined according to the called side in the call request;
According to the operational factor of the called side and the timestamp, by the preset calculation formula obtain described second with
Card.
3. according to the method described in claim 2, it is characterized in that, detecting that the first intelligent contract is closed to the second intelligence described
Before about initiating call request, the method also includes:
When the described first intelligent contract is deployed on the block chain, the preset fortune is set for the described first intelligent contract
Formula is calculated, and generates the operational factor of the described first intelligent contract;
By with the described first intelligent contract there are the operation of the called side of call relation, called side and corresponding called side because
Son is stored in the registration table.
4. according to the method described in claim 3, it is characterized in that, first voucher is the described first intelligent contract according to institute
The operational factor and the timestamp for stating the first intelligent contract, are generated by the preset operational formula.
5. according to the method described in claim 3, it is characterized in that, including the prison of called side and the side that is called in the registration table
Control state, the called side according in the call request and called side, are searched corresponding in the registration table of block chain
Before the operational factor of called side, the method also includes:
Determine that the monitor state of called side and called side in the registration table in the call request is monitoring state.
6. method according to claim 1-5, which is characterized in that the described first intelligent contract that executes calls
After described second intelligent contract, the method also includes:
The call relation of described first intelligent contract and the second intelligent contract is stored in the caching number outside the block chain
According in library.
7. according to the method described in claim 6, it is characterized in that, the method also includes:
When the call relation of intelligent contract updates, the registration table is modified according to updated call relation, and described in removing
Corresponding data in cache database.
8. the device called between a kind of control intelligent contract characterized by comprising
Parsing module parses the calling when for detecting that the first intelligent contract initiates call request to the second intelligent contract
Request, the call request include called side, called side, the first voucher and timestamp;
Processing module, for being searched in the registration table of block chain according to the called side in the call request and the side that is called
The operational factor of corresponding called side, and the second voucher is obtained according to the operational factor of the called side and the timestamp;
Authentication module, for judging whether second voucher matches with first voucher;
Calling module is called in second voucher and first credential match, executing the described first intelligent contract
Described second intelligent contract.
9. a kind of electronic equipment characterized by comprising memory and processor;
Memory is for storing program instruction;
Processor be used to calling program instruction perform claim in memory require the described in any item control intelligent contracts of 1-7 it
Between the method called.
10. a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that when the program is executed by processor
Realize the method as called between the described in any item control intelligent contracts of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811321299.5A CN109543457B (en) | 2018-11-07 | 2018-11-07 | Method and device for controlling calling between intelligent contracts |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811321299.5A CN109543457B (en) | 2018-11-07 | 2018-11-07 | Method and device for controlling calling between intelligent contracts |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109543457A true CN109543457A (en) | 2019-03-29 |
CN109543457B CN109543457B (en) | 2021-07-09 |
Family
ID=65845097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811321299.5A Active CN109543457B (en) | 2018-11-07 | 2018-11-07 | Method and device for controlling calling between intelligent contracts |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109543457B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110175845A (en) * | 2019-05-24 | 2019-08-27 | 杭州复杂美科技有限公司 | Across contract data call method, equipment and storage medium |
CN111090581A (en) * | 2019-11-22 | 2020-05-01 | 腾讯科技(深圳)有限公司 | Intelligent contract testing method and device, computer equipment and storage medium |
CN112417055A (en) * | 2020-12-10 | 2021-02-26 | 孔令超 | Method for mapping intelligent contracts of block chains to real contracts |
CN112612630A (en) * | 2020-12-29 | 2021-04-06 | 太平金融科技服务(上海)有限公司 | System call processing method and device, computer equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105681470A (en) * | 2012-03-29 | 2016-06-15 | 北京奇虎科技有限公司 | Communication method, server and terminal based on hypertext transfer protocol |
US20170155515A1 (en) * | 2015-11-26 | 2017-06-01 | International Business Machines Corporation | System, method, and computer program product for privacy-preserving transaction validation mechanisms for smart contracts that are included in a ledger |
CN107341702A (en) * | 2017-03-08 | 2017-11-10 | 阿里巴巴集团控股有限公司 | A kind of method and device of business processing |
CN107807991A (en) * | 2017-11-07 | 2018-03-16 | 泰康保险集团股份有限公司 | For handling the method and device of block chain data |
CN108537593A (en) * | 2018-04-11 | 2018-09-14 | 北京奇虎科技有限公司 | Based on the WIFI token management methods shared and device |
-
2018
- 2018-11-07 CN CN201811321299.5A patent/CN109543457B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105681470A (en) * | 2012-03-29 | 2016-06-15 | 北京奇虎科技有限公司 | Communication method, server and terminal based on hypertext transfer protocol |
US20170155515A1 (en) * | 2015-11-26 | 2017-06-01 | International Business Machines Corporation | System, method, and computer program product for privacy-preserving transaction validation mechanisms for smart contracts that are included in a ledger |
CN107341702A (en) * | 2017-03-08 | 2017-11-10 | 阿里巴巴集团控股有限公司 | A kind of method and device of business processing |
CN107807991A (en) * | 2017-11-07 | 2018-03-16 | 泰康保险集团股份有限公司 | For handling the method and device of block chain data |
CN108537593A (en) * | 2018-04-11 | 2018-09-14 | 北京奇虎科技有限公司 | Based on the WIFI token management methods shared and device |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110175845A (en) * | 2019-05-24 | 2019-08-27 | 杭州复杂美科技有限公司 | Across contract data call method, equipment and storage medium |
CN111090581A (en) * | 2019-11-22 | 2020-05-01 | 腾讯科技(深圳)有限公司 | Intelligent contract testing method and device, computer equipment and storage medium |
CN111090581B (en) * | 2019-11-22 | 2024-02-09 | 腾讯科技(深圳)有限公司 | Intelligent contract testing method, intelligent contract testing device, computer equipment and storage medium |
CN112417055A (en) * | 2020-12-10 | 2021-02-26 | 孔令超 | Method for mapping intelligent contracts of block chains to real contracts |
CN112417055B (en) * | 2020-12-10 | 2024-04-26 | 孔令超 | Method for mapping blockchain intelligent contracts to real contracts |
CN112612630A (en) * | 2020-12-29 | 2021-04-06 | 太平金融科技服务(上海)有限公司 | System call processing method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109543457B (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109543457A (en) | The method and device called between control intelligent contract | |
WO2021036545A1 (en) | Smart contract-based data processing method, and device and storage medium | |
CN107483509A (en) | A kind of auth method, server and readable storage medium storing program for executing | |
KR101937220B1 (en) | Method for generating and verifying a digital signature or message authentication code based on a block chain that does not require key management | |
CN106656932A (en) | Business processing method and device | |
EP3270319B1 (en) | Method and apparatus for generating dynamic security module | |
CN105760787B (en) | System and method for the malicious code in detection of random access memory | |
CN112367174B (en) | Block chain consensus method and device based on attribute values | |
CN106685894B (en) | Risk identification method, device and system | |
CN109690545A (en) | The automatic distributing of PLC virtual patch and safe context | |
CN111770198A (en) | Information sharing method, device and equipment | |
US11916936B2 (en) | Techniques for incentivized intrusion detection system | |
CN112995236B (en) | Internet of things equipment safety management and control method, device and system | |
WO2013173238A1 (en) | Electronic transaction notification system and method | |
CN111090581A (en) | Intelligent contract testing method and device, computer equipment and storage medium | |
Kairaldeen et al. | Data integrity time optimization of a blockchain IoT smart home network using different consensus and hash algorithms | |
JP7019533B2 (en) | Attack detection device, attack detection system, attack detection method and attack detection program | |
CN113282507A (en) | General safety test generation method based on threat modeling | |
CN112015826A (en) | Intelligent contract security detection method based on block chain and related equipment | |
US20170149831A1 (en) | Apparatus and method for verifying detection rule | |
KR20210027011A (en) | Peer node, method for processing information executed on peer node and blockchain platform system | |
CN113364766A (en) | APT attack detection method and device | |
US9535955B1 (en) | Modifying queries and rules for profile fetching and risk calculation | |
CN110533269B (en) | Business risk prevention and control method and device | |
US20220188829A1 (en) | Transaction verification of distributed ledgers |
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 |