Summary of the invention
Based on the above issues, the embodiment of the invention provides a kind of Transaction Information confirmation methods and dress based on block chainIt sets.
In a first aspect, the embodiment of the invention provides a kind of Transaction Information confirmation methods based on block chain.This method is suitableFor block chain meshed network, the block chain meshed network includes multiple block chain nodes, and this method includes:
Receive the first Transaction Information that terminal is sent;
Validation of information cluster is determined, so that the validation of information cluster confirms whether first Transaction Information meets firstPrefabricated rule, the validation of information cluster include the specified odd number for meeting the second prefabricated rule in the block chain meshed networkBlock chain node, the specified odd number are greater than 1;
When first Transaction Information, which closes, advises, first Transaction Information is carried out in the block chain meshed networkIt is synchronous.
Optionally, the specified odd number block chain node for meeting the second prefabricated rule includes:
It is randomly assigned odd number confidence values height and adjacent to one another block chain node.
Optionally, the determining validation of information cluster includes:
Determine validation of information cluster;
The mark of each block chain node in first Transaction Information and the confirmation cluster is sent to described trueRecognize other block chain nodes in cluster.
Optionally, the validation of information cluster confirms whether first Transaction Information meets the first prefabricated rule and include:
Each block chain node in validation of information cluster verifies first Transaction Information, is verified knotFruit;
When verification result be by block chain node quantity in the confirmation cluster be more than half when, determination described inTransaction Information closes rule.
Optionally, the confidence values of block chain node are determined according to safety, wherein the safety of block chain node is higher,Confidence values are higher.
Second aspect, the embodiment of the invention provides a kind of, and the Transaction Information based on block chain confirms device.Described deviceSuitable for block chain meshed network, the block chain meshed network includes multiple block chain nodes, and described device includes:
Receiving unit, for receiving the first Transaction Information of terminal transmission;
Determination unit, for determining validation of information cluster, so as to validation of information cluster confirmation the first transaction letterWhether breath meets the first prefabricated rule, and the validation of information cluster includes meeting the second prefabricated rule in the block chain meshed networkSpecified odd number block chain node then, the specified odd number are greater than 1;
Synchronization unit is used for when first Transaction Information is closed and advised, by first Transaction Information in the block chainIt is synchronized in meshed network.
Optionally, the specified odd number block chain node for meeting the second prefabricated rule includes:
It is randomly assigned odd number confidence values height and adjacent to one another block chain node.
Optionally, the determination unit is specifically used for:
Determine validation of information cluster;
The mark of each block chain node in first Transaction Information and the confirmation cluster is sent to described trueRecognize other block chain nodes in cluster.
Optionally, further include:
Authentication unit is verified result for verifying to first Transaction Information;
Determination unit, for when verification result be by block chain node quantity in the confirmation cluster be more than partlyWhen number, determine that the Transaction Information closes rule.
Optionally, the confidence values of block chain node are determined according to safety, wherein the safety of block chain node is higher,Confidence values are higher.
The third aspect, this specification embodiment provide a kind of computer equipment, including memory, processor and are stored inOn memory and the computer program that can run on a processor, which is characterized in that the processor executes real when described programThe method and step of existing aforementioned first aspect.
Fourth aspect provides a kind of computer readable storage medium, and meter is stored on the computer readable storage mediumCalculation machine program, the computer program realize method described in above-mentioned first aspect when being executed by processor.
5th aspect, provides a kind of computer program product comprising instruction, when described instruction is run on computersWhen, so that computer executes method described in above-mentioned first aspect.
Through the embodiment of the present invention, it is possible to specify odd number block chain node verifies transaction, in the odd number sectionAfter point is verified, carries out the whole network and synchronize, other block chain nodes only need to store the synchronizing information, no longer need to be testedCard, saves calculation power, will low energy consumption, improve the ability that block chain meshed network handles a large number of services data.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present inventionIn attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment isA part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the artEvery other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of Transaction Information confirmation methods and device based on block chain.This method is suitable forSystem shown in FIG. 1, as shown in Figure 1, including:One or more clients 110, block chain meshed network 120.Wherein, the areaBlock chain meshed network 120 may include one or more block chain nodes.Each block chain node can be by there is calculation functionEquipment realize.In addition, block chain node and client may be implemented in the same equipment.
Specifically, client 110 is mainly used for interacting with user and block chain link point.For example, the client 110It is main that wallet function is provided, block chain can be obtained from block chain node, newly-generated Transaction Information can also be sentBlock chain node is given, which may include being transferred to, producing the information such as address.
Block chain node is mainly used for recording Transaction Information, generates new block, verifying Transaction Information and memory blockChain.Wherein, each block chain node can preserve complete block chain, have recorded all history in the complete block chainTransaction guarantees the safety of historical trading by certain structure.In embodiments of the present invention, it trades in block chain node verificationWhen information, it is only necessary to which the node of specified quantity verifies Transaction Information, and the whole network is carried out after being verified and is synchronized, is not necessarily toThe whole network is verified, and the data processing amount of block chain network is greatly reduced, and improves the data processing of block chain meshed networkAbility reduces the energy consumption of block chain meshed network.
In addition, record Transaction Information and generating the function of new block and can also be realized by packaged service device.For example,Mine machine in bit coin system.The packaged service device can be with the realization of block chain node on the same device, can also be individually realIn present equipment, for example, the packaged service device may be implemented in the terminal connecting with block chain node, which canTo obtain Transaction Information and block chain etc. from block chain node.
In order to facilitate understanding of embodiments of the present invention, it is further explained below in conjunction with attached drawing with specific embodimentBright, embodiment does not constitute the restriction to the embodiment of the present invention.
Fig. 2 is a kind of Transaction Information confirmation method flow chart based on block chain provided in an embodiment of the present invention.This methodIt can be realized by system shown in FIG. 1, can specifically be realized by the block chain node in block chain meshed network.Such as Fig. 2Shown, this method specifically includes:
S210 receives the first Transaction Information that terminal is sent.
The terminal can refer to that operation has the terminal of client, for example, the client with wallet function.Between terminalAfter trading, which can be sent to block chain node, by the legitimacy of the block chain node verification transaction.Alternatively, the terminal can also refer to packaged service device, the packaged service device can by the Transaction Information generated in a period of time intoRow is packaged, and obtains the first Transaction Information, and the Transaction Information is sent to block chain link point and is verified.Wherein, transaction is believedBreath carries out being packaged the process that can be understood as generating new block.Wherein, block can be include block head and block main body, blockMain body is responsible for recording the Transaction Information in a period of time, and block head is mainly used for the upper block of connection, general all block structuresAt block chain, for example, the block head may include the cryptographic Hash of a upper block, which can also include the verifying of this blockInformation, such as can prove the random number of workload.
Specifically, which can be sent to block chain node, by block after determining Transaction Information by clientChain link point is verified, and is recorded in block chain after being verified.
Alternatively, client generate transaction after, can by trading card in block chain meshed network the whole network broadcast.It is packaged clothesBusiness device can recorde these trading cards, and by one of difficult math question of solution, to go to obtain creation new block right.It is createdThe packaged service device of new block right can be packaged the transaction generated in the whole network certain time, generate new block, andThe new block is sent to block chain node, is verified by block chain link point, records the new block after being verifiedIn block chain.At this point, the new block is the first Transaction Information.
Wherein, which can be sent to block chain meshed network by way of broadcast by terminal.It can alsoTo be only to be sent to the block chain node direct-connected with it by terminal.
Since same equipment may have client functionality and block chain nodal function simultaneously, or there is packing to take simultaneouslyBusiness device and block chain nodal function.The process that so step S210 may be equipment internal data transfer, that is, the client of equipmentEnd module is sent to block chain node module after determining Transaction Information, by the Transaction Information.
In addition, the Transaction Information may include diversified forms, it is specifically related with the field of block chain application.If the areaBlock chain is applied in digital cash field, then, which can indicate the information that both parties trade about digital cash,For example, the corresponding recipient address of the transaction, the side of producing address and transaction amount etc..If the block chain is applied in medical treatmentField, then, which can refer to clinician information, patient information, diagnostic message and prescription etc..
S220 determines validation of information cluster, so that the validation of information cluster confirms whether first Transaction Information accords withThe first prefabricated rule is closed, the validation of information cluster includes meeting specifying for the second prefabricated rule in the block chain meshed networkOdd number block chain node, the specified odd number are greater than 1.
In the concrete realization, it after determining the first Transaction Information, needs to be verified in validation of information cluster, with verifyingWhether first Transaction Information meets the first prefabricated rule.In one example, this first it is prefabricated rule for verify this firstWhether Transaction Information is correct.For example, whether the sequence of All Activity included in first Transaction Information is correct, first friendshipThe All Activity for including in easy information whether be true real transaction and verification result be by block chain node quantityIt is more than half etc. in the confirmation cluster.
Wherein, validation of information cluster can be determined according to the second prefabricated rule.The second prefabricated rule is specified for determiningOdd number block chain node is as validation of information cluster.In one example, which may include according to nodePosition and/or confidence values determine validation of information cluster.Wherein, the confidence values of block chain node predefine.For example, the nodeConfidence values can be calculated by the safety evaluation to node, the safety of the block chain node is higher, and confidence values are got overIt is high.
For example, the validation of information cluster can be determined centered on the block chain node direct-connected with terminal.
Specifically, the specified odd number block chain node for meeting the second prefabricated rule includes:It receives terminal and sends the first friendshipThe block chain node of easy information;And the block chain node confidence values height of the first Transaction Information is sent with reception terminal and is mutually facedClose block chain node.
For another example the validation of information cluster can be randomly assigned odd number confidence values height and adjacent to one another block chain linkPoint.
The specified odd number is generally higher than 1, for example, 3.
Each block chain node in validation of information cluster respectively verifies the first Transaction Information, is verified knotFruit;Each verification result can be synchronized in the block chain node that validation of information is concentrated.When verification result be by block chain linkWhen the quantity of point is more than half in confirming cluster, determine that Transaction Information closes rule.
Specifically, the block chain node direct-connected with terminal can believe first transaction after determining validation of information clusterThe mark of each block chain node is sent to other block chain nodes in confirmation cluster in breath and confirmation cluster.It is straight with terminalBlock chain node even verifies the first Transaction Information, is verified result.
Other nodes in validation of information cluster receive other block chain nodes (the block chain node direct-connected with terminal) hairThe mark of each block chain node in the first Transaction Information and the confirmation cluster sent;The Transaction Information is testedCard, is verified result;The verification result is sent to other block chain nodes in confirmation cluster;
When each block chain node in validation of information cluster determine verification result be by block chain node quantityWhen being more than half in the confirmation cluster, the Transaction Information is synchronized in the block chain meshed network.
In addition, the direct-connected block chain node of terminal receives the second transaction letter that other nodes in validation of information cluster are sentThe mark of each block chain node in breath and the confirmation cluster;Second Transaction Information is verified, knot is verifiedFruit;The verification result is sent to other block chain nodes in confirmation cluster;
When each block chain node in validation of information cluster determine verification result be by block chain node quantityWhen being more than half in the confirmation cluster, the second Transaction Information is synchronized in the block chain meshed network.
In addition, block chain node or terminal be after determining validation of information cluster, can by first Transaction Information andThe mark of each block chain node is sent to each block chain node in confirmation cluster in confirmation cluster.
Each node in validation of information cluster receives other block chain nodes (the block chain node direct-connected with terminal) hairThe mark of each block chain node in the first Transaction Information and the confirmation cluster sent;The Transaction Information is testedCard, is verified result;The verification result is sent to other block chain nodes in confirmation cluster;When in validation of information clusterEach block chain node determine verification result be by block chain node quantity in the confirmation cluster more than halfWhen, the Transaction Information is synchronized in the block chain meshed network.S230 is advised when first Transaction Information closesWhen, first Transaction Information is synchronized in the block chain meshed network.
In the concrete realization, after verifying the first Transaction Information and closing rule, block chain node can be believed according to first transactionBreath generates block, and the block is recorded in block chain and the whole network synchronizes the block, so that other block chain nodes are in the areaContinue to generate block on the basis of block.
Alternatively, if first Transaction Information is newborn block, after verifying the first Transaction Information and closing rule, block chainThe newly-generated block is recorded in block chain node and the whole network synchronizes the block, so as to the block in block chain meshed networkChain node continues to record on the basis of the newly-generated block.
Through the embodiment of the present invention, it is possible to specify odd number block chain node verifies transaction, in the odd number sectionAfter point is verified, carries out the whole network and synchronize, other block chain nodes only need to store the synchronizing information, no longer need to be testedCard, saves calculation power, will low energy consumption, improve the ability that block chain meshed network handles a large number of services data.
Fig. 3 is the structural schematic diagram of device provided in an embodiment of the present invention.The device is suitable for block chain meshed network, instituteStating block chain meshed network includes multiple block chain nodes.The device specifically includes:
Receiving unit 301, for receiving the first Transaction Information of terminal transmission;
Determination unit 302, for determining validation of information cluster, so as to validation of information cluster confirmation first transactionWhether information meets the first prefabricated rule, and the validation of information cluster includes that meet second in the block chain meshed network prefabricatedThe specified odd number block chain node of rule, the specified odd number are greater than 1;
Synchronization unit 303 is used for when first Transaction Information is closed and advised, by first Transaction Information in the blockIt is synchronized in chain meshed network.
In one embodiment, the specified odd number block chain node for meeting the second prefabricated rule includes:
It is randomly assigned odd number confidence values height and adjacent to one another block chain node.
In another embodiment, the determination unit is specifically used for:
Determine validation of information cluster;
The mark of each block chain node in first Transaction Information and the confirmation cluster is sent to described trueRecognize other block chain nodes in cluster.
In another embodiment, further include:
Authentication unit is verified result for verifying to first Transaction Information;
Determination unit, for when verification result be by block chain node quantity in the confirmation cluster be more than partlyWhen number, determine that the Transaction Information closes rule.
In another embodiment, the confidence values of block chain node are determined according to safety, wherein the peace of block chain nodeFull property is higher, and confidence values are higher.
Fig. 4 shows a kind of computer equipment structural schematic diagram, the computer equipment provided by this specification embodimentMay include:Processor 410, memory 420, input/output interface 430, communication interface 440 and bus 450.Wherein processor44, memory 420, input/output interface 430 and communication interface 440 by bus 450 realize between inside equipmentCommunication connection.Embodiment as shown in connection with fig. 2 may be implemented in the processor 410 when storing program in memory 420 by executingIn method and step.
Processor 410 can use general CPU (Central Processing Unit, central processing unit), micro processDevice, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one orThe modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 420 can use ROM (Read Only Memory, read-only memory), RAM (Random AccessMemory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 420 can storeOperating system and other applications are realizing technical solution provided by this specification embodiment by software or firmwareWhen, relevant program code is stored in memory 420, and execution is called by processor 410.
Input/output interface 430 is for connecting input/output module, to realize information input and output.Input and output/Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.WhereinInput equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,Loudspeaker, vibrator, indicator light etc..
Communication interface 440 is used for connection communication module (not shown), to realize the communication of this equipment and other equipmentInteraction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 450 includes an access, in various components (such as the processor 410, memory 420, input/output of equipmentInterface 430 and communication interface 440) between transmit information.
It should be noted that although above equipment illustrates only processor 410, memory 420, input/output interface430, communication interface 440 and bus 450, but in the specific implementation process, which can also include realizing to operate normallyNecessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipmentComponent necessary to this specification example scheme, without including all components shown in figure.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosureUnit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrateThe interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Professional technician can use different methods to achieve the described function each specific application, but this realizationIt should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can be executed with hardware, processorThe combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical fieldIn any other form of storage medium well known to interior.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effectsIt is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the inventionProtection scope, all any modification, equivalent substitution, improvement and etc. within the scope of the present invention, done should be included in this hairWithin bright protection scope.