Summary of the invention
Generally, embodiment of the disclosure provide for the method interacted between data outside block chain and chain,
Device and corresponding computer readable storage medium are at least to be partially solved the above and other potential problems of the prior art.
The first aspect of the embodiment of the present disclosure provides a kind of for interacting between data outside block chain and chain
Method the described method comprises the following steps: A. user during executing user's intelligence contract in block chain network
When intelligent contract request is located at the target data outside the block chain network, generates request of data and call interactive intelligence
Contract, wherein suction parameter of the request of data as the interactive intelligence contract and ground including the target data
Location information;B. the interactive intelligence contract is executed, the mesh fed by trusted context according to the address information is obtained
Mark data.
In some embodiments, the method also includes: C. returns to the target data to user's intelligence contract.
In some embodiments, the trusted context includes the security context provided by processor.
In some embodiments, step B. executes the interactive intelligence contract, obtains through credible equipment according to describedly
Location information and the target data fed includes: obtain the recalls information of the interactive intelligence contract, wherein calling letter
Breath indicates that the interactive intelligence contract is called by user's intelligence contract;The recalls information is associated with the address information
Ground is stored in log;Regularly inquired based on the log by the trusted context, obtain by the trusted context according to
The address information and the target data fed.
The second aspect of the embodiment of the present disclosure provides a kind of for interacting between data outside block chain and chain
Device, described device include: memory, for storing instruction;And processor, it is coupled to the memory, the finger
It enables and described device is made to execute the method described according to the first aspect of the embodiments of the present disclosure when being executed by the processor.
The third aspect of the embodiment of the present disclosure provides a kind of for interacting between data outside block chain and chain
Method the described method comprises the following steps: A. regularly inquires the log at the node of block chain network by trusted context;B.
When the log inquired includes the recalls information of the interactive intelligence contract executed in the block chain network, and the tune
When being called with user's intelligence contract that information indicates that the interactive intelligence contract executed in the block chain network, from described
Address information associated with the recalls information is obtained in log, wherein the address information corresponds to user's intelligence
The target data of contract request being located at outside the block chain network;C. be based on the address information, by it is described can
Believe that environment obtains the target data from data source;D. the target data is fed to the node by the trusted context.
The fourth aspect of the embodiment of the present disclosure provides a kind of for interacting between data outside block chain and chain
Device, described device include: memory, for storing instruction;And processor, it is coupled to the memory, the finger
It enables and described device is made to execute the method described according to the third aspect of an embodiment of the present disclosure when being executed by the processor.
5th aspect of the embodiment of the present disclosure provides a kind of computer readable storage medium.The computer-readable storage medium
Matter is stored with instruction, and described instruction is used to execute according to the first aspect of the embodiments of the present disclosure or the method that describes of the third aspect.
Embodiment of the disclosure provides the scheme for enhancing the interaction outside chain between data and block chain by trusted context,
To realize the prophesy machine of the confidence level of enhancing, prophesy machine can be enable safely, completely to obtain believable external data, it can
To ensure the safety of the trust data source outside chain, completely enter user's intelligence contract, user's intelligence contract and the external world are realized
Between authentic data interaction.
Specific embodiment
Now embodiment of the disclosure is specifically described in conjunction with attached drawing.It should be noted that similar in attached drawing
Component or functional unit may use same number mark.Appended attached drawing is intended only to illustrate embodiment of the disclosure.
The reality that those skilled in the art can be substituted from the description below on the basis of without departing from disclosure spirit and scope
Apply mode.
Term as used herein "include", "comprise" and similar terms are understood to open term, i.e.,
" including/including but not limited to ", expression can also include other contents.Term "based" is " being based at least partially on ".Term
" one embodiment " expression " at least one embodiment ";Term " another embodiment " expression " at least one other embodiment ",
Etc..Word " exemplary " expression " serving as example, example or illustration " is used herein.Described herein as " exemplary "
Any embodiment be all not necessarily construed to for other embodiments be preferred or advantageous.
In this disclosure, term " user's intelligence contract " refers to several users or user that can be used on block chain
Between affairs behavior a kind of intelligent contract, refer to can be used in block chain term " interactive intelligence contract " intelligently closes to user
A kind of intelligent contract with the interaction of the outer data of chain is about provided.
In this disclosure, term " trusted context " (or credible performing environment TEE (Trusted Execution
The peace for calculating and providing in equipment (for example, server, laptop computer, mobile device etc.) Environment)) is provided
Entire area can guarantee safety, confidentiality and the integrality of the code for being loaded into the environmental interior and data.With opening
Environment is compared, and trusted context provides the performing environment of an isolation, protects it from the attack of Malware, makes privilege or non-
The software of privilege can not access the environment, and the security feature provided includes: isolated execution, the integrality of trusted application, credible number
According to confidentiality, secure storage etc..For example, extending (Software Guard by the software protecting of processor grade
Extensions, SGX) etc. the security contexts of creations can be understood as trusted context, one can be provided in computing platform
Believable space ensures the confidentiality and integrity of user's key code and data, the trusted computing base that security application is relied on
Plinth is reduced to only comprising central processing unit (CPU) and security application itself, by incredible complex operations system (OS) and virtually
Monitor unit (VMM) excludes except security boundary.It should be appreciated that trusted context can also include being formed by similar techniques
Security context.
Technology, method and apparatus known to person of ordinary skill in the relevant may be not discussed in detail, but suitable
In the case of, the technology, method and apparatus should be considered as part of specification.For between each unit in attached drawing
Line, it is only for convenient for explanation, indicate that the unit at least line both ends is in communication with each other, it is not intended that limitation does not connect
It can not be communicated between the unit of line.
Fig. 1 is shown in which that the schematic diagram of the exemplary block chain network 100 of the embodiment of the present disclosure may be implemented.Block chain
Network 100 includes multiple block chain nodes 101,102,103,104.Since block chain technology has decentralization, distributed
Characteristic, each block chain node can intercourse information by various communication medias.User can be by (for example, client or answer
With routine interface) several nodes in access block chain link point 101-104 initiate transaction, when transaction reaches certain amount or super
Shi Hou, one or more transaction are packaged into block and are sent to node.Furthermore, it is possible in each block chain node 101-104
Place executes the management operation of intelligent contract, and intelligent contract installs and deploys, so that transaction is by calling intelligence to close
About realize.In addition, the quantity of the block chain node in Fig. 1 is only signal rather than limits, any amount can be, the area
Block chain network 100 can also include the node of various other types.
Fig. 2 shows according to the embodiment of the present disclosure in the exemplary mistake interacted between data outside block chain and chain
Journey 200.Example process 200 depict user intelligence and about 201, interactive intelligence and about 202, including trusted context 204
Data flowing between equipment 203 and data source 205.User intelligence and about 201 and interactive intelligence and about 202 can install with
It is deployed at the block chain node of the block chain network 100 such as Fig. 1, and can be called and be executed by node.From framework, in advance
Speech machine 206 includes front-end and back-end, wherein interactive intelligence and about 202 is used as prophesy machine front end, and equipment 203 is as after prophesy machine
End, the interaction outside block chain and chain between data (for example, data source 205) is realized by the interaction of front-end and back-end.Such as Fig. 2
Shown, process 200 includes: 1, executes user and Yue 201, when number outside user's intelligence in implementation procedure and about 201 request chains
According to when, generate request of data and simultaneously call interactive intelligence and about 202, interactive intelligence and about 202 suction parameter include that the data are asked
It asks, wherein request of data may include the address information of the outer data of chain;2, interactive intelligence and about 202 is executed, and by interactive intelligence
The address information of data is stored in the log of such as node outside about 202 recalls information and chain, and equipment 203 is led to
It crosses monitoring (for example, the regularly inquiring) log and recalls information and address information is passed into rear end;3, when equipment 203 by pair
The monitoring of log and when knowing the outer data of the request chain of user's intelligence contract on block chain, equipment 203 passes through trusted context 204
(for example, code is executed in trusted context) sends the data acquisition request of the outer data of chain for such as data source 205 etc
(for example, sending the data acquisition request to the equipment for including data source), for example, data source 205 may include by URL (system
One Resource Locator) and obtained from database data, obtained by search engine data, from other block chain (examples
Such as, from user's intelligence and about 201 where the different block chain of block chain) data or acquisition in any other way
Data;4, equipment 203 obtains data outside the chain of push from data source 205 by trusted context 204;5, equipment 203 passes through credible
Environment 204 passes data outside chain back interactive intelligence and about 202, for example, data outside chain are written in the log at node, so that
Interactive intelligence and about 202 can obtain the outer data of chain by monitoring (for example, regularly inquiring) log;6, interactive intelligence closes
About 202 push data outside acquired chain to user's intelligence and about 201.In addition, in order to guarantee safety, equipment 203 and outside
Interaction between data source 205 can come via the channel (for example, Secure Hypertext Transfer Protocol (https) channel) of encryption into
Row.In some instances, the channel of encryption can be determined according to the type of target data.In addition, can be can for data source 205
Letter data source.In the process 200, due to realizing data acquisition and transmission by trusted context 204, so that credible at one
Movement (for example, executing code etc.) is executed in environment, thus the safety of safety action and its data, integrality.Show some
It can be prophesy machine front end interactive intelligence and about 202 definition valuation interfaces, so that when calling interactive intelligence and about 202 in example
Call the valuation interface, the valuation interface be used for assess obtain different types of data needed for consumption voucher (e.g., including it is unlimited
In integral, expense etc.), need the prophesy machine mode of voucher that can guarantee that prophesy machine is stable, enduringly operation is gone down, for example,
It is realized according to different types of data from user blocks chain account to interactive intelligence and the voucher of about 202 block chain accounts turns
It moves.
The embodiment described according to fig. 2 provides the interaction enhanced outside chain between data and block chain by trusted context
Scheme prophesy machine can be enable safely, completely to obtain believable outside to realize the prophesy machine of the confidence level of enhancing
Data, it can be ensured that trust data source safety outside chain completely enters user's intelligence contract, realizes user's intelligence contract and outer
Authentic data interaction between the world, portion.
Fig. 3 is shown according to the embodiment of the present disclosure for exemplary what is interacted between data outside block chain and chain
The flow chart of method 300.Method 300 can be executed by the block chain node of the block chain network 100 of Fig. 1, such as flow chart institute
Show, method 300 the following steps are included:
Step 301: user's intelligence contract request obtains during executing user's intelligence contract in block chain network
When target data of the fetch bit outside the block chain network, generates request of data and simultaneously call interactive intelligence contract, wherein the data
Request the suction parameter as the interactive intelligence contract and the address information including the target data.In this step, when with
It, can be by calling interactive intelligence contract come real when family intelligence contract needs to obtain the target data outside block chain when being executed
Now to the access of external data, wherein the suction parameter of interactive intelligence contract includes the request of data for target data, the number
Include address information corresponding with target data according to request, and user can be embedded in the calling of interactive intelligence contract
In intelligent contract.
Step 302: executing the interactive intelligence contract, obtain the target fed by trusted context according to the address information
Data.In this step, trusted context obtains target data to outside according to the address information, and by acquired target data
It is fed to interactive intelligence contract, for example, data outside chain are written in the log at node, interactive intelligence contract is led to
Monitoring (for example, regularly inquiring) log is crossed to obtain the outer data of chain.
In some embodiments, method 300 can also include: to return to target data to user's intelligence contract.In the step
In rapid, acquired data-pushing is given to user's intelligence contract by interactive intelligence contract, to realize the importing of the outer data of chain.
In some embodiments, which may include the security context provided by processor, such as by aforementioned
The creations such as SGX technology security context.
In some embodiments, step 302 may include: to obtain the recalls information of the interactive intelligence contract, wherein the tune
Indicate that the interactive intelligence contract is called by user's intelligence contract with information;The recalls information and the address information are associatedly stored
In log;It is regularly inquired based on the log by trusted context, acquisition is presented by the trusted context according to the address information
The target data sent.In this step, between interactive intelligence contract and trusted context (or equipment including the trusted context)
Interaction is by monitoring to the log at node (for example, regularly inquiring) Lai Shixian, wherein log includes about interaction
The recalls information of intelligent contract and address information corresponding with target data.
According to the embodiment that Fig. 3 is described, the interaction enhanced outside chain between data and block chain by trusted context is provided
Scheme prophesy machine can be enable safely, completely to obtain believable outside to realize the prophesy machine of the confidence level of enhancing
Data, it can be ensured that trust data source safety outside chain completely enters user's intelligence contract, realizes user's intelligence contract and outer
Authentic data interaction between the world, portion.
Fig. 4 is shown according to the embodiment of the present disclosure for exemplary what is interacted between data outside block chain and chain
The flow chart of method 400.Method 400 can be executed by the equipment 203 of Fig. 2, and as shown in the flowchart, method 400 includes following
Step:
Step 401: the log at the node of block chain network is regularly inquired by trusted context.
Step 402: when the log inquired includes the calling letter of the interactive intelligence contract executed in block chain network
Breath, and the recalls information indicates that user's intelligence contract that the interactive intelligence contract is executed in the block chain network calls
When, address information associated with the recalls information is obtained from the log, wherein the address information corresponds to user intelligence
The target data of contract request being located at outside the block chain network.In this step, interactive intelligence contract and credible ring
Interaction between border (or equipment including the trusted context) is by the monitoring to the log at node (for example, regularly looking into
Ask) Lai Shixian, wherein log includes the recalls information and address corresponding with target data about interactive intelligence contract
Information.
Step 403: being based on the address information, target data is obtained from data source by the trusted context.
Step 404: the target data is fed to node by trusted context.
In some embodiments, which may include the security context provided by processor, such as by aforementioned
The creations such as SGX technology security context.
In some embodiments, step 403 may include: by the trusted context, via the channel of encryption to including institute
The equipment for stating data source sends the acquisition request for being directed to the target data;By the trusted context, via encryption channel from
The equipment receives the target data sent in response to the acquisition request.In this step, via the channel of encryption (for example,
Https channel etc.) realize the acquisition to target data, it is ensured that trusted context (or equipment including trusted context) and outer
The safety of interaction between portion's data source.
According to the embodiment that Fig. 4 is described, the interaction enhanced outside chain between data and block chain by trusted context is provided
Scheme prophesy machine can be enable safely, completely to obtain believable outside to realize the prophesy machine of the confidence level of enhancing
Data, it can be ensured that trust data source safety outside chain completely enters user's intelligence contract, realizes user's intelligence contract and outer
Authentic data interaction between the world, portion.
Fig. 5 shows the signal of the exemplary means 500 of the barter based on block chain according to the embodiment of the present disclosure
Figure.Device 500 may include: memory 501 and (one or more) processor 502 for being coupled to memory 501.Memory
501 for storing instruction, and processor 502 is configured as the instruction stored based on memory 501 realize device 500 for this
In any step in the step of method (for example, the method 300 of Fig. 3 or method 400 of Fig. 4) described in open embodiment
It is one or more.
As shown in figure 5, device 500 can also include communication interface 503, for carrying out information exchange with other equipment.This
Outside, device 500 can also include bus 504, and memory 501, processor 502 and communication interface 503 are by bus 504 come each other
It is communicated.
Memory 501 may include volatile memory, also may include nonvolatile memory.Processor 502 can be with
It is CPU, microcontroller, specific integrated circuit (ASIC), digital signal processor (DSP), field programmable gate array (FPGA)
Or other programmable logic device or be configured as realize the embodiment of the present disclosure one or more integrated circuits.
It is above-mentioned by based on the method interacted between data outside block chain and chain can pass through in addition, alternatively
Calculation machine program product, i.e., tangible computer readable storage medium embody.Computer program product may include that computer can
Storage medium is read, containing the computer-readable program instructions of the various aspects for executing the embodiment of the present disclosure.Computer
Readable storage medium storing program for executing can be the tangible device that can keep and store the instruction used by instruction execution equipment.It is computer-readable
Storage medium can for example be but not limited to storage device electric, magnetic storage apparatus, light storage device, electric magnetic storage apparatus, partly lead
Body stores equipment or above-mentioned any appropriate combination.The more specific example of computer readable storage medium is (non exhaustive
List) it include: that portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable type can be compiled
Journey read-only memory (EPROM or flash memory), static random access memory (SRAM), Portable compressed disk read-only memory (CD-
ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical coding equipment, the punch card for being for example stored thereon with instruction or
Groove internal projection structure and above-mentioned any appropriate combination.Computer readable storage medium used herein above is not solved
It is interpreted as instantaneous signal itself, such as electromagnetic wave of radio wave or other Free propagations passes through waveguide or other transmission mediums
The electromagnetic wave (for example, the light pulse for passing through fiber optic cables) of propagation or the electric signal transmitted by electric wire.
The foregoing is merely the alternative embodiments of the disclosure, are not limited to embodiment of the disclosure, for this field
Technical staff for, embodiment of the disclosure can have various modifications and variations.It is all embodiment of the disclosure spirit and
Within principle, made any modification, equivalence replacement, improvement etc., should be included in embodiment of the disclosure protection scope it
It is interior.In addition, although may about one in several embodiments come disclose embodiment special characteristic or in terms of, can be with
One or more of the other features or aspect of this features or aspect and other embodiment are combined, this is because its is right
It is expectation for any given or specific application and advantageous.
Although describing embodiment of the disclosure by reference to several specific embodiments, it should be appreciated that, the disclosure
Embodiment is not limited to disclosed specific embodiment.Embodiment of the disclosure be intended to cover appended claims spirit and
Included various modifications and equivalent arrangements in range.Scope of the following claims is to be accorded the broadest interpretation, thus comprising
All such modifications and equivalent structure and function.