Summary of the invention
For the status of block chain flow chart of data processing set forth above, present description provides a kind of based on block chain
Event deposits card method, applied in the block chain including depositing card side's node device;It disposes and useful is deposited in data on the block chain
Storage and the intelligent contract read;The described method includes:
It is described to deposit card side's node device and send first object transaction to the block chain, first object transaction include to
The object event data of storage;
The intelligent contract is called, the data storage logic of the intelligent contract statement is executed, stores the object event
Data are to the intelligent contract;
Card mark image is deposited in mark generation at least based on the intelligent contract.
In the another embodiment shown, the target data further includes the label of number made by object event related side
Name verifies the object event data so that acquisition side's node device is based on the digital signature;
Card mark image is deposited in the mark generation at least based on the intelligent contract, comprising:
Card mark is deposited in the identity name generation of mark and the object event related side at least based on the intelligent contract
Image.
In the another embodiment shown, card mark figure is deposited in the mark generation at least based on the intelligent contract
Picture, comprising:
At least the mark of the intelligent contract is encoded to generate and deposit card digital coding according to preset coding rule;
Mapping relations and preset color lump genesis sequence according to preset coding with color, deposit card digital coding for described
Sequentially generate the color lump with the preset style.
In the another embodiment shown, the method further include:
Receive the mapping code that the intelligent contract is object event data distribution;
Card mark image is deposited in the mark generation at least based on the intelligent contract, comprising:
Mark and mapping code generation at least based on the intelligent contract deposit card mark image.
In the another embodiment shown, the method further include:
The data acquisition permission transaction of target user is sent to the block chain, the data acquisition permission transaction is to set
The target user is set to the acquisition permission of the object event data;
The intelligent contract is called, the logic of the data acquisition permission of the setting user of the intelligent contract statement is executed,
The permission for obtaining the object event data is set for the target user.
In the another embodiment shown, the method further include:
Receive the notification message that acquisition side's node device that the intelligent contract is sent obtains the target data.
This specification additionally provides a kind of event acquisition methods based on block chain, applied to including depositing card side's node device
In the block chain of acquisition side's node device;The intelligent contract for having stored object event data is deployed on the block chain;Institute
The method of stating includes:
That node device offer in card side's is deposited described in acquisition side's node device identification deposits card mark image, at least to obtain
The mark of the intelligence contract;Wherein, the mark for depositing card mark image at least based on the intelligent contract generates;
The second target transaction is sent to the block chain, second target transaction includes the mark of the intelligent contract;
The intelligent contract is called, the data acquisition logic of the intelligent contract statement is executed, obtains the object event
Data.
In the another embodiment shown, the object event data further include number made by object event related side
Signature;
The method also includes:
The target data is verified based on the digital signature.
In the another embodiment shown, card mark image is deposited described in the identification at least to obtain the intelligent contract
Mark, comprising:
According to the mapping relations of preset color lump genesis sequence and preset digital coding and color, by the color of the color lump
Coloured silk, which is successively converted into, deposits card digital coding;
According to preset decoding rule, the card digital coding of depositing is decoded at least to obtain the intelligent contract
Mark.
In the another embodiment shown, the mark for depositing card mark image at least based on the intelligent contract and institute
The mapping code that intelligent contract is object event data distribution is stated to generate;
Card mark image is deposited described in the identification at least to obtain the mark of the intelligent contract, comprising: deposit described in identification
Card identifies image at least to obtain the mark of the intelligent contract and the mapping code;
Second target transaction further includes the mapping code.
In the another embodiment shown, the intelligence contract is that the acquisition side is provided with to the object event number
According to acquisition permission;The data acquisition logic for executing the intelligent contract statement, obtains the object event data, wraps
It includes:
The acquisition side is obtained to the acquisition permission of the object event data;
Based on the acquisition side to the acquisition permission of the target data, the data acquisition of the intelligent contract statement is executed
Logic.
Correspondingly, this specification, which additionally provides a kind of event based on block chain, deposits card device, applied to including depositing card side
In the block chain of node device;The useful intelligent contract for storing and reading in data is disposed on the block chain;Described device packet
It includes:
Transmission unit, card side's node device of depositing is to block chain transmission first object transaction, the first object
Transaction includes object event data to be stored;
Intelligent contract execution unit calls the intelligent contract, executes the data storage logic of the intelligent contract statement,
The object event data are stored to the intelligent contract;
Card mark image is deposited in image generation unit, the mark generation at least based on the intelligent contract.
In the another embodiment shown, the target data further includes the label of number made by object event related side
Name verifies the object event data so that acquisition side's node device is based on the digital signature;
Described image generation unit:
Card mark is deposited in the identity name generation of mark and the object event related side at least based on the intelligent contract
Image.
In the another embodiment shown, described image generation unit:
At least the mark of the intelligent contract is encoded to generate and deposit card digital coding according to preset coding rule;
Mapping relations and preset color lump genesis sequence according to preset coding with color, deposit card digital coding for described
Sequentially generate the color lump with the preset style.
In the another embodiment shown, the device further include:
Receiving unit receives the mapping code that the intelligent contract is object event data distribution;
Described image generation unit:
Mark and mapping code generation at least based on the intelligent contract deposit card mark image.
In the another embodiment shown, the transmission unit:
The data acquisition permission transaction of target user is sent to the block chain, the data acquisition permission transaction is to set
The target user is set to the acquisition permission of the object event data;
The intelligence contract execution unit calls the intelligent contract, executes the setting user of the intelligent contract statement
Data acquisition permission logic, the permission for obtaining the object event data is set for the target user.
In the another embodiment shown, the device further includes receiving unit: receiving the intelligent contract and sends
Acquisition side's node device obtain the notification message of the target data.
Correspondingly, this specification additionally provides a kind of event acquisition device based on block chain, applied to including depositing card side
In the block chain of node device and acquisition side's node device;The intelligence for having stored object event data is deployed on the block chain
Contract;Described device includes:
Image identification unit, it is described deposit card side's node device identification described in deposit card side node device provide deposit demonstrate,prove mark figure
Picture, at least to obtain the mark of the intelligent contract;Wherein, the mark for depositing card mark image at least based on the intelligent contract
Know and generates;
Transmission unit, Xiang Suoshu block chain send the second target transaction, and second target transaction includes that the intelligence is closed
Mark about;
Intelligent contract execution unit calls the intelligent contract, executes the data acquisition logic of the intelligent contract statement,
Obtain the object event data.
In the another embodiment shown, the object event data further include number made by object event related side
Signature;
Described device further include:
Data verification units verify the target data based on the digital signature.
In the another embodiment shown, described image recognition unit:
According to the mapping relations of preset color lump genesis sequence and preset digital coding and color, by the color of the color lump
Coloured silk, which is successively converted into, deposits card digital coding;
According to preset decoding rule, the card digital coding of depositing is decoded at least to obtain the intelligent contract
Mark.
In the another embodiment shown, the mark for depositing card mark image at least based on the intelligent contract and institute
The mapping code that intelligent contract is object event data distribution is stated to generate;
Described image recognition unit: card mark image is deposited described in identification at least to obtain the mark of the intelligent contract and institute
State mapping code;
Second target transaction further includes the mapping code.
In the another embodiment shown, the intelligence contract is that the acquisition side is provided with to the object event number
According to acquisition permission;The intelligence contract execution unit:
The acquisition side is obtained to the acquisition permission of the object event data;
Based on the acquisition side to the acquisition permission of the target data, the data acquisition of the intelligent contract statement is executed
Logic.
This specification additionally provides a kind of computer equipment, comprising: memory and processor;It is stored on the memory
The computer program that can be run by processor;When the processor runs the computer program, execute above-mentioned based on block chain
Event deposit step described in card method.
This specification additionally provides a kind of computer equipment, comprising: memory and processor;It is stored on the memory
The computer program that can be run by processor;When the processor runs the computer program, execute above-mentioned based on block chain
Event acquisition methods described in step.
The data based on block chain that this specification provides deposit card, acquisition methods and device, dispose on the block chain
There is the intelligent contract for storing and reading for data, which can execute the storage or reading to data using the calling at family
It takes.Based on the distributed data base memory mechanism of block chain technology, the target that card side user stores in the intelligent contract is deposited
Data by decentralization are recorded in all nodes, are safeguarded jointly by the node of all participants;Common recognition based on block chain
Mechanism, the data information for each depositing card side user offer will not be tampered after the supply, deposit card target data to reach
Effect.It deposits mark generation of the card side at least based on the intelligent contract and deposits card mark image, can be known by image for obtaining
This does not deposit the mark that card identifies image and obtains above-mentioned intelligent contract, and then calls the intelligence contract to obtain above-mentioned number of targets
According to.
Intelligent contract can be completed to deposit card or acquisition to target data using the calling at family at any time, greatly promote
To the efficiency for depositing card or acquisition of target data;And intelligent contract executes lower human intervention, decentralization authority
Advantage more increases data and deposits card and obtain the fairness of behavior.
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.
As shown in Figure 1, one illustrative examples of this specification provide a kind of object event based on block chain deposit card and
Acquisition methods are disposed on the block chain applied to including depositing card side's node device in the block chain of acquisition side's node device
There is the intelligent contract for storing and reading for data.
Block chain described in the present embodiment, specifically can refer to it is that each node device is reached by common recognition mechanism, have point
The P2P network system of cloth data store organisation, data distribution in the block chain " block one by one connected in time
(block) " within, latter block includes the data summarization of previous block, and according to specific common recognition mechanism (such as POW, POS,
DPOS or PBFT etc.) difference, reach the data full backup of all or part of node device.Those skilled in the art is known,
Since block catenary system is run under corresponding common recognition mechanism, includes to the data in block chain database and be difficult arbitrarily to be saved
Point device is distorted, for example, by using Pow common recognition block chain, at least need the whole network 51% calculate power attack be possible to distort it is existing
Data, thus block catenary system have other centralization Database Systems institute's methods compare guarantee data security, attack protection is distorted
Characteristic.
Moreover, it is noted that node device described in this specification, not only may include the distribution that backup has block chain
The full node device of the full dose data of formula database may also include the partial data for backing up the distributed data base for having block chain
Light node device, and other terminal devices or client, in the present specification without limitation.
The intelligent contract disposed on block chain is by the node device common recognition verifying of block chain to save to point of block chain
The executable computer programming language of cloth database;Any node equipment on block chain can receive the user of block chain
To the calling of intelligent contract, to execute the logic of intelligence contract statement;Node device of the above-mentioned implementing result through block chain is total
It also can be saved after knowing verifying to the distributed data base of block chain.
In the present embodiment, disposed on block chain it is useful with data store and read intelligent contract, user can pass through to
The account address of the intelligence contract or other identifier send transaction, call the interface and corresponding function of the intelligence contract, complete
The operation of stored data into the intelligent contract store data inside or the reading intelligent contract.
As shown in Figure 1, the data based on block chain provided by the present embodiment deposit card method and include:
Step 102, card side's node device of depositing to block chain transmission first object transaction, hand over by the first object
It include easily object event data to be stored.
Transaction (transaction) described in this specification refers to that user is created by the node device of block chain
The data built, and need finally to be distributed in the distributed data base of block chain.Wherein, the transaction in block chain, exists
Point of the transaction of the transaction and broad sense of narrow sense.The transaction of narrow sense refers to the value Transfer that user issues to block chain;Example
Such as, in traditional bit coin block chain network, transaction can be one that user initiates in block chain and transfer accounts.And broad sense
Transaction refers to the arbitrary data that user issues to block chain.First object described in the present embodiment transaction, be include to
The object event data of storage, above-mentioned object event data may include the number for describing the process that all or part of event occurs
According to, or the data etc. of the characteristic value of event are described, contract can be embodied in, notice, specification, service profile, ordered
The various forms such as single, in the present specification without limitation.Other nodes in block chain know above-mentioned object event in order to prevent
The original text of data causes the leakage of some privacy informations, can be to above-mentioned object event data encryption, by above-mentioned comprising object event
The first object of data ciphertext is traded to be sent to block chain.
Those skilled in the art is readily apparent that, deposits card side described in the present embodiment, and it is related to can be above-mentioned object event
One of side or object event related side can also be not belonging to above-mentioned object event related side, and as in one cubes or event
The mechanism side Cun Zheng executes event described in this specification embodiment and deposits card method.
In the another embodiment shown, above-mentioned object event data further include number made by the object event related side
Word signature, such as contract signatory to digital signature made by text of Contract, notice publisher makees notice text
Digital signature, the specification side of writing is to digital signature made by specification text, and order ordering party is to made by order contents
Digital signature, digital signature made by body matter of the sender of Email to Email etc..Similar to practical industry
Signature in business, above-mentioned digital signature can be expressed as identification of the object event related side to object event data, such as close
With signatory to digital signature made by electronic contract etc..
The mathematics for the data content that digital signature, which is signer, to be approved it based on the private key of itself is made a summary carried out number
Learn encryption;By verifying digital signature, identity corresponding to the public key of signer not only can verify that, it can also be by by above-mentioned private key
The mathematics abstract of encryption is made a summary with the resulting mathematics of existing data content to be compared, verify existing data content whether with
Whether the data content of signer signature is consistent, to know whether existing data content is tampered with.Therefore in this implementation
In example, by verifying above-mentioned digital signature, the usually signature for the acquisition side of the object event data to object event data
Whether the content of square identity and object event data, which is tampered, is verified.
In first object transaction after the verifying of the common recognition of the block chain node device, first object transaction is
It can be included into the distributed data base of the block chain;Any node equipment in block chain, including deposit card side's node and set
Including standby, can receive it is described deposit card side node device and be sent to the first object of the block chain trade, to be based on described the
Above-mentioned intelligent contract is called in the address of intelligent contract in one target transaction.
Step 104, the intelligent contract is called, executes the data storage logic of the intelligent contract statement, described in storage
Object event data are to the intelligent contract.
It is above-mentioned to store object event data to the process of the intelligent contract, point in above-mentioned block chain can also be considered as
The process of above-mentioned intelligent contract is updated in cloth database.In the embodiment shown in one, the storage object event number
According to the extremely described intelligent contract, comprising:
Have the node of book keeping operation permission by the intelligent contract for being stored with the object event data in the block chain
Code is added to candidate block;
The common recognition accounting nodes for meeting the block chain common recognition mechanism are determined from the node with book keeping operation permission;
Candidate block described in node broadcasts of the common recognition accounting nodes to the block chain;
After meeting the verifying approval of the node of preset quantity by the block chain in the candidate block, the candidate regions
Block is considered as newest block, is added in the distributed data base of the block chain.
In the above-described embodiment, the node with book keeping operation permission refers to the node with generation candidate block permission, can
Including depositing other node devices in card side's node device, acquisition side's node device and above-mentioned block chain described in this specification.
According to the common recognition mechanism of the block chain, there can be determining common recognition note in the node of book keeping operation permission to the candidate block from above-mentioned
Account node, above-mentioned common recognition mechanism may include that proof of work mechanism (PoW) or right prove mechanism (PoS) or share authorization
Proof mechanism (DPoS) or PBFT algorithm mechanism etc..
Based on above detailed process, above-mentioned object event data are stored to the intelligent contract, namely are stored in
In the distributed data base of the block chain, to complete to deposit card to the block chain of above-mentioned object event data.
When the object event data for including in the transaction of above-mentioned first object are the ciphertext state of encryption, above-mentioned intelligence contract
Both above-mentioned ciphertext can be decrypted, and demonstrate,proved the original text of above-mentioned object event data in intelligent contract memory;It can also directly deposit on card
The ciphertext of object event data is stated, in the present specification without limitation.
In the present embodiment, the above-mentioned object event data for having deposited card are got in order to facilitate other users, deposits card Fang Jie
Point device can also carry out step 106: card mark image is deposited in the mark generation at least based on the intelligent contract, for other users
Mode based on image recognition gets the mark of the intelligent contract, so that the intelligence be called to close in above-mentioned block chain
About, the data acquisition logic for executing the intelligent contract statement, obtains the object event data.The mark of above-mentioned intelligence contract
It usually may include that the address of intelligent contract or the name on account of intelligent contract or the digital digest value etc. of intelligent contract can be unique
Property identify the mark of above-mentioned intelligent contract.
In the another embodiment shown, when the target data further includes number made by the object event related side
When word is signed, for convenience of object event data acquisition side's node device after obtaining object event data, based on the number
Signature verifies the object event data --- for example, the identity of verifying object event related side, or verifying block chain
On deposit card object event data it is whether consistent with the object event data that object event related side's digital signature is signed, it is above-mentioned
Deposit card mark image can mark and object event related side based on above-mentioned intelligent contract identity name and generate.
The card mark image of depositing for characterizing the mark of the intelligent contract or the identity name of the object event related side leads to
The mode that the digital pictures such as two dimensional code or bar code often can be used, easily obtains above-mentioned intelligence by way of image barcode scanning
The mark of contract or/and the identity name of object event related side, for the acquisition or/and verifying to object event data;
But above-mentioned two dimensional code or the card of depositing of bar code form identify that image generally can not intuitively embody the data information of its representative.
The card of depositing that Fig. 2 illustrates the offer of one exemplary embodiment of this specification identifies image, and it is extremely that this, which deposits card mark image,
The picture (containing color) that few mark based on the intelligent contract generates, such as according to preset coding rule at least to the intelligence
The mark of energy contract is encoded to generate and deposit card digital coding, will be described according to the mapping relations of preset coding and color
Deposit the color lump that card digital coding sequentially generates corresponding color.Optionally, above-mentioned color lump can be the pattern with fixed pattern, such as
Flower shown in Fig. 2 etc., the sequence (sequence of petal 1 to 8 as shown in Figure 2) that can be generated according to above-mentioned color lump generate colored
Picture.
When depositing card mark image further includes the identity name information of object event related side, above-mentioned object event related side
Identity name can be presented jointly by the way of handwritten signature with above-mentioned color image, handwritten signature " woods as shown in Figure 2
It is vertical " (marked as 9), image, colour shown in Fig. 2 are identified compared to the above-mentioned card of depositing presented in the form of two dimensional code or bar code
The card of depositing that picture adds handwritten signature mode to present identifies image, and acquisition side user both can directly be obtained by observing handwritten signature
The identity name of object event related side to be obtained or to be verified is taken, there is better intuitive, can also be known by image
Identify that above-mentioned handwritten signature obtains the user's name of event related side otherwise;Compared to bar code or the image sample of two dimensional code
Formula, it is shown in Fig. 2 that also there is better aesthetics with multicolour pattern.
The intelligent contract for storing and reading for data described in above-described embodiment can be a specified target service
Event deposits card, or multiple target service events deposit card;It both can be a plurality of object event of an object event
Data deposit card, or the object event data of multiple object events deposit card.When above-mentioned intelligent contract is used to be multiple
When target service event deposits card or deposits card for a plurality of object event data of a target service event, above-mentioned intelligence contract
It can be also the corresponding mapping code of above-mentioned object event data distribution, so that the acquisition of object event data can be based on the mapping code
Get corresponding object event data.Above-mentioned mapping code may include the sequence that above-mentioned intelligent contract is the distribution of object event data
Row number may also comprise the identifier, etc. of the title distribution for the related side that above-mentioned intelligent contract is object event data.Accordingly
Card mark image is deposited in ground, the above-mentioned mark generation at least based on the intelligent contract, also should include: at least to be closed based on the intelligence
Mark and mapping code generation about deposits card mark image.
In order to guarantee that above-mentioned object event data will not answer any block chain user transferring and obtained to the intelligence contract
, guarantee privacy and the safety of the object event data, can also be set in above-mentioned intelligence contract for different block chain users
Set its acquisition permission to above-mentioned object event data, above-mentioned acquisition permission can include: can not obtain any object event data,
Preset partial target event data can be obtained, can get whole object event data etc., it can be answered according to above-mentioned intelligent contract
Concrete scene and be arranged.The setting of the above-mentioned acquisition permission to object event data, can be in the deployment of the intelligence contract
It is arranged before cochain by the deployment side of the intelligence contract, can also be used after intelligence contract deployment by the administrator with priority assignation
Family, which is given, to be arranged, and can also be given and is arranged by the card side that deposits of the object event according to specific object event.
In the embodiment shown in one, the above-mentioned data acquisition permission for depositing card side's setting target user by object event
Process include: to deposit card side's node described in any node equipment (including described deposit card side's node device) in the block chain receives
The data acquisition permission for the target user that equipment is sent to the block chain is traded, and the data acquisition permission transaction is to be arranged
Acquisition permission of the target user to the object event data;The intelligent contract is called, the intelligent contract sound is executed
The logic of the data acquisition permission of bright setting user, the power for obtaining the object event data is arranged for the target user
Limit.
The acquisition of above-mentioned object event data is monitored to guarantee the safety of data in order to guarantee to deposit card side's node device, is wrapped
The acquisition side user that timely learning gets above-mentioned object event data out of above-mentioned intelligent contract is included, in the another implementation shown
In mode, which has been further stated to obtain message informing logic, to send to the card side that deposits of above-mentioned object event data
The notification message of above-mentioned object event data is obtained about acquisition side's node device;Correspondingly, it is above-mentioned deposit card side's node device can
Receive the notification message that above-mentioned object event data are obtained about acquisition side's node device that above-mentioned intelligent contract is sent.
Above one or more embodiments describe one or more events based on block chain and deposit card method, are depositing card
Square node device complete to object event data deposit card after, any need can be sent to for above-mentioned card identification image of depositing by depositing card
The block chain node device of above-mentioned object event data is obtained or verifies, so that above-mentioned node device is used as acquisition side's node device
Obtain above-mentioned object event data.As shown in Figure 1, the process for obtaining above-mentioned object event data may include:
Step 108, that node device offer in card side's is deposited described in acquisition side's node device identification deposits card mark image, with
At least obtain the mark of the intelligent contract;Wherein, the mark for depositing card mark image at least based on the intelligent contract is raw
At;
Step 110, Xiang Suoshu block chain sends the second target transaction, and second target transaction includes the intelligent contract
Mark;
Step 108, the intelligent contract is called, executes the data acquisition logic of the intelligent contract statement, described in acquisition
Object event data.
As previously mentioned, above-mentioned object event data may include the number for describing the process that all or part of object event occurs
According to, or the data etc. of the characteristic value of object event are described, it is general that contract, notice, specification, business can be embodied in
The various forms such as condition, order, in the present specification without limitation.
In the another embodiment shown, above-mentioned object event data further include number made by the object event related side
Word signature, such as contract signatory to digital signature made by text of Contract, notice publisher makees notice text
Digital signature, the specification side of writing is to digital signature made by specification text, and order ordering party is to made by order contents
Digital signature, digital signature made by body matter of the sender of Email to Email etc..Similar to practical industry
Signature in business, above-mentioned digital signature can be expressed as identification of the object event related side to object event data, such as close
With signatory to digital signature made by electronic contract etc..
Correspondingly, the above-mentioned event acquisition methods based on block chain further include: based on the digital signature to the target
Data are verified.The mathematics abstract for the data content that digital signature, which is signer, to be approved it based on the private key of itself is carried out
Mathematics encryption;By verifying digital signature, the public key of signer not only can get, and then above-mentioned public key is provided to identity and is recognized
Card mechanism gives authentication, can also be by by above-mentioned private key encryption to know identity corresponding to the public key of signer
Mathematics abstract is made a summary with the resulting mathematics of existing data content to be compared, verify existing data content whether with signer
Whether the data content of signature is consistent, to know whether existing data content is tampered with.Therefore in the present embodiment, lead to
Cross and verify above-mentioned digital signature, usually for the acquisition side of the object event data to signatory's identity of object event data and
Whether the content of object event data, which is tampered, is verified.
In the another embodiment shown, when the target data further includes number made by the object event related side
When word is signed, for convenience of object event data acquisition side's node device after obtaining object event data, based on the number
Signature verifies the object event data --- for example, the identity of verifying object event related side, or verifying block chain
On deposit card object event data it is whether consistent with the object event data that object event related side's digital signature is signed, it is above-mentioned
Deposit card mark image can mark and object event related side based on above-mentioned intelligent contract identity name and generate.
The card mark image of depositing for characterizing the mark of the intelligent contract or the identity name of the object event related side leads to
The mode that the digital pictures such as two dimensional code or bar code often can be used, easily obtains above-mentioned intelligence by way of image barcode scanning
The mark of contract or/and the identity name of object event related side, for the acquisition or/and verifying to object event data;
But above-mentioned two dimensional code or the card of depositing of bar code form identify that image generally can not intuitively embody the data information of its representative.
The card of depositing that Fig. 2 illustrates the offer of one exemplary embodiment of this specification identifies image, and it is extremely that this, which deposits card mark image,
The picture (containing color) that few mark based on the intelligent contract generates, such as according to preset coding rule at least to the intelligence
The mark of energy contract is encoded to generate and deposit card digital coding, will be described according to the mapping relations of preset coding and color
Deposit the color lump that card digital coding sequentially generates corresponding color.Optionally, above-mentioned color lump can be the pattern with fixed pattern, such as
Flower shown in Fig. 2 etc., the sequence (sequence of petal 1 to 8 as shown in Figure 2) that can be generated according to above-mentioned color lump generate colored
Picture.Above-mentioned color image can be scanned by image recognition terminal by obtaining, according to the genesis sequence of the color lump (such as Fig. 2 institute
The sequence of the petal 1 to 8 shown), identify the color of the above-mentioned color lump with the preset style;According to preset digital coding and color
Mapping relations, the color of the color lump is decoded, deposits card digital coding to obtain;According to preset decoding rule, to described
Card digital coding is deposited to be decoded at least to obtain the mark of the intelligent contract.
When depositing card mark image further includes the identity name information of object event related side, above-mentioned object event related side
Identity name can be presented jointly by the way of handwritten signature with above-mentioned color image, handwritten signature " woods as shown in Figure 2
It is vertical " (marked as 9), image, colour shown in Fig. 2 are identified compared to the above-mentioned card of depositing presented in the form of two dimensional code or bar code
The card of depositing that picture adds handwritten signature mode to present identifies image, and acquisition side user both can directly be obtained by observing handwritten signature
The identity name of object event related side to be obtained or to be verified is taken, there is better intuitive, can also be known by image
Identify that above-mentioned handwritten signature obtains the user's name of event related side otherwise;Compared to bar code or the image sample of two dimensional code
Formula, it is shown in Fig. 2 that also there is better aesthetics with multicolour pattern.
The intelligent contract for storing and reading for data described in above-described embodiment can be a specified target service
Event deposits card, or multiple target service events deposit card;It both can be a plurality of object event of an object event
Data deposit card, or the object event data of multiple object events deposit card.When above-mentioned intelligent contract is used to be multiple
When target service event deposits card or deposits card for a plurality of object event data of a target service event, above-mentioned intelligence contract
It can be also the corresponding mapping code of above-mentioned object event data distribution, so that the acquisition of object event data can be based on the mapping code
Get corresponding object event data.Above-mentioned mapping code may include the sequence that above-mentioned intelligent contract is the distribution of object event data
Row number may also comprise the identifier, etc. of the title distribution for the related side that above-mentioned intelligent contract is object event data.Accordingly
Card mark image is deposited in ground, the above-mentioned mark generation at least based on the intelligent contract, also should include: at least to be closed based on the intelligence
Mark and mapping code generation about deposits card mark image.After acquisition side's node device carries out depositing card mark image recognition,
Can get the intelligent contract mark and the mapping code, and the mark of above-mentioned intelligent contract and the mapping code are put together
It is placed in the second target transaction, to call above-mentioned intelligent contract, and corresponding object event number is got based on above-mentioned mapping code
According to.
In order to guarantee that above-mentioned object event data will not answer any block chain user transferring and obtained to the intelligence contract
, guarantee privacy and the safety of the object event data, can also be set in above-mentioned intelligence contract for different block chain users
Set its acquisition permission to above-mentioned object event data, above-mentioned acquisition permission can include: can not obtain any object event data,
Preset partial target event data can be obtained, can get whole object event data etc., it can be answered according to above-mentioned intelligent contract
Concrete scene and be arranged.The setting of the above-mentioned acquisition permission to object event data, can be in the deployment of the intelligence contract
It is arranged before cochain by the deployment side of the intelligence contract, can also be used after intelligence contract deployment by the administrator with priority assignation
Family, which is given, to be arranged, and can also be given and is arranged by the card side that deposits of the object event according to specific object event.
Therefore, the data acquisition logic for executing the intelligent contract statement, obtains the target data, comprising: obtain
The acquisition side is obtained to the acquisition permission of the target data;Based on the acquisition side to the acquisition permission of the target data,
Execute the data acquisition logic of the intelligent contract statement.Specifically, the setting of the data acquisition permission of above-mentioned acquisition side can be with
It is realized by technological means such as setting user's white list, subscriber blacklist, user authority setting tables, details are not described herein.
Corresponding with the realization of above-mentioned process, the embodiment of this specification additionally provides a kind of event based on block chain and deposits card dress
It sets and is obtained with a kind of event based on block chain.The device can also pass through hardware or software and hardware by software realization
In conjunction with mode realize.It taking software implementation as an example, is the CPU by place equipment as the device on logical meaning
Corresponding computer program instructions are read into memory operation and are formed by (Central Process Unit, central processing unit)
's.For hardware view, other than CPU shown in fig. 5, memory and memory, the realization device of network risks business
The equipment at place also typically includes other hardware such as chip for carrying out wireless signal transmitting-receiving, and/or logical for realizing network
Other hardware such as board of telecommunication function.
As shown in figure 3, this specification, which additionally provides a kind of event based on block chain, deposits card device 30, applied to including depositing
In the block chain of card side's node device;The useful intelligent contract for storing and reading in data is disposed on the block chain;The dress
Setting 30 includes:
Transmission unit 302, card side's node device of depositing is to block chain transmission first object transaction, first mesh
Mark transaction includes object event data to be stored;
Intelligent contract execution unit 304 calls the intelligent contract, and the data storage for executing the intelligent contract statement is patrolled
Volume, the object event data are stored to the intelligent contract;
Card mark image is deposited in image generation unit 306, the mark generation at least based on the intelligent contract.
In the another embodiment shown, the object event data further include number made by object event related side
Signature verifies the object event data so that acquisition side's node device is based on the digital signature;
Described image generation unit 306:
Card mark is deposited in the identity name generation of mark and the object event related side at least based on the intelligent contract
Image.
In the another embodiment shown, described image generation unit 306:
At least the mark of the intelligent contract is encoded to generate and deposit card digital coding according to preset coding rule;
Mapping relations and preset color lump genesis sequence according to preset coding with color, deposit card digital coding for described
Sequentially generate the color lump with the preset style.
In the another embodiment shown, the device 30 further include:
Receiving unit 308 receives the mapping code that the intelligent contract is object event data distribution;
Described image generation unit 306:
Mark and mapping code generation at least based on the intelligent contract deposit card mark image.
In the another embodiment shown, the transmission unit 302:
The data acquisition permission transaction of target user is sent to the block chain, the data acquisition permission transaction is to set
The target user is set to the acquisition permission of the object event data;
The intelligence contract execution unit 304 calls the intelligent contract, and the setting for executing the intelligent contract statement is used
The permission for obtaining the object event data is arranged for the target user for the logic of the data acquisition permission at family.
In the another embodiment shown, the device 30 further includes receiving unit 310: receiving the intelligent contract
Acquisition side's node device of transmission obtains the notification message of the target data.
Correspondingly, as shown in figure 4, this specification additionally provides a kind of event acquisition device 40 based on block chain, application
In the block chain including depositing card side's node device and acquisition side's node device;It is deployed on the block chain and has stored target thing
The intelligent contract of number of packages evidence;Described device 40 includes:
Image identification unit 402, it is described deposit card side's node device identification described in deposit card side node device offer deposit demonstrate,prove mark
Image is known, at least to obtain the mark of the intelligent contract;Wherein, the card mark image of depositing at least is based on the intelligent contract
Mark generate;
Transmission unit 404, Xiang Suoshu block chain send the second target transaction, and second target transaction includes the intelligence
The mark of contract;
Intelligent contract execution unit 406 calls the intelligent contract, and the data acquisition for executing the intelligent contract statement is patrolled
Volume, obtain the object event data.
In the another embodiment shown, the object event data further include number made by object event related side
Signature;
Described device 40 further include:
Data verification units 408 verify the target data based on the digital signature.
In the another embodiment shown, described image recognition unit 402:
According to the mapping relations of preset color lump genesis sequence and preset digital coding and color, by the color of the color lump
Coloured silk, which is successively converted into, deposits card digital coding;
According to preset decoding rule, the card digital coding of depositing is decoded at least to obtain the intelligent contract
Mark.
In the another embodiment shown, the mark for depositing card mark image at least based on the intelligent contract and institute
The mapping code that intelligent contract is object event data distribution is stated to generate;
Described image recognition unit 402: card mark image is deposited described in identification at least to obtain the mark of the intelligent contract
With the mapping code;
Second target transaction further includes the mapping code.
In the another embodiment shown, the intelligence contract is that the acquisition side is provided with to the object event number
According to acquisition permission;The intelligence contract execution unit 404:
The acquisition side is obtained to the acquisition permission of the object event data;
Based on the acquisition side to the acquisition permission of the target data, the data acquisition of the intelligent contract statement is executed
Logic.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, the relevent part can refer to the partial explaination of embodiments of method, and details are not described herein.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics mould
Block, it can it is in one place, or may be distributed on multiple network modules.It can be selected according to the actual needs
In some or all of unit or module realize the purpose of this specification scheme.Those of ordinary skill in the art are not paying
In the case where creative work, it can understand and implement.
Device that above-described embodiment illustrates, unit, module can specifically be realized, Huo Zheyou by computer chip or entity
Product with certain function is realized.A kind of typically to realize that equipment is computer, the concrete form of computer can be a
People's computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation
It is any several in equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of kind equipment.
Corresponding with above method embodiment, the embodiment of this specification additionally provides a kind of computer equipment, the calculating
Machine equipment includes memory and processor.Wherein, the computer program that can be run by processor is stored on memory;Processing
For device in the computer program of operation storage, the event based on block chain in this specification embodiment that executes deposits each of card method
Step.Content before referring to the detailed description that the event based on block chain deposits each step of card method, is not repeated.
Corresponding with above method embodiment, the embodiment of this specification additionally provides a kind of computer equipment, the calculating
Machine equipment includes memory and processor.Wherein, the computer program that can be run by processor is stored on memory;Processing
For device in the computer program of operation storage, the event acquisition methods based on block chain is each in execution this specification embodiment
Step.Content before referring to the detailed description of each step of the event acquisition methods based on block chain, is not repeated.
The foregoing is merely the preferred embodiments of this specification, all in this explanation not to limit this specification
Within the spirit and principle of book, any modification, equivalent substitution, improvement and etc. done should be included in the model of this specification protection
Within enclosing.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable 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), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory
(ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only
Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or
Other magnetic storage devices or any other non-transmission medium, can be used for storage can be accessed by a computing device information.According to
Herein defines, and computer-readable medium does not include temporary computer readable media (transitory media), such as modulation
Data-signal and carrier wave.
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 will be understood by those skilled in the art that the embodiment of this specification can provide as the production of method, system or computer program
Product.Therefore, the embodiment of this specification can be used complete hardware embodiment, complete software embodiment or combine software and hardware side
The form of the embodiment in face.Moreover, it wherein includes that computer is available that the embodiment of this specification, which can be used in one or more,
It is real in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form for the computer program product applied.