Summary of the invention
The embodiment of the present invention provides a kind of data and deposits card method and apparatus, can by being carried out under chain to transaction data and
Card is deposited in multiple hash operation and data on chain, deposits the fast of card data to realize while preventing from illegally distorting transaction data
Speed retrieval.
In order to achieve the above objectives, the present invention adopts the following technical scheme:
In a first aspect, providing a kind of data deposits card method, this method comprises: block chain node device reception chain divides into preparation
Card data are deposited under the chain sent;The first hash value that card data include transaction data and transaction data, number of deals are wherein deposited under chain
T, both parties ID, transaction content are stabbed according to including exchange hour;Block chain node device by predetermined amount of time it is received at least
Card data are deposited under one chain and carry out hash operation, generate the 2nd hash value in predetermined amount of time, and record corresponding timestamp
T;Block chain node device will deposit card data and be packaged life under at least one chain in time stamp T, the 2nd hash value, predetermined amount of time
Card data are deposited at block chain to be locally stored, and are synchronized to other block chain node devices.
In the above-mentioned methods, block chain node is divided into chain received in predetermined amount of time under at least one chain that preparation is sent
It deposits card data and carries out hash operation, generate the 2nd hash value in predetermined amount of time, and record corresponding time stamp T;And by when
Between stab to deposit card data under T, the 2nd hash value, at least one chain in predetermined amount of time and be packaged to generate block chain and deposit card data and carry out
It is locally stored, and is synchronized to other block chain node devices.The present invention can be by carrying out under chain and on chain transaction data
Multiple hash operation and data deposit card, to realize the quick inspection for depositing card data while preventing from illegally distorting transaction data
Rope.
Optionally, described to be synchronized to other block chain node devices, later further include: the block chain node device receives
The acquisition block chain that verifying equipment is sent deposits card request of data;The block chain is deposited card number by the block chain node device
According to being sent to the verifying equipment, so as to the verifying equipment to deposited under the chain that equipment under the chain obtains card data with it is described
Block chain is deposited card data and is compared, and determines that card data are deposited under the chain deposits whether card data are modified with the block chain.
Second aspect provides a kind of data and deposits card method, this method comprises: equipment receives transaction data under chain;Wherein hand over
Easy data include exchange hour stamp t, both parties ID and transaction content;It is raw to carry out hash operation to transaction data for equipment under chain
At the first hash value of transaction data;Under chain equipment the first hash value and transaction data are packaged generate deposited under chain card data into
Row storage, and it is sent to block chain node device.
In the above-mentioned methods, under chain equipment by received transaction data;Carry out hash operation generates transaction data first
Hash value;Then card data will be deposited under the first hash value and transaction data packing generation chain to store, and is sent to block
Chain node device.The present invention can reduce by carrying out hash operation to transaction data and deposit the risk that card data are tampered under chain,
And it is provided for block chain node device and deposits card data under more safe and reliable chain.
Optionally, the first hash value and transaction data are packaged to generate and deposit card data under chain and store by equipment under chain,
And it is sent to block chain node device, later further include: equipment receives and deposits card data under the acquisition chain that verifying equipment is sent under chain
Request;Equipment will deposit card data and be sent to verifying equipment under chain under chain, so as to verify equipment to deposited under chain card data with from block
Chain node device obtain block chain deposit card data compare, determine deposited under chain card data and block chain deposit card data whether by
Change.
The third aspect, provides a kind of block chain node device, which includes:
Receiving unit is divided under the chain that preparation is sent for reception chain and deposits card data;It includes transaction that card data are wherein deposited under chain
First hash value of data and transaction data, transaction data include exchange hour stamp t, both parties ID, transaction content.
Processing unit carries out hash for will deposit card data under at least one received chain of receiving unit in predetermined amount of time
Operation generates the 2nd hash value in predetermined amount of time, and records corresponding time stamp T.
Processing unit is also used to that card number will be deposited under at least one chain in time stamp T, the 2nd hash value, predetermined amount of time
Card data are deposited according to packing generation block chain to be locally stored.
Transmission unit, the block chain for generating processing unit deposit card data and are synchronized to other block chain node devices.
Optionally, receiving unit is also used to receive the acquisition block chain that verifying equipment is sent and deposits card request of data.
Transmission unit is also used to deposit card request of data according to the received acquisition block chain of receiving unit for block chain and deposits card number
According to being sent to verifying equipment, so as to verify equipment to deposit card data under the chain that equipment obtains under chain and block chain deposit card data into
Row comparison determines that card data are deposited under chain deposits whether card data are modified with block chain.
It is to be appreciated that a kind of block chain node device of above-mentioned offer is for executing first aspect pair presented above
The method answered, therefore, the attainable beneficial effect of institute can refer to the corresponding method of first aspect above and in detail below reality
The beneficial effect of corresponding scheme in mode is applied, details are not described herein again.
Fourth aspect provides equipment under a kind of chain, and equipment includes: under the chain
Receiving unit, for receiving transaction data;Wherein transaction data include exchange hour stamp t, both parties ID and
Transaction content.
Processing unit, for carrying out the first of hash operation generation transaction data to the received transaction data of receiving unit
Hash value.
Processing unit, card data will be deposited under the first hash value and transaction data packing generation chain by, which being also used to, stores.
Transmission unit deposits card data under the chain for generating processing unit and is sent to block chain node device.
Optionally, receiving unit is also used to receive under the acquisition chain that verifying equipment is sent and deposits card request of data.
Transmission unit, be also used to according to deposited under the received acquisition chain of receiving unit card request of data will be deposited under chain card data hair
Send to verifying equipment, so as to verify equipment to deposited under chain card data with from block chain node device obtain block chain deposit card data
It compares, determines that depositing card data under chain deposits whether card data are modified with block chain.
It is to be appreciated that the chain of above-mentioned offer, which is divided into be ready for use on, executes the corresponding method of first aspect presented above,
Therefore, the attainable beneficial effect of institute can refer to right in the corresponding method of first aspect above and following detailed description
The beneficial effect for the scheme answered, details are not described herein again.
5th aspect, provides a kind of block chain node device, includes processor in the structure of the block chain node device
And memory, memory save the necessary program instruction of block chain node device and data, handle for coupling with processor
Device is for executing the program instruction stored in memory, so that the block chain node device executes method described in first aspect.
6th aspect, provides a kind of computer storage medium, is stored with computer program code in computer storage medium,
When computer program code is run on the block chain node device as described in terms of such as the 5th, so that block chain node device is held
The method of the above-mentioned first aspect of row.
7th aspect, provides a kind of computer program product, which stores above-mentioned computer software
Instruction, when computer software instructions are run on the block chain node device as described in terms of such as the 5th, so that block chain node
Equipment executes the program of the scheme as described in above-mentioned first aspect.
Eighth aspect provides equipment under a kind of chain, includes processor and memory, storage in the structure of equipment under the chain
Device saves the necessary program instruction of equipment and data under the chain, processor is for executing in memory for coupling with processor
The program instruction of storage, so that equipment executes method described in first aspect under the chain.
9th aspect, provides a kind of computer storage medium, is stored with computer program code in computer storage medium,
When computer program code is run in equipment under the chain as described in eighth aspect, so that equipment executes above-mentioned first party under chain
The method in face.
Tenth aspect, provides a kind of computer program product, which stores above-mentioned computer software
Instruction, when computer software instructions are run in equipment under the chain as described in eighth aspect, so that equipment executes as above under chain
State the program of scheme described in first aspect.
Embodiment two
Referring to Fig. 2, the embodiment of the present invention provides a kind of data and deposits card method, this method comprises:
201, equipment receives transaction data under chain;Wherein transaction data includes exchange hour stamp t, both parties ID and friendship
Easy content.
202, equipment carries out the first hash value that hash operation generates transaction data to transaction data under chain;Equipment will under chain
Card data are deposited under first hash value and transaction data packing generation chain to be stored, and are sent to block chain node device.
In addition, referring to Fig. 2, after step 202 further include:
Equipment receives and deposits card request of data under the acquisition chain that verifying equipment is sent under S21, chain.
Under S22, chain equipment will be deposited under chain card data be sent to verifying equipment, so as to verify equipment to deposited under chain card data with
The block chain obtained from block chain node device is deposited card data and is compared, and determines that card data and block chain are deposited under chain deposits card data
Whether it is modified.
In the above-mentioned methods, under chain equipment by received transaction data;Carry out hash operation generates transaction data first
Hash value;Then card data will be deposited under the first hash value and transaction data packing generation chain to store, and is sent to block
Chain node device.The embodiment of the present invention can deposit card data and be tampered by carrying out hash operation to transaction data under reduction chain
Risk, and provided for block chain node device and deposit card data under more safe and reliable chain.
Referring to Fig. 3, the embodiment of the present invention provides a kind of block chain node device 30, which includes:
Receiving unit 301 is divided under the chain that preparation is sent for reception chain and deposits card data;It includes handing over that card data are wherein deposited under chain
First hash value of easy data and transaction data, transaction data include exchange hour stamp t, both parties ID, transaction content.
Processing unit 302, for will be deposited under at least one received chain of receiving unit 301 in predetermined amount of time card data into
Row hash operation generates the 2nd hash value in predetermined amount of time, and records corresponding time stamp T.
Processing unit 302 is also used to that card will be deposited under at least one chain in time stamp T, the 2nd hash value, predetermined amount of time
Data packing generation block chain is deposited card data and is locally stored.
Transmission unit 303, the block chain for generating processing unit 302 deposit card data and are synchronized to other block chain nodes
Equipment.
In a kind of illustrative scheme, receiving unit 301 is also used to receive the acquisition block chain that verifying equipment is sent and deposits
Demonstrate,prove request of data.
Transmission unit 303 is also used to deposit card request of data according to the received acquisition block chain of receiving unit 301 for block chain
Deposit card data be sent to verifying equipment, so as to verify equipment under chain equipment obtain chain under deposit card data and block chain deposit card
Data compare, and determine that card data are deposited under chain deposits whether card data are modified with block chain.
Since the block chain node device in the embodiment of the present invention can be applied to implement to correspond in above method embodiment
Method therefore can be obtained technical effect see also method corresponding in above method embodiment, the present invention is implemented
Details are not described herein for example.
Referring to Fig. 4, the embodiment of the present invention provides equipment 40 under a kind of chain, and equipment 40 includes: under the chain
Receiving unit 401, for receiving transaction data;Wherein transaction data include exchange hour stamp t, both parties ID with
And transaction content.
Processing unit 402 generates transaction data for carrying out hash operation to the received transaction data of receiving unit 401
First hash value.
Processing unit 402, card data will be deposited under the first hash value and transaction data packing generation chain by, which being also used to, deposits
Storage.
Transmission unit 403 deposits card data under the chain for generating processing unit 402 and is sent to block chain node device.
Optionally, receiving unit 401 are also used to receive under the acquisition chain that verifying equipment is sent and deposit card request of data.
Transmission unit 403, be also used to according to deposited under the received acquisition chain of receiving unit 401 card request of data card will be deposited under chain
Data are sent to verifying equipment, deposit to verify equipment to card data are deposited under chain with the block chain obtained from block chain node device
Card data compare, and determine that card data are deposited under chain deposits whether card data are modified with block chain.
Since equipment can be applied to implement corresponding method in above method embodiment under the chain in the embodiment of the present invention,
Therefore, it can be obtained technical effect see also method corresponding in above method embodiment, the embodiment of the present invention is herein
It repeats no more.
Using integrated unit, Fig. 5 shows block chain node device involved in above-described embodiment
A kind of 30 possible structural schematic diagram.Block chain node device 30 includes: processing module 501, communication module 502 and storage mould
Block 503.Processing module 501 is for carrying out control management to the movement of block chain node device 30, for example, processing module 501 is used
Process 102,103, S12 in the support execution of block chain node device 30 Fig. 1.Communication module 502 is for supporting block chain link
The communication of point device 30 and other entities.Memory module 503 is used for the program code and data of memory block chain node device 30.
Wherein, processing module 501 can be processor or controller, such as can be central processing unit (central
Processing unit, CPU), general processor, digital signal processor (digital signal processor, DSP),
Specific integrated circuit (application-specific integrated circuit, ASIC), field programmable gate array
It is (field programmable gate array, FPGA) or other programmable logic device, transistor logic, hard
Part component or any combination thereof.It may be implemented or execute to combine and various illustratively patrol described in present disclosure
Collect box, module and circuit.The processor is also possible to realize the combination of computing function, such as includes one or more micro- places
Manage device combination, DSP and the combination of microprocessor etc..Communication module 502 can be transceiver, transmission circuit or communication interface
Deng.Memory module 503 can be memory.
When processing module 501 is processor as shown in FIG. 6, communication module 502 is the transceiver of Fig. 6, memory module 503
For Fig. 6 memory when, block chain node device 30 involved in the embodiment of the present application can be block chain link as described below
Point device 30.
Referring to shown in Fig. 6, which includes: processor 601, transceiver 602, memory 603 and total
Line 604.
Wherein, processor 601, transceiver 602, memory 603 are connected with each other by bus 604;Bus 604 can be outer
If component connection standard (peripheral component interconnect, PCI) bus or expanding the industrial standard structure
(extended industry standard architecture, EISA) bus etc..It is total that the bus can be divided into address
Line, data/address bus, control bus etc..Only to be indicated with a thick line in figure, it is not intended that an only bus convenient for indicating
Or a type of bus.
Processor 601 can be a general central processor (Central Processing Unit, CPU), micro process
Device, application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC) or one or more
A integrated circuit executed for controlling application scheme program.
Memory 603 can be read-only memory (Read-Only Memory, ROM) or can store static information and instruction
Other kinds of static storage device, random access memory (Random Access Memory, RAM) or letter can be stored
The other kinds of dynamic memory of breath and instruction, is also possible to Electrically Erasable Programmable Read-Only Memory (Electrically
Erasable Programmable Read-only Memory, EEPROM), CD-ROM (Compact Disc Read-
Only Memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, optical disc, digital universal
Optical disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can be used in carrying or store to have referring to
Enable or data structure form desired program code and can by any other medium of computer access, but not limited to this.
Memory, which can be, to be individually present, and is connected by bus with processor.Memory can also be integrated with processor.
Wherein, memory 603 is used to store the application code for executing application scheme, and is controlled by processor 601
System executes.Transceiver 602 is used to receive the content of external equipment input, and processor 601 is used to execute to store in memory 603
Application code, to realize that data described in the embodiment of the present application one deposit card method.
It should be understood that magnitude of the sequence numbers of the above procedures are not meant to execute suitable in the various embodiments of the application
Sequence it is successive, the execution of each process sequence should be determined by its function and internal logic, the implementation without coping with the embodiment of the present application
Process constitutes any restriction.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
It is apparent to those skilled in the art that for convenience and simplicity of description, the equipment of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, it can be with
It realizes by another way.For example, apparatus embodiments described above are merely indicative, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of equipment or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When being realized using software program, can entirely or partly realize in the form of a computer program product.The computer
Program product includes one or more computer instructions.On computers load and execute computer program instructions when, all or
It partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
Word user line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another
A web-site, computer, server or data center are transmitted.The computer readable storage medium can be computer
Any usable medium that can be accessed either includes the numbers such as one or more server, data centers that medium can be used to integrate
According to storage equipment.The usable medium can be magnetic medium (for example, floppy disk, hard disk, tape), optical medium (for example, DVD),
Or semiconductor medium (such as solid state hard disk (Solid State Disk, SSD)) etc..
The embodiment of the present invention also provides a kind of computer program product, which can be loaded directly into storage
In device, and contain software code, which is loaded into via computer and can be realized above-described embodiment after executing
One data deposit card method.
Using integrated unit, Fig. 7 shows one of equipment 40 under chain involved in above-described embodiment
The possible structural schematic diagram of kind.Equipment 40 includes: processing module 701, communication module 702 and memory module 703 under chain.Handle mould
Block 701 is for carrying out control management to the movement of equipment 40 under chain, for example, processing module 701 is for supporting that equipment 40 is held under chain
Process 202 in row Fig. 2, S22.Communication module 702 is used to support the communication of equipment 40 and other entities under chain.Memory module
703 program code and data for equipment 40 under storage chains.
Wherein, processing module 701 can be processor or controller, such as can be central processing unit (central
Processing unit, CPU), general processor, digital signal processor (digital signal processor, DSP),
Specific integrated circuit (application-specific integrated circuit, ASIC), field programmable gate array
It is (field programmable gate array, FPGA) or other programmable logic device, transistor logic, hard
Part component or any combination thereof.It may be implemented or execute to combine and various illustratively patrol described in present disclosure
Collect box, module and circuit.The processor is also possible to realize the combination of computing function, such as includes one or more micro- places
Manage device combination, DSP and the combination of microprocessor etc..Communication module 702 can be transceiver, transmission circuit or communication interface
Deng.Memory module 703 can be memory.
When processing module 701 is processor as shown in Figure 8, communication module 702 is the transceiver of Fig. 8, memory module 703
For Fig. 8 memory when, equipment 40 can be equipment 40 under chain as described below under chain involved in the embodiment of the present application.
Referring to shown in Fig. 8, equipment 40 includes: processor 801, transceiver 802, memory 803 and bus 804 under the chain.
Wherein, processor 801, transceiver 802, memory 803 are connected with each other by bus 804;Bus 804 can be outer
If component connection standard (peripheral component interconnect, PCI) bus or expanding the industrial standard structure
(extended industry standard architecture, EISA) bus etc..It is total that the bus can be divided into address
Line, data/address bus, control bus etc..Only to be indicated with a thick line in figure, it is not intended that an only bus convenient for indicating
Or a type of bus.
Processor 801 can be a general central processor (Central Processing Unit, CPU), micro process
Device, application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC) or one or more
A integrated circuit executed for controlling application scheme program.
Memory 803 can be read-only memory (Read-Only Memory, ROM) or can store static information and instruction
Other kinds of static storage device, random access memory (Random Access Memory, RAM) or letter can be stored
The other kinds of dynamic memory of breath and instruction, is also possible to Electrically Erasable Programmable Read-Only Memory (Electrically
Erasable Programmable Read-only Memory, EEPROM), CD-ROM (Compact Disc Read-
Only Memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, optical disc, digital universal
Optical disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can be used in carrying or store to have referring to
Enable or data structure form desired program code and can by any other medium of computer access, but not limited to this.
Memory, which can be, to be individually present, and is connected by bus with processor.Memory can also be integrated with processor.
Wherein, memory 803 is used to store the application code for executing application scheme, and is controlled by processor 801
System executes.Transceiver 802 is used to receive the content of external equipment input, and processor 801 is used to execute to store in memory 803
Application code, to realize that data described in the embodiment of the present application two deposit card method.
It should be understood that magnitude of the sequence numbers of the above procedures are not meant to execute suitable in the various embodiments of the application
Sequence it is successive, the execution of each process sequence should be determined by its function and internal logic, the implementation without coping with the embodiment of the present application
Process constitutes any restriction.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
It is apparent to those skilled in the art that for convenience and simplicity of description, the equipment of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, it can be with
It realizes by another way.For example, apparatus embodiments described above are merely indicative, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of equipment or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When being realized using software program, can entirely or partly realize in the form of a computer program product.The computer
Program product includes one or more computer instructions.On computers load and execute computer program instructions when, all or
It partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
Word user line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another
A web-site, computer, server or data center are transmitted.The computer readable storage medium can be computer
Any usable medium that can be accessed either includes the numbers such as one or more server, data centers that medium can be used to integrate
According to storage equipment.The usable medium can be magnetic medium (for example, floppy disk, hard disk, tape), optical medium (for example, DVD),
Or semiconductor medium (such as solid state hard disk (Solid State Disk, SSD)) etc..
The embodiment of the present invention also provides a kind of computer program product, which can be loaded directly into storage
In device, and contain software code, which is loaded into via computer and can be realized above-described embodiment after executing
Two data deposit card method.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any
Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain
Lid is within the scope of protection of this application.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.