CN109102287B - Block chain accounting method, device, equipment and storage medium - Google Patents
Block chain accounting method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109102287B CN109102287B CN201810916754.XA CN201810916754A CN109102287B CN 109102287 B CN109102287 B CN 109102287B CN 201810916754 A CN201810916754 A CN 201810916754A CN 109102287 B CN109102287 B CN 109102287B
- Authority
- CN
- China
- Prior art keywords
- accounting
- block
- node
- hash value
- nodes
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000004590 computer program Methods 0.000 claims description 11
- 238000001514 detection method Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000005065 mining Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 1
- 239000010931 gold Substances 0.000 description 1
- 229910052737 gold Inorganic materials 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3827—Use of message hashing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/401—Transaction verification
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Computer Security & Cryptography (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the invention provides a block chain accounting method, a block chain accounting device, block chain accounting equipment and a block chain accounting storage medium. The method comprises the following steps: an accounting node in the blockchain network receives a transaction record broadcasted by a participating node in the blockchain network; the accounting node records the transaction records broadcast by the participating nodes in a preset time period; when the accounting node records and finishes the transaction record in the preset time period, generating accounting right request information, wherein the accounting right request information comprises accounting reward information applied by the accounting node; the accounting node generates a block according to the transaction record and the accounting right request information; the accounting node calculates the hash values of the transaction records and the accounting right request information; the accounting node broadcasts the hash value and the block into the blockchain network so that other accounting nodes in the blockchain network verify the block according to the hash value. The embodiment of the invention reduces the power resource consumed by the accounting node.
Description
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a block chain accounting method, a block chain accounting device, block chain accounting equipment and a block chain accounting storage medium.
Background
A blockchain is a decentralized database that contains a list of what are called blocks, with records that are growing and aligned. Each block contains a timestamp and a link to the previous block, and the data, once recorded in the block, is not tampered with.
In the block chain network, a plurality of accounting nodes compete for the accounting right of each block, specifically, the plurality of accounting nodes compete for the accounting right by adopting a proof of work (POW) consensus algorithm, the POW consensus algorithm specifically means that a value meeting a rule is calculated through and or operation, and the accounting node which calculates the value obtains the accounting right most quickly.
However, as the transaction records in the blockchain network increase, each accounting node needs to perform a large amount of operations to compete for accounting rights, so that the accounting nodes need to consume a lot of power resources.
Disclosure of Invention
The embodiment of the invention provides a block chain accounting method, a block chain accounting device, block chain accounting equipment and a block chain accounting storage medium, so as to reduce power resources consumed by accounting nodes.
In a first aspect, an embodiment of the present invention provides a block chain accounting method, including:
an accounting node in a blockchain network receives a transaction record broadcasted by a participating node in the blockchain network;
the accounting node records the transaction records broadcast by the participating nodes in a preset time period;
when the accounting node records and finishes the transaction record in the preset time period, generating accounting right request information, wherein the accounting right request information comprises accounting reward information applied by the accounting node;
the accounting node generates a block according to the transaction record and the accounting right request information;
the accounting node calculates the hash value of the transaction record and the accounting right request information;
and the accounting node broadcasts the hash value and the block to the blockchain network so as to ensure that other accounting nodes in the blockchain network verify the block according to the hash value.
In a second aspect, an embodiment of the present invention provides a block chain accounting method, including:
an accounting node in the block chain network receives blocks generated by other accounting nodes and hash values corresponding to the blocks, which are sent by other accounting nodes, wherein the blocks comprise transaction records recorded by the other accounting nodes within a preset time period and request information of accounting rights of the blocks by the other accounting nodes;
the accounting node accounts the transaction records in the block;
if the accounting node checks the transaction records in the block, the accounting node detects whether the timestamp included in the block is within a preset time range after the preset time period;
if the timestamp included in the block is within a preset time range after the preset time period, the accounting node detects whether the hash value corresponding to the block meets a preset condition;
and if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block.
In a third aspect, an embodiment of the present invention provides a block chain accounting device, including:
a receiving module, configured to receive a transaction record broadcasted by a participating node in the blockchain network;
the recording module is used for recording the transaction records broadcasted by the participating nodes within a preset time period;
the first generation module is used for generating accounting right request information when the recording module records and finishes the transaction record in the preset time period, wherein the accounting right request information comprises accounting reward information applied by the accounting node;
the second generation module is used for generating a block according to the transaction record and the accounting right request information;
the calculation module is used for calculating the hash value of the transaction record and the accounting right request information;
a sending module, configured to broadcast the hash value and the chunk to the blockchain network, so that other accounting nodes in the blockchain network verify the chunk according to the hash value.
In a fourth aspect, an embodiment of the present invention provides a block chain accounting device, including:
the receiving module is used for receiving blocks generated by other accounting nodes and hash values corresponding to the blocks, wherein the blocks comprise transaction records recorded by the other accounting nodes within a preset time period and request information of accounting rights of the blocks by the other accounting nodes;
the account checking module is used for checking the transaction records in the block;
the first detection module is used for detecting whether the timestamp included in the block is within a preset time range after the preset time period when the reconciliation module is used for reconciling the transaction records in the block;
a second detection module, configured to detect whether a hash value corresponding to the block meets a preset condition when the timestamp included in the block is within a preset time range after the preset time period;
and the determining module is used for determining that the block is a valid block when the hash value corresponding to the block meets a preset condition.
In a fifth aspect, an embodiment of the present invention provides a block link point, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method of the first aspect.
The block chain accounting method, device, equipment and storage medium provided by the embodiments of the present invention receive, by an accounting node in a block chain network, a transaction record broadcasted by a participating node in the block chain network, the accounting node generates accounting right request information when recording the transaction record in a preset time period, the accounting right request information includes accounting reward information applied by the accounting node, the accounting node generates a block according to the transaction record and the accounting right request information and calculates a hash value of the block, the accounting node broadcasts the hash value and the block into the block chain network, so that other accounting nodes verify the block according to the hash value, when the hash value satisfies a preset condition, other accounting nodes regard the block as a valid block, so that the right of each block is determined by randomness among the accounting nodes instead of determining the accounting right of the accounting block by investment of power resources, the power resource consumption of the accounting node is reduced.
Drawings
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present invention;
fig. 2 is a flowchart of a block chain accounting method according to an embodiment of the present invention;
fig. 3 is a flowchart of a block chain accounting method according to another embodiment of the present invention;
fig. 4 is a flowchart of a block chain accounting method according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a block chain accounting device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a block chain accounting device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The block chain accounting method provided by the invention can be applied to the communication system shown in fig. 1. As shown in fig. 1, the communication system includes: accounting node 11, accounting node 12, participating node 13, participating node 14 and accounting node 15; the accounting node 11, the accounting node 12, the participating node 13, the participating node 14, and the accounting node 15 are all nodes in a blockchain network, and the blockchain network may specifically be a peer-to-peer network, which is only illustrated here for illustrative purposes and is not limited to a specific structure of the blockchain network, and in other embodiments, the blockchain network may further include other nodes.
The invention provides a block chain accounting method, which aims to solve the technical problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a block chain accounting method according to an embodiment of the present invention. The embodiment of the invention provides a block chain accounting method aiming at the technical problems in the prior art, and the method comprises the following specific steps:
In this embodiment, each tile in the blockchain network is generated according to a fixed time period, for example, a new tile is generated every W minutes. Participating nodes in the blockchain network, such as participating node 13 and participating node 14 shown in fig. 1, broadcast transaction records in the blockchain network according to service requirements, and accounting nodes in the blockchain network, such as accounting node 11, accounting node 12 and accounting node 15 shown in fig. 1, respectively receive the transaction records broadcast in the blockchain network.
Optionally, the accounting node 11, the accounting node 12 and the accounting node 15 respectively record the transaction records broadcasted by the participating nodes within a preset time period. The preset time period is marked as Tn-1Time to TnThe time of day. Optionally, Tn-1Time to TnThe duration of the time may be W minutes. At TnAt that time, accounting node 11, accounting node 12 and accounting node 15 begin to keep track of all transactions in that W minuteThe contention for accounting rights is recorded.
Taking the accounting node 11 as an example, when the accounting node 11 finishes the recording Tn-1Time to TnAnd generating the accounting right request information during the transaction record of the moment, wherein the accounting right request information comprises the identification information of the block for which the accounting node 11 applies accounting and the accounting reward information applied by the accounting node 11. For example, the accounting node 11 robs the accounting right of the P-th block in the blockchain network, and applies for obtaining 8 gold coins for the system mining reward, and the accounting right request information includes identification information of the P-th block and the system mining reward applied for obtaining.
And step 204, the accounting node generates a block according to the transaction record and the accounting right request information.
The accounting node 11 requests information according to the accounting right and the accounting node 11 is at the Tn-1Time to TnThe transaction record received within the time generates a block, optionally including the billing right request information and billing node 11 at the time Tn-1Time to TnTransaction records received at the moment.
The accounting node 11 sends the accounting right request information and the accounting node 11 to the Tn-1Time to TnThe transaction records received in time are combined together, and the accounting right request information and the accounting node 11 in the T are calculatedn-1Time to TnHash values of transaction records received at the time. That is, the accounting node 11 calculates the hash value of the chunk generated by the accounting node 11.
The accounting node 11 broadcasts the hash value corresponding to the block and the block into the blockchain network, and when other accounting nodes in the blockchain network, such as the accounting node 12 and the accounting node 15, receive the block broadcast by the accounting node 11, the accounting node 12 and the accounting node 15 may verify the block broadcast by the accounting node 11 according to the hash value broadcast by the accounting node 11. Similarly, when accounting node 12 broadcasts the block generated by accounting node 12 and the hash value corresponding to the block into the blockchain network, accounting node 11 and accounting node 15 verify the block broadcast by accounting node 12. Alternatively, when the accounting node 15 broadcasts the block generated by the accounting node 15 and the hash value corresponding to the block into the blockchain network, the accounting node 11 and the accounting node 12 verify the block broadcast by the accounting node 15.
In the embodiment of the invention, the accounting node in the block chain network receives the transaction record broadcasted by the participating node in the block chain network, the accounting node generates the accounting right request information when the accounting node finishes the transaction record in the preset time period, the billing right request information comprises billing reward information applied by the billing node, the billing node generates a block according to the transaction record and the billing right request information and calculates the hash value of the block, the accounting node broadcasts the hash value and the block to a blockchain network so as to ensure that other accounting nodes verify the block according to the hash value, other accounting nodes consider the block as a valid block, so that accounting rights of each block are determined by randomness among the accounting nodes, the accounting right of the block is determined instead of the investment of the power resources, so that the power resources consumed by the accounting node are reduced.
Fig. 3 is a flowchart of a block chain accounting method according to another embodiment of the present invention. On the basis of the above embodiment, after the accounting node calculates the hash value of the transaction record and the accounting right request information, the method further includes the following steps:
In this embodiment, when the accounting node 11 calculates the hash value of the block generated by the accounting node 11, the accounting node 11 queries a locally stored blockchain account book, the IP address information of the timestamp server is stored in the blockchain account book, the accounting node 11 sends the hash value to the timestamp server according to the IP address information of the timestamp server, optionally, the accounting node 11 sends the hash value to the timestamp server after signing the hash value by using its own private key, and after receiving the hash value, the timestamp server allocates a timestamp to the hash value, and sends the timestamp to the accounting node 11 after signing the hash value by using the private key of the timestamp server.
The accounting node 11 receives the timestamp corresponding to the hash value sent by the timestamp server, and specifically, the accounting node 11 receives the hash value signed by the timestamp server with a private key and time-stamped by the timestamp server.
Correspondingly, the accounting node broadcasts the hash value and the block to the blockchain network, so that other accounting nodes in the blockchain network verify the block, including: and the accounting node broadcasts the hash value, the timestamp corresponding to the hash value and the block to the blockchain network so as to enable other accounting nodes in the blockchain network to verify the block.
For example, accounting node 11 broadcasts the hash value time-stamped by the timestamp server signed with a private key by the timestamp server into the blockchain network along with the chunk generated by accounting node 11, so that other accounting nodes in the blockchain network, such as accounting node 12 and accounting node 15, verify the chunk broadcast by accounting node 11 according to the hash value and the timestamp.
In the embodiment of the invention, the accounting node in the block chain network receives the transaction record broadcasted by the participating node in the block chain network, the accounting node generates the accounting right request information when the accounting node finishes the transaction record in the preset time period, the billing right request information comprises billing reward information applied by the billing node, the billing node generates a block according to the transaction record and the billing right request information and calculates the hash value of the block, the accounting node broadcasts the hash value and the block to a blockchain network so as to ensure that other accounting nodes verify the block according to the hash value, other accounting nodes consider the block as a valid block, so that accounting rights of each block are determined by randomness among the accounting nodes, the accounting right of the block is determined instead of the investment of the power resources, so that the power resources consumed by the accounting node are reduced.
Fig. 4 is a flowchart of a block chain accounting method according to another embodiment of the present invention. On the basis of the foregoing embodiment, the block chain accounting method provided in this embodiment specifically includes the following steps:
For example, the accounting node 12 and the accounting node 15 in the blockchain network receive the block broadcasted by the accounting node 11 in the blockchain network and the hash value corresponding to the block, the block is generated by the accounting node 11, and the block includes the T recorded by the accounting node 11n-1Time to TnThe transaction record in the time and the request information of the accounting right of the accounting node 11 to the block.
The accounting node 12 and the accounting node 15 respectively account for the transaction records in the block generated by the accounting node 11, detect whether there is a omission in the transaction records in the block, and if the accounting node 12 or the accounting node 15 detects that there is a omission in the transaction records in the block, the accounting node 12 or the accounting node 15 sends a broadcast message in the blockchain network, where the broadcast message is used to indicate that there is a omission in the transaction records in the block. Optionally, if at least one of the accounting node 12 and the accounting node 15 sends a broadcast message in the blockchain network to indicate that there is a miss in the transaction record in the block, the transaction record in the block is checked out, and the block is not recorded in the blockchain ledger.
Optionally, in other embodiments, the accounting node for accounting the transaction records in the block generated by the accounting node 11 is not limited to the accounting node 12 and the accounting node 15, and there may be a plurality of accounting nodes for accounting the transaction records in the block generated by the accounting node 11, and assuming that a certain threshold percentage, for example, 50% of the accounting nodes in the plurality of accounting nodes all send broadcast messages in the blockchain network to indicate that there is a miss in the transaction record in the block, the accounting node does not account the transaction record in the block, and the block is not recorded in the blockchain ledger.
In this embodiment, assuming that the accounting node 12 and the accounting node 15 check the transaction records in the block generated by the accounting node 11, the accounting node 12 or the accounting node 15 may further detect whether the timestamp included in the block is within a preset time period, for example, Tn-1Time to TnWithin a preset time range after the time period corresponding to the moment, the preset time range is, for example, from TnTime to Tn+1The range of time instants. If the time stamp included in the block is from TnTime to Tn+1If the time is out of the range, the block is an invalid block, and the block is not recorded in the block chain account book.
In addition, if the accounting node 11 broadcasts the hash value signed by the timestamp server with the private key and time-stamped by the timestamp server together with the block generated by the accounting node 11 into the blockchain network, when the accounting node 12 and the accounting node 15 receive the broadcast message of the accounting node 11, the accounting node 12 and the accounting node 15 may also query and acquire the public key of the timestamp server from the locally stored blockchain account book, verify the signature of the timestamp server according to the public key of the timestamp server, and if the verification is passed, the accounting node 12 and the accounting node 15 determine that the timestamp is authentic and valid.
When the accounting node 12 and the accounting node 15 determine that the timestamp server stamps the hash value is true, the accounting node 12 and the accounting node 15 further detect whether the hash value meets a preset condition.
If the hash value corresponding to the block generated by the accounting node 11 meets the preset condition, the accounting node 12 and the accounting node 15 determine that the block generated by the accounting node 11 is a valid block, the block is approved by the whole blockchain network, and the block can be written into the blockchain ledger.
Optionally, the checking node detects whether the hash value corresponding to the block meets a preset condition, including: the accounting node detects whether the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks sent by the other accounting nodes; if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block, including: and if the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, the accounting node determines that the block is a valid block.
In this embodiment, the accounting node 12 and the accounting node 15 are not limited to receive the hash value signed by the timestamp server and time-stamped by the timestamp server and sent by the accounting node 11, and the chunk generated by the accounting node 11, and the accounting node 12 and the accounting node 15 may also receive the hash value signed by the timestamp server and time-stamped by the timestamp server and the chunk generated by the other accounting node, sent by the other accounting node and signed by the timestamp server and the private key. When the hash value corresponding to the block sent by the accounting node 11 is minimum, the accounting node 12 and the accounting node 15 determine that the block generated by the accounting node 11 is a valid block.
Or, the checking node detects whether the hash value corresponding to the block meets a preset condition, including: the accounting node detects whether the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks sent by the other accounting nodes; if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block, including: and if the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, the accounting node determines that the block is a valid block.
For example, in this embodiment, the accounting node 12 and the accounting node 15 are not limited to receive the hash value signed by the timestamp server and time-stamped by the timestamp server and the chunk generated by the accounting node 11, which are sent by the accounting node 11 and signed by the timestamp server through a private key, and the accounting node 12 and the accounting node 15 may also receive the hash value signed by the timestamp server and time-stamped by the timestamp server and the chunk generated by the other accounting node, which are sent by the other accounting node and time-stamped by the timestamp server and signed by the private key. When the hash value corresponding to the block sent by the accounting node 11 is the maximum, the accounting node 12 and the accounting node 15 determine that the block generated by the accounting node 11 is a valid block.
In other embodiments, the preset condition that the hash value corresponding to the block sent by the accounting node 11 satisfies is not limited to maximum or minimum.
Optionally, the block sent by the accounting node 11 is approved by the whole blockchain network, and the block sent by the accounting node 11 includes the accounting reward information applied by the accounting node 11, so that when the block sent by the accounting node 11 is effectively recorded in the blockchain account book, the accounting node 11 successfully obtains the mining reward of the blockchain network. All accounting nodes then resume contending for accounting rights for the next block.
In addition, in this embodiment, in order to avoid the accounting node applying for a large number of accounts to rob the Hash value, all nodes in the blockchain network may register in a real-name system.
In the embodiment of the invention, the accounting node carries the hash value corresponding to the block and the timestamp corresponding to the hash value when sending the block, other accounting nodes in the block chain network need to verify the hash value and the timestamp corresponding to the hash value when verifying the block, and the block sent by the accounting node is an effective block only if the hash value meets the preset condition and the timestamp corresponding to the hash value is true, so that the block forged by the accounting node is difficult to pass the verification of other accounting nodes, the accounting node is prevented from passing the forged block to improve the probability of successful accounting right competition, and the fairness of different accounting nodes in accounting right competition is ensured.
Fig. 5 is a schematic structural diagram of a block chain accounting device according to an embodiment of the present invention. The block chain accounting device may be specifically an accounting node in the above embodiments. The block chain accounting apparatus provided in the embodiment of the present invention may execute the processing procedure provided in the embodiment of the block chain accounting method, and as shown in fig. 5, the block chain accounting apparatus 50 includes: a receiving module 51, a recording module 52, a first generating module 53, a second generating module 54, a calculating module 55 and a transmitting module 56; the receiving module 51 is configured to receive a transaction record broadcasted by a participating node in the blockchain network; the recording module 52 is configured to record a transaction record broadcasted by the participating node within a preset time period; the first generating module 53 is configured to generate billing right request information when the recording module records and completes the transaction record in the preset time period, where the billing right request information includes billing reward information applied by the billing node; the second generating module 54 is configured to generate a block according to the transaction record and the billing right request information; the calculation module 55 is configured to calculate a hash value of the transaction record and the billing right request information; the sending module 56 is configured to broadcast the hash value and the chunk into the blockchain network, so that other accounting nodes in the blockchain network verify the chunk according to the hash value.
Optionally, the sending module 56 is further configured to: after the calculation module calculates the hash values of the transaction records and the accounting right request information, sending the hash values to a timestamp server so that the timestamp server assigns a timestamp to the hash values; the receiving module 51 is further configured to: receiving a timestamp corresponding to the hash value sent by the timestamp server; the sending module 56 broadcasts the hash value and the block to the blockchain network, so that when the other accounting nodes in the blockchain network verify the block, the sending module is specifically configured to: broadcasting the hash value, the timestamp corresponding to the hash value and the block to the blockchain network so that other accounting nodes in the blockchain network verify the block.
The block chain accounting device in the embodiment shown in fig. 5 can be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, and are not described herein again.
Fig. 6 is a schematic structural diagram of a block chain accounting device according to an embodiment of the present invention. The block chain accounting device may be specifically an accounting node in the above embodiments. The block chain accounting apparatus provided in the embodiment of the present invention may execute the processing procedure provided in the embodiment of the block chain accounting method, and as shown in fig. 6, the block chain accounting apparatus 60 includes: a receiving module 61, a reconciliation module 62, a first detection module 63, a second detection module 64 and a determination module 65; the receiving module 61 is configured to receive a block generated by another accounting node and sent by the other accounting node and a hash value corresponding to the block, where the block includes a transaction record recorded by the other accounting node within a preset time period and request information of an accounting right of the block by the other accounting node; the reconciliation module 62 is used for reconciling the transaction records in the block; the first detection module 63 is configured to detect whether a timestamp included in the block is within a preset time range after the preset time period when the reconciliation module reconciles the transaction record in the block; the second detecting module 64 is configured to detect whether the hash value corresponding to the block meets a preset condition when the timestamp included in the block is within a preset time range after the preset time period; the determining module 65 is configured to determine that the block is a valid block when the hash value corresponding to the block satisfies a preset condition.
Optionally, the second detecting module 64 is specifically configured to: detecting whether the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks sent by the other accounting nodes respectively; the determining module 65 is specifically configured to: and when the hash value corresponding to the block is the minimum value of the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, determining that the block is a valid block.
Optionally, the second detecting module 64 is specifically configured to: detecting whether the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks sent by the other accounting nodes respectively; the determining module 65 is specifically configured to: and when the hash value corresponding to the block is the maximum value of the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, determining that the block is a valid block.
The block chain accounting device in the embodiment shown in fig. 6 can be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, and are not described herein again.
Fig. 7 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention. The block link point provided by the embodiment of the present invention may execute the processing procedure provided by the block chain accounting method embodiment, as shown in fig. 7, the block link point 70 includes a memory 71, a processor 72, a computer program, and a communication interface 73; wherein a computer program is stored in the memory 71 and configured to be executed by the processor 72 for performing the block chain accounting method as described in the above embodiments.
The block link points of the embodiment shown in fig. 7 can be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, and are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the block chain accounting method in the foregoing embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method of block chain accounting, comprising:
an accounting node in a blockchain network receives a transaction record broadcasted by a participating node in the blockchain network;
the accounting node records the transaction records broadcast by the participating nodes in a preset time period;
when the accounting node records and finishes the transaction record in the preset time period, generating accounting right request information, wherein the accounting right request information comprises accounting reward information applied by the accounting node;
the accounting node generates a block according to the transaction record and the accounting right request information;
the accounting node calculates the hash value of the transaction record and the accounting right request information;
the accounting node sends the hash value to a timestamp server so that the timestamp server allocates a timestamp to the hash value;
the accounting node receives a timestamp corresponding to the hash value sent by the timestamp server;
the accounting node broadcasts the hash value, the timestamp corresponding to the hash value and the block to the block chain network, so that other accounting nodes determine that each accounting node does not detect that a transaction record in the block has a omission, determine that the timestamp is within a preset time range after the preset time period, and determine that the block is a valid block after the hash value corresponding to the block meets a preset condition; each reconciliation node comprises the other accounting nodes, and each reconciliation node comprises an accounting node except the accounting node in the block chain network in which the accounting node is positioned;
and all nodes in the block chain network are registered in a real-name mode.
2. A method of block chain accounting, comprising:
an accounting node in the block chain network receives blocks generated by other accounting nodes and hash values corresponding to the blocks, which are sent by other accounting nodes, wherein the blocks comprise transaction records recorded by the other accounting nodes within a preset time period and request information of accounting rights of the blocks by the other accounting nodes;
the accounting node detects whether the transaction records in the block have omission or not;
if the accounting node determines that the accounting nodes do not detect that the transaction records in the block have omission, the accounting node detects whether the timestamp included in the block is within a preset time range after the preset time period; each reconciliation node comprises the accounting node, and each reconciliation node comprises an accounting node except the other accounting nodes in the block chain network where the accounting node is positioned;
if the timestamp included in the block is within a preset time range after the preset time period, the accounting node detects whether the hash value corresponding to the block meets a preset condition;
if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block;
and all nodes in the block chain network are registered in a real-name mode.
3. The method according to claim 2, wherein the step of the accounting node detecting whether the hash value corresponding to the block meets a preset condition comprises:
the accounting node detects whether the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks sent by the other accounting nodes;
if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block, including:
and if the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, the accounting node determines that the block is a valid block.
4. The method according to claim 2, wherein the step of the accounting node detecting whether the hash value corresponding to the block meets a preset condition comprises:
the accounting node detects whether the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks sent by the other accounting nodes;
if the hash value corresponding to the block meets a preset condition, the accounting node determines that the block is a valid block, including:
and if the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, the accounting node determines that the block is a valid block.
5. A block chain accounting device, comprising:
a receiving module, configured to receive a transaction record broadcasted by a participating node in the blockchain network;
the recording module is used for recording the transaction records broadcasted by the participating nodes within a preset time period;
the first generation module is used for generating accounting right request information when the recording module records and finishes the transaction record in the preset time period, wherein the accounting right request information comprises accounting reward information applied by the accounting node;
the second generation module is used for generating a block according to the transaction record and the accounting right request information;
the calculation module is used for calculating the hash value of the transaction record and the accounting right request information;
a sending module: the accounting module is used for sending the hash value to a timestamp server after the calculation module calculates the hash value of the transaction record and the accounting right request information, so that the timestamp server assigns a timestamp to the hash value;
the receiving module is further configured to: receiving a timestamp corresponding to the hash value sent by the timestamp server;
the sending module is further configured to broadcast the hash value, the timestamp corresponding to the hash value, and the block to the blockchain network, so that other accounting nodes in the blockchain network determine that no transaction record in the block is detected by each accounting node, determine that the timestamp is within a preset time range after the preset time period, and determine that the block is a valid block after determining that the hash value corresponding to the block meets a preset condition; each reconciliation node comprises the other accounting nodes, and each reconciliation node comprises an accounting node except the accounting node in the block chain network in which the accounting node is positioned;
and all nodes in the block chain network are registered in a real-name mode.
6. A block chain accounting apparatus, comprising:
the receiving module is used for receiving blocks generated by other accounting nodes and hash values corresponding to the blocks, wherein the blocks comprise transaction records recorded by the other accounting nodes within a preset time period and request information of accounting rights of the blocks by the other accounting nodes;
the account checking module is used for detecting whether the transaction records in the block have omission or not;
the first detection module is used for detecting whether a timestamp included in the block is within a preset time range after the preset time period when the reconciliation module determines that no transaction record in the block is detected by each reconciliation node; each reconciliation module comprises the accounting nodes, and each reconciliation module comprises accounting nodes except the other accounting nodes in the block chain network in which the accounting nodes are positioned;
a second detection module, configured to detect whether a hash value corresponding to the block meets a preset condition when the timestamp included in the block is within a preset time range after the preset time period;
the determining module is used for determining that the block is a valid block when the hash value corresponding to the block meets a preset condition;
and all nodes in the block chain network are registered in a real-name mode.
7. The block chain accounting device of claim 6, wherein the second detecting module is specifically configured to: detecting whether the hash value corresponding to the block is the minimum value in the hash values corresponding to the blocks sent by the other accounting nodes respectively;
the determining module is specifically configured to: and when the hash value corresponding to the block is the minimum value of the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, determining that the block is a valid block.
8. The block chain accounting device of claim 6, wherein the second detecting module is specifically configured to: detecting whether the hash value corresponding to the block is the maximum value in the hash values corresponding to the blocks sent by the other accounting nodes respectively;
the determining module is specifically configured to: and when the hash value corresponding to the block is the maximum value of the hash values corresponding to the blocks respectively sent by a plurality of other accounting nodes, determining that the block is a valid block.
9. A block link point, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-4.
10. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to perform the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810916754.XA CN109102287B (en) | 2018-08-13 | 2018-08-13 | Block chain accounting method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810916754.XA CN109102287B (en) | 2018-08-13 | 2018-08-13 | Block chain accounting method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109102287A CN109102287A (en) | 2018-12-28 |
CN109102287B true CN109102287B (en) | 2021-09-07 |
Family
ID=64849652
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810916754.XA Active CN109102287B (en) | 2018-08-13 | 2018-08-13 | Block chain accounting method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109102287B (en) |
Families Citing this family (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109508565B (en) * | 2018-12-29 | 2021-04-09 | 西安纸贵互联网科技有限公司 | Account book accounting method of block chain network with multi-chain sharing computing power |
CN109951290B (en) * | 2019-01-31 | 2022-03-01 | 创新先进技术有限公司 | Time service authentication method, device and equipment for chain type account book |
CN109919748A (en) * | 2019-03-06 | 2019-06-21 | 中汇信息技术(上海)有限公司 | A kind of data processing method and system based on block chain |
CN110135178A (en) * | 2019-04-11 | 2019-08-16 | 贝克链区块链技术有限公司 | Zero-lag account book access technique in the verifying of block chain |
CN110430066B (en) * | 2019-07-15 | 2021-07-06 | 杭州复杂美科技有限公司 | Method, apparatus and storage medium for reducing repeated broadcasting of blockchain transactions |
CN110489231B (en) * | 2019-08-09 | 2023-08-22 | 全链通有限公司 | Transaction information recording method, apparatus and computer readable storage medium |
CN110471922B (en) * | 2019-08-09 | 2023-02-03 | 全链通有限公司 | Content extension method and device for accounting node and computer readable storage medium |
CN118195611A (en) * | 2019-09-02 | 2024-06-14 | 创新先进技术有限公司 | Managing a blockchain-based centralized ledger system |
CN111464539B (en) * | 2020-03-31 | 2022-11-04 | 中国联合网络通信集团有限公司 | Block chain accounting method and accounting node |
CN111581286B (en) * | 2020-05-07 | 2023-03-24 | 桂勋 | Energy block chain block storage method based on consistency hash |
CN111597264B (en) * | 2020-05-15 | 2023-06-23 | 中国联合网络通信集团有限公司 | Block chain accounting method and device |
CN111641617B (en) * | 2020-05-19 | 2022-10-21 | 全链通有限公司 | Processing method, device and storage medium for accounting right in block chain network |
CN111639944B (en) * | 2020-06-08 | 2023-06-02 | 杭州复杂美科技有限公司 | Transaction broadcasting method, apparatus and storage medium |
CN111858751A (en) * | 2020-06-29 | 2020-10-30 | 深圳壹账通智能科技有限公司 | Data storage method and device based on block chain |
CN111836268B (en) * | 2020-07-10 | 2023-04-28 | 全链通有限公司 | Terminal equipment access information processing method, equipment and storage medium |
CN111951110A (en) * | 2020-08-10 | 2020-11-17 | 神话科技传媒(深圳)有限公司上海分公司 | Economic model based on excitation of block chain |
CN112084201B (en) * | 2020-08-27 | 2024-04-09 | 东软集团股份有限公司 | Distributed account book processing method and device, storage medium and electronic equipment |
CN112218317B (en) * | 2020-10-22 | 2023-05-23 | 中国联合网络通信集团有限公司 | Rewarding method and device |
CN112261049B (en) * | 2020-10-22 | 2022-08-19 | 中国联合网络通信集团有限公司 | Reward method and device |
CN112529703B (en) * | 2020-11-23 | 2023-09-01 | 中国联合网络通信集团有限公司 | Method and device for selecting accounting node of blockchain |
CN112927078A (en) * | 2021-03-03 | 2021-06-08 | 关莉莉 | Block chain financial big data analysis processing system and method and transaction platform system |
CN113240248A (en) * | 2021-04-25 | 2021-08-10 | 上海和数软件有限公司 | Enterprise electric energy method and system based on block chain |
CN114143011A (en) * | 2021-11-26 | 2022-03-04 | 中国联合网络通信集团有限公司 | Test report processing method and device |
CN114140118A (en) * | 2021-12-01 | 2022-03-04 | 浪潮云信息技术股份公司 | Distributed accounting method and device and computer readable medium |
CN114511321B (en) * | 2022-01-14 | 2022-09-23 | 北京第五力科技有限公司 | Point-to-point based data processing method, system, computing device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107566124A (en) * | 2017-08-24 | 2018-01-09 | 深圳市易成自动驾驶技术有限公司 | Common recognition method for building up, block catenary system and storage medium based on lottery mechanism |
CN108182581A (en) * | 2017-12-29 | 2018-06-19 | 北京欧链科技有限公司 | A kind of bookkeeping methods and device of block chain |
CN108230109A (en) * | 2018-01-02 | 2018-06-29 | 罗梅琴 | A kind of shared system and method based on block chain technology |
CN108270821A (en) * | 2016-12-30 | 2018-07-10 | 深圳瀚德创客金融投资有限公司 | For the block generation method and network node in block chain network |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160321751A1 (en) * | 2015-04-28 | 2016-11-03 | Domus Tower, Inc. | Real-time settlement of securities trades over append-only ledgers |
CN107171810B (en) * | 2017-06-27 | 2020-03-13 | 中国联合网络通信集团有限公司 | Verification method and device of block chain |
CN107147501B (en) * | 2017-06-27 | 2019-08-06 | 中国联合网络通信集团有限公司 | Timestamp processing method and processing device |
CN108009918B (en) * | 2017-11-23 | 2021-10-26 | 深圳捷汇科技有限公司 | Accounting method of block chain consensus algorithm transaction system and electronic equipment |
-
2018
- 2018-08-13 CN CN201810916754.XA patent/CN109102287B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108270821A (en) * | 2016-12-30 | 2018-07-10 | 深圳瀚德创客金融投资有限公司 | For the block generation method and network node in block chain network |
CN107566124A (en) * | 2017-08-24 | 2018-01-09 | 深圳市易成自动驾驶技术有限公司 | Common recognition method for building up, block catenary system and storage medium based on lottery mechanism |
CN108182581A (en) * | 2017-12-29 | 2018-06-19 | 北京欧链科技有限公司 | A kind of bookkeeping methods and device of block chain |
CN108230109A (en) * | 2018-01-02 | 2018-06-29 | 罗梅琴 | A kind of shared system and method based on block chain technology |
Also Published As
Publication number | Publication date |
---|---|
CN109102287A (en) | 2018-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109102287B (en) | Block chain accounting method, device, equipment and storage medium | |
CN107171810B (en) | Verification method and device of block chain | |
CN107480990B (en) | Block chain accounting method and device | |
CN107493340B (en) | Data distribution verification method, device and system in block chain network | |
CN107220130B (en) | Method, device and system for realizing information consensus at nodes of block chain | |
CN109493204B (en) | Service accounting method based on block chain and terminal equipment | |
CN109408595B (en) | Block chain accounting method, device and computer readable storage medium | |
CN109166040B (en) | Transaction auditing method, device, equipment and storage medium based on block chain | |
JP2023076628A (en) | Computer-implemented systems and methods relating to binary blockchain comprising one pair of coupled blockchains | |
CN111556120A (en) | Data processing method and device based on block chain, storage medium and equipment | |
CN108898440A (en) | Flow exchanging method and device | |
CN108648081B (en) | Transaction processing method and device based on block chain and electronic equipment | |
CN110286849B (en) | Data processing method and device of data storage system | |
CN112749968B (en) | Service data recording method and device based on block chain | |
CN110661656B (en) | Block chain rapid consensus method and device | |
CN109447803B (en) | Alliance chain accounting method, equipment, alliance chain and storage medium | |
CN111641694A (en) | Block chain-based application program release method, device and storage medium | |
CN110796447A (en) | Electronic bid supervision method and device based on block chain and storage medium | |
US20230177501A1 (en) | Methods and devices for double-spend relay in a blockchain network | |
CN111865595A (en) | Block chain consensus method and device | |
CN111858753B (en) | Training parameter processing method, device and storage medium based on block chain | |
CN109101577A (en) | A kind of data circulation method, apparatus and system | |
CN111858752A (en) | Artificial intelligence training method and device based on block chain and storage medium | |
CN110598479A (en) | Data processing method and device and computer readable storage medium | |
CN110619023A (en) | Water source detection data chaining method and device of Internet of things by combining block chains |
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 |