CN109726229A - A kind of block chain date storage method and device - Google Patents
A kind of block chain date storage method and device Download PDFInfo
- Publication number
- CN109726229A CN109726229A CN201811464549.0A CN201811464549A CN109726229A CN 109726229 A CN109726229 A CN 109726229A CN 201811464549 A CN201811464549 A CN 201811464549A CN 109726229 A CN109726229 A CN 109726229A
- Authority
- CN
- China
- Prior art keywords
- transaction
- common recognition
- block
- request
- block chain
- 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
Links
Abstract
The embodiment of the present application discloses a kind of block chain date storage method and device.Wherein, which comprises the first common recognition node receives the first transaction request;The legitimacy of first transaction request described in the first common recognition node verification;If first transaction request meets legitimacy, the first common recognition node sends first transaction request to accounting nodes;The first common recognition node receives the first block that the accounting nodes are sent, and first block is generated according to first transaction request;First block includes local data base of the first common recognition node described in first transaction request by the block head storage of first block to the first common recognition node.The embodiment of the present application can effectively reduce block chain data and occupy space in common recognition node local memory.
Description
Technical field
This application involves field of computer technology more particularly to a kind of block chain date storage methods and device.
Background technique
Trade on internet almost requires to handle e-payment letter by reliable third party credit institution
Breath, this kind of system is endogenous to be limited by " fiduciary mode ", and block chain technology is based on Cryptography Principles and is not based on
Credit, any both sides to reach an agreement can direct payment, without the participation of third party intermediary, block chain be building ratio
The basic technology of special coin block chain network and Transaction Information encrypted transmission.
Block chain is a kind of a kind of chain type number for being sequentially in time combined into data block in such a way that sequence is connected
According to structure, and the distributed account book that can not be distorted He can not forge guaranteed in a manner of cryptography.Block chain as emerging technology,
It received extensive attention and studied in recent years.In existing block platform chain, transaction is bundled to block, and is recorded on block chain
Process be by participate in common recognition all-network node complete.Common recognition node local disk must save complete block chain number
Cochain is packaged according to could verify to transaction, and then legal transaction.
With the increase of block platform chain runing time and number of transaction, block chain data also be will increase, this to know together
The local disk low memory of node, need to carry out dilatation could accommodate complete block chain data.
Summary of the invention
The embodiment of the present application provides a kind of block chain date storage method and device, reduces block chain data and is knowing together
Node local memory occupies space.
First aspect the embodiment of the present application provides a kind of block chain date storage method, and this method mainly includes following step
It is rapid:
First common recognition node receives the first transaction request;
The legitimacy of first common recognition the first transaction request of node verification;
If the first transaction request meets legitimacy, the first common recognition node sends the first transaction request to accounting nodes;
First common recognition node receives the first block that accounting nodes are sent, and first block is by the accounting nodes root
It is generated according to first transaction request;
The block head of first block is stored the local data base to the first common recognition node by the first common recognition node.
During the application is implemented, the block head of the first block is stored by the sheet to the first common recognition node by the first common recognition node
Ground database stores block head in the local data base of the first common recognition node, can relative to complete block data is stored
It effectively reduces block chain data and occupies space in common recognition node local memory.
Optionally, the above method further include: the first common recognition node receives the first inquiry request, and the first inquiry request is for looking into
Ask the second transaction.First common recognition node, second transaction of inquiry from the local data base of the first common recognition node.If the first common recognition section
O'clock from first common recognition node local data base in do not inquire the second transaction, then to database server send first inquiry ask
It asks.First common recognition node receives the query result for the first inquiry request that database server is sent.
During the application is implemented, when the first common recognition node receives the first inquiry request, the first common recognition node is total from first first
Know the second transaction of inquiry in the local data base of node.If not inquiring the second friendship from the local data base of the first common recognition node
Easily, then inquiry request is sent to database server, passes through the second transaction of database server inquiry.In conclusion although
Partial Block chain data are only stored in the local data base of one common recognition node, but pass through the scheme in the embodiment of the present application, the
One common recognition node still has Transaction Inquiries function.
Optionally, the first transaction request includes: the digital signature and the first transaction request of the initiator of the first transaction request
Essential information, the essential information of above-mentioned first transaction request includes that the corresponding transaction serial number of the first transaction request and first are traded
The type of transaction of request.
Optionally, the legitimacy of first common recognition the first transaction request of node verification, specifically includes: the first common recognition node verification
Whether the digital signature of the first transaction request initiator is correct.If the digital signature of the first transaction request initiator be correctly,
Then inquire the historical record of the first transaction request.The basic of the first transaction request is judged according to the historical record of the first transaction request
The legitimacy of information.
In the embodiment of the present application, the first common recognition node verifies the legitimacy of the first transaction request through the above scheme.Therefore,
Although only storing Partial Block chain data in the local data base of the first common recognition node, pass through the side in the embodiment of the present application
Case, the first common recognition node still have the function of verifying transaction request legitimacy.
For second aspect the embodiment of the present application also provides a kind of block chain date storage method, this method mainly includes following
Step:
Accounting nodes receive the first transaction request that the first common recognition node is sent;
Accounting nodes verify the legitimacy of the first transaction request;
If the first transaction request meets legitimacy, at the end of the first billing cycle, accounting nodes seal the first transaction
It is attached in the first block;
The block head of first block is stored the local data base to accounting nodes by accounting nodes;
Accounting nodes send the first block to the first common recognition node and database server.
During the application is implemented, by accounting nodes by the local data of the block head of the first block storage to accounting nodes
Library stores block head in the local data base of accounting nodes, relative to complete block data is stored, can effectively reduce area
Block chain data occupy space accounting nodes local memory.
Optionally, the above method further include: accounting nodes receive third inquiry request, and third inquiry request is for inquiring the
Three transaction;Accounting nodes inquire third transaction from the local data base of accounting nodes;If accounting nodes are from the sheet of accounting nodes
Third transaction is not inquired in ground database, then sends the 4th inquiry request to database server;Accounting nodes receive data
The query result for the 4th inquiry request that library server is sent.
During the application is implemented, when accounting nodes receive third inquiry request, first from the local data base of accounting nodes
Inquire third transaction.If not inquiring third transaction from the local data base of accounting nodes, sent to database server
Inquiry request inquires third transaction by database server.In conclusion although only being deposited in the local data base of accounting nodes
Partial Block chain data are stored up, but by the scheme in the embodiment of the present application, accounting nodes still have the function of inquiry transaction.
For the third aspect the embodiment of the present application also provides a kind of block chain date storage method, this method mainly includes following
Step:
Database server receives the first block that accounting nodes are sent;
First block is charged to block chain account book by database server;
Database server receives the second inquiry request that the first common recognition node is sent, and the second inquiry request is for inquiring the
Two transaction;
The second transaction of database server inquiry;
Database server sends the query result of the second inquiry request to the first common recognition node;
Alternatively, database server receives the 4th inquiry request that accounting nodes are sent, the 4th inquiry request is for inquiring
Third transaction;
Database server inquires third transaction;
Database server sends the query result of the 4th inquiry request to accounting nodes.
During the application is implemented, the first block is charged to by block chain account book by database server, in database server
Complete block chain data are saved, database server can be realized Transaction Inquiries function, thus for common recognition node and book keeping operation
Node provides query service.
Fourth aspect, the embodiment of the present application also provides a kind of device of block chain data storage, which is able to achieve
The function of the first common recognition node in the block chain date storage method of first aspect and its alternative embodiment is stated, therefore is also able to achieve
The beneficial effect that the block chain date storage method of first aspect and its alternative embodiment has.Wherein, the function of the device
Corresponding software realization can also be executed by hardware by hardware realization.The hardware or software include at least one
Module corresponding with above-mentioned function.
Optionally, which includes the first receiving unit, the first authentication unit, the first transmission unit, the first receiving unit
With the first storage unit.
First receiving unit, for receiving the first transaction request.
First authentication unit, for verifying the legitimacy of first transaction request.
First transmission unit, if meeting legitimacy for first transaction request, described in being sent to accounting nodes
First transaction request.
First receiving unit, is also used to receive the first block that the accounting nodes are sent, and the first block is saved by book keeping operation
O'clock according to the first transaction request generate.
First storage unit, for storing the block head of first block.
5th aspect, the embodiment of the present application also provides a kind of block chain node device, which can be real
The function of first common recognition node in the block chain date storage method of existing above-mentioned first aspect and its alternative embodiment, therefore also can
Realize the beneficial effect that the block chain date storage method of first aspect and its alternative embodiment has.Wherein, the block chain
The function of node device can also execute corresponding software realization by hardware realization by hardware.The hardware is soft
Part includes at least one module corresponding with above-mentioned function.The block chain node device includes memory, processor and transmitting-receiving
Device, memory are used to store the computer program for supporting block chain node device to execute the above method, the computer program packet
Program instruction is included, processor is used to carry out control management to the movement of block chain node device according to program instruction, and transceiver is used
In the communication for supporting block chain node device and other communication equipments.
6th aspect, the embodiment of the present application also provides a kind of device of block chain data storage, which is able to achieve
The function of accounting nodes in the block chain date storage method of second aspect and its alternative embodiment is stated, therefore is also able to achieve second
The beneficial effect that the block chain date storage method of aspect and its alternative embodiment has.Wherein, the function of the device can be with
By hardware realization, corresponding software realization can also be executed by hardware.The hardware or software include at least one with it is upper
State the corresponding module of function.
Optionally, which includes the second receiving unit, the second authentication unit, encapsulation unit, the second storage unit and the
Two transmission units.
Second receiving unit, the first transaction request sent for receiving the first common recognition node.
Second authentication unit, for verifying the legitimacy of the first transaction request.
At the end of the first billing cycle, first is handed over if meeting legitimacy for the first transaction request for encapsulation unit
Easily request is encapsulated into the first block
Second storage unit, for storing the block head of the first block.
Second transmission unit sends first for broadcasting the first block, and to the first common recognition node and database server
Block.
7th aspect, the embodiment of the present application also provides a kind of block chain node device, which can be real
The function of accounting nodes in the block chain date storage method of existing above-mentioned second aspect and its alternative embodiment, therefore be also able to achieve
The beneficial effect that the block chain date storage method of second aspect and its alternative embodiment has.Wherein, the block chain node
The function of equipment can also execute corresponding software realization by hardware realization by hardware.The hardware or software package
Include at least one module corresponding with above-mentioned function.The block chain node device includes memory, processor and transceiver, is deposited
Reservoir is used to store the computer program for supporting block chain node device to execute the above method, and the computer program includes program
Instruction, processor are used to carry out control management to the movement of block chain node device according to program instruction, and transceiver is for supporting
The communication of block chain node device and other communication equipments.
Eighth aspect, the embodiment of the present application also provides a kind of device of block chain data storage, which is able to achieve
The function of database server in third aspect block chain date storage method is stated, therefore is also able to achieve third aspect block chain number
The beneficial effect having according to storage method.Wherein, the function of the device can also be held by hardware realization by hardware
The corresponding software realization of row.The hardware or software include at least one module corresponding with above-mentioned function.
Optionally, which includes third receiving unit, third storage unit and third transmission unit.
Third receiving unit, for receiving the first block of accounting nodes transmission.
Third storage unit, for the first block to be charged to block chain account book.
Third receiving unit, is also used to receive the second inquiry request of the first common recognition node transmission, and the second inquiry request is used
It trades in inquiry second.
First query unit, for inquiring the second transaction.
Third transmission unit, for sending the query result of the second inquiry request to the first common recognition node.
Alternatively, third receiving unit, is also used to receive the 4th inquiry request of accounting nodes transmission, the 4th inquiry request is used
In inquiry third transaction;
First query unit, for inquiring third transaction.
Third transmission unit, for sending the query result of the 4th inquiry request to accounting nodes.
9th aspect, the embodiment of the present application also provides a kind of server, which is able to achieve above-mentioned third aspect area
The function of database server in block chain date storage method, therefore also it is able to achieve third aspect block chain date storage method institute
The beneficial effect having.Wherein, the function of the server can also be executed corresponding soft by hardware realization by hardware
Part is realized.The hardware or software include at least one module corresponding with above-mentioned function.The server includes memory, place
Device and transceiver are managed, memory is used to store the computer program for supporting server to execute the above method, the computer program
Including program instruction, processor is used to carry out control management to the movement of server according to program instruction, and transceiver is for supporting
The communication of server and other communication equipments.
9th aspect, the embodiment of the present application also provides a kind of block chain data-storage system, which includes: common recognition section
Point, accounting nodes and database server composition, above-mentioned common recognition node, accounting nodes and database server are mutual by network
Connection forms block chain network.
Tenth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored on readable storage medium storing program for executing
Instruction, when it runs on a processor, so that processor executes the area of the description of above-mentioned first aspect and its alternative embodiment
Block chain date storage method.
Tenth on the one hand, and the embodiment of the present application provides a kind of computer readable storage medium, stores on readable storage medium storing program for executing
There is instruction, when it runs on a processor, so that processor executes the description of above-mentioned second aspect and its alternative embodiment
Block chain date storage method.
12nd aspect, the embodiment of the present application provide a kind of computer readable storage medium, store on readable storage medium storing program for executing
There is instruction, when it runs on a processor, so that processor executes the block chain data storage side of above-mentioned third aspect description
Method.
13rd aspect, the embodiment of the present application provides a kind of computer program product comprising instruction, when it is being handled
When being run on device, so that processor executes the block chain data storage side of the description of above-mentioned first aspect and its alternative embodiment
Method.
Fourteenth aspect, the embodiment of the present application provide a kind of computer program product comprising instruction, when it is being handled
When being run on device, so that processor executes the block chain data storage side of the description of above-mentioned second aspect and its alternative embodiment
Method.15th aspect, the embodiment of the present application provides a kind of computer program product comprising instruction, when it is transported on a processor
When row, so that processor executes the block chain date storage method of the description of the above-mentioned third aspect and its alternative embodiment.
Detailed description of the invention
A brief introduction will be made to the drawings that need to be used in the embodiment or the description of the prior art below.
Fig. 1 is a kind of system architecture diagram of block chain data-storage system provided by the embodiments of the present application;
Fig. 2 is a kind of structural schematic diagram of block chain node device provided by the embodiments of the present application;
Fig. 3 is a kind of structural schematic diagram of server provided by the embodiments of the present application;
Fig. 4 is a kind of flow diagram of block chain date storage method provided by the embodiments of the present application;
Fig. 5 is the flow diagram of another block chain date storage method provided by the embodiments of the present application;
Fig. 6 is the flow diagram of another block chain date storage method provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of block chain data storage device provided by the embodiments of the present application;
Fig. 8 is the structural schematic diagram of another block chain data storage device provided by the embodiments of the present application;
Fig. 9 is the structural schematic diagram of another block chain data storage device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application is described, and is answered
Work as understanding, when use in this specification and in the appended claims, term " includes " and "comprising" indicate described feature,
Entirety, step, operation, the presence of element and/or component, but one or more of the other feature, entirety, step, behaviour is not precluded
The presence or addition of work, element, component and/or its set.
It should be noted that the term used in the embodiment of the present application is only merely for the mesh of description specific embodiment
, it is not intended to be limiting the application." the one of the embodiment of the present application and singular used in the attached claims
Kind ", " described " and "the" are also intended to including most forms, unless the context clearly indicates other meaning.It is also understood that this
Term "and/or" used herein refers to and includes one or more associated any or all possible group for listing project
It closes.
It should be noted that the block chain node device in the embodiment of the present application, which can be, can undertake service and ensure clothes
The General Server of business ability is also possible to be registered in block chain, has processor, hard disk, memory and system bus structure
The terminal device that can be undertaken service and ensure service ability.The embodiment of the present application is not especially limited.
For narrow sense, block chain is a kind of be sequentially in time combined into data block in such a way that sequence is connected one
Kind linked data structure, and the distributed account book that can not be distorted He can not forge guaranteed in a manner of cryptography.Broadly, area
Block chain technology is to verify to know together algorithm with storing data, using distributed node to generate and more using block linked data structure
New data, utilizes the be made of automatized script code at the safety for guaranteeing data transmission and access in the way of cryptography
One intelligent contract programs the distributed basis framework and calculation completely new with one kind of operation data.Block chain can be divided into
Three classes are publicly-owned block chain, alliance's block chain and privately owned block chain, block chain data storage provided by the embodiments of the present application respectively
Method is suitable for alliance's block chain and privately owned block chain.Alliance's block chain refers to: by specifying multiple pre-selections inside some group
Node is book keeping operation people, and each piece of generation is codetermined by all preselected nodes, other access nodes can participate in business, but
Accounting procedure is kept aloof from, all other men can be defined inquiry by the open data-interface of the block chain.Privately owned block
Chain refers to: only keeping accounts using only the general ledger technology of block chain, can be a company, be also possible to individual, exclusively enjoy the area
The write-in permission of block chain.
Fig. 1 is a kind of configuration diagram of block chain data-storage system 100 provided by the embodiments of the present application.It can by Fig. 1
Know, which is made of common recognition node 101 and database server 102, wraps in node 101 of knowing together
Containing an accounting nodes 103.Above-mentioned common recognition node 101 and database server 102 are connected with each other by network, form block chain
Network.It is understood that the communication between each equipment in block chain data-storage system 100 can be based on it is any wired
And wireless network, including but not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, Virtual Private Network (Virtual
Private Network, VPN), cordless communication network etc..
The database server 102 in block chain data-storage system 100 can use master-slave database knot as shown in Figure 1
Structure includes 1 main database server 102 and K backup database server 102 that is, in block chain data-storage system 100.
Main database server 102 and K backup database server 102 save the complete of above-mentioned block chain data-storage system 100
Whole block chain data.Using this master-slave database structure, it is ensured that the data in block chain data-storage system 100 are gathered around
There are multiple disaster tolerance copies, the safety of data can be improved.When 102 failure of main database server, other can be immediately switched to
Database server 102 improves the availability of system.In the block chain data-storage system 100, each billing cycle starts
Afterwards, the accounting nodes 103 of the billing cycle are selected by common recognition mechanism by multiple common recognition nodes 101, the common recognition mechanism can be with
It is practical Byzantine failure tolerance algorithm (English: Practical Byzantine Fault Tolerance, english abbreviation: PBFT),
It is also possible to Raft agreement common recognition mechanism, the application does not limit this.Each common recognition node 101 can be from database server
Data are inquired and read in 102, but only data, each database can be written to database server 102 in accounting nodes 103
Server 102 saves the complete block chain data of the system, however to alleviate the memory pressure of each common recognition node, it is each to know together
Node 101 optionally saves Partial Block chain data in the local database.
Common recognition node 101 and accounting nodes 103 are block chain node device, and block chain node device can be service
Device, mobile terminal, PC etc. have the function of intelligence computation, and the network equipment of communication interaction can be carried out with other equipment.
It will describe in detail to the function of block chain node device in following embodiments.
Fig. 2 is referred to, Fig. 2 is a kind of hardware configuration signal of block chain node device 200 provided by the embodiments of the present application
Figure, block chain node device 200 include: memory 201, transceiver 202 and couple with the memory 201 and transceiver 202
Processor 203.For memory 201 for storing computer program, the computer program includes program instruction, processor 203
For execute memory 201 storage program instruction, transceiver 202 be used under the control of processor 203 with other equipment into
Row communication.When processor 203 can execute block chain date storage method according to program instruction when executing instruction.
Wherein, processor 203 can be central processing unit (English: central processing unit, referred to as:
CPU), general processor, digital signal processor (English: digital signal processor, referred to as: DSP), dedicated collection
At circuit (English: application-specific integrated circuit, abbreviation: ASIC), field-programmable gate array
Column (English: field programmable gate array, referred to as: FPGA) or other programmable logic device, transistor
Logical device, hardware component or any combination thereof.It, which may be implemented or executes, combines described in present disclosure respectively
The illustrative logic block of kind, module and circuit.Processor be also possible to realize computing function combination, such as comprising one or
Multi-microprocessor combination, DSP and the combination of microprocessor etc..Transceiver 202 can be communication interface, transmission circuit etc.,
Wherein, communication interface is to be referred to as, and may include connecing between one or more interfaces, such as block chain node device and terminal
Mouthful.
Optionally, block chain node device 200 can also include bus 204.Wherein, memory 201, transceiver 202 with
And processor 203 can be connected with each other by bus 204;Bus 204 can be Peripheral Component Interconnect standard (English:
Peripheral component interconnect, referred to as: PCI) bus or expanding the industrial standard structure (English:
Extended industry standard architecture, referred to as: EISA) bus etc..Bus 204 can be divided into address
Bus, data/address bus, control bus etc..Only to be indicated with a thick line in Fig. 2, it is not intended that only one convenient for indicating
Bus or a type of bus.
Other than memory 201 shown in Fig. 2, transceiver 202, processor 203 and above-mentioned bus 204, embodiment
Middle block chain node device 200 can also include other hardware, to this generally according to the actual functional capability of the block chain node device
It repeats no more.
Fig. 3 is referred to, Fig. 3 is a kind of hardware structural diagram of server 300 provided by the embodiments of the present application, the service
The function of database server in block chain date storage method provided in an embodiment of the present invention, server 300 may be implemented in device
It include: memory 301, transceiver 302 and the processor 303 coupled with the memory 301 and transceiver 302.Memory 301
For storing computer program, the computer program includes program instruction, and processor 303 is for executing the storage of memory 301
Program instruction, transceiver 302 under the control of processor 303 with other equipment for being communicated.When processor 303 is being held
When row instruction block chain date storage method can be executed according to program instruction.
Wherein, processor 303 can be central processing unit (English: central processing unit, referred to as:
CPU), general processor, digital signal processor (English: digital signal processor, referred to as: DSP), dedicated collection
At circuit (English: application-specific integrated circuit, abbreviation: ASIC), field-programmable gate array
Column (English: field programmable gate array, referred to as: FPGA) or other programmable logic device, transistor
Logical device, hardware component or any combination thereof.It, which may be implemented or executes, combines described in present disclosure respectively
The illustrative logic block of kind, module and circuit.Processor be also possible to realize computing function combination, such as comprising one or
Multi-microprocessor combination, DSP and the combination of microprocessor etc..Transceiver 302 can be communication interface, transmission circuit etc.,
Wherein, communication interface is to be referred to as, and may include connecing between one or more interfaces, such as server and block chain node device
Mouthful.
Optionally, server 300 can also include bus 304.Wherein, memory 301, transceiver 302 and processor
303 can be connected with each other by bus 304;Bus 304 can be Peripheral Component Interconnect standard (English: peripheral
Component interconnect, referred to as: PCI) bus or expanding the industrial standard structure (English: extended industry
Standard architecture, referred to as: EISA) bus etc..Bus 304 can be divided into address bus, data/address bus, control
Bus etc..Only to be indicated with a thick line in Fig. 3 convenient for indicating, it is not intended that an only bus or a type of total
Line.
Other than memory 301 shown in Fig. 3, transceiver 302, processor 303 and above-mentioned bus 304, embodiment
Middle server 300 can also include other hardware, repeat no more to this generally according to the actual functional capability of the server.
Under above-mentioned running environment, the embodiment of the present application provides a kind of block chain date storage method, referring to Fig. 4,
Fig. 4 is a kind of flow diagram of block chain date storage method provided by the embodiments of the present application, as shown in figure 4, this method has
Body includes:
S401, the first common recognition node receive the first transaction request.
Optionally, the first transaction request includes the digital signature and the first transaction request of the initiator of the first transaction request
Essential information, the essential information of the first transaction request include the corresponding transaction serial number of the first transaction request and the first transaction request
Type of transaction.
The digital signature of the initiator of first transaction request is the initiator by the first transaction request using after private key encryption
Summary info, the digital signature of the initiator of the first transaction request is used to show the legitimacy of the first transaction request.It is specific next
It says, on the one hand digital signature can be used for determining that Transaction Information is strictly to be signed and issued by sender, because other people can not
Palm off the signature of sender;On the other hand it can also be used in the integrality for determining message, because being that it is represented the characteristics of digital signature
The feature of file, file is in case of changing, and the value of digital digest will also change, and different files will obtain different
Digital digest.
It is appreciated that can carry out various types of transaction based on block chain technology, the embodiment of the present application is not limited specifically
It is fixed.For example, the type of transaction that can be carried out transfers accounts, supplements with money, manages money matters and withdraws deposit for the user of bank.
Optionally, there is spy according to trading order and scheduled coding rule for same type of transaction in block chain
Fixed transaction serial number, for scheduled coding rule, the embodiment of the present application is not especially limited.
Optionally, the essential information of first transaction request in addition to include the corresponding transaction serial number of the first transaction request with
The type of transaction of first transaction request further includes the relevant information of other first transaction requests.For example, the first transaction is asked
The transfer request that the user for bank is initiated by terminal device is sought, then the essential information of first transaction can also include being somebody's turn to do
The account information of user, the account information of beneficiary and transaction amount.
It is appreciated that the particular content of the essential information of the first transaction request is different for different type of transaction,
The embodiment of the present application is not especially limited.
For example, the first common recognition node receives the transaction request that user A is initiated by terminal device, which is
User A requests to transfer accounts to user B 1000 yuan, and the digital signature in the transaction request comprising user A is basic with the transaction request
Information, the essential information of the transaction request include the corresponding transaction serial number of the transaction request, the type of transaction of the transaction request, use
The transaction amount of the account of family A and user B and the transaction request, the wherein corresponding transaction serial number H5 of the transaction request, the friendship
The type of transaction easily requested is to transfer accounts, and the transaction amount of the transaction request is 1000 yuan.
The legitimacy of S402, first common recognition the first transaction request of node verification, if the first transaction request meets legitimacy,
Execute step S403.
Optionally, the legitimacy of first common recognition the first transaction request of node verification, specifically includes the following steps:
S1, first common recognition the first transaction request of node verification initiator digital signature it is whether correct.
It is appreciated that others the number of segment word that can not forge that the sender that digital signature is only information could generate
String, this number of segment word string are also the valid certificates that information authenticity is sent to the sender of information simultaneously.
If the digital signature of the initiator of S2, the first transaction request is that correctly, the first common recognition querying node first is traded
The historical record of request.
S3, the first common recognition node judge the essential information of first transaction request according to the historical record of the first transaction request
Legitimacy.
Optionally, whether the digital signature of the initiator of the first transaction request described in the first common recognition node verification is correct, tool
Body includes: the first common recognition node using the public key of the initiator of the first transaction request to the number of the initiator of the first transaction request
Signature is decrypted, and obtains the first summary info.One the is generated to the essential information of the first transaction request using HASH function
Two summary infos.First summary info and the second summary info are compared, if they are the same, then illustrate the hair of the first transaction request
The digital signature for playing side is that correctly, the information that the first common recognition node receives is completely, not modified in transmission process,
Otherwise illustrate the initiator of the first transaction request digital signature be it is incorrect, it is legal that first transaction request is unsatisfactory for
Property.
Optionally, the historical record of first common recognition the first transaction request of querying node, specifically includes the following steps: first is total
Know the historical record that node inquires the first transaction request from the local data base of the first common recognition node.If from the first common recognition node
Local data base in do not inquire the historical record of the first transaction request, then the first common recognition node is sent to database server
5th inquiry request, the 5th inquiry transaction request are used to inquire the history of the first transaction request in above-mentioned database server
Record.First common recognition section receives the historical record for the first transaction request that database server is sent.
Optionally, the first common recognition node judges the basic letter of the first transaction request according to the historical record of the first transaction request
The legitimacy of breath specifically includes: the first common recognition node verifies the ginseng of the first transaction request according to the historical record of the first transaction request
It whether is legitimate user with side.If the participant of the first transaction request is legitimate user, the first common recognition node is handed over according to first
Whether the transaction serial number that the historical record easily requested verifies the first transaction request is correct.If the transaction serial number of the first transaction request is
Correctly, then first common recognition node according to the historical record of the first transaction request verify the first transaction request participant account
Whether information meets terms of trade, if the account information of the participant of the first transaction request meets terms of trade, the first transaction
The essential information of request meets legitimacy.
It is appreciated that the first transaction request is illegal if the participant of the first transaction request is not legitimate user.
If the transaction serial number of the first transaction does not meet scheduled coding rule and number order, the first transaction request is illegal.
If the account information of the participant of the first transaction request is unsatisfactory for terms of trade, the first transaction request is illegal.
For example, the first common recognition node receives the transaction request that user A is initiated by terminal device, which is
User A requests to transfer accounts to user B 1000 yuan, and the digital signature in the transaction request comprising user A is basic with the transaction request
Information, the essential information of the transaction request include the corresponding transaction serial number of the transaction request, the type of transaction of the transaction request, use
The transaction amount of the account of family A and user B and the transaction request, the wherein corresponding transaction serial number H5 of the transaction request, the friendship
The type of transaction easily requested is to transfer accounts, and the transaction amount of the transaction request is 1000 yuan.First common recognition querying node transaction is asked
The historical record asked, the historical record of the transaction request includes the historical record of user A and user B, according to the transaction request
Historical record judges the legitimacy of the essential information of the first transaction request, specifically includes: according to the historical record of the transaction request
Verify whether user A and user B is legitimate user.If user A and user B are legitimate users, according to the first transaction request
Whether historical record verifying H5 is correct transaction serial number.If correct, verified and used according to the historical record of the first transaction request
Whether the account balance of family A is more than or equal to the transaction amount of the transaction request, if more than then the essential information of the transaction request is full
Sufficient legitimacy.For example, the account balance of user A is 1001 yuan, it is greater than 1000 yuan, it is sufficient to support the implementation of the transaction request.
S403, the first common recognition node send the first transaction request to accounting nodes, and accounting nodes receive the first transaction request.
As shown in Figure 1, current accounting nodes are also one of the common recognition node in block chain data-storage system.The book keeping operation
Node is the node chosen by all common recognition nodes in block chain data-storage system based on common recognition mechanism, and accounting nodes are used for
All Activity in current billing cycle is packaged into block, and the block is written to the block chain account book of database server
In, block chain account book is used to save the complete block chain data of the block chain data-storage system.Billing cycle is to set in advance
The time cycle set, for example, billing cycle is 10 minutes.Common recognition mechanism be common recognition node with regard to block information reach the whole network unanimously altogether
The mechanism of knowledge, it is ensured that newest block is accurately added to block chain, it is ensured that the block chain information of common recognition node storage
Consistent not bifurcated, it might even be possible to resist malicious attack.Common recognition mechanism mentioned in the embodiment of the present application can be practical visit and account for
Front yard tolerant fail algorithm (English: Practical Byzantine Fault Tolerance, english abbreviation: PBFT), is also possible to
Raft agreement common recognition mechanism, the application do not limit this.
The legitimacy that S404, accounting nodes verify the first transaction request executes if the first transaction request meets legitimacy
Step S405.
Optionally, accounting nodes verify the legitimacy of the first transaction request, specifically includes the following steps:
Whether the digital signature for the initiator that T1, accounting nodes verify the first transaction request is correct.
If the digital signature of the initiator of T2, the first transaction request is that correctly, the first transaction of accounting nodes inquiry is asked
The historical record asked.
T3, accounting nodes according to the historical record of the first transaction request judge the first transaction request essential information it is legal
Property.
Optionally, accounting nodes inquire the first transaction request historical record, specifically includes the following steps: accounting nodes from
The historical record of the first transaction request is inquired in the local data base of accounting nodes.If from the local data base of accounting nodes not
Inquire the historical record of the first transaction request, then accounting nodes to database server send the 6th inquiry request, the 6th
Inquiry transaction request is used to inquire the historical record of the first transaction request in above-mentioned database server.Accounting nodes receive number
According to the historical record for the first transaction request that library server is sent.
Optionally, accounting nodes judge the essential information of first transaction request according to the historical record of the first transaction request
Legitimacy specifically includes: accounting nodes according to the historical record of the first transaction request verify the first transaction request participant whether
For legitimate user.If the participant of the first transaction request is legitimate user, accounting nodes are according to the history of the first transaction request
Whether the transaction serial number of record the first transaction request of verifying is correct.If the transaction serial number of the first transaction request is correctly, to remember
Account node verifies the first transaction request with the presence or absence of transaction honeysuckle according to the historical record of first transaction request.If first hands over
Easily request is there is no transaction honeysuckle, then accounting nodes verify the ginseng of the first transaction request according to the historical record of the first transaction request
Whether meet terms of trade with the account information of side, if the account information of the participant of the first transaction request meets terms of trade,
Then the essential information of the first transaction request meets legitimacy.
Above-mentioned transaction honeysuckle refers to: if user A first initiates a transaction using assets a, before the transaction is identified,
Be exactly the exchange the transaction of this period be not also packaged into block when, user A utilizes assets a to initiate second again
Transaction.
S405, at the end of the first billing cycle, accounting nodes by first transaction be encapsulated into the first block.
First block includes the All Activity in the block head and the first billing cycle of the first block.The block of first block
Head includes upper block cryptographic Hash, timestamp, version number and merkle root.
The block head of first block is stored the local data base to accounting nodes by S406, accounting nodes.
Optionally, the block head of the first block is charged to the block chain in the local data base of accounting nodes by accounting nodes
On.
Optionally, accounting nodes charge to the first block on the block chain in the local data base of accounting nodes.
It is appreciated that the block head or the first block of the first block of preservation of the accounting nodes property of can choose, accounting nodes
Local data base in save the Partial Block chain data of block chain data-storage system.
Optionally, when the local data base low memory of accounting nodes, in the deletion Partial Block for the property of can choose
Transaction Information only retains the block head of this Partial Block.
S407, accounting nodes send the first block to the first common recognition node, and the first common recognition node receives the first block.
Accounting nodes broadcast the first block, all nodes and database server in block chain data-storage system
Receive the first block.
The block head of first block is stored the local data base to the first common recognition node by S408, the first common recognition node.
Optionally, the first common recognition node is charged to the block head of the first block in the local data base of the first common recognition node
On block chain.
Optionally, the first block is charged to the block chain in the local data base of the first common recognition node by the first common recognition node
On.
It is appreciated that the block head or the first block of the first block of preservation of the first common recognition node property of can choose, first
The Partial Block chain data of block chain data-storage system are saved in the local data base of common recognition node.
Optionally, when the local data base low memory of the first common recognition node, the deletion Partial Block for the property of can choose
Interior Transaction Information only retains the block head of this Partial Block.
S409, accounting nodes send the first block to database server, and database server receives the first block.
First block is charged to block chain account book by S410, database server.
It is appreciated that having recorded the complete block chain data of block chain data-storage system in block chain account book.
Optionally, database server uses master-slave database structure, i.e., includes 1 master in block chain data-storage system
Database server and K backup database server.Main database server and K backup database server save
State the complete block chain data of block chain data-storage system.It is that main database server is avoided to occur in the embodiment of the present application
Read operation and write operation can be separated on different database servers by performance bottleneck, and therefore, main database server carries out
When write operation, the query performance for inquiring application server is not influenced.Using this master-slave database structure, it is ensured that block chain
Data in data-storage system possess multiple disaster tolerance copies, and the safety of data can be improved.When main database server failure
When, other servers can be immediately switched to, the availability of system is improved.
In the embodiment of the present application without limitation to the implementation sequence of S407 and S409.
In the embodiment of the present application, the block head of the first block is stored to the first common recognition node by the first common recognition node
Local data base stores block head in the local data base of the first common recognition node, relative to storing complete block data, energy
It enough effectively reduces block chain data and occupies space in common recognition node local memory.In addition, although the local of the first common recognition node
Partial Block chain data are only stored in database, but by the scheme in the embodiment of the present application, the first common recognition node still has
The function of standby verifying transaction request legitimacy.The application is arrived the block head storage of the first block by accounting nodes in implementing
The local data base of accounting nodes stores block head in the local data base of accounting nodes, relative to storing complete block
Data can effectively reduce block chain data in accounting nodes local memory and occupy space.In addition, although the sheet of accounting nodes
Partial Block chain data are only stored in ground database, but by the scheme in the embodiment of the present application, accounting nodes still have
Verify the function of transaction request legitimacy.First block is charged to block chain account by database server in implementing by the application
This, saves complete block chain data in database server, ensure that the block chain data of block chain data-storage system
Integrality.
Optionally, as shown in figure 5, above-mentioned block chain date storage method further include:
S411, the first common recognition node receive the first inquiry request, and the first inquiry request is for inquiring the second transaction.
Optionally, the initiator of the first inquiry request can be any node in block chain data-storage system, can also
To be the terminal device for accessing the block chain data-storage system.
Optionally, the transaction serial number comprising the second transaction in the first inquiry request.
It optionally, include the timestamp of the second transaction and the transaction serial number that second trades in the first inquiry request.
S412, the first common recognition node the second transaction of inquiry from the local data base of the first common recognition node, if not inquiring
Second transaction, thens follow the steps S413.
Optionally, the transaction serial number comprising the second transaction in the first inquiry request, the first common recognition node is according to the second transaction
Transaction serial number from first common recognition node local data base in inquiry second transaction.
Optionally, the transaction serial number of the timestamp comprising the second transaction in the first inquiry request and the second transaction.First is total
Know node according to second transaction timestamp position in the local database the second exchange the second block, according to second hand over
Easy transaction serial number inquires the second transaction from above-mentioned second block.
If being appreciated that, the second exchange includes block head in block, does not include transaction data, then the first common recognition node root
The second transaction cannot be inquired from above-mentioned second block according to the transaction serial number of the second transaction.
Optionally, if inquiring the second transaction, the first common recognition node sends first to the initiator of the first inquiry request
The query result of inquiry request, if not inquiring the second transaction, the first common recognition node executes step S413.
S413, the first common recognition node send the second inquiry request to database server, and the second inquiry request is for inquiring
Second transaction, database server receive the second inquiry request.
Optionally, the first common recognition node sends the block head of the second inquiry request and the second block to database server,
Database server receives the block head of the first inquiry request and the second block.
S414, the second transaction of database server inquiry.
Optionally, database server receives the second inquiry request, the transaction comprising the second transaction in the second inquiry request
Serial number.Database server inquires second from the block chain account book in database server according to the transaction serial number of the second transaction
Transaction.
Optionally, database server receives the second inquiry request, the time comprising the second transaction in the second inquiry request
The transaction serial number of stamp and the second transaction, database server position second on block chain account book according to the timestamp of the second transaction
Exchange third block, then, according to second transaction transaction serial number inquire from above-mentioned third block second trade.
Optionally, database server receives the block head of the second inquiry request and the second block, in the second inquiry request
The transaction serial number of timestamp comprising the second transaction and the second transaction.Database server searches the secondth area on block chain account book
Then the corresponding third block of the block head of block inquires the second transaction according to the transaction serial number of the second transaction in third block.
S415, database server send the query result of the second inquiry request, the first common recognition section to the first common recognition node
Point receives the query result of the second inquiry request.
Optionally, the query result of above-mentioned second inquiry request includes the data and the second transaction of complete second transaction
Verify path.
Optionally, the first common recognition node carries out the verifying path of the second transaction according to the block chain data of local data base
Verifying shows that third transaction is necessary being if the verifying path of the second transaction is correct.
It is appreciated that the first common recognition node saves the block head of all blocks of block chain account book, therefore, the first common recognition
Node can verify the verifying path of the second transaction.
During the application is implemented, the first block is charged to by block chain account book by database server, in database server
Complete block chain data are saved, ensure that the integrality of the block chain data of block chain data-storage system, therefore, data
Library server can be realized Transaction Inquiries function, to provide query service for common recognition node.In the embodiment of the present application, although the
Partial Block chain data are only stored in the local data base of one common recognition node, but pass through the scheme in the embodiment of the present application, the
One common recognition node still has Transaction Inquiries function.
Optionally, as shown in fig. 6, above-mentioned block chain date storage method further include:
S416, accounting nodes receive third inquiry request, and third inquiry request is for inquiring third transaction.
Optionally, the initiator of third inquiry request can be any node in block chain data-storage system, can also
To be the terminal device for accessing the block chain data-storage system.
Optionally, the transaction serial number comprising third transaction in third inquiry request.
It optionally, include the timestamp of third transaction and the transaction serial number that third is traded in third inquiry request.
S417, accounting nodes inquire third transaction from the local data base of accounting nodes, if not inquiring third transaction,
Then follow the steps S418.
Optionally, the transaction serial number comprising third transaction in third inquiry request, the friendship that accounting nodes are traded according to third
Easy serial number inquires third transaction from the local data base of accounting nodes.
Optionally, the transaction serial number of the timestamp comprising third transaction in third inquiry request and third transaction.Book keeping operation section
Timestamp trade according to third of point position in the local database third exchange the 4th block, traded according to third
Transaction serial number inquires third transaction from above-mentioned 4th block.
If being appreciated that, third exchange in block includes block head, does not include transaction data, then accounting nodes are according to the
The transaction serial number of three transaction cannot inquire third transaction from above-mentioned 4th block.
Optionally, if inquiring third transaction, accounting nodes send third inquiry to the initiator of third inquiry request
The query result of request, if not inquiring third transaction, accounting nodes execute step S418.
S418, accounting nodes send the 4th inquiry request to database server, and database server receives the 4th inquiry
Request.
Optionally, accounting nodes send the block head of the 4th inquiry request and the 4th block, data to database server
Library server receives the block head of the 4th inquiry request and the 4th block.
S419, database server inquiry third transaction.
Optionally, database server receives the 4th inquiry request, the transaction comprising third transaction in the 4th inquiry request
Serial number.The transaction serial number that database server is traded according to third inquires third from the block chain account book in database server
Transaction.
Optionally, database server receives the 4th inquiry request, the time comprising third transaction in the 4th inquiry request
The transaction serial number of stamp and third transaction, the timestamp that database server is traded according to third position third on block chain account book
Exchange the 5th block, then, according to third trade transaction serial number inquire from above-mentioned 5th block third trade.
Optionally, database server receives the block head of the 4th inquiry request and the 4th block, in the 4th inquiry request
The transaction serial number of timestamp comprising third transaction and third transaction.Database server searches the 4th area on block chain account book
Then corresponding 5th block of the block head of block inquires third transaction according to the transaction serial number that third is traded in the 5th block.
S420, database server send the query result of the 4th inquiry request to accounting nodes.
Optionally, the query result of above-mentioned 4th inquiry request includes that the data of complete third transaction and third are traded
Verify path.
Optionally, accounting nodes test the verifying path that third is traded according to the block chain data of local data base
Card shows that third transaction is necessary being if the verifying path of third transaction is correct.
It is appreciated that accounting nodes save the block head of all blocks of block chain account book, therefore, accounting nodes can be with
The verifying path of third transaction is verified.
In the embodiment of the present application without limitation to the implementation sequence of S411 and S416.
During the application is implemented, the first block is charged to by block chain account book by database server, in database server
Complete block chain data are saved, ensure that the integrality of the block chain data of block chain data-storage system, therefore, data
Library server can be realized Transaction Inquiries function, to provide query service for accounting nodes.During the application is implemented, although book keeping operation
Partial Block chain data are only stored in the local data base of node, but pass through the scheme in the embodiment of the present application, accounting nodes
Still has Transaction Inquiries function.
Referring to Fig. 7, Fig. 7 is a kind of structural representation of block chain data storage device 700 provided by the embodiments of the present application
Figure, the device are able to achieve the function of the first common recognition node in above-mentioned block chain date storage method.Wherein, the function of the device can
Corresponding software realization can also be executed by hardware by hardware realization.The hardware or software include at least one with
The corresponding module of above-mentioned function.
Optionally, which includes the first receiving unit 701, the first authentication unit 703, the first transmission unit 703 and the
One storage unit 704.
First receiving unit 701, for receiving the first transaction request.
First authentication unit 702, for verifying the legitimacy of first transaction request.
First transmission unit 703 sends institute to accounting nodes if meeting legitimacy for first transaction request
State the first transaction request.
First receiving unit 701, is also used to receive the first block that the accounting nodes are sent, first block according to
First transaction request generates.
First storage unit 704, for storing the block head of first block.
Optionally, block chain data storage device 700 further include:
First receiving unit 701 is also used to receive the first inquiry request, and the first inquiry request is for inquiring the second transaction.
Second query unit, for the second transaction of inquiry from the local data base of block chain data storage device 700.
First transmission unit 703, if being also used to not inquire from the local data base of block chain data storage device 400
Second transaction then sends the second inquiry request to database server, and the second inquiry request is for inquiring the second transaction.
First receiving unit 701 is also used to receive the query result of the second inquiry request of database server transmission.
Optionally, the first transaction request includes: the digital signature and the first transaction request of the initiator of the first transaction request
Essential information, the essential information of above-mentioned first transaction request includes that the corresponding transaction serial number of the first transaction request and first are traded
The type of transaction of request.
Optionally, above-mentioned first authentication unit specifically includes 702: third authentication unit, third query unit and judgement are single
Member.
Whether third authentication unit, the digital signature for verifying the first transaction request initiator are correct.
Third query unit, if the digital signature for the first transaction request initiator is that correctly, inquiry first is handed over
The historical record easily requested.
Judging unit, the conjunction of the essential information for judging the first transaction request according to the historical record of the first transaction request
Method.
Referring to Fig. 8, Fig. 8 is a kind of structural representation of block chain data storage device 800 provided by the embodiments of the present application
Figure, the device are able to achieve the function of accounting nodes in above-mentioned block chain date storage method.Wherein, the function of the device can lead to
Hardware realization is crossed, corresponding software realization can also be executed by hardware.The hardware or software include at least one with it is above-mentioned
The corresponding module of function.
Optionally, which includes the second receiving unit 801, the second authentication unit 802, the storage of encapsulation unit 803, second
Unit 804 and the second transmission unit 805.
Second receiving unit 801, the first transaction request sent for receiving the first common recognition node.
Second authentication unit 802, for verifying the legitimacy of the first transaction request.
Encapsulation unit 803, if meeting legitimacy for the first transaction request, at the end of the first billing cycle, by
One transaction request is encapsulated into the first block
Second storage unit 804, for storing the block head of the first block.
Second transmission unit 805 sends for broadcasting the first block, and to the first common recognition node and database server
One block.
Optionally, block chain data storage device 800 further include:
Second receiving unit 801 is also used to receive third inquiry request, and third inquiry request is for inquiring third transaction.
4th query unit, for inquiring third transaction from the local data base of block chain data storage device 800.
Second transmission unit 805, if being also used to not inquire from the local data base of block chain data storage device 800
Third transaction then sends the 4th inquiry request to database server, and the 4th inquiry request is for inquiring third transaction.
Second receiving unit 801 is also used to receive the query result of the 4th inquiry request of database server transmission.
Referring to Fig. 9, Fig. 9 is a kind of structural representation of block chain data storage device 700 provided by the embodiments of the present application
Figure, the device are able to achieve the function of database server in above-mentioned block chain date storage method.Wherein, the function of the device can
Corresponding software realization can also be executed by hardware by hardware realization.The hardware or software include at least one with
The corresponding module of above-mentioned function.
Optionally, which includes third receiving unit 901, third storage unit 902, the first query unit 903 and
Three transmission units 904.
Third receiving unit 901, for receiving the first block of accounting nodes transmission.
Third storage unit 902, for the first block to be charged to block chain account book.
Third receiving unit 901 is also used to receive the second inquiry request of the first common recognition node transmission, the second inquiry request
For inquiring the second transaction.
First query unit 903, for inquiring the second transaction.
Third transmission unit 904, for sending the query result of the second inquiry request to the first common recognition node.
Alternatively, third receiving unit 901, is also used to receive the 4th inquiry request of accounting nodes transmission, the 4th inquiry is asked
It asks for inquiring third transaction.
First query unit 903, for inquiring third transaction.
Third transmission unit 904, for sending the query result of the 4th inquiry request to accounting nodes.
The step of method in conjunction with described in the embodiment of the present application disclosure or algorithm, can be come real in a manner of hardware
It is existing, it is also possible to execute the mode of software instruction by processor to realize.Software instruction can be made of corresponding software unit,
Software unit can be stored on random access memory (English: random access memory, referred to as: RAM), flash memory,
Read-only memory (English: read only memory, referred to as: ROM), Erasable Programmable Read Only Memory EPROM (English:
Erasable programmable rom, referred to as: EPROM), Electrically Erasable Programmable Read-Only Memory (English:
Electrically eprom, referred to as: EEPROM), register, hard disk, mobile hard disk, CD-ROM (CD-ROM) or ability
In the storage medium of any other form known to domain.A kind of illustrative storage medium is coupled to processor, to make to handle
Device can be from the read information, and information can be written to the storage medium.Certainly, storage medium is also possible to handle
The component part of device.Pocessor and storage media can be located in ASIC.In addition, the ASIC can be located in the network equipment.When
So, pocessor and storage media can also be used as discrete assembly and be present in the network equipment.
Those skilled in the art it will be appreciated that in said one or multiple examples, retouched by the embodiment of the present application
The function of stating can be realized with hardware, software, firmware or their any combination.It when implemented in software, can be by this
A little functions storages in computer-readable medium or as on computer-readable medium one or more instructions or code into
Row transmission.Computer-readable medium includes computer storage media and communication media, and wherein communication media includes convenient for from one
Any medium of the place to another place transmission computer program.Storage medium can be general or specialized computer and can deposit
Any usable medium taken.
Above-described specific embodiment carries out the purpose of the embodiment of the present application, technical scheme and beneficial effects
It is further described, it should be understood that the foregoing is merely the specific embodiments of the embodiment of the present application, and does not have to
In limit the embodiment of the present application protection scope, it is all on the basis of the technical solution of the embodiment of the present application, done it is any
Modification, equivalent replacement, improvement etc. should all include within the protection scope of the embodiment of the present application.
Claims (10)
1. a kind of block chain date storage method, which is characterized in that the described method includes:
First common recognition node receives the first transaction request;
The legitimacy of first transaction request described in the first common recognition node verification;
If first transaction request meets legitimacy, the first common recognition node sends first transaction to accounting nodes
Request;
The first common recognition node receives the first block that the accounting nodes are sent, and first block is saved by the book keeping operation
What point was generated according to first transaction request;
The block head of first block is stored the local data base to the first common recognition node by the first common recognition node.
2. the method according to claim 1, wherein the method also includes:
The first common recognition node receives the first inquiry request, and first inquiry request is for inquiring the second transaction;
The first common recognition node inquires second transaction from the local data base of the first common recognition node;
If the first common recognition node does not inquire second transaction from the local data base of the first common recognition node,
The second inquiry request is sent to database server, second inquiry request is for inquiring second transaction;
The first common recognition node receives the query result for second inquiry request that database server is sent.
3. the method according to any one of claims 1 and 2, which is characterized in that first transaction request, comprising:
The essential information of the digital signature of the initiator of first transaction request and first transaction request, described first hands over
The essential information easily requested includes the transaction class of the corresponding transaction serial number and first transaction request of first transaction request
Type.
4. according to the method described in claim 3, it is characterized in that, the first transaction request described in the first common recognition node verification
Legitimacy, specifically include:
Whether the digital signature of the first transaction request initiator described in the first common recognition node verification is correct;
If correct, the historical record of first transaction request is inquired;
The legitimacy of the essential information of first transaction request is judged according to the historical record of first transaction request.
5. a kind of block chain date storage method, which is characterized in that the described method includes:
Accounting nodes receive the first transaction request that the first common recognition node is sent;
The accounting nodes verify the legitimacy of first transaction request;
If first transaction request meets legitimacy, at the end of the first billing cycle, the accounting nodes are by described
One transaction is encapsulated into the first block;
The block head of first block is stored the local data base to the accounting nodes by the accounting nodes;
The accounting nodes send first block to the first common recognition node and database server.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
The accounting nodes receive third inquiry request, and the third inquiry request is for inquiring third transaction;
The accounting nodes inquire the third transaction from the local data base of the accounting nodes;
If the accounting nodes do not inquire the third transaction from the local data base of the accounting nodes, to database
Server sends the 4th inquiry request, and the 4th inquiry request is for inquiring the third transaction;
The accounting nodes receive the query result for the 4th inquiry request that database server is sent.
7. a kind of block chain date storage method, which is characterized in that the described method includes:
Database server receives the first block that accounting nodes are sent;
First block is charged to block chain account book by database server;
Database server receives the second inquiry request that the first common recognition node is sent, and second inquiry request is for inquiring the
Two transaction;
Database server inquiry second transaction;
Database server sends the query result of second inquiry request to the first common recognition node;
Alternatively, database server receives the 4th inquiry request that accounting nodes are sent, the 4th inquiry request is for inquiring
Third transaction;
Database server inquires the third transaction;
Database server sends the query result of the 4th inquiry request to the accounting nodes.
8. a kind of common recognition node characterized by comprising
Processor, memory, transceiver and bus;The processor, the memory and the transceiver pass through the bus
It connects and completes mutual communication;The memory stores executable program code;The processor described in reading by depositing
The executable program code stored in reservoir runs program corresponding with the executable program code, to be used for perform claim
It is required that 1 to 4 described in any item block chain date storage methods.
9. a kind of accounting nodes characterized by comprising
Processor, memory, transceiver and bus;The processor, the memory and the transceiver pass through the bus
It connects and completes mutual communication;The memory stores executable program code;The processor described in reading by depositing
The executable program code stored in reservoir runs program corresponding with the executable program code, to be used for perform claim
It is required that 5 to 6 described in any item block chain date storage methods.
10. a kind of database server characterized by comprising
Processor, memory, transceiver and bus;The processor, the memory and the transceiver pass through the bus
It connects and completes mutual communication;The memory stores executable program code;The processor described in reading by depositing
The executable program code stored in reservoir runs program corresponding with the executable program code, to be used for perform claim
It is required that block chain date storage method described in 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811464549.0A CN109726229B (en) | 2018-11-30 | 2018-11-30 | Block chain data storage method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811464549.0A CN109726229B (en) | 2018-11-30 | 2018-11-30 | Block chain data storage method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109726229A true CN109726229A (en) | 2019-05-07 |
CN109726229B CN109726229B (en) | 2023-10-10 |
Family
ID=66295154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811464549.0A Active CN109726229B (en) | 2018-11-30 | 2018-11-30 | Block chain data storage method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109726229B (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110096522A (en) * | 2019-05-15 | 2019-08-06 | 西安电子科技大学 | A kind of block chain data processing method, device and equipment for supporting relationship type to retrieve |
CN110309163A (en) * | 2019-06-28 | 2019-10-08 | 杭州复杂美科技有限公司 | Block chain relation type database maintenance method and data query method |
CN110334154A (en) * | 2019-06-28 | 2019-10-15 | 阿里巴巴集团控股有限公司 | Based on the classification storage method and device of block chain, electronic equipment |
CN110473106A (en) * | 2019-08-21 | 2019-11-19 | 腾讯科技(深圳)有限公司 | A kind of method and relevant apparatus of trading processing |
CN110471987A (en) * | 2019-08-09 | 2019-11-19 | 全链通有限公司 | Date storage method, equipment and computer readable storage medium |
CN110535969A (en) * | 2019-09-16 | 2019-12-03 | 腾讯科技(深圳)有限公司 | Date storage method, device, storage medium and equipment based on block chain network |
CN110597835A (en) * | 2019-09-17 | 2019-12-20 | 深圳前海微众银行股份有限公司 | Transaction data deleting method and device based on block chain |
CN111046107A (en) * | 2019-12-19 | 2020-04-21 | 北京中兵智航科技有限公司 | Distributed storage system of airport center data based on block chain technology |
CN111108478A (en) * | 2019-07-11 | 2020-05-05 | 阿里巴巴集团控股有限公司 | Shared blockchain data storage |
WO2019179538A3 (en) * | 2019-07-11 | 2020-05-14 | Alibaba Group Holding Limited | Shared blockchain data storage |
US10789222B2 (en) | 2019-06-28 | 2020-09-29 | Alibaba Group Holding Limited | Blockchain-based hierarchical data storage |
CN112488833A (en) * | 2020-11-24 | 2021-03-12 | 成都质数斯达克科技有限公司 | Transaction processing method and device, electronic equipment and readable storage medium |
CN112527825A (en) * | 2019-09-19 | 2021-03-19 | 上海哔哩哔哩科技有限公司 | Data storage method and device and computer equipment |
CN112561532A (en) * | 2021-01-31 | 2021-03-26 | 刘伟娜 | Block chain-based secure transaction system and method |
US11036720B2 (en) | 2019-06-28 | 2021-06-15 | Advanced New Technologies Co., Ltd. | Blockchain-based hierarchical data storage |
CN113032478A (en) * | 2019-12-24 | 2021-06-25 | 航天信息股份有限公司 | Block chain system and data uplink method, device, equipment and medium |
US11055712B2 (en) | 2019-07-11 | 2021-07-06 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN111818167B (en) * | 2020-07-09 | 2021-09-07 | 广州知弘科技有限公司 | High-security resource transfer method based on block chain |
CN113572620A (en) * | 2021-09-27 | 2021-10-29 | 中邮消费金融有限公司 | On-line voting method and system based on block chain |
WO2022027531A1 (en) * | 2020-08-03 | 2022-02-10 | 西安电子科技大学 | Blockchain construction method and system, and storage medium, computer device and application |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107180350A (en) * | 2017-03-31 | 2017-09-19 | 唐晓领 | A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system |
CN107317672A (en) * | 2017-05-10 | 2017-11-03 | 广东网金控股股份有限公司 | A kind of light weight terminating machine block catenary system |
US20180109516A1 (en) * | 2016-10-13 | 2018-04-19 | Coinplug, Inc. | Method for providing certificate service based on smart contract and server using the same |
WO2018080207A1 (en) * | 2016-10-26 | 2018-05-03 | 주식회사 코인플러그 | Method for issuing currency and making payment by managing balance database for each block in blockchain and server using same |
US20180240114A1 (en) * | 2017-02-22 | 2018-08-23 | Alibaba Group Holding Limited | Transaction verification in a consensus network |
CN108512939A (en) * | 2018-04-17 | 2018-09-07 | 深圳市元征科技股份有限公司 | A kind of block chain common recognition method, apparatus and relevant device |
CN108665359A (en) * | 2017-03-29 | 2018-10-16 | 中国移动通信有限公司研究院 | Block chain processing method, accounting nodes and verification node |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
CN108776929A (en) * | 2018-04-02 | 2018-11-09 | 成都云创智融科技有限公司 | Bill processing method, system based on block chain database and readable storage medium storing program for executing |
CN108805570A (en) * | 2018-06-01 | 2018-11-13 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
-
2018
- 2018-11-30 CN CN201811464549.0A patent/CN109726229B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180109516A1 (en) * | 2016-10-13 | 2018-04-19 | Coinplug, Inc. | Method for providing certificate service based on smart contract and server using the same |
WO2018080207A1 (en) * | 2016-10-26 | 2018-05-03 | 주식회사 코인플러그 | Method for issuing currency and making payment by managing balance database for each block in blockchain and server using same |
US20180240114A1 (en) * | 2017-02-22 | 2018-08-23 | Alibaba Group Holding Limited | Transaction verification in a consensus network |
CN108665359A (en) * | 2017-03-29 | 2018-10-16 | 中国移动通信有限公司研究院 | Block chain processing method, accounting nodes and verification node |
CN107180350A (en) * | 2017-03-31 | 2017-09-19 | 唐晓领 | A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system |
CN107317672A (en) * | 2017-05-10 | 2017-11-03 | 广东网金控股股份有限公司 | A kind of light weight terminating machine block catenary system |
CN108776929A (en) * | 2018-04-02 | 2018-11-09 | 成都云创智融科技有限公司 | Bill processing method, system based on block chain database and readable storage medium storing program for executing |
CN108512939A (en) * | 2018-04-17 | 2018-09-07 | 深圳市元征科技股份有限公司 | A kind of block chain common recognition method, apparatus and relevant device |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
CN108805570A (en) * | 2018-06-01 | 2018-11-13 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
Non-Patent Citations (5)
Title |
---|
于雷;金岩;: "区块链全局账本数据的拆分技术研究", 高技术通讯 * |
翟社平;杨媛媛;张海燕;赵江明;: "区块链中的隐私保护技术", 西安邮电大学学报 * |
闵新平;李庆忠;孔兰菊;张世栋;郑永清;肖宗水;: "许可链多中心动态共识机制", 计算机学报 * |
韩爽;蒲宝明;李顺喜;李相泽;张笑东;王帅;: "区块链技术在数字资产安全交易中的应用", 计算机系统应用 * |
韩爽等: "区块链技术在数字资产安全交易中的应用", 《计算机系统应用》 * |
Cited By (36)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110096522B (en) * | 2019-05-15 | 2023-07-28 | 西安电子科技大学 | Block chain data processing method, device and equipment supporting relational retrieval |
CN110096522A (en) * | 2019-05-15 | 2019-08-06 | 西安电子科技大学 | A kind of block chain data processing method, device and equipment for supporting relationship type to retrieve |
US10789222B2 (en) | 2019-06-28 | 2020-09-29 | Alibaba Group Holding Limited | Blockchain-based hierarchical data storage |
CN110334154B (en) * | 2019-06-28 | 2020-07-21 | 阿里巴巴集团控股有限公司 | Block chain based hierarchical storage method and device and electronic equipment |
US11386054B2 (en) | 2019-06-28 | 2022-07-12 | Advanced New Technologies Co., Ltd. | Blockchain-based hierarchical data storage |
US11042518B2 (en) | 2019-06-28 | 2021-06-22 | Advanced New Technologies Co., Ltd. | Blockchain-based hierarchical data storage |
US11036720B2 (en) | 2019-06-28 | 2021-06-15 | Advanced New Technologies Co., Ltd. | Blockchain-based hierarchical data storage |
CN110309163A (en) * | 2019-06-28 | 2019-10-08 | 杭州复杂美科技有限公司 | Block chain relation type database maintenance method and data query method |
CN110334154A (en) * | 2019-06-28 | 2019-10-15 | 阿里巴巴集团控股有限公司 | Based on the classification storage method and device of block chain, electronic equipment |
CN111108478A (en) * | 2019-07-11 | 2020-05-05 | 阿里巴巴集团控股有限公司 | Shared blockchain data storage |
US10944567B2 (en) | 2019-07-11 | 2021-03-09 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
US10826709B1 (en) | 2019-07-11 | 2020-11-03 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN111837115A (en) * | 2019-07-11 | 2020-10-27 | 创新先进技术有限公司 | Shared blockchain data storage |
US11088849B2 (en) | 2019-07-11 | 2021-08-10 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
WO2019179538A3 (en) * | 2019-07-11 | 2020-05-14 | Alibaba Group Holding Limited | Shared blockchain data storage |
US10892898B2 (en) | 2019-07-11 | 2021-01-12 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
WO2019179539A3 (en) * | 2019-07-11 | 2020-05-14 | Alibaba Group Holding Limited | Shared blockchain data storage |
US11055712B2 (en) | 2019-07-11 | 2021-07-06 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN111108478B (en) * | 2019-07-11 | 2023-11-21 | 创新先进技术有限公司 | Method, system and apparatus for communicating and sharing blockchain data |
US11405219B2 (en) | 2019-07-11 | 2022-08-02 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
US11270308B2 (en) | 2019-07-11 | 2022-03-08 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN110471987A (en) * | 2019-08-09 | 2019-11-19 | 全链通有限公司 | Date storage method, equipment and computer readable storage medium |
CN110473106A (en) * | 2019-08-21 | 2019-11-19 | 腾讯科技(深圳)有限公司 | A kind of method and relevant apparatus of trading processing |
CN110535969A (en) * | 2019-09-16 | 2019-12-03 | 腾讯科技(深圳)有限公司 | Date storage method, device, storage medium and equipment based on block chain network |
CN110597835A (en) * | 2019-09-17 | 2019-12-20 | 深圳前海微众银行股份有限公司 | Transaction data deleting method and device based on block chain |
CN112527825A (en) * | 2019-09-19 | 2021-03-19 | 上海哔哩哔哩科技有限公司 | Data storage method and device and computer equipment |
CN111046107B (en) * | 2019-12-19 | 2023-05-26 | 北京中兵智航科技有限公司 | Distributed storage system based on airport center data of block chain technology |
CN111046107A (en) * | 2019-12-19 | 2020-04-21 | 北京中兵智航科技有限公司 | Distributed storage system of airport center data based on block chain technology |
CN113032478A (en) * | 2019-12-24 | 2021-06-25 | 航天信息股份有限公司 | Block chain system and data uplink method, device, equipment and medium |
CN113032478B (en) * | 2019-12-24 | 2023-10-31 | 航天信息股份有限公司 | Block chain system and data uplink method, device, equipment and medium |
CN111818167B (en) * | 2020-07-09 | 2021-09-07 | 广州知弘科技有限公司 | High-security resource transfer method based on block chain |
WO2022027531A1 (en) * | 2020-08-03 | 2022-02-10 | 西安电子科技大学 | Blockchain construction method and system, and storage medium, computer device and application |
CN112488833A (en) * | 2020-11-24 | 2021-03-12 | 成都质数斯达克科技有限公司 | Transaction processing method and device, electronic equipment and readable storage medium |
CN112561532A (en) * | 2021-01-31 | 2021-03-26 | 刘伟娜 | Block chain-based secure transaction system and method |
CN112561532B (en) * | 2021-01-31 | 2024-04-19 | 云南花伍科技有限公司 | Block chain-based secure transaction system and method |
CN113572620A (en) * | 2021-09-27 | 2021-10-29 | 中邮消费金融有限公司 | On-line voting method and system based on block chain |
Also Published As
Publication number | Publication date |
---|---|
CN109726229B (en) | 2023-10-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109726229A (en) | A kind of block chain date storage method and device | |
CN110442652B (en) | Cross-chain data processing method and device based on block chain | |
Eckey et al. | Optiswap: Fast optimistic fair exchange | |
WO2020082887A1 (en) | Block chain transaction method and apparatus | |
KR102120703B1 (en) | Apparatus for managing group of nodes which comprises transaction of dual signature based on group key on blockchain network and computing apparatus | |
CN110839029B (en) | Micro-service registration method and device | |
EP3779760B1 (en) | Blockchain-based data processing method and apparatus, and electronic device | |
CN112801658B (en) | Cross-border resource transfer authenticity auditing method and device and electronic equipment | |
CN109003185B (en) | Intelligent contract establishing method and device, computing equipment and storage medium | |
JP7319961B2 (en) | Computer-implemented systems and methods related to binary blockchains forming a pair of coupled blockchains | |
CN109102269A (en) | Transfer account method and device, block chain node and storage medium based on block chain | |
CN108647965A (en) | Across chain method of commerce, device, storage medium and electronic equipment | |
Yadav | Blockchain Security | |
US11356258B2 (en) | Methods and systems for distributed cryptographically secured data validation | |
CN108985930A (en) | Information processing method and device, block chain node and storage medium | |
CN113947394A (en) | Block chain-based fair payment method for deletable duplicate data in cloud storage | |
CN110505311A (en) | A kind of across the chain exchange method of isomorphism block chain and system | |
CN105787727A (en) | HCE offline payment system and realization method | |
CN110365711A (en) | Multi-platform user identification relevancy method and device | |
Meijers et al. | Blockchain for v2x: Applications and architectures | |
CN110033367A (en) | Based on the contract record method and device of block chain, electronic equipment | |
CN110619566A (en) | On-chain pledge asset return system and method through on-chain digital currency settlement | |
CN109711821A (en) | A kind of digital wallet transaction, creation method, device and storage medium | |
CN108985933A (en) | A kind of bookkeeping methods and device | |
CN110751483A (en) | Financial accounting and sales rushing method and device based on block chain and electronic 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 |