CN109741060A - Information inquiry system, method, device, electronic equipment and storage medium - Google Patents

Information inquiry system, method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109741060A
CN109741060A CN201811640208.4A CN201811640208A CN109741060A CN 109741060 A CN109741060 A CN 109741060A CN 201811640208 A CN201811640208 A CN 201811640208A CN 109741060 A CN109741060 A CN 109741060A
Authority
CN
China
Prior art keywords
transaction information
server
information
transaction
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811640208.4A
Other languages
Chinese (zh)
Other versions
CN109741060B (en
Inventor
高春盟
杨文玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201811640208.4A priority Critical patent/CN109741060B/en
Publication of CN109741060A publication Critical patent/CN109741060A/en
Application granted granted Critical
Publication of CN109741060B publication Critical patent/CN109741060B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides an information inquiry system, an information inquiry method, an information inquiry device, electronic equipment and a storage medium, wherein the information inquiry system comprises: a client, a block chain and a server; the client is used for obtaining the field value of the field for inquiring the transaction information and sending the field value to the server; each node of the block chain is used for sending the transaction information stored in the local block of the node to the server; the server is used for receiving and storing the transaction information sent by each node of the block chain, receiving the field value of the field inquired by the transaction information sent by the client, inquiring the transaction information matched with the field value of the field inquired by the received transaction information in the transaction information stored by the server, obtaining the inquiry result and sending the inquiry result to the client, and the client is used for displaying the inquiry result. By using the technical scheme provided by the embodiment of the invention, the computing resources of the occupied nodes due to information query can be saved, so that the nodes can more timely synchronize transaction information.

Description

Information query system, method, apparatus, electronic equipment and storage medium
Technical field
The present invention relates to block chain technical fields, set more particularly to a kind of information query system, method, apparatus, electronics Standby and storage medium.
Background technique
With the maturation of block chain technology, block chain is more and more widely used in every field.Wherein, block Chain is formed by multiple computer nodes, multiple blocks is stored in each node, the block stored in each node is identical, often Transaction Information is stored in one block.When the Transaction Information stored in a block in a node changes, other Node can carry out the Transaction Information phase that new transaction information is synchronous, stores in the block to keep each node for this block Together.
Wherein, the Transaction Information stored in each block can be described by one or more field, for example, handing over Easily be identified as " 123 ", exchange hour be on October 1st, 2018 transaction Transaction Information, can by transaction ID, transaction when Between two field descriptions are as follows: transaction ID " 123 ", exchange hour on October 1st, 2018, wherein " 123 ", on October 1st, 2018 It is properly termed as field value.
In addition, user may have the demand of inquiry Transaction Information as transaction carries out.In the prior art, Yong Huke To carry out Transaction Information inquiry by any node in block chain, specific querying method is: any node in block chain is obtained After the field value for obtaining field that user provides, for carrying out Transaction Information inquiry, which is deposited in local each block The Transaction Information to match with the field value of obtained field is inquired in the Transaction Information of storage, and the Transaction Information inquired is made For query result.
Although Transaction Information inquiry may be implemented using aforesaid way, the node in block chain is in addition to being responsible for transaction letter Breath inquiry is outer, also it is synchronous to carry out Transaction Information when the Transaction Information that the block of other nodes stores changes.And for For each node, computing resource is limited, and after node, which carries out Transaction Information inquiry, occupies computing resource, may cause surplus Remaining computing resource is unable to satisfy the synchronous demand of Transaction Information, so that it is synchronous to make node that can not carry out Transaction Information in time.
Summary of the invention
Be designed to provide a kind of information query system, method, apparatus, electronic equipment and the storage of the embodiment of the present invention are situated between Matter can not synchronize the probability of block institute store transaction information with the node reduced in block chain in time.
Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of information query system, the system comprises: client, block Chain and server-side;Wherein,
The client, for obtaining the field value of the field for carrying out Transaction Information inquiry, and to the server-side Send the field value of field obtained;
Each node of the block chain, the Transaction Information for being stored into the server-side sending node block;
The server-side, the Transaction Information that each node for receiving and storing the block chain is sent, described in reception Client send Transaction Information inquiry field field value, and the server-side storage Transaction Information in, inquiry with The Transaction Information that the field value of the field of received Transaction Information inquiry matches obtains query result, and the inquiry is tied Fruit is sent to the client;
The client, for showing the query result.
Optionally, the system also includes cache servers;Wherein,
Each node of the block chain, specifically for the transaction stored into the cache server sending node block Information;
The cache server, the Transaction Information that each node for receiving the block chain is sent, and to the clothes Business end sends the received Transaction Information of institute;
The server-side, the Transaction Information sent specifically for receiving and storing the cache server.
Optionally, the structure of the server-side are as follows: distributed storage architecture, the server-side includes: index data base and Storing data library;Wherein,
The index data base, the index information for store transaction information, wherein the index information includes: to be used for The field value of index field in the field of Transaction Information is identified, the index field includes at least: transaction ID;
The storing data library is used for store transaction information;
The server-side, specifically for the inquiry in the index information that the index data base stores and the acquired friendship The index information that the field value of the field of easy information inquiry matches, and the index inquired is obtained from the storing data library The corresponding Transaction Information of the transaction ID that information includes, as query result.
Optionally, the server-side, specifically for determining and using according to the transaction ID for including in the index information inquired In the storing data library for carrying out Transaction Information inquiry, obtaining the index information inquired from identified storing data library includes The corresponding Transaction Information of transaction ID, as query result.
Optionally, each node of the block chain, becomes specifically for the Transaction Information stored in node block After change, Transaction Information is sent to the server-side according to changed Transaction Information;
The server-side, the Transaction Information that each node specifically for receiving the block chain is sent, and according to being connect The Transaction Information of receipts updates the Transaction Information of the server-side storage.
Second aspect, the embodiment of the invention provides a kind of information query methods, applied to the clothes in information query system Business end, the information query system includes: client, the server-side and block chain, which comprises
Receive the field value of the field for the Transaction Information inquiry that the client is sent;
In the Transaction Information of server-side storage, the field value phase for the field inquired with received Transaction Information is inquired Matched Transaction Information obtains query result;Wherein, the Transaction Information of the server-side storage is from each of the block chain Transaction Information that node obtains, being stored in node block;
The query result is sent to the client, so that the client shows the query result.
Optionally, the server-side is also stored with the index information of Transaction Information, wherein the index information includes: use The field value of index field, the index field include at least in the field of mark Transaction Information: transaction ID.
Optionally, described in the Transaction Information of server-side storage, the word of inquiry and the inquiry of received Transaction Information The Transaction Information that the field value of section matches obtains query result, comprising:
The index to match with the field value of the field of received Transaction Information inquiry is inquired in the index information to believe Breath;
It is corresponding that the transaction ID that the index information inquired includes is obtained in the Transaction Information of server-side storage Transaction Information, as query result.
Optionally, the transaction ID is transaction cryptographic Hash, and the server-side includes multiple storing data libraries, each storage The Transaction Information for meeting preset condition is stored in database, wherein the preset condition are as follows: the transaction cryptographic Hash of Transaction Information The mark of the operation result and storing data library that carry out complementation operation matches;
The transaction ID pair for obtaining the index information inquired in the Transaction Information of server-side storage and including The Transaction Information answered, comprising:
Calculate the operation result of the complementation operation for the transaction cryptographic Hash for including in the index information inquired;
The mark in the determining storing data library to match with the operation result;
By the corresponding storing data library of the mark in the storing data library determined, as carrying out Transaction Information inquiry Storing data library;
The friendship that the index information inquired includes is obtained from the storing data library for carrying out Transaction Information inquiry Easily identify corresponding Transaction Information.
Optionally, the Transaction Information of the server-side storage is specifically:
When the Transaction Information stored in each node block of the block chain changes, the server-side is received simultaneously The Transaction Information for the transmission variation that each node of storage is sent.
The third aspect, the embodiment of the invention provides a kind of information query methods, are applied to block in information query system The node of chain, the information query system include: client, server-side and the block chain, which comprises
Detect whether that meeting Transaction Information sends condition;
If it is, Xiang Suoshu server-side sends Transaction Information, so that institute according to the Transaction Information that the node block stores It states server-side store transaction information and Transaction Information inquiry is carried out according to the Transaction Information of server-side storage, and inquiry is tied Fruit is sent to the client.
It is optionally, described to detect whether that meeting Transaction Information sends condition, comprising:
Whether the Transaction Information stored in detection node block changes;
If it is, determining that meeting Transaction Information sends condition.
Fourth aspect, the embodiment of the invention provides a kind of information query devices, applied to the clothes in information query system Business end, the information query system includes: that client, the server-side and block chain, described device include:
Field value acquiring unit, the field value of the field for receiving the Transaction Information inquiry that the client is sent;
As a result obtaining unit, in the Transaction Information that the server-side stores, inquiry to be looked into received Transaction Information The Transaction Information that the field value of the field of inquiry matches obtains query result;Wherein, the Transaction Information of the server-side storage is Transaction Information being obtained from each node of the block chain, being stored in node block
As a result transmission unit, for the query result to be sent to the client, so that the client shows institute State query result.
Optionally, the server-side is also stored with the index information of Transaction Information, wherein the index information includes: use The field value of index field, the index field include at least in the field of mark Transaction Information: transaction ID.
Optionally, the result obtaining unit, comprising:
Index information inquires subelement, for inquiring the field with the inquiry of received Transaction Information in the index information The index information that matches of field value;
Transaction Information obtains subelement, for obtaining the index inquired letter in the Transaction Information that the server-side stores The corresponding Transaction Information of the transaction ID that breath includes, as query result.
Optionally, the transaction ID is transaction cryptographic Hash, and the server-side includes multiple storing data libraries, each storage The Transaction Information for meeting preset condition is stored in database, wherein the preset condition are as follows: the transaction cryptographic Hash of Transaction Information The mark of the operation result and storing data library that carry out complementation operation matches;
The Transaction Information obtains subelement, comprising:
As a result computing module, the fortune of the complementation operation for calculating the transaction cryptographic Hash for including in the index information inquired Calculate result;
Determining module is identified, the mark for the determining storing data library to match with the operation result;
Database determining module, the corresponding storing data library of the mark in the storing data library for will determine, as with In the storing data library for carrying out Transaction Information inquiry;
Transaction Information obtains module, for being inquired from the storing data library for carrying out Transaction Information inquiry To the index information corresponding Transaction Information of transaction ID that includes.
Optionally, the Transaction Information of the server-side storage is specifically: when each node block memory of the block chain When the Transaction Information of storage changes, the transaction letter for the transmission variation that each node that the server-side receives and stores is sent Breath.
5th aspect, the embodiment of the invention provides a kind of information query devices, are applied to block in information query system The node of chain, the information query system include: that client, server-side and the block chain, described device include:
Condition detection unit, for detecting whether meeting Transaction Information sends condition;
Information transmitting unit, for when the testing result of the condition detection unit be when, according to the node block The Transaction Information of storage, Xiang Suoshu server-side sends Transaction Information, so that the server-side store transaction information and according to described The Transaction Information of server-side storage carries out Transaction Information inquiry, and query result is sent to the client.
Optionally, the condition detection unit, comprising:
Change detection sub-unit, whether the Transaction Information for storing in detection node block changes;
Condition criterion subelement, for determining to meet transaction when the testing result of the variation detection sub-unit is to be Information sends condition.
6th aspect, the embodiment of the invention provides a kind of server-side, including processor, communication interface, memory and logical Believe bus, wherein the processor, the communication interface, the memory complete mutual communication by the bus;
The memory, for storing computer program;
The processor realizes any method step of second aspect for executing the program stored on memory Suddenly.
7th aspect, the embodiment of the invention provides a kind of electronic equipment, node of the electronic equipment as block chain, It is characterised in that it includes processor, communication interface, memory and communication bus, wherein the processor, the communication interface, The memory completes mutual communication by the bus;
The memory, for storing computer program;
The processor realizes any method step of the third aspect for executing the program stored on memory Suddenly.
Eighth aspect, the embodiment of the invention provides a kind of computer readable storage medium, storage in the storage medium There is computer program, second aspect any method and step is realized when the computer program is executed by processor.
9th aspect, the embodiment of the present invention provide a kind of computer readable storage medium, are stored in the storage medium Computer program realizes the third aspect any method and step when the computer program is executed by processor.
Information query system provided in an embodiment of the present invention includes client, block chain and server-side, wherein client, For obtaining the field value of the field for carrying out Transaction Information inquiry, and send to server-side the field of field obtained Value, the Transaction Information that each node of block chain is used to store into server-side sending node block, server-side is for receiving simultaneously The field value of the field for the Transaction Information inquiry that the Transaction Information and client that each node of memory block chain is sent are sent, Since server-side stores the Transaction Information that each node of block chain is sent, looked into when server-side is got for carrying out Transaction Information After the field value of the field of inquiry, so that it may the word of inquiry and the inquiry of acquired Transaction Information in the Transaction Information of server-side storage The Transaction Information that the field value of section matches, to obtain query result.Information query system provided in an embodiment of the present invention by Server-side completes the inquiry of Transaction Information, Transaction Information is inquired without block chain node, can thus save because of letter Breath is inquired and the computing resource of occupied node, and the computing resource of node is made preferably to meet the needs of Transaction Information is synchronous, Carrying out node more in time, Transaction Information is synchronous, and block institute store transaction can not be synchronized in time by reducing the node in block chain The probability of information.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of information query system provided in an embodiment of the present invention;
Fig. 2 is another structural schematic diagram of information query system provided in an embodiment of the present invention;
Fig. 3 is a kind of flow diagram of information query method provided in an embodiment of the present invention;
Fig. 4 is another flow diagram of information query method provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of information query device provided in an embodiment of the present invention;
Fig. 6 is another structural schematic diagram of information query device provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of server-side provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
It is synchronized to make node carry out Transaction Information more in time, so that the node reduced in block chain can not synchronize in time The probability of block institute store transaction information, the embodiment of the invention provides a kind of information query system, method, apparatus, electronics to set Standby and storage medium, client send the field value of the field of obtained Transaction Inquiries, area in information query system to server-side After the Transaction Information that each node of block chain is stored into server-side sending node block, server-side can receive and memory block The Transaction Information that each node of chain is sent, can thus be completed the inquiry of Transaction Information, without block by server-side Chain node inquires Transaction Information, saves the computing resource of the occupied node because of information inquiry, provides the calculating of node Source preferably meets the needs of Transaction Information is synchronous, so that node is carried out Transaction Information more in time and synchronizes, reduces in block chain Node can not synchronize the probability of block institute store transaction information in time.
A kind of information query system is provided for the embodiments of the invention first below to be introduced.
It should be noted that information query system provided by the embodiment of the present invention can be applied to be related to block chain application Industry.
As shown in Figure 1, information query system provided by the embodiment of the present invention includes: 110 block chain of client, 120 kimonos Business end 130;Wherein,
Client 110 is sent out for obtaining the field value of the field for carrying out Transaction Information inquiry, and to server-side 130 Send the field value of field obtained;
Each node 121 of block chain 120, the transaction letter for being stored into 130 sending node of server-side, 121 block Breath;
Server-side 130, the Transaction Information that each node 121 for receiving and storing block chain 120 is sent, receives client The field value of the field for the Transaction Information inquiry that end 110 is sent, and in the Transaction Information that server-side 130 stores, inquiry and institute The Transaction Information that the field value of the field of Transaction Information inquiry matches is received, obtains query result, and query result is sent To client 110;
Client 110, for showing above-mentioned query result.
In embodiments of the present invention, each node 121 specifically can detect meet Transaction Information send condition when, to The Transaction Information stored in 130 sending node of server-side, 121 block.Above-mentioned Transaction Information, which sends condition, can be following at least one Kind: reach the predetermined time, the Transaction Information that stores in the local block of node 121 changes, receives Transaction Information transmission refers to It enables, Transaction Information, which sends condition, can also be that other conditions, the embodiment of the present invention do not limit specifically.
It, can be by received friendship after the Transaction Information that each node 121 that server-side 130 receives block chain 120 is sent Easy information is stored in memory, and also be can store in the hard disk of server-side, can also be stored in other storages of server-side. Since server-side 130 would generally receive a large amount of Transaction Information, and the limited memory of server-side 130, it can be by server-side 130 Transaction Informations received are stored in the hard disk of server-side, to save the occupancy to 130 memory of server-side, make to service The information search efficiency at end is higher.
In embodiments of the present invention, for example, when the field for being used to carry out Transaction Information inquiry is: when transaction ID, transaction Between, transaction initiator, transaction acceptance side when, for carry out the field value of field of Transaction Information inquiry may is that " 123 ", October 1, " a ", " b " in 2018;Wherein, " 123 " be transaction ID, on October 1st, 2018 be exchange hour, " a " be transaction Initiator, " b " are transaction acceptance sides.
In embodiments of the present invention, user can input the field for carrying out Transaction Information inquiry in client 110 Field value, the user that is more convenient for carry out Transaction Information inquiry.
In embodiments of the present invention, identify Transaction Information field can be it is following at least one: transaction ID, transaction when Between, transaction initiator, transaction acceptance side, contract method used in transaction, the field for identifying Transaction Information can also include it His field, the embodiment of the present invention do not limit specifically.Above-mentioned transaction ID for example can be transaction cryptographic Hash.
For example, the field value of field acquired in server-side 130 are as follows: initiator " a ", recipient " b ", then, server-side 130 Can in the Transaction Information of storage query originator " a ", recipient " b " Transaction Information, and the Transaction Information that will be inquired As query result.
Information query system provided in an embodiment of the present invention includes client, block chain and server-side, wherein client, For obtaining the field value of the field for carrying out Transaction Information inquiry, and send to server-side the field of field obtained Value, the Transaction Information that each node of block chain is used to store into server-side sending node block, server-side is for receiving simultaneously The field value of the field for the Transaction Information inquiry that the Transaction Information and client that each node of memory block chain is sent are sent, Since server-side stores the Transaction Information that each node of block chain is sent, looked into when server-side is got for carrying out Transaction Information After the field value of the field of inquiry, so that it may the word of inquiry and the inquiry of acquired Transaction Information in the Transaction Information of server-side storage The Transaction Information that the field value of section matches, to obtain query result.Information query system provided in an embodiment of the present invention by Server-side completes the inquiry of Transaction Information, Transaction Information is inquired without block chain node, can thus save because of letter Breath is inquired and the computing resource of occupied node, and the computing resource of node is made preferably to meet the needs of Transaction Information is synchronous, Carrying out node more in time, Transaction Information is synchronous, and block institute store transaction can not be synchronized in time by reducing the node in block chain The probability of information.
In one embodiment, as shown in Fig. 2, the information query system can also include: cache server 140; Wherein,
Each node 121 of block chain 120 specifically can be used for into 140 sending node block of cache server storing Transaction Information;
Cache server 140, the Transaction Information that each node 121 for receiving block chain 120 is sent, and to server-side 130 send the received Transaction Information of institute;
Server-side 130 specifically can be used for receiving and storing the Transaction Information of the transmission of cache server 140.
Above-mentioned cache server 140 can be the server in kafka system, wherein kafka system is a kind of high handles up The distributed post of amount subscribes to message system, when cache server 140 is the server in kafka system, block chain 120 The Transaction Information that each node 121 specifically can be used for storing into kafka queue sending node block, server-side 130 are specific It can be used for receiving and storing the Transaction Information of kafka queue transmission.Above-mentioned cache server 140 be also possible to other have compared with The server of high information throughput.
Since the Transaction Information quantity stored in the block of the node 121 of block chain 120 is very big, in the block of node 121 Generally also quickly, this is just easy to each node 111 for receiving server-side 120 hair to the frequency of the Transaction Information variation of storage The Transaction Information amount sent is very big, in present embodiment, is sent to Transaction Information by each node 111 of block chain 110 slow After depositing server 140, server-side 120 is sent information to by cache server 140, when the transaction letter that each node 111 is sent When breath amount is very big, due to the information throughput with higher of cache server 140, it is possible to reduce believe in Transaction Information transmission process The phenomenon that breath is lost, the Transaction Information that can receive server-side 120 is more complete, to keep Transaction Information query result more quasi- Really.
In one embodiment, as shown in Fig. 2, the structure of server-side 130 can be with are as follows: distributed storage architecture, service End 130 may include: index data base 131 and storing data library 132;Wherein,
Index data base 131, the index information for store transaction information, wherein index information includes: to hand over for identifying The field value of index field, index field include at least in the field of easy information: transaction ID;
Storing data library 132 is used for store transaction information;
Server-side 130, specifically for the inquiry in the index information that index data base 131 stores and acquired Transaction Information The index information that the field value of the field of inquiry matches, and the index information packet inquired is obtained from storing data library 132 The corresponding Transaction Information of the transaction ID contained, as query result.
Above-mentioned index field can also include at least one of the following: exchange hour, transaction initiator, transaction acceptance side, hand over Contract method used in easily.When the field type that index field includes is more, the multiplicity of Transaction Information inquiry can be improved Property and availability, user experience are more preferable.
Multiple index groupings are can store in above-mentioned index data base 131.Specifically, can be according to exchange hour, friendship Either field etc. in contract method used in easy initiator, transaction is grouped index information.For example, when according to transaction It may include the index of exchange hour within a preset period of time in an index grouping when time is grouped index information Information, for example, one index grouping in may include exchange hour in may in index information.Correspondingly, server-side 130 Be specifically used for: the index that the field value of inquiry and acquired field matches in the index grouping of index data base 131 is grouped, It is grouped in stored index information in the index inquired, the index that the field value of inquiry and acquired field matches is believed Breath.
Above-mentioned index data base 131 is referred to as index server.Above-mentioned index data base 131 for example can be ElasticSearch, wherein ElasticSearch is a search server, it provides a distributed multi-user ability Search engine, be currently used wider Enterprise search engine, have stable, reliable, quick, easy to install and use etc. Advantage.Above-mentioned storing data library 132 for example can be levelDB database, wherein levelDB be have very high random write, The database of sequence read/write performance ability.Above-mentioned index data base 131 and storing data library 132 are also possible to other kinds of Database, the embodiment of the present invention do not limit specifically.
Above-mentioned storing data library 132 can also be referred to as storage server.
In a specific embodiment, the structure of server-side 130 can be distributed storage architecture, and server-side 130 can be with Including index server, storage server and management server;Wherein, index server is believed for the index of store transaction information Breath;Storage server is used for store transaction information;Management server in the index information that index server stores for inquiring The index information to match with the field value of acquired field, and obtain the index information inquired from storage server and include The corresponding Transaction Information of transaction ID, as query result.
Since the quantity of Transaction Information is very big, the quantity of index information is also very big, after index information is grouped, is being handed over When easy information inquiry, can in more small-scale index is grouped search index information, make index information inquiry velocity faster, from And make the search efficiency of Transaction Information with height.
After index data base 131 and storing data library 132 are set, when carrying out Transaction Information inquiry, it can first inquire and obtain The matched index information of field value institute for taking field, inquires Transaction Information further according to the index information inquired, passes through index Mode carries out Transaction Information inquiry, and the search efficiency of Transaction Information can be improved.
In one embodiment, above-mentioned server-side 130 specifically can be used for according to including in the index information that inquires Transaction ID, the storing data library 132 for carrying out Transaction Information inquiry is determined, from identified storing data library 132 The corresponding Transaction Information of transaction ID that the index information inquired includes is obtained, as query result.Specifically, server-side 120 structure can be distributed storage architecture, and server-side 130 may include multiple storing data libraries 132, each storing data Library 132 is marked with corresponding mark.The Transaction Information stored in each storing data library 132 can be the friendship for meeting preset condition Easy information, wherein preset condition specifically may is that the transaction ID of Transaction Information and the mark in storing data library 132 match. For example, server-side may include 10 storing data libraries 122, the mark in each storing data library 122 is respectively 0,1 ... 9, transaction It is identified as transaction cryptographic Hash, it can be according to the operation result or the transaction last one-bit digital of cryptographic Hash of the mod 10 of transaction cryptographic Hash 0,1 ... 9, the correspondence of Transaction Information corresponding to different transaction cryptographic Hash is stored in different storing data libraries 122, for example, The Transaction Information that the operation result of the mod 10 for cryptographic Hash of trading is 0 is stored in the storing data library 132 for being identified as " 0 ", Above-mentioned server-side 130 can be determined according to the transaction cryptographic Hash for including in the index information inquired for carrying out Transaction Information The storing data library 132 of inquiry obtains the trading standard that the index information inquired includes from identified storing data library 132 Corresponding Transaction Information is known, as query result.Different Transaction Informations is stored in different storing data libraries 132, it can To improve the efficiency of Transaction Information inquiry, when storing different Transaction Informations in different storing data libraries 132, service Transaction Information is inquired after the storing data library for carrying out Transaction Information inquiry has been determined, then in determining database in end, can To reduce the query context of Transaction Information, to improve the efficiency of Transaction Information inquiry.
In one embodiment, each node 121 of block chain 120 specifically can be used in node block storing Transaction Information change after, according to changed Transaction Information to the server-side send Transaction Information;
The server-side, the Transaction Information that each node specifically for receiving the block chain is sent, and according to being connect The Transaction Information of receipts updates the Transaction Information of the server-side storage.
In the above-described embodiment, the Transaction Information stored in 121 block of node changes, and can be node 121 certainly Oneself changes the Transaction Information stored in block, is also possible to the generation that node 121 stores in being synchronized other node blocks After the Transaction Information of variation, the Transaction Information stored in caused 121 block of node is changed.Above-mentioned Transaction Information hair Changing, such as can be the variation of the Transaction Informations such as Transaction Information is deleted, Transaction Information increases, Transaction Information modification, it can also To be other variations of Transaction Information generation.Each node 121 of block chain 120 can change to server-side 130 Transaction Information, changed Transaction Information and not changed information can also be sent, to server-side 130 in order to make letter Cease transmission speed faster, each node 121 can send changed Transaction Information to server-side 130.
In above embodiment, after the Transaction Information stored in node block changes, according to changed friendship Easy information sends Transaction Information to server-side, and server-side can be made to update the Transaction Information of server-side storage more in time, reduces The Transaction Information stored in server-side updates the probability of lag, and the accuracy rate for inquiring Transaction Information is higher.
Corresponding with above- mentioned information inquiry system, the embodiment of the invention also provides a kind of information query methods, such as Fig. 3 institute Show, the server-side that should be applied in information query system, the information query system includes: client, the server-side and area Block chain, the described method comprises the following steps:
S310: the field value of the field for the Transaction Information inquiry that the client is sent is received.
In embodiments of the present invention, the field for the Transaction Information inquiry that the available user of client inputs in client Field value, and the field value of the field for the Transaction Information inquiry that will acquire is sent to server-side, server-side receives client and sends The field for carrying out Transaction Information inquiry field value, family can be used inputted in client and looked into for carrying out Transaction Information The field value of the field of inquiry, the user that is more convenient for carry out Transaction Information inquiry.
S320: in the Transaction Information of server-side storage, the field value of inquiry and the field of received Transaction Information inquiry The Transaction Information to match obtains query result;Wherein, the Transaction Information of server-side storage is obtained from each node of block chain Transaction Information taking, being stored in node block.
The Transaction Information that server-side can store in memory, can also store transaction information in a hard disk, can also be Store transaction information in other storages of server-side.Since server-side would generally receive a large amount of Transaction Information, and server-side Limited memory, server-side can store transaction information in a hard disk to save the occupancy to service end memory make server-side Information search efficiency it is higher.
In embodiments of the present invention, describe Transaction Information field can be it is following at least one: transaction ID, transaction when Between, transaction initiator, transaction acceptance side, contract method used in transaction, the field for describing Transaction Information can also include it His field.Above-mentioned transaction ID for example can be transaction cryptographic Hash.
For example, for carrying out the field value of the field of Transaction Information inquiry acquired in server-side are as follows: initiator " a " connects Debit " b ", then, server-side can in the Transaction Information of storage query originator " a ", recipient " b " Transaction Information, and Using the Transaction Information inquired as query result.
S330: being sent to client for above-mentioned query result, so that client shows the query result.
Information query method provided in an embodiment of the present invention, since the server-side in information query system stores block chain The Transaction Information that each node is sent, when server-side receives the field for carrying out Transaction Information inquiry of client transmission After field value, so that it may which the transaction that the field value of inquiry and acquired field matches in the Transaction Information of server-side storage is believed Breath, to obtain query result.Information query system provided in an embodiment of the present invention is completed looking into for Transaction Information by server-side It askes, Transaction Information is inquired without block chain node, can thus save the meter of the occupied node because of information inquiry Resource is calculated, so that the computing resource of node is preferably met the needs of Transaction Information is synchronous, node is made to carry out transaction letter more in time Breath synchronizes, and the probability of block institute store transaction information can not be synchronized in time by reducing the node in block chain.
In one embodiment, above-mentioned server-side can also be stored with the index information of Transaction Information, wherein above-mentioned rope Fuse breath includes: the field value for identifying index field in the field of Transaction Information, and above-mentioned index field includes at least: transaction Mark.By the index information of the store transaction information in server-side, allow to carry out information inquiry by way of index, To improve the efficiency of information inquiry.
In one embodiment, when server-side is stored with the index information of Transaction Information, step S320 can by with Lower step S321~S322 is realized:
S321: the rope to match with the field value of the field of received Transaction Information inquiry is inquired in above-mentioned index information Fuse breath;
S322: to obtain the transaction ID that the index information inquired includes corresponding in the Transaction Information of server-side storage Transaction Information, as query result.
Above-mentioned index field can also include at least one of the following: exchange hour, transaction initiator, transaction acceptance side, hand over Contract method used in easily.When the field type that index field includes is more, the multiplicity of Transaction Information inquiry can be improved Property and availability, user experience are more preferable.
For present embodiment when carrying out Transaction Information inquiry, first inquiry obtains the matched index letter of field value institute of field Breath inquires Transaction Information further according to the index information inquired, Transaction Information inquiry is carried out by way of index, can be improved The search efficiency of Transaction Information.
In one embodiment, the index inquired is obtained in the Transaction Information of server-side storage in step S322 The corresponding Transaction Information of the transaction ID that information includes, can realize according to the following steps:
According to the transaction ID for including in the index information inquired, the storage number for carrying out Transaction Information inquiry is determined According to library, the corresponding Transaction Information of transaction ID that the index information inquired includes is obtained from identified storing data library.
When different Transaction Informations stores in different storing data libraries, server-side is first according to the index letter inquired The transaction ID for including in breath, determines the storing data library for carrying out Transaction Information inquiry, then from identified storing data The corresponding Transaction Information of transaction ID that the index information inquired includes is obtained in library, i.e. server-side is being determined for carrying out Transaction Information is inquired behind the storing data library of Transaction Information inquiry, then in determining database, looking into for Transaction Information can be reduced Range is ask, to improve the efficiency of Transaction Information inquiry.
In a specific embodiment, above-mentioned transaction ID can be able to be for transaction cryptographic Hash, the structure of server-side Distributed storage architecture, server-side may include multiple storing data libraries, and each storing data library is marked with corresponding mark, often The Transaction Information for meeting preset condition is stored in a storing data library, wherein preset condition specifically may is that Transaction Information Transaction cryptographic Hash carries out the operation result of complementation operation and the mark in storing data library matches;
Correspondingly, step S322, can be realized with S3221~S3224 according to the following steps:
S3221: the operation result of the complementation operation for the transaction cryptographic Hash for including in the index information inquired is calculated.
The complementation operation of transaction cryptographic Hash can be the complementation operation that default value is carried out to transaction cryptographic Hash, for example, working as When default value is 5,5 operation of mod is carried out to transaction cryptographic Hash, when default value is 10, mod is carried out to transaction cryptographic Hash 10 operations.
S3222: the mark in the determining storing data library to match with above-mentioned operation result.
For example, server-side may include 10 storing data libraries, the mark in each storing data library is respectively 0,1 ... 9, can To carry out 10 operation of mod to transaction cryptographic Hash, obtained operation result includes 0,1 ... 9, will be corresponding to nonidentity operation result Transaction Information correspondence is stored in different storing data libraries, for example, being 0 by the operation result of the mod 10 for cryptographic Hash of trading Transaction Information is stored in the storing data library 122 for being identified as " 0 ".
S3223: by the corresponding storing data library of the mark in the storing data library determined, as carrying out Transaction Information The storing data library of inquiry.
S3224: the index information inquired is obtained from the storing data library for carrying out Transaction Information inquiry includes The corresponding Transaction Information of transaction ID.
The corresponding Transaction Information of different transaction cryptographic Hash is stored in not according to the operation result after transaction cryptographic Hash complementation In same storing data library, server-side is when carrying out Transaction Information inquiry, first according to the friendship for including in the index information inquired Easy cryptographic Hash determines the storing data library for carrying out Transaction Information inquiry, then is looked into from identified storing data library The corresponding Transaction Information of the transaction ID that the index information ask includes, i.e. server-side are looked into for carrying out Transaction Information having determined Transaction Information is inquired behind the storing data library of inquiry, then in determining database, the query context of Transaction Information can be reduced, thus Improve the efficiency of Transaction Information inquiry.
In one embodiment, the Transaction Information of above-mentioned server-side storage is specifically: when each node area of block chain When the Transaction Information stored in block changes, the transaction letter for the transmission variation that each node that server-side receives and stores is sent Breath.
In the above-described embodiment, the Transaction Information stored in node block changes, and can be node oneself change The Transaction Information stored in block, is also possible to the changed transaction that node stores in being synchronized other node blocks After information, the Transaction Information stored in caused node block is changed.Above-mentioned Transaction Information changes, such as can To be the variation of the Transaction Informations such as Transaction Information is deleted, Transaction Information increases, Transaction Information modification, it is also possible to Transaction Information hair Other raw variations.
In above embodiment, after the Transaction Information stored in node block changes, server-side is received and stored Each node send transmission variation Transaction Information, can make server-side updates more in time server-side storage transaction believe Breath, reduces the probability that the Transaction Information stored in server-side updates lag, and the accuracy rate for inquiring Transaction Information is higher.
Corresponding with above- mentioned information inquiry system, the embodiment of the invention also provides a kind of information query methods, are applied to The node of block chain in information query system, the information query system include: client, server-side and above-mentioned block chain, such as Fig. 4 It is shown, method includes the following steps:
S410: detect whether that meeting Transaction Information sends condition.
Above-mentioned Transaction Information, which sends condition, can be following at least one: store in arrival predetermined time, node block Transaction Information changes, node receives Transaction Information and sends instruction, and Transaction Information, which sends condition, can also be other conditions, The embodiment of the present invention does not limit specifically.
S420: if the testing result of step S410 be it is yes, according to above-mentioned node block store Transaction Information, to above-mentioned clothes Business end sends Transaction Information, so that above-mentioned server-side store transaction information and the Transaction Information progress according to the storage of above-mentioned server-side Transaction Information inquiry, and query result is sent to the client.
Node can send in block to server-side and store whole Transaction Informations, can also send in block and deposit to server-side The Transaction Information of storage changed in away from current time preset time period.It is node block when Transaction Information sends condition When the Transaction Information of middle storage changes, node can send the changed transaction letter stored in block to server-side Breath.In embodiments of the present invention, in order to make information transmission speed faster, each node can send changed to server-side Transaction Information.
Information query method provided in an embodiment of the present invention, since each node of block in information query system is detecting To server-side when meeting Transaction Information transmission condition, according to the Transaction Information that node block stores, into information query system Transaction Information is had sent, so that above-mentioned server-side can store Transaction Information and be handed over according to the Transaction Information that server-side stores Easy information inquiry.Information query system provided in an embodiment of the present invention is completed the inquiry of Transaction Information by server-side, without Block chain node inquires Transaction Information, can thus save the computing resource of the occupied node because of information inquiry, make The computing resource of node preferably meets the needs of Transaction Information is synchronous, so that node is carried out Transaction Information more in time and synchronizes, subtracts Node in small block chain can not synchronize the probability of block institute store transaction information in time.
In one embodiment, step S410 can be realized according to the following steps:
S411: whether the Transaction Information stored in detection node block changes;
S412: if the testing result of step S411 be it is yes, judgement meet Transaction Information send condition.
In the above-described embodiment, the Transaction Information stored in node block changes, and can be node oneself change The Transaction Information stored in block, is also possible to the changed transaction that node stores in being synchronized other node blocks After information, the Transaction Information stored in caused node block is changed.The Transaction Information of above-mentioned node block storage It changes, such as can be the variation of the Transaction Informations such as Transaction Information is deleted, Transaction Information increases, Transaction Information modification, It can be other variations of Transaction Information generation.Each node of block chain can send changed transaction letter to server-side Breath can also send changed Transaction Information and not changed information to server-side, in order to make information transmission speed Faster, each node can send changed Transaction Information to server-side.
In above embodiment, the Transaction Information stored in node block changes to meet Transaction Information and send item Part, in this way, node sends Transaction Information to server-side after the Transaction Information that can be stored in node block changes, from And server-side can be made to update the Transaction Information of server-side storage more in time, reduce the Transaction Information stored in server-side more The probability newly lagged, the accuracy rate for inquiring Transaction Information are higher.
Corresponding with information query method shown in Fig. 2, the embodiment of the invention also provides a kind of information query devices, answer For the server-side in information query system, the information query system includes: client, the server-side and block chain, such as Shown in Fig. 5, described device includes:
Field value acquiring unit 510, the field value of the field for receiving the Transaction Information inquiry that the client is sent;
As a result obtaining unit 520, for inquiring and received Transaction Information in the Transaction Information that the server-side stores The Transaction Information that the field value of the field of inquiry matches obtains query result, wherein the Transaction Information of the server-side storage It is Transaction Information being obtained from each node of the block chain, being stored in node block;
As a result transmission unit 530, for the query result to be sent to the client, so that the client is shown The query result.
Information query device provided in an embodiment of the present invention, since the server-side in information query system stores block chain The Transaction Information that each node is sent, when server-side receives the field for carrying out Transaction Information inquiry of client transmission After field value, so that it may which the transaction that the field value of inquiry and acquired field matches in the Transaction Information of server-side storage is believed Breath, to obtain query result.Information query system provided in an embodiment of the present invention is completed looking into for Transaction Information by server-side It askes, Transaction Information is inquired without block chain node, can thus save the meter of the occupied node because of information inquiry Resource is calculated, so that the computing resource of node is preferably met the needs of Transaction Information is synchronous, node is made to carry out transaction letter more in time Breath synchronizes, and the probability of block institute store transaction information can not be synchronized in time by reducing the node in block chain.
In one embodiment, the server-side is also stored with the index information of Transaction Information, wherein the index letter Breath includes: the field value for identifying index field in the field of Transaction Information, and the index field includes at least: trading standard Know.
In one embodiment, the result obtaining unit 520, comprising:
Index information inquires subelement, for inquiring the field with the inquiry of received Transaction Information in the index information The index information that matches of field value;
Transaction Information obtains subelement, for obtaining the index inquired letter in the Transaction Information that the server-side stores The corresponding Transaction Information of the transaction ID that breath includes, as query result.
In one embodiment, the transaction ID is transaction cryptographic Hash, and the server-side includes multiple storing datas Library is stored with the Transaction Information for meeting preset condition in each storing data library, wherein the preset condition are as follows: Transaction Information Transaction cryptographic Hash carry out the operation result of complementation operation and the mark in storing data library matches;
The Transaction Information obtains subelement, comprising:
As a result computing module, the fortune of the complementation operation for calculating the transaction cryptographic Hash for including in the index information inquired Calculate result;
Determining module is identified, the mark for the determining storing data library to match with the operation result;
Database determining module, the corresponding storing data library of the mark in the storing data library for will determine, as with In the storing data library for carrying out Transaction Information inquiry;
Transaction Information obtains module, for being inquired from the storing data library for carrying out Transaction Information inquiry To the index information corresponding Transaction Information of transaction ID that includes.
In one embodiment, the Transaction Information of the server-side storage is specifically: when each section of the block chain When the Transaction Information stored in point block changes, the transmission that each node that the server-side receives and stores is sent changes Transaction Information.
Corresponding with information query method shown in Fig. 3, the embodiment of the invention also provides a kind of information query devices, answer For the node of block chain in information query system, the information query system includes: client, server-side and the block Chain, as shown in fig. 6, described device includes:
Condition detection unit 610, for detecting whether meeting Transaction Information sends condition;
Information transmitting unit 620, for when the testing result of the condition detection unit be when, according to the node area The Transaction Information of block storage, Xiang Suoshu server-side sends Transaction Information, so that the server-side store transaction information and according to institute The Transaction Information for stating server-side storage carries out Transaction Information inquiry, and query result is sent to the client.
Information query device provided in an embodiment of the present invention, since each node of block in information query system is detecting To server-side when meeting Transaction Information transmission condition, according to the Transaction Information that node block stores, into information query system Transaction Information is had sent, so that above-mentioned server-side can store Transaction Information and be handed over according to the Transaction Information that server-side stores Easy information inquiry.Information query system provided in an embodiment of the present invention is completed the inquiry of Transaction Information by server-side, without Block chain node inquires Transaction Information, can thus save the computing resource of the occupied node because of information inquiry, make The computing resource of node preferably meets the needs of Transaction Information is synchronous, so that node is carried out Transaction Information more in time and synchronizes, subtracts Node in small block chain can not synchronize the probability of block institute store transaction information in time.
In one embodiment, the condition detection unit 610 may include:
Change detection sub-unit, whether the Transaction Information for storing in detection node block changes;
Condition criterion subelement, for determining to meet transaction when the testing result of the variation detection sub-unit is to be Information sends condition.
The embodiment of the invention also provides a kind of server-side, as shown in fig. 7, comprises processor 701, communication interface 702, depositing Reservoir 703 and communication bus 704, wherein processor 701, communication interface 702, memory 703 are completed by communication bus 704 Mutual communication,
Memory 703, for storing computer program;
Processor 701 when for executing the program stored on memory 703, realizes following steps:
Receive the field value of the field for the Transaction Information inquiry that client is sent;
In the Transaction Information of server-side storage, the field value phase for the field inquired with received Transaction Information is inquired Matched Transaction Information obtains query result;Wherein, the Transaction Information of the server-side storage is from each of the block chain Transaction Information that node obtains, being stored in node block
The query result is sent to the client, so that the client shows the query result.
Server-side provided in an embodiment of the present invention can complete the inquiry of Transaction Information, look into without block chain node Transaction Information is ask, the computing resource of the occupied node because of information inquiry can be thus saved, make the computing resource of node Preferably meet the needs of Transaction Information is synchronous, so that node is carried out Transaction Information more in time and synchronize, reduce in block chain Node can not synchronize the probability of block institute store transaction information in time.
The embodiment of the invention also provides a kind of electronic equipment, node of the electronic equipment as block chain, such as Fig. 8 institute Show, including processor 801, communication interface 802, memory 803 and communication bus 804, wherein processor 801, communication interface 802, memory 803 completes mutual communication by communication bus 804,
Memory 803, for storing computer program;
Processor 801 when for executing the program stored on memory 803, realizes following steps:
Detect whether that meeting Transaction Information sends condition;
If it is, Xiang Suoshu server-side sends Transaction Information, so that institute according to the Transaction Information that the node block stores It states server-side store transaction information and Transaction Information inquiry is carried out according to the Transaction Information of server-side storage, and inquiry is tied Fruit is sent to the client.
Electronic equipment provided in an embodiment of the present invention inquires system when detecting that meeting Transaction Information sends condition, to information Server-side in system has sent Transaction Information, so that the friendship that above-mentioned server-side can store Transaction Information and be stored according to server-side Easy information carries out Transaction Information inquiry.Information query system provided in an embodiment of the present invention completes Transaction Information by server-side Inquiry, Transaction Information is inquired without block chain node, can thus save the occupied node because of information inquiry Computing resource makes the computing resource of node preferably meet the needs of Transaction Information is synchronous, node is made to trade more in time Synchronizing information, the probability of block institute store transaction information can not be synchronized in time by reducing the node in block chain.
The communication bus that above-mentioned server-side/electronics is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication of the communication interface for above-mentioned server-side/between node and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
The embodiment of the invention also provides the embodiment of the invention provides a kind of computer readable storage medium, the storages Dielectric memory contains computer program, and the computer program performs the steps of when being executed by processor
Receive the field value of the field for the Transaction Information inquiry that the client is sent;
In the Transaction Information of server-side storage, the field value phase for the field inquired with received Transaction Information is inquired Matched Transaction Information obtains query result, wherein the Transaction Information of the server-side storage is from each of the block chain Transaction Information that node obtains, being stored in node block;
The query result is sent to the client, so that the client shows the query result.
The embodiment of the invention also provides the embodiment of the invention provides a kind of computer readable storage medium, the storages Dielectric memory contains computer program, and the computer program performs the steps of when being executed by processor
Detect whether that meeting Transaction Information sends condition;
If it is, Xiang Suoshu server-side sends Transaction Information, so that institute according to the Transaction Information that the node block stores It states server-side store transaction information and Transaction Information inquiry is carried out according to the Transaction Information of server-side storage, and inquiry is tied Fruit is sent to the client.
For method, device/server-side/electronic equipment/storage medium embodiment, since it is substantially similar to system Embodiment, so being described relatively simple, related place illustrates referring to the part of system embodiment.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device/ For electronic equipment/storage medium embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, phase Place is closed to illustrate referring to the part of embodiment of the method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (12)

1. a kind of information query system, which is characterized in that the system comprises: client, block chain and server-side;Wherein,
The client is sent for obtaining the field value of the field for carrying out Transaction Information inquiry, and to the server-side The field value of field obtained;
Each node of the block chain, the Transaction Information for being stored into the server-side sending node block;
The server-side, the Transaction Information that each node for receiving and storing the block chain is sent, receives the client The field value of the field for the Transaction Information inquiry that end is sent, and in the Transaction Information of server-side storage, it inquires and is connect The Transaction Information that the field value of the field of Transaction Information inquiry matches is received, obtains query result, and the query result is sent out Give the client;
The client, for showing the query result.
2. system according to claim 1, which is characterized in that the system also includes: cache server;Wherein,
Each node of the block chain is believed specifically for the transaction stored into the cache server sending node block Breath;
The cache server, the Transaction Information that each node for receiving the block chain is sent, and to the server-side Send the received Transaction Information of institute;
The server-side, the Transaction Information sent specifically for receiving and storing the cache server.
3. system according to claim 1 or 2, which is characterized in that the structure of the server-side are as follows: distributed storage knot Structure, the server-side includes: index data base and storing data library;Wherein,
The index data base, the index information for store transaction information, wherein the index information includes: for identifying The field value of index field in the field of Transaction Information, the index field include at least: transaction ID;
The storing data library is used for store transaction information;
The server-side, specifically for the inquiry in the index information that the index data base stores and the acquired transaction letter The index information that the field value of the field of inquiry matches is ceased, and obtains the index information inquired from the storing data library The corresponding Transaction Information of the transaction ID for including, as query result.
4. system according to claim 3, which is characterized in that
The server-side, specifically for determining for trading according to the transaction ID for including in the index information inquired The storing data library of information inquiry, obtains the transaction ID that the index information inquired includes from identified storing data library Corresponding Transaction Information, as query result.
5. system according to claim 1 or 2, which is characterized in that
Each node of the block chain, after changing specifically for the Transaction Information stored in node block, according to hair The Transaction Information for changing sends Transaction Information to the server-side;
The server-side, the Transaction Information that each node specifically for receiving the block chain is sent, and it is received according to institute Transaction Information updates the Transaction Information of the server-side storage.
6. a kind of information query method, which is characterized in that applied to the server-side in information query system, information inquiry system System includes: client, the server-side and block chain, which comprises
Receive the field value of the field for the Transaction Information inquiry that the client is sent;
In the Transaction Information of server-side storage, the field value for inquiring the field inquired with received Transaction Information matches Transaction Information, obtain query result;Wherein, the Transaction Information of the server-side storage is each node from the block chain Transaction Information obtaining, being stored in node block;
The query result is sent to the client, so that the client shows the query result.
7. according to the method described in claim 6, it is characterized in that, the server-side is also stored with the index letter of Transaction Information Breath, wherein the index information includes:
The field value of index field, the index field include at least in field for identifying Transaction Information: transaction ID.
8. the method according to the description of claim 7 is characterized in that it is described the server-side storage Transaction Information in, look into The Transaction Information to match with the field value of the field of received Transaction Information inquiry is ask, query result is obtained, comprising:
The index information to match with the field value of the field of received Transaction Information inquiry is inquired in the index information;
The corresponding transaction of transaction ID that the index information inquired includes is obtained in the Transaction Information of server-side storage Information, as query result.
9. according to the method described in claim 8, it is characterized in that, the transaction ID is transaction cryptographic Hash, the server-side Including multiple storing data libraries, the Transaction Information for meeting preset condition is stored in each storing data library, wherein described default Condition are as follows: the transaction cryptographic Hash of Transaction Information carries out the operation result of complementation operation and the mark in storing data library matches;
It is described that obtain the transaction ID that the index information inquired includes corresponding in the Transaction Information of server-side storage Transaction Information, comprising:
Calculate the operation result of the complementation operation for the transaction cryptographic Hash for including in the index information inquired;
The mark in the determining storing data library to match with the operation result;
By the corresponding storing data library of the mark in the storing data library determined, as the storage for carrying out Transaction Information inquiry Database;
The trading standard that the index information inquired includes is obtained from the storing data library for carrying out Transaction Information inquiry Know corresponding Transaction Information.
10. according to the described in any item methods of claim 6 to 9, which is characterized in that the Transaction Information tool of the server-side storage Body is:
When the Transaction Information stored in each node block of the block chain changes, the server-side is received and stored Each node send transmission variation Transaction Information.
11. a kind of information query method, which is characterized in that applied to the node of block chain in information query system, the information Inquiry system includes: client, server-side and the block chain, which comprises
Detect whether that meeting Transaction Information sends condition;
If it is, Xiang Suoshu server-side sends Transaction Information, so that the clothes according to the Transaction Information that the node block stores End store transaction information of being engaged in simultaneously carries out Transaction Information inquiry according to the Transaction Information of server-side storage, and query result is sent out Give the client.
12. according to the method for claim 11, which is characterized in that it is described to detect whether that meeting Transaction Information sends condition, Include:
Whether the Transaction Information stored in detection node block changes;
If it is, determining that meeting Transaction Information sends condition.
CN201811640208.4A 2018-12-29 2018-12-29 Information inquiry system, method, device, electronic equipment and storage medium Active CN109741060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811640208.4A CN109741060B (en) 2018-12-29 2018-12-29 Information inquiry system, method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811640208.4A CN109741060B (en) 2018-12-29 2018-12-29 Information inquiry system, method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109741060A true CN109741060A (en) 2019-05-10
CN109741060B CN109741060B (en) 2021-01-22

Family

ID=66362469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811640208.4A Active CN109741060B (en) 2018-12-29 2018-12-29 Information inquiry system, method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109741060B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263014A (en) * 2019-05-15 2019-09-20 广州致链科技有限公司 Block chain storage system and method towards timing type data
CN110472012A (en) * 2019-07-19 2019-11-19 深圳市中农易讯信息技术有限公司 A kind of block chain sensitivity word treatment method, device, storage medium and equipment
CN110489413A (en) * 2019-07-15 2019-11-22 杭州复杂美科技有限公司 A kind of storage of transaction record, querying method and system, equipment and storage medium
CN110874365A (en) * 2019-11-20 2020-03-10 深圳市网心科技有限公司 Information query method and related equipment thereof
CN111049902A (en) * 2019-09-16 2020-04-21 腾讯科技(深圳)有限公司 Data storage method, device, storage medium and equipment based on block chain network
CN111259056A (en) * 2020-01-15 2020-06-09 深圳微众信用科技股份有限公司 Block chain data query method, system and related equipment
CN111813788A (en) * 2020-05-20 2020-10-23 北京金山云网络技术有限公司 Information query method and device and information synchronization method and device
WO2020238250A1 (en) * 2019-05-24 2020-12-03 创新先进技术有限公司 Capital chain information tracing method and system, and server and readable storage medium
CN113064929A (en) * 2021-04-26 2021-07-02 深圳壹账通智能科技有限公司 Method, device, equipment and storage medium for inquiring transaction data in block chain
CN113379542A (en) * 2021-05-28 2021-09-10 中邮信息科技(北京)有限公司 Query method, device, medium and electronic equipment for block chain transaction
US11120513B2 (en) 2019-05-24 2021-09-14 Advanced New Technologies Co., Ltd. Capital chain information traceability method, system, server and readable storage medium
CN114490781A (en) * 2022-04-01 2022-05-13 中国信息通信研究院 Block chain data processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263014A (en) * 2019-05-15 2019-09-20 广州致链科技有限公司 Block chain storage system and method towards timing type data
WO2020238250A1 (en) * 2019-05-24 2020-12-03 创新先进技术有限公司 Capital chain information tracing method and system, and server and readable storage medium
US11120513B2 (en) 2019-05-24 2021-09-14 Advanced New Technologies Co., Ltd. Capital chain information traceability method, system, server and readable storage medium
CN110489413A (en) * 2019-07-15 2019-11-22 杭州复杂美科技有限公司 A kind of storage of transaction record, querying method and system, equipment and storage medium
CN110472012A (en) * 2019-07-19 2019-11-19 深圳市中农易讯信息技术有限公司 A kind of block chain sensitivity word treatment method, device, storage medium and equipment
CN111049902A (en) * 2019-09-16 2020-04-21 腾讯科技(深圳)有限公司 Data storage method, device, storage medium and equipment based on block chain network
CN111049902B (en) * 2019-09-16 2021-08-13 腾讯科技(深圳)有限公司 Data storage method, device, storage medium and equipment based on block chain network
CN110874365A (en) * 2019-11-20 2020-03-10 深圳市网心科技有限公司 Information query method and related equipment thereof
CN110874365B (en) * 2019-11-20 2023-11-17 深圳市迅雷网络技术有限公司 Information query method and related equipment thereof
CN111259056A (en) * 2020-01-15 2020-06-09 深圳微众信用科技股份有限公司 Block chain data query method, system and related equipment
CN111813788A (en) * 2020-05-20 2020-10-23 北京金山云网络技术有限公司 Information query method and device and information synchronization method and device
CN113064929A (en) * 2021-04-26 2021-07-02 深圳壹账通智能科技有限公司 Method, device, equipment and storage medium for inquiring transaction data in block chain
CN113379542A (en) * 2021-05-28 2021-09-10 中邮信息科技(北京)有限公司 Query method, device, medium and electronic equipment for block chain transaction
CN113379542B (en) * 2021-05-28 2024-01-09 中邮信息科技(北京)有限公司 Block chain transaction query method, device, medium and electronic equipment
CN114490781A (en) * 2022-04-01 2022-05-13 中国信息通信研究院 Block chain data processing method and device

Also Published As

Publication number Publication date
CN109741060B (en) 2021-01-22

Similar Documents

Publication Publication Date Title
CN109741060A (en) Information inquiry system, method, device, electronic equipment and storage medium
US10204114B2 (en) Replicating data across data centers
CN110147398A (en) A kind of data processing method, device, medium and electronic equipment
CN104243598B (en) A kind of information recommendation method and device
CN109213792A (en) Method, server-side, client, device and the readable storage medium storing program for executing of data processing
CN110162270A (en) Date storage method, memory node and medium based on distributed memory system
CN107196848B (en) Information push method and device
CN110162292A (en) Voice broadcast method and device
CN106210163B (en) IP address-based localization method and device
CN109274584A (en) Cut-in method, device, client device and the storage medium of access server
CN112566033B (en) Feature uploading and acquiring method and device for wireless signal
CN112541019B (en) Block chain resource searching method and device
CN109241084A (en) Querying method, terminal device and the medium of data
CN108282508A (en) Determination method and device, information-pushing method and the device in geographical location
CN110413845A (en) Resource storage method and device based on Internet of Things operating system
CN109194565A (en) A kind of message read states reminding method and device
CN108234277A (en) A kind of mail transmission, the method and device of editor
CN108076112A (en) A kind of host dispatching method and device
CN109669807A (en) The method of calibration and device of business event, processor, storage medium
CN111461826A (en) Information pushing method and device, storage medium and electronic device
CN114579311B (en) Method, device, equipment and storage medium for executing distributed computing task
CN110333984A (en) Interface method for detecting abnormality, device, server and system
CN109981726A (en) A kind of distribution method of memory node, server and system
CN110188140A (en) Data pull method, apparatus, storage medium and computer equipment
CN106484714A (en) A kind of storage method of behavior record and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant