Specific embodiment
Before block chain authority control method, device and the node device provided the disclosure are illustrated, first to this
The block chain involved by each embodiment is disclosed to be introduced.
In the embodiment of the present disclosure, the data in block chain are set into different safety class according to attribute, without Tongan City congruence
The data of level then correspond to different query nodes and randomly select ratio in inquiry, and then are carried out by the query node of respective numbers
Data query;And threshold is judged according to the successful inquiring whether the Query Result statistics of query node return reaches the safe DBMS
Value, thinks that this Query Result is credible if successful inquiring judgment threshold is reached, and not reaching successful inquiring judgment threshold then needs
To carry out second inquiry more at high proportion or directly with ratio very, if second inquiry does not reach corresponding peace still
The corresponding successful inquiring judgment threshold of full DBMS, then can carry out early warning or judge the accurate of this data by artificial and other modes
Property.Thus, the data query method of the embodiment of the present disclosure, device and node device can improve the confidence level of Query Result and correct
Rate, prevents block chain data to be tampered the inquiry error and security risk for bringing.
The embodiment of the present disclosure, the querying method of block chain data, can be applied to inquire about end is not the node in block chain
Scene, can also be applied to inquire about the scene that end is node in block chain, improve the confidence level and accuracy of Query Result, prevent
Only block chain data are tampered the inquiry error and security risk for bringing.
It is first each to the disclosure before data query method, device and the node device provided the disclosure are illustrated
Block chain involved by individual embodiment is introduced.
Block chain node:Block chain is the decentralization distribution for participating in maintenance jointly by all nodes in block chain network
Database Systems, it is into each data block is in block chain by a series of data chunks produced based on cryptography method
A block.According to the sequencing of generation time, block is linked together in an orderly manner, forms a data chain, quilt
Visually it is referred to as block chain.Some concepts to block chain network are introduced below.
Node in block chain network is properly termed as block chain node, and wherein block chain network is based on P2P (Peer to
Peer, peer-to-peer network) network, each is participated in business and block is stored, verified, the P2P network nodes of forwarding are a blocks
Node in chain network.
User identity:The account address that user identity in block chain can be generated using public key or according to the public key
Represent, and public key and private key are that occur in pairs, and wherein private key is grasped without being published to above-mentioned block chain network by user
In, public key or above-mentioned account address can be arbitrarily issued in block chain network.Wherein, public key can be by specific Hash
With after coding turn into above-mentioned account address.It is noted that user identity and block chain node are closed in the absence of one-to-one corresponding
System, user can use the private key of oneself on any one block chain node.
Block chain data write:Realized by issuing transaction (Transaction) to block chain network from block chain node
Data are write to block chain.The transaction includes:Block chain link point according to default transaction data format to generate transaction data
Bag, and using the digital signature that is carried out to the transaction data package of private key of the block chain node oneself, the digital signature is used for
Prove the identity of the user of the block chain node;Then, after the transaction is distributed to block chain network, by block chain network
" miner " (performing the block chain node of PoW (Proof Of Work, work is proved) common recognition competition mechanism) is recorded into block chain
The new block of middle generation, and the new block is published in block chain network, recorded in the new block and the new block
Conclude the business other block chain node verifications by and receive after, the transaction that the new block is recorded is written into block chain.Wherein, area
New block in block chain is periodically produced by performing the common recognition competition mechanism such as PoW or PoS by above-mentioned " miner ", therefore
Produce the time interval of new block generally related to above-mentioned default technical requirements, can by the default technical requirements for setting different
To change the time interval that block chain produces new block.
It is the schematic diagram of the block chain network of the embodiment of the disclosure one referring to Fig. 1.
The block chain network 100 includes:One or more block chain nodes 101, these block chain nodes 101 can be each
Kind of form is implemented, for example, can be mobile phone, smart phone, notebook computer, digit broadcasting receiver, PDA (individual digitals
Assistant), PAD (panel computer), PMP (portable media player), server, ore deposit machine etc..
In one embodiment, each block in block chain includes block head and block main body.Block main body is preserved to be handed over
Easy data.Transaction data is preserved by Merkel tree.The cryptographic Hash of Merkel's tree root is stored in block head.Block head is extremely
Include less:The cryptographic Hash of upper block head, the cryptographic Hash of Merkel's tree root, timestamp and block number etc..
Transaction data can be any kind of data, including but not limited to:Various types of statistics are (for example, population
Data, medical data etc.), various types of moneytary operations data (for example, transfer transaction data), and various types of requests
Data (for example, inquiry request, node add request etc.) etc..
In the embodiment of the present disclosure, for the security of guarantee information inquiry, block chain data will be entered according to data attribute
Row safe class is set, the different query strategy of different safe class correspondences, improves the security and accuracy rate of data query.
It is the block chain data and different query strategies of the different safety class of the embodiment of the disclosure one referring to table 1
Corresponding relation.
Table 1
Wherein, query node ratio refers to, the ratio of query node number and block chain node total number, as shown in formula (1).
In one embodiment of the disclosure, query node is the node for responding inquiry request, or the node for receiving inquiry request.
Wherein, n is query node number, and N is the block chain node total number in block chain network.
Successful inquiring decision threshold refers to, in the Query Result that query node is returned, the number of ratio highest Query Result
The amount ratio total with query node, as shown in formula (2).
Wherein, m is the quantity of ratio highest Query Result.
It should be understood that be cannot respond to caused by shutdown or deadlock etc. are abnormal due to there may be some query nodes in block chain
The situation of any request, the n in formula (1) and formula (2) includes these and should respond inquiry request, returns to Query Result,
But due to the abnormal query node for not returning to Query Result and the sum of the query node for returning to Query Result.
In an embodiment of the disclosure, its safe class can be determined according to the classification belonging to block chain data.First peace
The block chain data of congruent level can be the data related to personal information, moneytary operations data etc.;The block of the second safe class
Chain data can be various types of statistics;The block chain data of the 3rd safe class can be various types of request datas
(for example, inquiry request, node add request etc.).It should be understood that the safe class of block chain data can be carried out according to actual conditions
Setting, however it is not limited to example described herein.
In further embodiments, in newly-built block, it is determined that to be written to the safe class of the data of block chain.By number
According to safe class be written to together with data in block chain.Thus, when data query is carried out, can be inquired from block chain
The safe class of data.
The safe class of block chain data shown in above-mentioned table 1 is stored in block chain with the corresponding relation of query strategy
In one block.When block chain node receives inquiry request, data to be checked can be determined according to inquiry request, and from block
The corresponding relation of the safe class with query strategy of block chain data is inquired about in the block of chain, the inquiry plan of data to be checked is determined
Slightly.
It is the schematic flow sheet of the data query method of the embodiment of the disclosure one referring to Fig. 2.The method includes following step
Suddenly:
In step 201, inquiry request is received, it is determined that the safe class of data to be checked corresponding with inquiry request.
In step 202., query node is determined according to safe class.
In step 203, inquiry request is sent to identified query node.
In step 204, the Query Result that query node is returned is received, if ratio highest Query Result meets default
Condition, using ratio highest Query Result as the corresponding Query Result of data to be checked.
The data query method of the embodiment of the present disclosure is introduced below with reference to Fig. 3 to Fig. 5.
Referring to Fig. 3, in step 301, target block chain node determines safety of data to be checked etc. according to inquiry request
Level.
In one embodiment, when data query to be carried out, inquiry end generation inquiry request, and inquiry request is sent
Give target block chain node.Here inquiry end is the electronic equipment in non-block chain network.
In another embodiment, inquiry request is generated by target block chain node oneself, i.e., the target block chain node is
It is inquiry end.
Inquiry request includes at least one of following information:Transaction Hash, account address and key word of the inquiry.
When inquiry request include transaction Hash when, it is determined that data to be checked may include:The corresponding transaction of transaction Hash
Whether come into force, moneytary operations data etc..In one embodiment, when inquiry request includes transaction Hash, by number to be checked
According to safe class be defined as the first safe class.
When inquiry request includes account address, it is determined that data to be checked may include:The corresponding account in account address
Information, the transaction record of the corresponding account in account address etc..In one embodiment, when inquiry request includes account address
When, the safe class of data to be checked is defined as the first safe class.
When inquiry request includes key word of the inquiry, it is determined that data to be checked may include:It is corresponding with keyword
Data.In one embodiment, the safe class of data to be checked can according to keyword, be determined, when keyword includes:Account,
During the information such as transaction, the safe class of data to be checked is defined as the first safe class;When keyword does not include account, transaction
During etc. information, the safe class of data to be checked is defined as the second safe class or other grades.
Thus, the embodiment of the present disclosure, is capable of achieving according to inquiry request, determines the safe class of data to be checked.
In step 302, target block chain node determines query strategy according to the safe class of data to be checked.
In an embodiment of the disclosure, can be from being stored with the block of the corresponding relation shown in above-mentioned table 1, query safe
The corresponding query strategy of grade.
In step 303, target block chain node determines query node according to the corresponding query strategy of safe class.
In step 304, target block chain node is asked to query node forwarding inquiries.
In an embodiment of the disclosure, each block chain node preserves the ground of all nodes in block chain network
Location information, and when thering is new node to add block chain network and thering is node to exit block chain network, update preserved address letter
Breath.Thus, target block chain node can be according to the address information of the block chain node of storage, such as IP address information, random choosing
The block chain node of number corresponding with query strategy is selected as query node, and according to the IP address of block chain node, is carried out
The forwarding of inquiry request.For example, when determining query node ratio for w1% according to query strategy, in the node of block chain network
Random selection w1% × N number of node, according to its IP address, inquiry is sent to this w1% × N number of query node as query node
Request.
It should be understood that itself is may include in query node determined by target block chain node, and during including itself, without entering
The forwarding of row inquiry request.
In step 305, target block chain node receives query node and returns to Query Result.
The query node of inquiry request is received, is inquired about according to inquiry request, obtain Query Result, and inquiry is tied
Fruit returns to target block chain node.In one embodiment, target block chain node is when forwarding inquiries are asked, by oneself
Address information is forwarded together with inquiry request, and thus, query node, can be according to target block when Query Result is got
The address information of chain node, target block chain node is returned to by Query Result.
When query node obtains Query Result according to inquiry request:When inquiry request includes transaction Hash, inquiry section
Point according to transaction Hash, the block where determining data to be checked, and data are obtained from corresponding block, and obtaining
Data return to target block chain node as Query Result.
In certain embodiments, query node is verified, i.e. root according to transaction Hash to the corresponding transaction of transaction Hash
According to transaction Hash, inquired about in block chain, judged whether transaction is recorded in certain block, and according to block in area
Position in block chain, determines the block has obtained how many confirmation.Thus, Query Result includes transaction verification result, and the transaction is tested
Card result at least includes:Whether transaction has been recorded in block, and the confirmation block counts for obtaining.
When inquiry request includes account address, query node is determined corresponding to account address according to account address
Block, and data are obtained from corresponding block, and return to target block chain link using the data of acquisition as Query Result
Point.
When inquiry request includes key word of the inquiry, query node is traveled through according to key word of the inquiry to block chain,
The data corresponding with keyword are obtained, and the data corresponding with keyword are returned into target block as Query Result
Chain node.
Within step 306, the Query Result that target block chain node is returned according to query node, determines candidate result.
Target block chain node receives the Query Result that query node is returned, and different Query Results are counted, will
Ratio highest Query Result is used as candidate result.If for example, return Query Result number be 100, wherein there is 85 inquiries
Result is all A, then be ratio highest Query Result by A, as candidate result.
In step 307, when candidate result meets it is pre-conditioned when, candidate result is looked into as data to be checked are corresponding
Ask result.
In one embodiment, it is pre-conditioned to be:Query node number and inquiry of the Query Result of return for candidate result
The ratio of node total number is more than or equal to the corresponding successful inquiring judgment threshold of data to be checked.Thus, target block chain node
It is the query node number of candidate result compared with query node sum by the Query Result of return, when ratio is more than or equal to be checked
When asking the successful inquiring decision threshold in the corresponding query strategy of data, will candidate result looked into as data to be checked are corresponding
Ask result.
In embodiment of the disclosure, not all query node can all return to Query Result, for example, query node
Query Result may not be returned to due to abnormal (for example, illegally being controlled, being tampered, shutdown or failure etc.), but ratio calculating
In, by the Query Result of return for candidate result query node number compared with query node sum so that do not return looking into
Asking the query node of result can produce influence on Query Result, improve the referring to property of Query Result, reduce inquiry risk.
Referring to Fig. 4, when candidate result does not meet it is pre-conditioned when, then re-start inquiry.In an embodiment of the disclosure
In, when re-starting inquiry, the quantity to query node is adjusted, to improve the confidence level and accuracy of Query Result.
In step 401, target block chain link o'clock increases the quantity of query node according to the first preset ratio.
In embodiment of the disclosure, the first preset ratio may be configured as 10%-50%.In certain embodiments, if
One query is failed (i.e. candidate result does not meet pre-conditioned), then improve to 100% the ratio of query node.
In step 402, target block chain node is asked to query node forwarding inquiries.
In step 403, target block chain node receives query node and returns to Query Result.
In step 404, the Query Result that target block chain node is returned according to query node, determines candidate result.
In step 405, when candidate result meets it is pre-conditioned when, candidate result is looked into as data to be checked are corresponding
Ask result.
It should be understood that step 402-405 is identical with the implementation principle of above-mentioned steps 304-307, will not be repeated here.And in step
In rapid 405, when determining whether candidate result meets pre-conditioned, successful inquiring decision threshold is identical with step 307.Certainly,
In certain embodiments, also successful inquiring decision threshold can be scaled up in step 405, the disclosure is not limited this
It is fixed.
Referring to Fig. 5, in embodiment of the disclosure, when second inquiry is carried out, candidate result does not meet default yet
Condition, then second inquiry failure, in target block chain node issue early warning information to block chain network.Wrapped in the early warning information
Include:Transaction Hash, account address or key word of the inquiry in inquiry request.During the early warning information is used to point out block chain network
There is security risk in node, the data corresponding to inquiry request.In one embodiment, if inquiry end is in non-block chain network
Node device, then target block chain node to inquiry end send prompt message, the prompt message be used for prompting query result not
Can with or inquire about invalid etc..
It should be understood that when second inquiry failure, can also carry out third time, the 4th time ... inquiry, the number of times of inquiry can
It is configured according to actual conditions, until inquiry times reach the maximum search frequency, when still inquiring about unsuccessfully, according to defeated shown in Fig. 5
Go out early warning information and prompt message.Often increase one query, the ratio of query node can be improved once.
The data query method of the embodiment of the present disclosure, different query strategies are determined according to different safety class, it is to avoid
The caused inquiry error such as individual node is attacked, data are tampered;The confidence level and accuracy of Query Result are improved, area is prevented
Block chain data are tampered the inquiry error and security risk for bringing;Can avoid because only being inquired about by individual node, and the list
Individual node is attacked or data are tampered, and makes to inquire the possibility of error message;On the other hand, it also avoid all of looking into
Asking request all using same ratio query node inquire about the wasting of resources for bringing, and inquiry all passes through 100% every time
Block chain link point is inquired about the burden brought to all block chain nodes, can ensure Query Result reliability in the case of,
The negative effect that reduction is caused to block chain concurrency.
It is the schematic flow sheet of the data query method of another embodiment of the disclosure referring to Fig. 6.The method includes following step
Suddenly:
In step 601, the inquiry request for being sent according to target block chain node, it is determined that corresponding with inquiry request to be checked
Ask the safe class of data;
In step 602, the probability of response inquiry request is determined according to safe class;
In step 603, when according to probability, it is determined that during response inquiry request, returning to Query Result and giving target block chain link
Point.
In the embodiment of the disclosure, target block chain node (receives the area of the inquiry request that inquiry end sends
The block chain node of block chain node or itself generation inquiry request) inquiry request is published in block chain network so that block
All nodes in chain network can all receive inquiry request.The block chain node of inquiry request is received, can be asked according to inquiry
Corresponding query strategy is sought, it is determined that the probability of response inquiry request, so as to carry out the return of Query Result according to probability.
Referring to Fig. 7, in the data query method of the embodiment of the disclosure one, in step 701, target block chain node will
Inquiry request is published in block chain network.
Identical with the embodiment shown in above-mentioned Fig. 3, inquiry request can be generated for target block chain node oneself, or non-block
Electronic equipment generation in chain network.
In this embodiment, inquiry request is sent to target block chain node the block chain node being connected with oneself, and
Inquiry request is sent to other block chain nodes by these block chain nodes again so that each the block chain link in block chain network
Point can receive inquiry request.
In a step 702, the block chain node of inquiry request is received, according to inquiry request, data to be checked is determined
Safe class.
In step 703, according to the safe class of data to be checked, query strategy is determined.
It should be understood that step 702 determines the safe class of data to be checked, and step 703 determines the implementation of query strategy
Principle is identical with the embodiment shown in above-mentioned Fig. 3, will not be repeated here.
In step 704, block chain node is according to the corresponding query strategy of safe class, it is determined that response inquiry request is general
Rate.
In an embodiment of the disclosure, the probability for responding inquiry request is identical with the ratio of query node in above-mentioned table 1,
Thus, block chain node can inquire response inquiry corresponding with different safety class from the block of information shown in storage table 1
The probability of request.
Because the probability of safe class and response inquiry request is corresponding, therefore, block chain node can be according to safety
Grade obtains the probability for oneself needing to respond inquiry request.In one embodiment, block chain node obtains response inquiry request
Probability after, i.e., determine whether itself responds this inquiry request to generate the method for random number.
For example, if the probability of response inquiry request is 80%, random number can be the arbitrary integer between 1 to 10.Then
Understand that the probability that 1,2,3,4,5,6,7,8,9,10 this ten numerals occur inside random array is all 10%.Because response is looked into
The probability for asking request is 80%, then can set and be not responding to inquiry request if the random number of generation is 1 or 2, if generation
Random number is any several between 3 to 10, responds inquiry request.In this way, there is 80% probability due to each node
Can returning result, according to Probability Principles, then about 80% can respond inquiry request in the node of normal work in block chain network,
And return to Query Result.Because be there may be in block chain some nodes be cannot respond to caused by reason because shutting down or crashing etc. it is any
Request, therefore judge whether Query Result meets successful inquiring and sentence after node total number in 80% block chain network should be used as
Determine the denominator of threshold percentage.And accounting example highest inquiry in the Query Result that the block chain node for responding inquiry request is returned
The quantity of result is then to determine whether to meet the molecule of successful inquiring decision threshold percentage.
It should be understood that block chain node can also be according to other modes, it is determined whether response inquiry request, if for example, safety
The corresponding query node ratio of grade be higher than a preset value when, then respond inquiry request mode, the embodiment of the present disclosure to this not
It is construed as limiting.
In step 705, the query node of inquiry request is responded, return to Query Result and give target block chain node.
It should be understood that the implementation process that query node obtains Query Result is identical with above-mentioned embodiment illustrated in fig. 2, herein no longer
Repeat.
In step 706, the Query Result that target block chain node is returned according to query node, determines candidate result.
In step 707, when candidate result meets it is pre-conditioned when, candidate result is looked into as data to be checked are corresponding
Ask result.
It should be understood that the implementation process phase of the step of step 706 and step 707 and above-mentioned embodiment illustrated in fig. 3 306 and 307
Together, will not be repeated here.
When candidate result do not meet Query Result discrimination threshold it is pre-conditioned when, then re-start inquiry.In the disclosure
In one embodiment, when re-starting inquiry, be published to inquiry request in block chain network again by target block chain node, block
If chain node receives identical inquiry request again, the probability for responding inquiry request is increased according to the second preset ratio,
Second preset ratio may be configured as 10%-50%.In certain embodiments, if inquiring about for the first time, failed (i.e. candidate result is not
Meet pre-conditioned), then the block chain node that will again receive same inquiry request carries the probability for responding inquiry request
All nodes for receiving inquiry request in up to 100%, i.e. block chain network respond inquiry request
Query Result is returned to target block chain node by the query node for responding inquiry request.Target block chain node root
According to the Query Result that query node is returned, candidate result is determined.
When candidate result meets it is pre-conditioned when, using candidate result as the corresponding Query Result of data to be checked.
It should be understood that when determining whether candidate result meets pre-conditioned, successful inquiring decision threshold can keep constant, or ratio
Example improve, the disclosure this is not made limit it is identical with the embodiment shown in above-mentioned Fig. 4, when second inquiry is carried out, candidate result
Do not meet pre-conditioned yet, then second inquiry failure, in target block chain node issue early warning information to block chain network.Should
Early warning information includes:Transaction Hash, account address or key word of the inquiry in inquiry request.The early warning information is used for highlight
There is security risk in node in block chain network, the data corresponding to inquiry request.In one embodiment, if inquiry end is non-
Node device in block chain network, then to inquiry end transmission prompt message, the prompt message is used to carry target block chain node
Show that Query Result is unavailable or it is invalid etc. to inquire about.
It should be understood that when second inquiry failure, can also carry out third time, the 4th time ... inquiry, the number of times of inquiry can
It is configured according to actual conditions, until inquiry times reach the maximum search frequency, when still inquiring about unsuccessfully, according to defeated shown in Fig. 5
Go out early warning information and prompt message.Often increase one query, the probability that can will respond inquiry request is improved once.
The data query method of the embodiment of the present disclosure, different query strategies are determined according to different safety class, it is to avoid
The caused inquiry error such as individual node is attacked, data are tampered;The confidence level and accuracy of Query Result are improved, area is prevented
Block chain data are tampered the inquiry error and security risk for bringing;Can avoid because only being inquired about by individual node, and the list
Individual node is attacked or data are tampered, and makes to inquire the possibility of error message;On the other hand, it also avoid all of looking into
Asking request all using same ratio query node inquire about the wasting of resources for bringing, and inquiry all passes through 100% every time
Block chain link point is inquired about the burden brought to all block chain nodes, can ensure Query Result reliability in the case of,
The negative effect that reduction is caused to block chain concurrency.
Referring to Fig. 8, the embodiment of the present disclosure also provides a kind of data query arrangement, is applied to the block chain link of block chain network
Point, the device includes:
Safe class determining module 801, is configured as receiving inquiry request, it is determined that corresponding with the inquiry request to be checked
Ask the safe class of data;
First query node determining module 802, is configured as determining query node, the inquiry according to the safe class
Node is the node in block chain network;
First inquiry request forwarding module 803, be configured as sending the inquiry request be transmitted to determined by described look into
Ask node;
First Query Result determining module 804, is configured as receiving the Query Result that the query node is returned, if than
Example highest Query Result meets pre-conditioned, and the ratio highest Query Result is corresponding as the data to be checked
Query Result.
In one embodiment, the safe class determining module 801, is configured as in the data to be checked that are stored with
In the block of the corresponding relation of safe class, the corresponding safe class of the data to be checked is inquired about.
In one embodiment, the first Query Result determining module 804 includes:
First candidate result determination sub-module, is configured as tying the ratio highest Query Result as the first candidate
Really;
First Query Result determination sub-module, it is looking into for first candidate result to be configured as in the Query Result for returning
When the ratio for asking nodes and query node sum is more than or equal to the data to be checked corresponding successful inquiring judgment threshold,
Using the ratio highest Query Result as the corresponding Query Result of the data to be checked.
In one embodiment, described device 800 also includes:
Query node adjusting module 805, when being configured as ratio highest Query Result and not meeting pre-conditioned, to looking into
The quantity for asking node is adjusted;
Second query node determining module 806, the query node quantity after being configured as according to adjustment, it is determined that inquiry section
Point;
Second inquiry request forwarding module 807, is configured as the inquiry request being transmitted to the identified inquiry
Node;And
Second Query Result determining module 808, is configured as the Query Result returned according to query node, it is determined that described treat
The corresponding Query Result of inquiry data.
In one embodiment, the second Query Result determining module 808 includes:
Second candidate result determination sub-module, is configured as ratio highest Query Result as the second candidate result;
Early warning information issues submodule, is configured as in the inquiry section that the Query Result for returning is second candidate result
When points and the ratio of query node sum are less than the data to be checked corresponding successful inquiring judgment threshold, to block link network
Network issues early warning information.
Referring to Fig. 9, the embodiment of the present disclosure also provides a kind of data query arrangement, is applied to the block chain link of block chain network
Point, the device 900 includes:
Safe class determining module 901, is configured as the inquiry request sent according to target block chain node, it is determined that and institute
State the safe class of the corresponding data to be checked of inquiry request;
Inquiry probability determination module 902, is configured as determining the general of the response inquiry request according to the safe class
Rate;
First Query Result returns to module 903, is configured as according to the probability, it is determined that responding the inquiry request
When, Query Result is returned to the target block chain node.
In one embodiment, device 900 also includes:
Probability adjusting module 904, is configured as, when repeating to receive the inquiry request, adjusting the probability
It is whole;
Second Query Result returns to module 905, is configured as the probability after according to adjustment, it is determined that respond the inquiry please
When asking, Query Result is returned to the target block chain node
In one embodiment, the first Query Result returns to module 903 and includes:
First block determination sub-module, is configured as when the inquiry request includes transaction Hash, according to the friendship
Easy Hash, the block where determining the data to be checked;
First Query Result determination sub-module, is configured as obtaining data from the block for determining, and the number that will be obtained
The target block chain node is returned to according to as Query Result.
In one embodiment, the first Query Result returns to module 903 and includes:
Transaction verification submodule, is configured as, when the inquiry request includes transaction Hash, being breathed out according to the transaction
It is uncommon, the corresponding transaction of transaction Hash is verified;
Second Query Result determination sub-module, is configured as returning to the mesh using the result as the Query Result
Mark block chain node, the result at least includes:Whether transaction has been recorded in block, and the confirmation block for obtaining
Number.
In one embodiment, the first Query Result returns to module 903 and includes:
Second block determination sub-module, when being configured as the inquiry request and including account address, according to the account
Family address, determines the block corresponding to account address;
3rd Query Result determination sub-module, is configured as obtaining data from the block for determining, and the number that will be obtained
The target block chain node is returned to according to as the Query Result.
In one embodiment, the first Query Result returns to module 903 and includes:
3rd block determination sub-module, when being configured as the inquiry request and including key word of the inquiry, according to described
Key word of the inquiry, travels through to block chain, obtains the data corresponding with keyword;And
4th Query Result determination sub-module, is configured as the data corresponding with the keyword as the inquiry
Result returns to the target block chain node.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant the method
Embodiment in be described in detail, explanation will be not set forth in detail herein.
Figure 10 is a kind of block diagram of the device 1000 for data query method according to an exemplary embodiment, should
Device 1000 can be the node device in block chain.As shown in Figure 10, the device 1000 can include:Processor 1001, deposits
Reservoir 1002, multimedia groupware 1003, input/output (I/O) interface 1004, and communication component 1005.
Wherein, processor 1001 is used to control the integrated operation of the device 1000, to complete above-mentioned data query method
All or part of step.Memory 1002 is used for storage program area, and various types of data are supporting in the device 1000
Operation, these data for example can include on the device 1000 operate any application program or method finger
Order, and the related data of application program.The memory 1002 can be set by any kind of volatibility or non-volatile memories
The realization of standby or combinations thereof, such as static RAM (Static Random Access Memory, referred to as
SRAM), Electrically Erasable Read Only Memory (Electrically Erasable Programmable Read-Only
Memory, abbreviation EEPROM), Erasable Programmable Read Only Memory EPROM (Erasable Programmable Read-Only
Memory, abbreviation EPROM), programmable read only memory (Programmable Read-Only Memory, abbreviation PROM), only
Read memory (Read-Only Memory, abbreviation ROM), magnetic memory, flash memory, disk or CD.
Multimedia groupware 1003 can include screen and audio-frequency assembly.Wherein screen for example can be touch-screen, audio group
Part is used to export and/or input audio signal.For example, audio-frequency assembly can include a microphone, microphone is used to receive outer
Portion's audio signal.The audio signal for being received can be further stored in memory 1002 or be sent out by communication component 1005
Send.Audio-frequency assembly also includes at least one loudspeaker, for exports audio signal.I/O interfaces 1004 be processor 1001 and its
There is provided interface between his interface module, above-mentioned other interface modules can be keyboard, mouse, button etc..These buttons can be
Virtual push button or entity button.Communication component 1005 is used to carry out wired or wireless leading between the device 1000 and other equipment
Letter.Radio communication, such as Wi-Fi, bluetooth, near-field communication (Near Field Communication, abbreviation NFC), 2G, 3G or
4G, or one or more in them combination, therefore the corresponding communication component 1005 can include:Wi-Fi module, bluetooth
Module, NFC module.
In one exemplary embodiment, device 1000 can be by one or more application specific integrated circuits
(Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital
Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device,
Abbreviation DSPD), PLD (Programmable Logic Device, abbreviation PLD), field programmable gate array
(Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics unit
Part is realized, for performing above-mentioned data query method.
In a further exemplary embodiment, a kind of computer program product, the computer program product bag are additionally provided
Containing the computer program that can be performed by programmable device, the computer program has to work as to be held by the programmable device
For performing the code section of above-mentioned data query method during row.
In a further exemplary embodiment, a kind of non-transitory computer-readable storage medium including instructing is additionally provided
Matter, such as, including the memory 1002 for instructing, above-mentioned instruction can be performed above-mentioned to complete by the processor 1001 of device 1000
Data query method.Illustratively, the non-transitorycomputer readable storage medium can be ROM, random access memory
(Random Access Memory, abbreviation RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
Describe the preferred embodiment of the disclosure in detail above in association with accompanying drawing, but, the disclosure is not limited to above-mentioned reality
The detail in mode is applied, in the range of the technology design of the disclosure, various letters can be carried out with technical scheme of this disclosure
Monotropic type, these simple variants belong to the protection domain of the disclosure.
Any process described otherwise above or method description can be by flow chart or in embodiment of the disclosure
Be interpreted as, expression include it is one or more for realizing specific logical function or process the step of executable instruction code
Module, fragment or part, and the scope of disclosure implementation method includes other realization, wherein can not by shown or
The order of discussion, including function involved by basis by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should
Those skilled in the art understand described in embodiment of the disclosure.
It is further to note that each particular technique feature described in above-mentioned specific embodiment, in not lance
In the case of shield, can be combined by any suitable means.In order to avoid unnecessary repetition, the disclosure to it is various can
The combination of energy is no longer separately illustrated.
Additionally, can also be combined between a variety of implementation methods of the disclosure, as long as it is without prejudice to originally
Disclosed thought, it should equally be considered as disclosure disclosure of that.