Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification one or more embodiment.Phase
Instead, they are only some aspects phases with the one or more embodiments of as detailed in the attached claim, this specification
The example of consistent device and method.
It should be understood that the sequence that might not show and describe according to this specification in other embodiments executes
The step of correlation method.In some other embodiments, step included by method can than described in this specification more
It is more or less.In addition, single step described in this specification, may be broken down into other embodiments multiple steps into
Row description;And multiple steps described in this specification, it may also be merged into single step progress in other embodiments
Description.
Block chain is normally divided into three types: publicly-owned chain (Public Blockchain), privately owned chain (Private
) and alliance's chain (Consortium Blockchain) Blockchain.In addition, there are also a plurality of types of combinations, such as privately owned chain
The different combinations such as+alliance chain, alliance's chain+publicly-owned chain.It is publicly-owned chain that wherein decentralization degree is highest.Publicly-owned chain with than
Special coin, ether mill are representative, and the participant that publicly-owned chain is added can read data record on chain, participate in business and compete newly
Book keeping operation power of block etc..Moreover, each participant's (i.e. node) freely can be added and exit network, and carry out relevant operation.It is private
There is chain then on the contrary, the write-in permission of the network is by some tissue or mechanism controls, reading data permission is by organization prescribed.Simply
For, privately owned chain can be weak center's system, and participating in node has stringent limitation and less.Such block chain is more
It is suitable for using inside particular organization.Alliance's chain is then block chain between publicly-owned chain and privately owned chain, it can be achieved that " part
Decentralization ".Each node usually has corresponding physical mechanism or tissue in alliance's chain;Participant is added by authorization
Enter network and composition interests correlation alliance, it is common to safeguard the operation of block chain.
Whether publicly-owned chain, privately owned chain or alliance's chain all realize correlation function in the form of transaction (transaction)
And data interaction, and each object is participated in transaction with corresponding account respectively.By taking ether mill as an example, the type of account can be with
It is divided into external account and contract account etc..External account is usually controlled by personal or mechanism, and generates and initiate transaction.Contract
Account corresponds to the intelligent contract on block chain, and intelligent contract is can on the block chain of publicly-owned chain, privately owned chain or alliance's chain type
With the contract executed by transaction triggering, the formal definition that intelligent contract passes through code.
After intelligent contract creation, occurs a contract account corresponding with the intelligence contract on block chain, and possess one
Specific address, contract code and account storage will be stored in the contract account.The behavior of intelligent contract is by contract code control
System, and the account storage of intelligent contract then saves the state of contract.In other words, intelligent contract to generate packet on block chain
The virtual account of code containing contract and account storage (Storage).And external account passes through the in transaction when generating transaction
The called corresponding address of intelligent contract of field addition, can be called the intelligence contract, thus by executing the intelligence
Can contract code and realize correlation function.Intelligent contract can pass through each node of the defined mode in block chain network
Independently executing, all execution records and data are all stored on block chain, so after the completion of such transaction, on block chain
Just save the transaction certificate that can not be distorted, will not lose.
Certainly, external account is when generating transaction it is not absolutely required to be called intelligent contract, for example the transaction can
To be only used for realizing general function of transferring accounts.
Below in conjunction with the realization process for illustrating that this specification one realizes the embodiment of the method for secret protection shown in Fig. 1:
Step 102, the first block chain node receives transaction.
In one embodiment, transaction can be committed to the first block chain node by client.For example, user is by corresponding
Transaction is committed to the first block chain node after client generates the transaction, through the client by account.By taking Fig. 2 as an example, the
It include transaction/query interface in one block chain node, which can dock with client, allow client to the first block
Chain node submits transaction.Correspondingly, after completion of transactions, the first block chain node can be by the transaction/query interface to visitor
Family end returns to the implementing result of transaction, which may include running succeeded or executing failure, can also include such as handing over
Detail informations, this specification such as easy log are limited not to this.
The transaction can also be forwarded to the first block chain node by the second block chain node.For example, user is by corresponding
The transaction is committed to the second block chain node after client generates the transaction, through the client by account;Then, the secondth area
The transaction is further forwarded to the first block chain node by block chain link point.By taking Fig. 2 as an example, above-mentioned interface can be with other block chain links
Point docking, such as other block chain nodes may include the second above-mentioned block chain node, so that the second block chain node can
With to the first block chain node transmitted transaction.Similarly, the second block chain node can also by itself transaction/query interface with
Client docking, to receive the transaction of client submission.
Such as proved using proof of work (Proof of Work, POW) and equity (Proof of Stake,
POS), equity is appointed to prove in the block chain network of the common recognition such as (Delegated Proof of Stake, DPOS) algorithm, second
Block chain node is after the transaction for receiving client submission, other blocks of diffusion immediately (as broadcasted) into ether mill network
Chain node.
Using practical Byzantine failure tolerance (Practical Byzantine Fault Tolerance, PBFT) for another example
Etc. in the block chain network of mechanism, accounting nodes have been agreed upon before epicycle book keeping operation, so that the second block chain node is receiving
After the transaction that client is submitted, if itself not being accounting nodes, which is sent to fixed accounting nodes, so that
The accounting nodes transmit transaction (including the transaction) to each verifying node in the further common recognition stage.And when second
It, can be with after other block chain link points receive the transaction of client submission when block chain node itself is fixed accounting nodes
Transaction is forwarded to the second block chain node;Then, the second block chain node can common recognition the stage by above-mentioned transaction (or also
Including other transaction) it transmits to each verifying node, including the first block chain node.
Step 104A, the first block chain node identification transaction are transaction in plain text or privacy transaction;Wherein, the plaintext
Transaction corresponds to plaintext contract, and the privacy transaction corresponds to plaintext contract and/or privacy contract.
In one embodiment, transaction is divided into the bright of plaintext type based on different secret protection demands by this specification
Text transaction, the privacy transaction of privacy type, may be implemented the executive mode of differentiation for different types of trade, hereafter will be right
This is described in detail.For example, allowing the first block chain to identify type of transaction in plain text accordingly by adding type field in transaction
Transaction or privacy transaction.In the related art, such as in the network of ether mill, transaction generally comprises the words such as to, value, data
Section.And the present embodiment increases by a type field on the basis of the relevant technologies in transaction, for example is characterized as type field, and
Based on the value of the type field, show the type of relationship trading;For example, showing correlation when type field is the first value
Transaction is trades in plain text, when type field is the second value, shows relationship trading for privacy transaction.
In one embodiment, all the elements of transaction are all made of plaintext version in plain text, i.e. each field of the transaction is adopted
With plaintext version, the first block chain node is directly read out to each field of plaintext transaction, to implement phase
Pass processing;Meanwhile transaction is packaged blocking in plain text with plaintext version, and then is recorded in block chain with plaintext version.Privacy is handed over
Easily other than type field is using plaintext version, other fields are all made of ciphertext form, so that on the one hand the first block chain link
Point can quickly identify type of transaction without decryption, to implement difference for transaction in plain text and privacy transaction
Change processing, on the other hand makes it only by using ciphertext form and can be held the object of key to be decrypted and read, avoid
Transaction Information is revealed, and privacy transaction is packaged blocking with ciphertext form, and then is recorded in block chain with ciphertext form
In.
Step 104B, the first block chain node identify that generation side's account of the transaction is plaintext account or privacy account.
In one embodiment, external account is divided into the plaintext account of plaintext type, privacy type in this specification
Privacy account, wherein the behavior of privacy account will receive special safeguard protection, so that the leakage of privacy information is avoided, under
Text will be to this detailed description.
In the publicly-owned chain such as ether mill, user can freely create external account, then user can mark certainly
The external account of body creation is plaintext type or privacy type, and each node in block chain network can be respectively to all outer
The type information of portion's account carry out it is pre-recorded, can be from transaction so that the first block chain node is when receiving above-mentioned transaction
From field reads the information of generation side's account, and determines that generation side's account is plaintext account according to pre-recorded type information
Family or privacy account.
And in alliance's chain or privately owned chain, the creation of external account is operated there are certain restrictions, is needed outer by what is created
Portion's account creates other external accounts, and cannot arbitrarily create.Plaintext account can be limited when creation can create in plain text
Account or privacy account, and privacy account can only create privacy account.Similarly, in alliance's chain or the block link network of privately owned chain
In network, each node should also be as the type information of pre-recorded all external accounts, so that the first block chain node is on receiving
When stating transaction, the information of generation side's account can be read from the from field of transaction, and true according to pre-recorded type information
Fixed generation side's account is plaintext account or privacy account.
Step 106, the first block chain node refusal in the plaintext transaction that the transaction is initiated for privacy account executes institute
Transaction is stated, the transaction is otherwise executed.
In one embodiment, it when transaction is initiated by privacy account, for the safeguard protection to privacy account, needs to limit
The type of the transaction: when privacy account initiates privacy transaction, since privacy transaction is relatively prone to meet high level privacy
Protection demand uses encrypted transmission and executes in credible performing environment, so that privacy transaction has high privacy, because
And allow to execute privacy transaction;When privacy account is initiated to trade in plain text, since plaintext transaction is relatively prone to satisfaction processing
Efficiency requirements use plaintext transmission and execute except credible performing environment, so that the privacy relative deficiency of transaction in plain text,
Because trading in plain text without allowing to execute, to realize the safeguard protection to privacy account, the user using privacy account is avoided
The leakage for trading and causing in plain text associated privacy information is initiated unintentionally.
In one embodiment, when transaction is initiated by plaintext account, no matter the plaintext account initiates transaction or privacy in plain text
Transaction, the first block chain node executed, allow plaintext account select to initiate according to actual needs plaintext type or
The transaction of privacy type.
In one embodiment, the first block chain node is compatible in the related technology for the processing capacity of plaintext transaction, can be with
Plaintext transaction is handled except credible performing environment, and plaintext implementing result is stored to external memory space.Such as
Shown in Fig. 2, the first block chain node can be divided into conventional performing environment and credible performing environment, and client is submitted (with client
Hold submit transaction for) transaction initially enter " transaction/query interface " in conventional performing environment carry out type identification, general
The plaintext transaction identified stays in the privacy transaction transport that is handled in conventional performing environment, and will identify that credible execution
It is handled in environment.In other words, the first block chain node can be not only compatible in the related technology for the processing of plaintext transaction, but also
It can trade and handle to the privacy of ciphertext form, thus real to plaintext transaction and privacy transaction in entire block chain network
Existing mixed processing.
Transaction in this specification can be used to implement relatively simple processing logic, for example be similar in the related technology
It transfers accounts logic.
Transaction in this specification can be also used for realizing relative complex processing logic, here can be by means of above-mentioned
Intelligent contract is realized.By taking ether mill as an example, user is supported to create and/or call patrolling for some complexity in the network of ether mill
Volume, this is the ultimate challenge that ether mill is different from bit coin block chain technology.Core of the ether mill as a programmable block chain
The heart is ether mill virtual machine (EVM), and each ether mill node can run EVM.EVM is the complete virtual machine of a figure spirit,
This means that can realize the logic of various complexity by it.User issue and call in ether mill intelligent contract be exactly
It is run on EVM.In fact, what virtual machine directly ran is virtual machine code (Virtual Machine bytecodes, lower abbreviation " bytecode ").
The intelligent contract being deployed on block chain can be the form of bytecode.
In one embodiment, the intelligent contract of this specification can be divided into the plaintext contract of plaintext type, privacy type
Privacy contract.The contract code and contract state of plaintext contract are stored at node with plaintext version, and privacy contract
Contract code and contract state are stored at node with ciphertext form, so that privacy contract has relatively higher privacy.
When transaction is for creating and/or calling intelligent contract, which be may be considered that corresponding to the transaction.
Since the first block chain node is handled plaintext transaction except credible performing environment, and will directly handle
To plaintext implementing result store to external memory space, thus when plaintext transaction for creating intelligent contract when, this intelligently close
It is about inevitable that external memory space is stored in plaintext version, thus the intelligence contract is necessarily plaintext contract.Meanwhile when plaintext is handed over
When easily calling intelligent contract, since only privacy contract can be decrypted in credible performing environment, thus transaction is adjusted in plain text
Intelligent contract only can be plaintext contract.
In one embodiment, when the transaction that generation side's account generates is that privacy is traded, which can be bright
Literary account or privacy account.First block chain node can be in credible performing environment (Trusted Execution
Environment, TEE) in decryption privacy transaction.TEE is the security extension based on CPU hardware, and with it is external completely every
From credible performing environment.TEE is the concept proposed by Global Platform earliest, for solving resource in mobile device
Security isolation, be parallel to operating system and credible and secure performing environment be provided for application program.The Trust Zone technology of ARM
The TEE technology of real commercialization is realized earliest.
Along with the high speed development of internet, safe demand is higher and higher, is not limited only to mobile device, cloud device,
Data center all proposes more demands to TEE.The concept of TEE has also obtained the development and expansion of high speed.Now described
TEE is compared to the TEE for the concept initially proposed being more broad sense.For example, server chips manufacturer Intel, AMD etc. are first
It is proposed the TEE of hardware auxiliary afterwards and enriches the concept and characteristic of TEE, is had been widely recognized in industry.It mentions now
The TEE risen usually more refers to the TEE technology of this kind of hardware auxiliary.Different from mobile terminal, cloud access needs to remotely access, terminal
User is invisible to hardware platform, therefore seeks to the genuine and believable of confirmation TEE using the first step of TEE.Therefore present TEE
Technology all introduces remote proving mechanism, is endorsed by hardware vendor (mainly CPU manufacturer) and is ensured by digital signature technology
User can verify that TEE state.It is simultaneously only the demand for security that the resource isolation of safety is also unable to satisfy, further data
Secret protection is also suggested.Including Intel SGX, the commercial TEE including AMD SEV also both provides memory encryption technology, will
Reliable hardware is limited to inside CPU, and the data of bus and memory are that ciphertext prevents malicious user from being spied upon.For example, Ying Te
Your software protection extends code execution, remote proving, security configuration, the secure storage of data such as (SGX) TEE technology insulation
And the trusted path for executing code.The application program run in TEE is kept safe, as a consequence it is hardly possible to by third
Side's access.
By taking Intel SGX technology as an example, SGX provides enclosure (enclave, also referred to as enclave), i.e., one adds in memory
Close credible execution region, protects data not to be stolen by CPU.By taking the first block chain node is using the CPU for supporting SGX as an example,
Using newly-increased processor instruction, a part of region EPC (Enclave Page Cache, enclosure page can be distributed in memory
Face caching or enclave page cache), by the crypto engine MEE (Memory Encryption Engine) in CPU to wherein
Data encrypted.The content encrypted in EPC, which only enters after CPU, can just be decrypted into plain text.Therefore, in SGX, user
It can distrust operating system, VMM (Virtual Machine Monitor, monitor of virtual machine), even BIOS (Basic
Input Output System, basic input output system), it is only necessary to trust CPU just and can ensure that private data will not leak.
It in practical application, is transferred in enclosure after private data being encrypted with ciphertext form, and will be corresponding by remote proving
Code key is also passed to enclosure.Then, operation is carried out using data under the encipherment protection of CPU, as a result can be returned with ciphertext form.This
Under kind mode, powerful calculating power not only can use, but also do not have to concern of data and leak.
Certainly, with trade in plain text similar, can to create and/or call intelligent contract relatively multiple to realize for privacy transaction
Miscellaneous processing logic or privacy transaction can also never call intelligent contract and realize the relatively simple processing logic such as transfer accounts.
Since privacy transaction executes in TEE, thus the corresponding intelligent contract of privacy transaction can be privacy contract, for example privacy is traded
Intelligent contract can be created in TEE, the contract code and contract state of the intelligence contract can be encrypted in TEE, from
And create corresponding privacy contract;For another example privacy transaction can with invoking privacy contract, the privacy contract in TEE be decrypted and
The contract state for executing, and updating after executing can be updated and re-encrypted storage;For another example privacy transaction can adjust
With plaintext contract, after which is performed in TEE, the contract state updated is still stored with plaintext version.
It is generated at a certain client it is assumed that above-mentioned privacy is traded, which can firstly generate in transaction in plain text
Hold, then encrypts the plaintext transaction content with key.The encryption can use symmetric cryptography, can also use asymmetric
Encryption.Correspondingly, the first block chain node can decrypt the privacy with corresponding key and trade, to obtain in transaction in plain text
Hold.If client symmetric cryptography mode, i.e., plaintext transaction content is encrypted with the symmetric key of symmetric encipherment algorithm, then phase
Ying Di, the first block chain node can the transaction of privacy described in the symmetric key decryption with the symmetric encipherment algorithm.Symmetric cryptography
The Encryption Algorithm of use, e.g. DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm
Deng.The symmetric key of symmetric encipherment algorithm, such as can be the generation side to be traded by the privacy and generate, or by client and the
One block chain node is negotiated to determine, or sends to obtain by Key Management server.
If encrypted with the public key of rivest, shamir, adelman to plaintext transaction content, then phase with asymmetric encryption mode
Ying Di, the first block chain node can decrypt the privacy with the private key of the rivest, shamir, adelman and trade.Asymmetric encryption
Algorithm, e.g. RSA, Elgamal, knapsack algorithm, Rabin, D-H, ECC (elliptic curve encryption algorithm) etc..Asymmetric encryption
The key of algorithm, such as can be and a pair of of public key and private key are generated by the first block chain node, and public key is sent to institute in advance
Client is stated, so that the client can be by the plaintext transaction content public key encryption.
The key of rivest, shamir, adelman can also be generated by a Key Management server.Pass through the side of remote proving
Private key is sent to the first block chain node by formula, Key Management server, specifically, can be incoming first block chain node
In enclosure.First block chain node may include multiple enclosures, and the safety that above-mentioned private key can be passed into these enclosures is enclosed
Circle;For example, the safe enclosure can be QE (Quoting Enclave) enclosure, rather than AE (Application Enclave) encloses
Circle.For the public key of asymmetric encryption, the client can be sent to by Key Management server.Thus client can be used
The public key encryption plaintext transaction content, correspondingly, the first block chain node can decrypt the privacy with the private key and trade, with
Obtain the plaintext transaction content that privacy transaction includes.
Client can also be in such a way that symmetric cryptography combination asymmetric encryption combines.For example, client use pair
Claim Encryption Algorithm encrypting plaintext transaction content, that is, uses the symmetric key encryption plaintext transaction content of symmetric encipherment algorithm, be used in combination
The symmetric key used in rivest, shamir, adelman cryptographic symmetrical Encryption Algorithm.In general, using the public affairs of rivest, shamir, adelman
The symmetric key used in key cryptographic symmetrical Encryption Algorithm.It, can be in this way, after the first block chain node receives the transaction of encryption
It is first decrypted using the private key of rivest, shamir, adelman, obtains the symmetric key of symmetric encipherment algorithm, and then use symmetric cryptography
The symmetric key decryption of algorithm obtains plaintext transaction content.
For example, the private key of rivest, shamir, adelman can be sent to the firstth area by remote proving by Key Management server
The enclosure of block chain node, and the private key of rivest, shamir, adelman is sent to the client.Thus, the client can adopt
With the symmetric key encryption plaintext transaction content of symmetric encipherment algorithm, that is, use the symmetric key encryption of symmetric encipherment algorithm in plain text
Transaction content, and with the symmetric key used in the public key encryption symmetric encipherment algorithm of rivest, shamir, adelman.In turn, the visitor
Family end the privacy can be traded and encryption key (public key by rivest, shamir, adelman in the symmetric encipherment algorithm to adopting
Symmetric key obtains after being encrypted) it is sent to the first block chain node.First block chain node receives the privacy
After transaction and encryption key, first the encryption key can be decrypted to obtain symmetric cryptography with the private key of rivest, shamir, adelman
The symmetric key of algorithm, and then privacy described in the symmetric key decryption with the symmetric encipherment algorithm is traded, and is obtained in transaction in plain text
Hold.Here cipher mode is commonly referred to as digital envelope encryption.
After privacy transaction is decrypted in first block chain node, plaintext transaction content is obtained.Plaintext transaction content can be with
Code comprising intelligent contract, for creating intelligent contract in block chain;Plaintext transaction content may include in block chain
The contract address of a certain intelligent contract created, for calling the intelligence contract.
Either for creating or calling intelligent contract, the first block chain node can be by executing generation of the intelligence contract
Code, to complete to trade.First block chain node can execute the code of the intelligent contract in credible performing environment.Work as intelligence
When the code of contract is located in privacy transaction, the first block chain node to privacy transaction by being decrypted to obtain above-mentioned plaintext
Transaction content, the code of the intelligent contract in the plaintext transaction content comprising plaintext;When intelligent contract has created in advance, privacy is handed over
When being easy for calling the intelligence contract, if the intelligence contract carries out encryption storage by the first block chain link point in advance, and this
One block chain node can be by reading in the code of the intelligent contract of ciphertext in credible performing environment, and decrypts and obtain plaintext
The code of intelligent contract.Multinest structure may be implemented between intelligent contract;Such as the code in intelligence and about 1 has invoked intelligence
Can be with about 2, and the code in intelligence and about 2 has been directed toward the contract address 3 through creating intelligent contract code building, to work as privacy
When the code in intelligence and about 1 is called in transaction, the intelligent contract code in the contract address 3 is had invoked indirectly.
When privacy is traded for creating intelligent contract, the code comprising intelligence contract in privacy transaction, the first block
Chain node can be decrypted to obtain the code of intelligence contract contained by it in credible performing environment to privacy transaction, and in turn
The plaintext code is executed in credible performing environment.When privacy transaction is used for the intelligent contract of invoking privacy type, the firstth area
Block chain node can be decrypted to obtain corresponding plaintext code in credible performing environment to the intelligence contract, and in turn can
The plaintext code is executed in letter performing environment.When privacy trades the intelligent contract for calling plaintext type, the first block chain
Node directly reads the plaintext code of the intelligence contract, and the plaintext code is executed in credible performing environment.Specifically, first
Block chain node can use the processor instruction increased newly in CPU, a part of region EPC be distributed in memory, by CPU
Crypto engine MEE carries out encryption to above-mentioned plaintext code and is stored in the EPC.The content encrypted in EPC is solved after entering CPU
Close Cheng Mingwen.In CPU, operation is carried out to the plaintext code, completes implementation procedure.
In SGX technology, the plaintext code of the intelligent contract is executed, EVM can be loaded into the enclosure.Long-range
In proof procedure, the Key Management server can calculate the hash value of local EVM code, and in the first block chain node
The hash value of the EVM code of load compares, and comparison result is correctly as a necessary condition for passing through remote proving, to complete
To the measurement of the code of the first block chain node SGX enclosure load.Through excess vol, described in correct EVM can be executed in SGX
Intelligent contract code.
After CPU executes the plaintext code, corresponding plaintext implementing result is generated.In general, plaintext implementing result can be with
Including changed contract state.It is by the contract state that contract state, which is stored in block chain from the angle of block chain node,
Database, such as local database is written.The database, is generally stored among storage medium, and more common is lasting
Property storage medium.The persistent storage medium can be disk, floppy disk, be also possible to be powered after can restore data so as to
With the memory etc of persistent storage.
When the corresponding intelligent contract of privacy transaction is privacy contract, need to deposit after encrypting plaintext implementing result
Storage.For example, if the operation of write-in database is indicated with code, such as setstorage (key, ENC (value, secret_
key)).In setstorage (key, ENC (value, secret_key)), key (key) can be with traditional key writing mode phase
Together.As for the write-in of value, Intel SGX technology can be used, ENC indicates that enclave, secret_key indicate to use SGX
The key used when database is written in technology.The key can be the key of symmetric cryptography, e.g. seal (Simple
Encrypted Arithmetic Library) key.The seal key, for example, can be by after remote proving by key
Management server is sent to the first block chain node, then for example can be each node (such as the first block chain link in block chain
Point and other block chain nodes) between negotiate to obtain.The key is also possible to the key of asymmetric encryption.The key can be with
It is stored in the enclosure of the first block chain node.First block chain node may include multiple enclosures, and above-mentioned private key can be with
The safe enclosure being passed into these enclosures;For example, the safe enclosure can be QE enclosure, rather than AE enclosure.When privacy is traded
When corresponding intelligence contract is plaintext contract, plaintext implementing result is stored with plaintext version, without encryption.
It is each in the first block chain node or block chain by being sent to after remote proving by Key Management server
The key negotiated between node (such as the first block chain node and other block chain nodes), can not be above-mentioned seal close
Key, but root key (root key), and above-mentioned seal key can be the derivative key of the root key.For example, root
Key irreversibly can successively derive the derivative key of several versions, and by highest version between two keys of arbitrary neighborhood
Key irreversibly derives lowest version key, to form the cipher key derivative structure of chain type.For example, being published if necessary to derivative
This number be respectively 0~255 256 versions key, can (metric value be by root key and version factor 0xFF
255, that is, the version number for the key for needing to generate;It is of course also possible to use other values) Hash calculation is carried out, obtain version number
For 255 key key-255;By the way that key key-255 and version factor 0xFE is carried out Hash calculation, obtaining version number is
254 key key-254;... by the way that key key-1 and version factor 0x00 is carried out Hash calculation, obtaining version number is 0
Key key-0.Due to the characteristic of hash algorithm, so that the calculating between highest version key and lowest version key is irreversible, than
Such as key key-0 can be calculated by key key-1 and version factor 0x00, but key key-0 and version can not be passed through
This factor 0x00 is counter to release key key-1.
It is possible to specify the derivative key of a certain version, carried out as above-mentioned seal key pair plaintext implementing result
Encryption obtains corresponding ciphertext implementing result.Further, version updating can also be carried out to seal key, and is based on institute above
The characteristic stated should be updated from lowest version key to highest version key, even if so that also can not after lowest version Key Exposure
It is anti-to release highest version key, it is ensured that enough Information Securities.
There may be multiple corresponding intelligent contracts for above-mentioned privacy transaction, and above-mentioned plaintext implementing result may include
The corresponding plaintext contract implementing result of each intelligence contract (i.e. close by the contract implementing result of plaintext version, corresponding intelligence
It can be about plaintext contract or privacy contract).So: if the corresponding intelligent contract of privacy transaction is plaintext contract, ciphertext
Implementing result may include the corresponding plaintext contract implementing result of these plaintext contracts, these plaintext contract implementing results without
It need to be encrypted with key, and directly be stored with plaintext version;If the corresponding intelligent contract of privacy transaction is privacy
Contract, ciphertext implementing result may include the corresponding ciphertext contract implementing result of these privacy contracts, and ciphertext contract executes
As a result it is encrypted to obtain by key pair plaintext contract implementing result by the first block chain node;If privacy transaction is corresponding
Intelligent contract includes plaintext contract and privacy contract simultaneously, then ciphertext implementing result may include the corresponding plaintext of plaintext contract
Contract implementing result and the corresponding ciphertext contract implementing result of privacy contract.Wherein, the corresponding multiple intelligent contracts of privacy transaction
It can be used to create intelligent contract, can be used to call intelligent contract, or a part is for creating intelligent contract and another
A part is for calling intelligent contract.
As it can be seen that the first block chain node can create credible performing environment, and ensure phase in the embodiment of this specification
Close sensitive information (such as transaction content, implementing result) only in credible performing environment be decrypted read or execute, and once from
It is in encrypted state when opening credible performing environment, thus in the full link of processing transaction, it is ensured that privacy and safety.
First block chain node is by running the code for realizing a certain function, to realize the function.Therefore, for needing
The function to realize in credible performing environment also needs to execute correlative code.And for being executed in credible performing environment
Code, need to meet the related specifications and requirement of credible performing environment;Accordingly in the related technology for realizing a certain
The code of function needs the specification and requirement in conjunction with credible performing environment to re-start written in code, and there is only relatively bigger
Exploitation amount, and be easy during rewriting generate loophole (bug), influence function realization reliability and stability.
Therefore, plaintext implementing result is encrypted as ciphertext implementing result, and the ciphertext by key by the first block chain node
Implementing result is only decrypted by credible performing environment, it can be ensured that ciphertext implementing result safe enough itself.Herein
On the basis of, the first block chain node is held the ciphertext by executing store function code except the credible performing environment
Row result (certainly, if privacy transaction has invoked plaintext contract, can be equally used for carrying out plaintext implementing result herein
Storage;This is illustrated for sentencing the storing process of ciphertext implementing result) store it is outer to except the credible performing environment
Portion's memory space, allow the store function code be in the related technology for realizing the code of store function, do not need to tie
The specification and requirement for closing credible performing environment re-start written in code, can realize for the ciphertext implementing result safe and reliable
Storage, on the basis of not influencing safe and reliable degree, can not only reduce the exploitation amount of correlative code, and can lead to
It crosses the correlative code for reducing credible performing environment and reduces TCB (Trusted Computing Base, trusted computing base), so that
During TEE technology and block chain technology are combined, it is additional caused by security risk be in controlled range.
In one embodiment, the first block chain node can execute write buffer function code in credible performing environment, with
The plaintext implementing result is stored in the write buffer in the credible performing environment, for example the write buffer can correspond to such as figure
" caching " shown in 2.Further, the first block chain node by after the data encryption in the write buffer from the credible execution
Environment output, to store to the external memory space.Wherein, the write buffer function code can be stored in plaintext version
In the credible performing environment, the caching function code of the plaintext version can be directly executed in credible performing environment;Or, institute
Stating write buffer function code can be stored in except the credible performing environment with ciphertext form, for example be stored in above-mentioned outside
Memory space (such as " packing+storage " shown in Fig. 2, wherein " packing " indicates the first block chain node in credible performing environment
Except transaction be packaged it is blocking), the write buffer function code of the ciphertext form can be read in credible performing environment, can
It is decrypted in letter performing environment as plaintext code, and executes the plaintext code.
Write buffer refers to when writing data into external memory space, in order to avoid causing " the punching to external memory space
Hit " and " buffering " mechanism of offer.For example, can realize above-mentioned write buffer using buffer;Certainly, write buffer can also adopt
It is realized with cache, this specification is limited not to this.In fact, due to the safety collar that credible performing environment is isolation
Border, and external memory space is located at except credible performing environment, so that by using write buffer mechanism, it can be to the number in caching
External memory space is written according to batch is carried out, so that the interaction times between credible performing environment and external memory space are reduced,
Promote data storage efficiency.Meanwhile credible performing environment is during constantly executing each item plaintext transaction content, it may be necessary to
Transferring generated data (such as value of contract state) can be direct if the data that need to be called are located exactly in write buffer
The data are read from write buffer, on the one hand can be reduced the interaction between external memory space in this way, on the other hand be removed from
To the decrypting process from external memory space data streams read, thus the data processing effect being lifted in credible performing environment
Rate.
It is of course also possible to write buffer is built on except credible performing environment, for example the first block chain node can be can
Believe and execute write buffer function code except performing environment, so that the ciphertext implementing result is stored in outside the credible performing environment
Write buffer in, and further the data in the write buffer are stored to the external memory space.
In one embodiment, the inquiry request that the first block chain node can be initiated according to client, holds the plaintext
It is exported after the encryption of row result from credible performing environment, to be back to the client.
For example, the first block chain node can read the ciphertext implementing result from the external memory space, by institute
The decryption of ciphertext implementing result is stated the credible performing environment to be read in, then being held to the plaintext after the plaintext implementing result
It is exported after the encryption of row result from credible performing environment, for example is returned and encrypted to client by transaction/query interface shown in Fig. 2
Plaintext implementing result afterwards.
For another example the first block chain node can read the plaintext from the read buffer in credible performing environment executes knot
Fruit, and exported to after plaintext implementing result encryption from credible performing environment;Wherein, the plaintext implementing result is by the firstth area
Block chain node executes read buffer function code in credible performing environment in advance, reads from the external memory space described close
Literary implementing result decrypts the ciphertext implementing result to read in the credible performing environment simultaneously after the plaintext implementing result
It is stored in the read buffer.In other words, the first block chain node reads the ciphertext from the external memory space and executes knot
Fruit decrypts the ciphertext implementing result for after the plaintext implementing result, can be by executing reading in credible performing environment
The plaintext implementing result is stored in the read buffer in credible performing environment by caching function code, for example the read buffer can be right
It should be in " caching " shown in Fig. 2;Further, the inquiry request initiated for client, or exist for credible performing environment
Data required when plaintext transaction content are executed, reading data can be preferentially carried out from the read buffer, if dependency number can be read
According to being then not necessarily to read from external memory space, to reduce and the interaction times of external memory space, release data deciphering mistake
Journey.
Read buffer refers to after data are read in credible performing environment from external memory space, in order to reduce and external storage
The data read can be stored in the read buffer space in credible performing environment by the interaction times in space with plaintext version
It is interior.For example, can realize above-mentioned read buffer using cache;Certainly, read buffer can also be realized using buffer, this theory
Bright book is limited not to this.
First block chain node can support above-mentioned read buffer mechanism and write buffer mechanism simultaneously.And with caching technology
Continuous development, same caching can be applied not only to realize reading data or data write-in, it might even be possible to while support data
Read-write operation, so that the boundary line between read buffer and write buffer is not sometimes very clear, thus only with " caching " progress in Fig. 2
Signal, and its concrete type is not distinguished specifically, it can be configured and be adjusted according to actual needs.
Certainly, the caching mechanism in above-mentioned credible performing environment, can be applied equally in conventional performing environment, such as logical
" caching " Lai Shixian in conventional performing environment shown in Fig. 2 is crossed, but reading and writing data at this time relates only to read and write in plain text, no
Need to implement data encrypting and deciphering operation, details are not described herein again.
When the first block chain node is by competition or negotiates to be determined as accounting nodes, the first block chain node can be to area
Verifying node in block chain initiates common recognition.Specifically, the first block chain node can determine that epicycle needs one group of transaction of cochain,
These transaction can be that plaintext trades, is privacy transaction or transaction and privacy transaction in plain text simultaneously, then the first block
Chain node can be traded by executing each item in group transaction, and according to every transaction and its corresponding transaction implementing result
Information such as (corresponding to ciphertext implementing result if corresponding to plaintext implementing result, privacy transaction if plaintext is traded), generate state
Tree, transaction tree and receipt tree, corresponding Hash of root node that this three are set is charged in block head;Then, the first block chain
After one group of above-mentioned transaction is packaged (such as " packing+storage " module as shown in Figure 2 is realized) and generates new block by node,
The block or block head are broadcasted into the verifying node into block chain network (i.e. in block chain network other than accounting nodes
Block chain node), it initiates common recognition and proposes.And node is verified by executing one group of above-mentioned transaction, to the root Hash in block head
It is verified, and after determining proposal by verifying, the block comprising this group transaction is appended to original block chain end (i.e.
Cochain), according to this group transaction implementing result world state is updated.And the first block chain node can know together in confirmation
By rear, by executing the store function code to corresponding plaintext implementing result and/or the privacy transaction correspondence of trading in plain text
Ciphertext implementing result stored;It is of course also possible to just be stored when common recognition unconfirmed passes through, and carried out after finding the problem
Rollback.
When the first block chain node is verifying node rather than accounting nodes, the first block chain node can receive book keeping operation
The common recognition that node is initiated proposes that the common recognition is proposed related to plaintext transaction and/or privacy transaction.For example, accounting nodes can be with
For the second block chain node, and the common recognition that the first block chain link point receives the initiation of the second block chain node is proposed, which proposes
Comprising one group of transaction, these transaction are that plaintext trades, is privacy transaction or transaction and privacy transaction in plain text simultaneously, this is total
Know the root node proposed also comprising three trees described above.First block chain node can be held by process described above
Transaction obtains corresponding plaintext implementing result to row in plain text, execution privacy trades to obtain corresponding ciphertext implementing result, then generates
The root node of three trees, and be compared by root node contained by block head in proposing with common recognition, to be in comparison result
Determine that the common recognition proposes otherwise to be determined as unverified by verifying when consistent.After being verified, the first block chain link
Point is by executing the store function code to corresponding plaintext implementing result and/or the corresponding ciphertext of privacy transaction of trading in plain text
Implementing result is stored.
It is noted that each block chain node in block chain network, corresponding bright trading for same privacy
When literary implementing result is encrypted, it should be ensured that the key of use is identical, in this way in the corresponding plaintext implementing result phase of privacy transaction
It can ensure that resulting ciphertext implementing result is identical in the case where, to generate identical root node.
Above in association with embodiment shown in Fig. 1-2, describe by node (such as the first block chain link in block chain network
Point) type of transaction, Account Type are identified after, avoid privacy account initiate plaintext transaction is performed;And in other realities
It applies in example, based on the identification and control to type of transaction, can be avoided hidden by privacy account during client is generated and traded
Private account generates trades in plain text, to realize the safeguard protection to privacy account.
Below in conjunction with the realization process for illustrating another embodiment of the method for realizing secret protection of this specification shown in Fig. 3:
Step 302, the transaction that client receives local account initiation generates request.
In one embodiment, client can be carried in a certain calculating equipment that user uses, and user can be in the visitor
The account of itself control is logged on the end of family.After the account of user's control logs on the client, the account is in client
Local account.
In one embodiment, calculating equipment may include the display components such as display screen, allow the client to be in user
An existing interactive interface, and user can initiate the transaction based on local account by the interactive interface and generate request.
Step 304A, the transaction that the client identification request generates are transaction in plain text or privacy transaction;Wherein, it is stated clearly
Text transaction corresponds to plaintext contract, and the privacy transaction corresponds to plaintext contract and/or privacy contract.
In one embodiment, client may provide for the choosing of type of transaction in the interactive interface provided a user
, and user can trigger the option according to actual needs, to set the type of transaction for wishing to use as plaintext type or privacy
Type, the transaction for allowing client to know that request generates accordingly are transaction in plain text or privacy transaction.
In one embodiment, client can check the corresponding intelligent contract of transaction, if the corresponding intelligent contract of transaction
In include at least one privacy contract, then determining the transaction for privacy transaction, if the corresponding intelligent contract of transaction is bright
Literary contract, then can be determined that the transaction to trade in plain text.Certainly, transaction might not have corresponding intelligent contract, then
Client can be judged by other means, such as based on above-mentioned option etc..
Step 304B, the client identify that the local account is plaintext account or privacy account.
In one embodiment, client periodically can synchronize account information by the node into block chain network, each to obtain
The set (such as list or other forms) of a account and its type information allows client to be based on the set to local account
Type identified, to determine local account as plaintext type or the account of privacy type.
In one embodiment, client can send inquiry request to the node in block chain network, in the inquiry request
It may include the information of local account, so that node identifies the type of the local account, and recognition result returned into visitor
Family end, then client can know that local account is plaintext account or privacy account accordingly.
Step 306, the client refuses the transaction generation request when privacy account request is generated and traded in plain text, no
Request then is generated in response to the transaction and generates corresponding transaction.
In one embodiment, when transaction, which generates request, to be initiated by privacy account, for the safeguard protection to privacy account,
Need to limit the type of the transaction: when the transaction that privacy account is initiated generates request for generating privacy transaction, due to privacy
Transaction is relatively prone to meet high level secret protection demand, uses encrypted transmission and executes in credible performing environment,
So that privacy transaction has high privacy, thus allow to generate privacy transaction;When the transaction that privacy account is initiated generates
When request is traded in plain text for generating, since plaintext transaction is relatively prone to meet treatment effeciency demand, plaintext transmission is used
And executed except credible performing environment, so that the privacy relative deficiency of transaction in plain text, because being handed over without allowing to generate the plaintext
Easily, to realize the safeguard protection to privacy account, avoid initiating unintentionally using the user of privacy account trading in plain text and
Cause the leakage of associated privacy information.
In one embodiment, when transaction generate request by plaintext account initiate when, no matter the plaintext account wish to generate it is bright
Text transaction or privacy transaction, client are generated relationship trading, plaintext account are allowed to select to send out according to actual needs
Play the transaction of plaintext type or privacy type.
In one embodiment, when client, which generates, trades in plain text, plaintext transaction is generated by plaintext account, this is handed in plain text
It easily can be used for creating and/or calling intelligent contract.Since the first block chain node hands over plaintext except credible performing environment
It is easily handled, and is directly stored the plaintext implementing result that processing obtains to external memory space, thus used when trading in plain text
When creating intelligent contract, the intelligence contract is inevitable to be stored in external memory space with plaintext version, thus the intelligence contract must
It is so plaintext contract.Meanwhile when plaintext trades and calls intelligent contract, due to can only be closed to privacy in credible performing environment
About it is decrypted, thus the intelligent contract that transaction is called in plain text only can be plaintext contract.
In one embodiment, when client generates privacy transaction, privacy transaction is raw by plaintext account or privacy account
At privacy transaction is for creating privacy contract, calling plaintext contract and/or invoking privacy contract.Since privacy is traded in TEE
Middle execution, thus the corresponding intelligent contract of privacy transaction can be privacy contract, for example privacy transaction can create intelligence in TEE
Energy contract, the contract code and contract state of the intelligence contract can be encrypted in TEE, be closed to create corresponding privacy
About;Privacy transaction can be with invoking privacy contract for another example, which is decrypted and executes in TEE, and occurs after executing
The contract state of update can be updated and re-encrypted storage;For another example privacy transaction can call plaintext contract, this is in plain text
After contract is performed in TEE, the contract state updated is still stored with plaintext version.
Although relatively more complicated processing logic, above-mentioned plaintext transaction and privacy may be implemented by intelligence contract
Transaction can be also used for realizing the relatively simple processing logic such as transfer accounts, can also never call at this time intelligent contract come it is real
It is existing.
It is generated at a certain client it is assumed that above-mentioned privacy is traded, which can firstly generate in transaction in plain text
Hold, then encrypts the plaintext transaction content with key.The encryption can use symmetric cryptography, can also use asymmetric
Encryption.Correspondingly, the first block chain node can decrypt the privacy with corresponding key and trade, to obtain in transaction in plain text
Hold.If client symmetric cryptography mode, i.e., plaintext transaction content is encrypted with the symmetric key of symmetric encipherment algorithm, then phase
Ying Di, the first block chain node can the transaction of privacy described in the symmetric key decryption with the symmetric encipherment algorithm.Symmetric cryptography
The Encryption Algorithm of use, e.g. DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm
Deng.The symmetric key of symmetric encipherment algorithm, such as can be the generation side to be traded by the privacy and generate, or by client and the
One block chain node is negotiated to determine, or sends to obtain by Key Management server.
If encrypted with the private key of rivest, shamir, adelman to plaintext transaction content, then phase with asymmetric encryption mode
Ying Di, the first block chain node can decrypt the privacy with the private key of the rivest, shamir, adelman and trade.Asymmetric encryption
Algorithm, e.g. RSA, Elgamal, knapsack algorithm, Rabin, D-H, ECC (elliptic curve encryption algorithm) etc..Asymmetric encryption
The key of algorithm, such as can be and a pair of of public key and private key are generated by the first block chain node, and public key is sent to institute in advance
Client is stated, so that the client can encrypt plaintext transaction content with key.
The key of rivest, shamir, adelman can also be generated by a Key Management server.Pass through the side of remote proving
Private key is sent to the first block chain node by formula, Key Management server, specifically, can be incoming first block chain node
In enclosure.First block chain node may include multiple enclosures, and the safety that above-mentioned private key can be passed into these enclosures is enclosed
Circle;For example, the safe enclosure can be QE (Quoting Enclave) enclosure, rather than AE (Application Enclave) encloses
Circle.For the public key of asymmetric encryption, the client can be sent to by Key Management server.Thus client can be used
The public key encryption plaintext transaction content, correspondingly, the first block chain node can decrypt the privacy with the private key and trade, with
Obtain the plaintext transaction content that privacy transaction includes.
Client can also be in such a way that symmetric cryptography combination asymmetric encryption combines.For example, client use pair
Claim Encryption Algorithm encrypting plaintext transaction content, that is, uses the symmetric key encryption plaintext transaction content of symmetric encipherment algorithm, be used in combination
The symmetric key used in rivest, shamir, adelman cryptographic symmetrical Encryption Algorithm.In general, using the public affairs of rivest, shamir, adelman
The symmetric key used in key cryptographic symmetrical Encryption Algorithm.It, can be in this way, after the first block chain node receives the transaction of encryption
It is first decrypted using the private key of rivest, shamir, adelman, obtains the symmetric key of symmetric encipherment algorithm, and then use symmetric cryptography
The symmetric key decryption of algorithm obtains plaintext transaction content.
For example, the private key of rivest, shamir, adelman can be sent to the firstth area by remote proving by Key Management server
The enclosure of block chain node, and the private key of rivest, shamir, adelman is sent to the client.Thus, the client can adopt
With the symmetric key encryption plaintext transaction content of symmetric encipherment algorithm, that is, use the symmetric key encryption of symmetric encipherment algorithm in plain text
Transaction content, and with the symmetric key used in the public key encryption symmetric encipherment algorithm of rivest, shamir, adelman.In turn, the visitor
Family end the privacy can be traded and encryption key (public key by rivest, shamir, adelman in the symmetric encipherment algorithm to adopting
Symmetric key obtains after being encrypted) it is sent to the first block chain node.First block chain node receives the privacy
After transaction and encryption key, first the encryption key can be decrypted to obtain symmetric cryptography with the private key of rivest, shamir, adelman
The symmetric key of algorithm, and then privacy described in the symmetric key decryption with the symmetric encipherment algorithm is traded, and is obtained in transaction in plain text
Hold.Here cipher mode is commonly referred to as digital envelope encryption.
The node embodiment that three handed deal is realized in a kind of block chain of this specification is introduced below in conjunction with Fig. 4, comprising:
Receiving unit 401, for receiving transaction;
Transaction identification unit 402, the transaction is transaction in plain text or privacy transaction for identification;Wherein, the plaintext is handed over
Easily correspond to plaintext contract, the privacy transaction corresponds to plaintext contract and/or privacy contract;
Account recognition unit 403, generation side's account of the transaction is plaintext account or privacy account for identification;
Execution unit 404, for being that refusal executes the transaction when plaintext that privacy account is initiated is traded in the transaction,
Otherwise the transaction is executed.
The system embodiment that three handed deal is realized in a kind of block chain of this specification, including client are introduced below in conjunction with Fig. 5
End 501 and the first block chain node 502, in which:
After the transaction that client 501 receives local account initiation generates request, identify that the local account is plaintext account
The transaction that family or privacy account, request generate is transaction in plain text or privacy transaction, and generates in privacy account request and trade in plain text
When refuse the transaction and generate request, otherwise generate request in response to the transaction and generate and trade accordingly;Wherein, it is stated clearly
Text transaction corresponds to plaintext contract, and the privacy transaction corresponds to plaintext contract and/or privacy contract;
First block chain node 502 executes the plaintext transaction except credible performing environment, and obtained plaintext is held
Row result is stored to the external memory space except the credible performing environment;Or, the first block chain node 502 is to the privacy
Transaction is decrypted, to obtain corresponding plaintext transaction content;The plaintext transaction content is executed in credible performing environment, and
Obtained plaintext implementing result is encrypted as being stored after ciphertext implementing result to the external memory space.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " is patrolled
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed is most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method process can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and insertion microcontroller, the example of controller includes but is not limited to following microcontroller
Device: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320 are deposited
Memory controller is also implemented as a part of the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained to come in fact in the form of logic gate, switch, specific integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc.
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when specification.
It should be understood by those skilled in the art that, the embodiment of the present invention 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 present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, 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 present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
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.
This specification can describe in the general context of computer-executable instructions executed by a computer, such as journey
Sequence module.Generally, program module include routines performing specific tasks or implementing specific abstract data types, programs, objects,
Component, data structure etc..This specification can also be practiced in a distributed computing environment, in these distributed computing environment
In, by executing task by the connected remote processing devices of communication network.In a distributed computing environment, program module
It can be located in the local and remote computer storage media including storage equipment.
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, computer includes at one or more
Manage device (CPU), input/output interface, 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 medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, based on graphene
Storage medium or other magnetic storage devices or any other non-transmission medium, can be used for storing can be accessed by a computing device
Information.As defined in this article, computer-readable medium does not include temporary computer readable media (transitory media),
Such as the data-signal and carrier wave of modulation.
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 described want
There is also other identical elements in the process, method of element, commodity or equipment.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
The term that this specification one or more embodiment uses be only merely for for the purpose of describing particular embodiments, and
It is not intended to be limiting this specification one or more embodiment.In this specification one or more embodiment and the appended claims
Used in the "an" of singular, " described " and "the" be also intended to including most forms, unless context understands earth's surface
Show other meanings.It is also understood that term "and/or" used herein refers to and includes one or more associated list
Any or all of project may combine.
It will be appreciated that though this specification one or more embodiment may using term first, second, third, etc. come
Various information are described, but these information should not necessarily be limited by these terms.These terms are only used to same type of information area each other
It separates.For example, the first information can also be referred to as in the case where not departing from this specification one or more scope of embodiments
Two information, similarly, the second information can also be referred to as the first information.Depending on context, word as used in this is " such as
Fruit " can be construed to " ... when " or " when ... " or " in response to determination ".
The foregoing is merely the preferred embodiments of this specification one or more embodiment, not to limit this theory
Bright book one or more embodiment, all within the spirit and principle of this specification one or more embodiment, that is done is any
Modification, equivalent replacement, improvement etc. should be included within the scope of the protection of this specification one or more embodiment.