CN109783569A - A kind of account book recording method, device and terminal device based on block chain - Google Patents
A kind of account book recording method, device and terminal device based on block chain Download PDFInfo
- Publication number
- CN109783569A CN109783569A CN201811488340.8A CN201811488340A CN109783569A CN 109783569 A CN109783569 A CN 109783569A CN 201811488340 A CN201811488340 A CN 201811488340A CN 109783569 A CN109783569 A CN 109783569A
- Authority
- CN
- China
- Prior art keywords
- account book
- node
- block
- accounting nodes
- data
- 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.)
- Pending
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The present invention is suitable for block chain technical field, provides a kind of account book recording method, device and terminal device based on block chain, wherein method includes: the account book data for obtaining non-accounting nodes and sending;Wherein, the account book data include node data, signature and hash;The account book data of all non-accounting nodes are packaged, preset data block is generated;Wherein, the block head of the preset data block includes the hash and timestamp of the hash of a upper preset data block, the preset data block;The block body of the preset data block includes the account book data volume of all node acquisitions in preset time period;The node includes the non-accounting nodes and accounting nodes;Account book block is generated according to the preset data block and the accounting nodes, and is broadcasted to the whole network.The present invention flows out block book keeping operation by node wheel, ensure that the equality between node, reduces the calculation amount in account book record, and improve the efficiency of account book record.
Description
Technical field
The invention belongs to block chain technical field more particularly to a kind of account book recording method based on block chain, device and
Terminal device.
Background technique
In recent years, the application method based on Internet of Things progress account book record is more and more extensive, currently, account book recording method one
As include centralization account book technology or block chain account book.
However, above-mentioned account book recording method is at high cost, computationally intensive, efficiency is lower.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of account book recording method, device and terminals based on block chain to set
Standby, with solution, account book recording method is at high cost in the prior art, computationally intensive, the lower problem of efficiency.
The first aspect of the embodiment of the present invention provides a kind of account book recording method based on block chain, comprising:
Obtain the account book data that non-accounting nodes are sent;Wherein, the account book data include node data, signature and
hash;
The account book data of all non-accounting nodes are packaged, preset data block is generated;Wherein, described default
The block head of data block includes the hash and timestamp of the hash of a upper preset data block, the preset data block;
The block body of the preset data block includes the account book data volume of all node acquisitions in preset time period;The node includes
The non-accounting nodes and accounting nodes;
Account book block is generated according to the preset data block and the accounting nodes, and is broadcasted to the whole network.
Optionally, account book block is generated according to the preset data block and the accounting nodes, and broadcasts it to the whole network
Afterwards, comprising:
Obtain the confirmation message that the node is sent;Wherein, the confirmation message includes the node to the account book area
The confirmation message of the account book data of node described in block;
It is the number for having confirmed that node, and having confirmed that node described in record by the vertex ticks for sending confirmation message;
If the number for having confirmed that node meets the first preset threshold, determine that the account book block confirms successfully.
Optionally, account book block is generated according to the preset data block and the accounting nodes, and broadcasts it to the whole network
Afterwards, further includes:
Obtain the decision error information that the node is sent;
It is error node by the vertex ticks of decision error information is sent, and records the number of the error node;
If the number of the error node meets the second preset threshold, the account book block confirmation failure is determined;
The accounting nodes are piped off, and limit the book keeping operation right of the accounting nodes to pipe off;
Using next node as accounting nodes, the operation for executing and obtaining the account book data that non-accounting nodes are sent is returned.
Optionally, account book block is generated according to the preset data block and the accounting nodes, and broadcasts it to the whole network
Afterwards, further includes:
Detect whether the node of non-return information;Wherein, the information includes confirmation message and decision error information;
The vertex ticks of the non-return information is then to have confirmed that node by the node of the non-return information if it exists,
And the number of node is had confirmed that described in updating.
Optionally, the method also includes:
If network interruption or offline phenomenon occur in the accounting nodes, using next node as accounting nodes, return is held
Row obtains the operation for the account book data that non-accounting nodes are sent.
Optionally, the account book data volume includes data head and data volume, and the data head includes node i d, the data
The hash of body and the signature, the data volume include the account book data of the non-accounting nodes acquisition.
The second aspect of the embodiment of the present invention provides a kind of account book recording device based on block chain, comprising:
First obtains module, the account book data sent for obtaining non-accounting nodes;Wherein, the account book data include section
Point data, signature and hash;
First generation module generates preset data for being packaged the account book data of all non-accounting nodes
Block;Wherein, the block head of the preset data block includes the hash of a upper preset data block, the preset data area
The hash and timestamp of block;The block body of the preset data block includes the account book number of all node acquisitions in preset time period
According to body;The node includes the non-accounting nodes and accounting nodes;
Second generation module is used for according to the preset data block and accounting nodes generation account book block, and to
The whole network broadcast.
The third aspect of the embodiment of the present invention provides a kind of terminal device, comprising: memory, processor and is stored in
In the memory and the computer program that can run on the processor, when the processor executes the computer program
It realizes such as the step of the above method.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
Media storage has computer program, realizes when the computer program is executed by processor such as the step of the above method.
The account book data that the embodiment of the present invention is sent by obtaining non-accounting nodes, and by the account book of all non-accounting nodes
Data are packaged, and preset data block is generated, then according to preset data block and accounting nodes generation account book block, and to
The whole network broadcast realizes the outflow block book keeping operation of the node wheel based on block chain, ensure that the equality between node, reduces account book note
Calculation amount in record, and improve the efficiency of book keeping operation.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the flow diagram for the account book recording method based on block chain that the embodiment of the present invention one provides;
Fig. 2 is the flow diagram of the account book recording method provided by Embodiment 2 of the present invention based on block chain;
Fig. 3 is the flow diagram for the account book recording method based on block chain that the embodiment of the present invention three provides;
Fig. 4 is the flow diagram for the account book recording method based on block chain that the embodiment of the present invention four provides;
Fig. 5 is the structural schematic diagram for the account book recording device based on block chain that the embodiment of the present invention five provides;
Fig. 6 is the schematic diagram for the terminal device that the embodiment of the present invention six provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
As shown in Figure 1, the present embodiment provides a kind of account book recording method based on block chain, this method can be applied to as
The terminal devices such as PC, tablet computer.Account book recording method based on block chain provided by the present embodiment, comprising:
S101, the account book data that non-accounting nodes are sent are obtained;Wherein, the account book data include node data, signature
And hash.
In a particular application, the account book data that all non-accounting nodes are sent on current block chain are obtained, wherein account book number
According to node data, signature and the hash for including the acquisition of non-accounting nodes.
S102, the account book data of all non-accounting nodes are packaged, generate preset data block;Wherein, institute
State preset data block block head include the hash of a upper preset data block, the preset data block hash and when
Between stab;The block body of the preset data block includes the account book data volume of all node acquisitions in preset time period;The section
Point includes the non-accounting nodes and accounting nodes.
In a particular application, the account book data of the non-accounting nodes of all acquisitions are packaged, generate preset data area
Block, wherein the block head of preset data block includes the hash of the hash of a upper preset data block, preset data block
(i.e. the hash of current preset data block) and timestamp, the block body of preset data block include all sections in preset time period
The account book data volume of point acquisition;Node includes non-accounting nodes and accounting nodes.Preset time period can according to the actual situation into
The specific setting of row, for example, setting preset time period is 24 hours.
S103, account book block is generated according to the preset data block and the accounting nodes, and is broadcasted to the whole network.
In a particular application, generate account book block according to preset data block and accounting nodes, and to the node of the whole network into
Row broadcast.In the present embodiment, if the interstitial content on current block chain is more than default interstitial content threshold value, certainty is used
Common recognition algorithm (PBFT/RAFT) carries out the confirmation operation of book keeping operation and account book block, to avoid there is the problem of inefficiency.Its
In, default interstitial content threshold value can specifically be set according to the actual situation, for example, set preset interstitial content threshold value as
10000.
In one embodiment, the method also includes:
If network interruption or offline phenomenon occur in the accounting nodes, using next node as accounting nodes, return is held
Row obtains the operation for the account book data that non-accounting nodes are sent.
In a particular application, if current checkout node occur network interruption, offline phenomenon or other cannot execute book keeping operation
The scene of operation returns then according to next sequential node of node ID sequence as accounting nodes and executes the non-accounting nodes of acquisition
The operation (i.e. step S101) of the account book data of transmission, to execute book keeping operation operation.
In one embodiment, the account book data volume includes data head and data volume, the data head include node i d,
The hash of the data volume and the signature, the data volume include the account book data of the non-accounting nodes acquisition.
In a particular application, account book data volume includes data head and data volume, and data head includes but is not limited to node i d, number
According to the hash and signature of body, data volume includes but is not limited to the account book data of non-accounting nodes acquisition.
The account book data that the present embodiment is sent by obtaining non-accounting nodes, and by the account book data of all non-accounting nodes
It is packaged, generates preset data block, then generate account book block according to preset data block and accounting nodes, and to the whole network
Broadcast realizes the outflow block book keeping operation of the node wheel based on block chain, ensure that the equality between node, reduces in account book record
Calculation amount, and improve the efficiency of book keeping operation.
Embodiment two
As shown in Fig. 2, the present embodiment is the further explanation to the method and step in embodiment one.In the present embodiment,
After step S103, comprising:
S104, the confirmation message that the node is sent is obtained;Wherein, the confirmation message includes the node to the account
The confirmation message of the account book data of node described in this block.
In a particular application, the confirmation message that node is sent on current block chain is obtained, to determine the node reconciliation local area
The account book data of the node are confirmed in block.Wherein, confirmation message includes the account book data of node reconciliation this block interior joint
Confirmation message.
It S105, is to have confirmed that node, and have confirmed that node described in record for the vertex ticks for sending confirmation message
Number;If the number for having confirmed that node meets the first preset threshold, determine that the account book block confirms successfully.
It in a particular application, is to have confirmed that node, and record and have confirmed that node for the vertex ticks for sending confirmation message
Number, if having confirmed that, the number of node meets the first preset threshold, determines that account book block confirms successfully.Wherein, first is default
Threshold value can be set according to the actual situation, for example, setting has confirmed that the number of node reaches the 50% of all interstitial contents, then
Determine that account book block confirms successfully.It should be noted that can be sorted according to node ID next suitable when account book block confirms successfully
Sequence node carries out book keeping operation operation next time as accounting nodes.
The confirmation message that the present embodiment is sent by obtaining node, and be to have confirmed that by the vertex ticks for sending confirmation message
Node has confirmed that and determines that account book block confirms successfully when the number of node meets the first preset threshold, maintains the steady of block chain
It is fixed, effectively increase the accuracy rate of account book.
Embodiment three
As shown in figure 3, the present embodiment is the further explanation to the method and step in embodiment one.In the present embodiment,
After step S103, further includes:
S106, the decision error information that the node is sent is obtained.
In a particular application, the decision error information that node is sent on current block chain is obtained, to know that the node determines
The information of the account book error in data of the node in account book block, wherein decision error information includes that node determines in account book block
The information of the account book error in data of the node.
S107, by the vertex ticks of decision error information is sent it is error node, and records the number of the error node.
It in a particular application, is error node by the vertex ticks for sending decision error information, and misregistration node
Number.
If the number of S108, the error node meets the second preset threshold, the account book block confirmation failure is determined.
In a particular application, if the number of error node meets the second preset threshold, determine the confirmation failure of account book block,
Current accounting nodes book keeping operation failure.Wherein, the second preset threshold can specifically be set according to the actual situation, for example, working as mistake
When the number of node reaches the 50% of all interstitial contents, the confirmation failure of account book block is determined.
S109, the accounting nodes are piped off, and limits the book keeping operation right of the accounting nodes to pipe off.
In a particular application, current accounting nodes are piped off, limits the book keeping operation of the accounting nodes of such as blacklist
Right, to guarantee being normally carried out for book keeping operation operation.
The behaviour of S110, the account book data for sending next node as accounting nodes, the non-accounting nodes of return execution acquisition
Make.
In a particular application, using the next sequential node to be sorted according to node ID as accounting nodes, return executes acquisition
The operation for the account book data that non-accounting nodes are sent, so that next sequential node re-executes book keeping operation operation.
The present embodiment is error node by that will send the vertex ticks of decision error information, and the number of error node meets
The confirmation failure of account book block is determined when the second preset threshold;Accounting nodes are piped off, the book keeping operation to pipe off is limited
The book keeping operation right of node and using next node as accounting nodes, returns and executes book keeping operation operation, improve the pipe to node book keeping operation
Manage effect, ensure that account book information it is fair disclose it is just.
Example IV
As shown in figure 4, the present embodiment is the further explanation to the method and step in embodiment one.In the present embodiment,
After step S103, further includes:
S111, the node for detecting whether non-return information;Wherein, the information includes confirmation message and decision error letter
Breath.
In a particular application, the node for whether having non-return information on current block chain detected, wherein information includes confirmation
Information and decision error information.
The node of S112, the if it exists non-return information, then be to have confirmed that by the vertex ticks of the non-return information
Node, and the number of node is had confirmed that described in update.
In a particular application, the node of non-return information if it exists, then default the node and carried out the section in account book block
The vertex ticks of non-return information is to have confirmed that node, and update and have confirmed that node by the confirmation operation of the account book data of point
Number.
The present embodiment passes through the node for detecting whether non-return information, is to have confirmed that by the vertex ticks of non-return information
Node, and the number for having confirmed that node is updated, it ensure that being normally carried out for account book confirmation operation, avoid and inefficiency occur
Problem.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Embodiment five
As shown in figure 5, the present embodiment provides a kind of account book recording devices 100 based on block chain, for executing embodiment
Method and step in one.Account book recording device 100 provided in this embodiment based on block chain, comprising:
First obtains module 101, the account book data sent for obtaining non-accounting nodes;Wherein, the account book data packet
Include node data, signature and hash;
First generation module 102 generates present count for being packaged the account book data of all non-accounting nodes
According to block;Wherein, the block head of the preset data block includes the hash of a upper preset data block, the preset data
The hash and timestamp of block;The block body of the preset data block includes the account book of all node acquisitions in preset time period
Data volume;The node includes the non-accounting nodes and accounting nodes;
Second generation module 103, for generating account book block according to the preset data block and the accounting nodes, and
It is broadcasted to the whole network.
In one embodiment, described device 100 further include:
Second obtains module, the confirmation message sent for obtaining the node;Wherein, the confirmation message includes described
Confirmation message of the node to the account book data of node described in the account book block;
First mark module, for the vertex ticks for sending confirmation message to be had confirmed that node, and described in record
Have confirmed that the number of node;If the number for having confirmed that node meets the first preset threshold, determine that the account book block is true
Recognize success.
In one embodiment, described device 100 further include:
Third obtains module, the decision error information sent for obtaining the node;
Second mark module, the vertex ticks for that will send decision error information is error node, and records the mistake
The accidentally number of node;
Determination module determines the account book block if the number for the error node meets the second preset threshold
Confirmation failure;
Module is limited, for the accounting nodes to pipe off, and limits the note of the accounting nodes to pipe off
Account right;
First return module obtains what non-accounting nodes were sent for using next node as accounting nodes, returning to execute
The operation of account book data.
In one embodiment, described device 100 further include:
Detection module, for detecting whether there is the node of non-return information;Wherein, the information includes confirmation message and sentences
Determine error message;
Update module, for the node of the non-return information if it exists, then by the vertex ticks of the non-return information
The number of node is had confirmed that have confirmed that node, and described in update.
In one embodiment, described device 100 further include:
Second return module makees next node if there is network interruption or offline phenomenon for the accounting nodes
For accounting nodes, the operation for executing and obtaining the account book data that non-accounting nodes are sent is returned.
In one embodiment, the account book data volume includes data head and data volume, the data head include node i d,
The hash of the data volume and the signature, the data volume include the account book data of the non-accounting nodes acquisition.
The account book data that the present embodiment is sent by obtaining non-accounting nodes, and by the account book data of all non-accounting nodes
It is packaged, generates preset data block, then generate account book block according to preset data block and accounting nodes, and to the whole network
Broadcast realizes the outflow block book keeping operation of the node wheel based on block chain, ensure that the equality between node, reduces in account book record
Calculation amount, and improve the efficiency of book keeping operation.
Embodiment six
Fig. 6 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in fig. 6, the terminal of the embodiment is set
Standby 6 include: processor 60, memory 61 and are stored in the meter that can be run in the memory 61 and on the processor 60
Calculation machine program 62, such as the account book logging program based on block chain.The processor 60 executes real when the computer program 62
Step in existing above-mentioned each account book recording method embodiment based on block chain, such as step S101 to S103 shown in FIG. 1.
Alternatively, the processor 60 realizes the function of each module/unit in above-mentioned each Installation practice when executing the computer program 62
Can, such as the function of module 101 to 103 shown in Fig. 5.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 61, and are executed by the processor 60, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 62 in the terminal device 6 is described.For example, the computer program 62 can be divided
It is cut into the first acquisition module, the first generation module and the second generation module, each module concrete function is as follows:
First obtains module, the account book data sent for obtaining non-accounting nodes;Wherein, the account book data include section
Point data, signature and hash;
First generation module generates preset data for being packaged the account book data of all non-accounting nodes
Block;Wherein, the block head of the preset data block includes the hash of a upper preset data block, the preset data area
The hash and timestamp of block;The block body of the preset data block includes the account book number of all node acquisitions in preset time period
According to body;The node includes the non-accounting nodes and accounting nodes;
Second generation module is used for according to the preset data block and accounting nodes generation account book block, and to
The whole network broadcast.
The terminal device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The terminal device may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6
The only example of terminal device 6 does not constitute the restriction to terminal device 6, may include than illustrating more or fewer portions
Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net
Network access device, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 61 can be the internal storage unit of the terminal device 6, such as the hard disk or interior of terminal device 6
It deposits.The memory 61 is also possible to the External memory equipment of the terminal device 6, such as be equipped on the terminal device 6
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), safe digital card (Secure Digital, SD) dodge
Deposit card (Flash Card) etc..Further, the memory 61 can also both include the storage inside list of the terminal device 6
Member also includes External memory equipment.The memory 61 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device
Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie
Matter may include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of account book recording method based on block chain characterized by comprising
Obtain the account book data that non-accounting nodes are sent;Wherein, the account book data include node data, signature and hash;
The account book data of all non-accounting nodes are packaged, preset data block is generated;Wherein, the preset data
The block head of block includes the hash and timestamp of the hash of a upper preset data block, the preset data block;It is described
The block body of preset data block includes the account book data volume of all node acquisitions in preset time period;The node includes described
Non- accounting nodes and accounting nodes;
Account book block is generated according to the preset data block and the accounting nodes, and is broadcasted to the whole network.
2. as described in claim 1 based on the account book recording method of block chain, which is characterized in that according to the preset data area
Block and the accounting nodes generate account book block, and to after the whole network broadcast, comprising:
Obtain the confirmation message that the node is sent;Wherein, the confirmation message includes the node in the account book block
The confirmation message of the account book data of the node;
It is the number for having confirmed that node, and having confirmed that node described in record by the vertex ticks for sending confirmation message;If institute
It states and has confirmed that the number of node meets the first preset threshold, then determine that the account book block confirms successfully.
3. as described in claim 1 based on the account book recording method of block chain, which is characterized in that according to the preset data area
Block and the accounting nodes generate account book block, and to after the whole network broadcast, further includes:
Obtain the decision error information that the node is sent;
It is error node by the vertex ticks of decision error information is sent, and records the number of the error node;
If the number of the error node meets the second preset threshold, the account book block confirmation failure is determined;
The accounting nodes are piped off, and limit the book keeping operation right of the accounting nodes to pipe off;
Using next node as accounting nodes, the operation for executing and obtaining the account book data that non-accounting nodes are sent is returned.
4. as claimed in claim 2 or claim 3 based on the account book recording method of block chain, which is characterized in that according to the present count
Account book block is generated according to block and the accounting nodes, and to after the whole network broadcast, further includes:
Detect whether the node of non-return information;Wherein, the information includes confirmation message and decision error information;
The node of the non-return information if it exists, then by the vertex ticks of the non-return information to have confirmed that node, and more
The new number for having confirmed that node.
5. such as the described in any item account book recording methods based on block chain of Claims 1-4, which is characterized in that the method
Further include:
If network interruption or offline phenomenon occur in the accounting nodes, using next node as accounting nodes, returns to execute and obtain
The operation for the account book data that negated accounting nodes are sent.
6. as described in claim 1 based on the account book recording method of block chain, which is characterized in that the account book data volume includes
Data head and data volume, the data head include the hash and the signature of node i d, the data volume, and the data volume includes
The account book data of the non-accounting nodes acquisition.
7. a kind of account book recording device based on block chain characterized by comprising
First obtains module, the account book data sent for obtaining non-accounting nodes;Wherein, the account book data include number of nodes
According to, signature and hash;
First generation module generates preset data block for being packaged the account book data of all non-accounting nodes;
Wherein, the block head of the preset data block includes the hash of a upper preset data block, the preset data block
Hash and timestamp;The block body of the preset data block includes the account book data of all node acquisitions in preset time period
Body;The node includes the non-accounting nodes and accounting nodes;
Second generation module, for generating account book block according to the preset data block and the accounting nodes, and to the whole network
Broadcast.
8. as claimed in claim 7 based on the account book recording device of block chain, which is characterized in that further include:
Second obtains module, the confirmation message sent for obtaining the node;Wherein, the confirmation message includes the node
To the confirmation message of the account book data of node described in the account book block;
First mark module has confirmed that node for being by the vertex ticks for sending confirmation message, and record it is described really
Recognize the number of node;If the number for having confirmed that node meets the first preset threshold, determine account book block confirmation at
Function.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program
The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In when the computer program is executed by processor the step of any one of such as claim 1 to 6 of realization the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811488340.8A CN109783569A (en) | 2018-12-06 | 2018-12-06 | A kind of account book recording method, device and terminal device based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811488340.8A CN109783569A (en) | 2018-12-06 | 2018-12-06 | A kind of account book recording method, device and terminal device based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783569A true CN109783569A (en) | 2019-05-21 |
Family
ID=66496868
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811488340.8A Pending CN109783569A (en) | 2018-12-06 | 2018-12-06 | A kind of account book recording method, device and terminal device based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783569A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111818167B (en) * | 2020-07-09 | 2021-09-07 | 广州知弘科技有限公司 | High-security resource transfer method based on block chain |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106548349A (en) * | 2016-11-02 | 2017-03-29 | 江苏通付盾科技有限公司 | Transaction Information verification method and system |
US20180025181A1 (en) * | 2016-07-21 | 2018-01-25 | Acronis International Gmbh | System and method for verifying data integrity using a blockchain network |
CN108320155A (en) * | 2017-12-21 | 2018-07-24 | 中国科学院信息工程研究所 | A method of realizing block chain common recognition mechanism |
CN108615153A (en) * | 2018-04-28 | 2018-10-02 | 百度在线网络技术(北京)有限公司 | Processing method, device, system, equipment and the storage medium of block chain data |
-
2018
- 2018-12-06 CN CN201811488340.8A patent/CN109783569A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180025181A1 (en) * | 2016-07-21 | 2018-01-25 | Acronis International Gmbh | System and method for verifying data integrity using a blockchain network |
CN106548349A (en) * | 2016-11-02 | 2017-03-29 | 江苏通付盾科技有限公司 | Transaction Information verification method and system |
CN108320155A (en) * | 2017-12-21 | 2018-07-24 | 中国科学院信息工程研究所 | A method of realizing block chain common recognition mechanism |
CN108615153A (en) * | 2018-04-28 | 2018-10-02 | 百度在线网络技术(北京)有限公司 | Processing method, device, system, equipment and the storage medium of block chain data |
Non-Patent Citations (4)
Title |
---|
TIANMINGYUN: ""MasterBitcoin2CN"", 《HTTPS://GITHUB.COM/TIANMINGYUN/MASTERBITCOIN2CN/BLOB/EBDE109A7F775B4D0F29F40DCEA7BEE0A88049BD/CH10.MD》 * |
姚前等: "《数字货币经济分析》", 31 October 2018, 中国金融出版社 * |
朱岩等: "区块链关键技术中的安全性研究", 《信息安全研究》 * |
覃晓康: "《管理信息系统及应用》", 31 August 2018, 山东大学出版社 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111818167B (en) * | 2020-07-09 | 2021-09-07 | 广州知弘科技有限公司 | High-security resource transfer method based on block chain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109598509A (en) | The recognition methods of risk clique and device | |
CN108900353A (en) | Fault alarming method and terminal device | |
CN112633649A (en) | Power grid multi-attribute important node evaluation and planning method | |
CN107438833A (en) | A kind of data-updating method, device, system and server | |
CN107807891A (en) | Information collecting method and terminal device | |
CN109656873A (en) | Data archiving method, device and terminal device based on block chain | |
CN107404740B (en) | Method for switching network, device and the terminal device of safety | |
CN109684272A (en) | Document storage method, system and terminal device | |
CN109447287A (en) | Multiple-energy-source operational system method for building up and terminal device | |
CN113242305B (en) | Cross-chain transaction processing method, device, computer equipment and medium | |
CN109241357A (en) | Chain structure model and its construction method, system and terminal device | |
CN105045790A (en) | Graph data search system, method and device | |
CN110336677A (en) | Block packing, broadcasting method and system, equipment and storage medium | |
CN112491900A (en) | Abnormal node identification method, device, equipment and medium | |
CN108259195A (en) | The determining method and system of the coverage of anomalous event | |
CN110162549A (en) | A kind of fire data analysis method, device, readable storage medium storing program for executing and terminal device | |
CN109905366A (en) | Terminal device safe verification method, device, readable storage medium storing program for executing and terminal device | |
CN109783569A (en) | A kind of account book recording method, device and terminal device based on block chain | |
CN110505655A (en) | Data command processing method, storage medium and bluetooth shield | |
CN108234687A (en) | A kind of smart IP address configuration method, device and terminal device | |
CN108038127A (en) | A kind of method, apparatus, terminal device and the storage medium of data synchronization | |
CN110515591A (en) | Random digit generation method and device based on block chain | |
CN113656466B (en) | Policy data query method, device, equipment and storage medium | |
CN109242321A (en) | Custom power load on-line analysis and terminal device | |
CN112015373B (en) | Endogenous safety application software formal modeling method based on formalization method |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190521 |
|
RJ01 | Rejection of invention patent application after publication |