CN108171601B - Block chain source tracing method, device and system - Google Patents

Block chain source tracing method, device and system Download PDF

Info

Publication number
CN108171601B
CN108171601B CN201611112091.3A CN201611112091A CN108171601B CN 108171601 B CN108171601 B CN 108171601B CN 201611112091 A CN201611112091 A CN 201611112091A CN 108171601 B CN108171601 B CN 108171601B
Authority
CN
China
Prior art keywords
resource transfer
mapping
block
spanning tree
address
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
Application number
CN201611112091.3A
Other languages
Chinese (zh)
Other versions
CN108171601A (en
Inventor
肖扬
胡杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN201611112091.3A priority Critical patent/CN108171601B/en
Publication of CN108171601A publication Critical patent/CN108171601A/en
Application granted granted Critical
Publication of CN108171601B publication Critical patent/CN108171601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a block chain source tracing method, device and system, and relates to the field of big data. The method comprises the following steps: traversing the block chain according to the block generation order; mapping resource transfer records of the block chain to a plurality of servers based on addresses of the blocks, wherein the addresses comprise input addresses or output addresses; each server constructs a sub spanning tree set according to the mapping stored block resource transfer records; merging the sub spanning tree sets constructed by the servers to construct a spanning tree, thereby realizing the tracing of the block chain. The invention can solve the performance problem of tracing mass data by a single machine and improve the efficiency of tracing the block chain.

Description

Block chain source tracing method, device and system
Technical Field
The invention relates to the field of big data, in particular to a method, a device and a system for tracing a block chain.
Background
The blockchain technology represented by bitcoin has recently attracted more and more attention and is widely applied to numerous fields such as finance, logistics, notarization and the like. Due to the characteristic of anonymity of the block chain, the privacy protection is improved, meanwhile, the transfer of assets is difficult to track, and the block chain is easy to become a tool for money laundering of lawbreakers and trade in the black market. The traceability of the block chain becomes one of important means for transaction management, and meanwhile, the traceability of the block chain becomes an important choice for safety supervision of an organization or a government in the fields of supply chain management, product safety monitoring and the like.
The existing block chain tracing method mainly traverses the whole block chain for many times according to the generation sequence of blocks, and constructs an expenditure and income generating tree to obtain the whole transfer record of assets. However, the spanning tree is established in a sequential serial process, the whole block chain is required to be traversed once each time, the method cannot perform multi-thread/multi-processor parallel processing, is not suitable for tracing the future mass data, and is easily limited by the memory and the processor capacity of a single machine when the mass data is large, so that the method becomes a bottleneck. In addition, the generation of each new child node in the existing method depends on the traversal of the whole original block chain, and the time complexity for constructing the spanning tree is O (N)N) The time cost of asset tracing is too high. The asset balance calculation of the tracing address needs to traverse 2 spanning trees for income and expenditure respectively, and the efficiency is too low.
Disclosure of Invention
The invention aims to solve the technical problem of providing a block chain tracing method, a device and a system, which can solve the performance problem of tracing mass data by a single machine and improve the efficiency of tracing the block chain.
According to an aspect of the present invention, a method for tracing a blockchain source is provided, including: traversing the block chain according to the block generation order; mapping resource transfer records of the block chain to a plurality of servers based on addresses of the blocks, wherein the addresses comprise input addresses or output addresses; each server constructs a sub spanning tree set according to the mapping stored block resource transfer records; merging the sub spanning tree sets constructed by the servers to construct a spanning tree, thereby realizing the tracing of the block chain.
Further, each server constructs a sub spanning tree set according to the mapping stored block resource transfer record, including: each server acquires any address from the mapping and storage block resource transfer records as the root node of the sub spanning tree; traversing the block resource transfer records stored in the block mapping, and generating tree nodes of the sub spanning tree according to the relation between the addresses of the block resource transfer records stored in the mapping until the addresses of the block resource transfer records stored in the mapping of the created blocks are used as leaf nodes of the sub spanning tree; and combining the sub spanning trees to generate a sub spanning tree set.
Further, merging the sub spanning tree sets constructed by the servers to construct a spanning tree, so as to realize the tracing of the block chain, comprising: merging the sub spanning tree sets constructed by each server by taking the address to be traced as a root node of the spanning tree to construct the spanning tree; and traversing the spanning tree to obtain a resource transfer history record of the address to be traced.
Further, still include: mapping resource transfer records of the block chain to a plurality of servers based on the output addresses of the blocks; each server respectively calculates the allowance of the block resource transfer record which is mapped and stored; merging the margins calculated by the servers to obtain the resource margins of the addresses to be traced.
Further, the step of calculating the remaining amount of the block resource transfer record stored in the mapping manner by each server includes: each server respectively checks the mapping and storing block resource transfer records; if the mapping stored block resource transfer record comprises an input address and an output address, the mapping stored block resource transfer record allowance is the sum of the input allowance and the output allowance; if the mapping stored block resource transfer record only comprises the input address, the mapping stored block resource transfer record allowance is the input allowance; and if the mapping stored block resource transfer record only comprises the output address, the mapping stored block resource transfer record allowance is the output allowance.
According to another aspect of the present invention, there is also provided a blockchain source tracing apparatus, including: a record mapping unit, configured to traverse the block chains according to a block generation order, and map resource transfer records of the block chains to the plurality of servers based on addresses of the blocks, where the addresses include an input address or an output address; the spanning tree construction unit is used for receiving the sub spanning tree sets from the servers, the sub spanning tree sets are generated by the servers according to the transfer record blocks, and the sub spanning tree sets constructed by the servers are merged and processed to construct spanning trees; and the source tracing unit is used for realizing source tracing of the block chain.
Furthermore, the spanning tree construction unit is used for merging the sub spanning tree sets constructed by the servers to construct a spanning tree by taking the address to be traced as a root node of the spanning tree; the source tracing unit is used for traversing the spanning tree to obtain a resource transfer history record of the address to be traced.
Further, the system also comprises a resource allowance calculation unit; the record mapping unit is used for mapping the resource transfer record of the block chain to a plurality of servers based on the output address of the block; the resource allowance calculation unit is used for receiving the calculated allowance of the block resource transfer record mapped and stored from each server, merging the calculated allowance of each server, and acquiring the resource allowance of the address to be traced.
According to another aspect of the present invention, a blockchain traceability tracking system is further provided, which includes a plurality of servers and the blockchain traceability tracking apparatus; each server is used for acquiring any address from the mapping and storage block resource transfer records as the root node of the sub spanning tree; traversing the block resource transfer records stored in the block mapping, and generating tree nodes of the sub spanning tree according to the relation between the addresses of the block resource transfer records stored in the mapping until the addresses of the block resource transfer records stored in the mapping of the created blocks are used as leaf nodes of the sub spanning tree; and combining the sub spanning trees to generate a sub spanning tree set.
Further, each server is also used for respectively calculating the surplus of the block resource transfer record of the mapping storage.
Furthermore, each server is also used for respectively checking the mapping and storing block resource transfer records; if the mapping stored block resource transfer record comprises an input address and an output address, the mapping stored block resource transfer record allowance is the sum of the input allowance and the output allowance; if the mapping stored block resource transfer record only comprises the input address, the mapping stored block resource transfer record allowance is the input allowance; and if the mapping stored block resource transfer record only comprises the output address, the mapping stored block resource transfer record allowance is the output allowance.
Compared with the prior art, the method is based on the divide-and-conquer thought, the resource transfer records are mapped to the plurality of servers according to the addresses of the blocks, the servers parallelly construct the sub spanning tree sets, and the sub spanning tree sets are merged to realize the construction of the spanning tree, so that the tracing of the block chain is realized, the performance problem of tracing the mass data by a single machine is solved, and the efficiency of tracing the block chain is improved. In addition, when the spanning tree is constructed, each new child node is generated only by searching in the segmented block chain data interval, so that the traversal data volume is reduced, and the time cost is reduced.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a flowchart illustrating a block chain tracing method according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating an embodiment of constructing a set of child spanning trees by servers according to the present invention.
Fig. 3 is a flowchart illustrating a blockchain source tracing method according to another embodiment of the present invention.
Fig. 4 is a flowchart illustrating a blockchain source tracing method according to still another embodiment of the present invention.
FIG. 5 is a schematic diagram of one embodiment of a blockchain of the present invention.
FIG. 6 is a schematic diagram of one embodiment of a revenue generation tree of the present invention.
Fig. 7 is a flowchart illustrating an embodiment of a method for calculating asset balance of a traceability address according to the present invention.
Fig. 8 is a schematic diagram of another embodiment of the tracing address asset balance calculation method of the present invention.
Fig. 9 is a schematic structural diagram of a blockchain traceability tracking apparatus according to an embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a blockchain traceability tracking apparatus according to another embodiment of the present invention.
Fig. 11 is a schematic structural diagram of a blockchain traceability tracking system according to an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
Fig. 1 is a flowchart illustrating a block chain tracing method according to an embodiment of the present invention. The method comprises the following steps:
in step 110, the block chain is traversed according to the block generation order. When the system receives a certain block chain address to be traced, the whole block chain is traversed according to the sequence of block generation. The block chain is formed by linking different blocks once according to the generation time, and each block is formed by a block head and a block body. The chunk header includes a previous chunk root hash value, a timestamp, a random number, and the like. The block contains all resource transfer record information in the current block. Each resource transfer record contains the previous transfer information and the next owner address (public key address). A public key address may have multiple inputs and outputs, each input corresponding to a previous output.
At step 120, resource transfer records of the block chain are mapped to a plurality of servers based on the addresses of the blocks. For example, the resource transfer records are mapped and distributed to different servers according to the input address or the output address in the block, and each server contains a block resource transfer record stored in a mapping mode.
In step 130, each server constructs a set of child spanning trees according to the mapping stored chunk resource transfer records. The servers may build the input sub-spanning tree set or the output sub-spanning tree set in parallel.
In step 140, merging the sub spanning tree sets constructed by the servers to construct a spanning tree, thereby implementing the tracing of the block chain. For example, the address to be traced is used as a root node of the spanning tree, the sub spanning tree sets of each server are merged, and a resource transfer history based on the address to be traced is constructed.
In the embodiment, based on the divide-and-conquer concept, the resource transfer records are mapped to the plurality of servers according to the addresses of the blocks, the servers construct the sub spanning tree sets in parallel, and the sub spanning tree sets are merged to realize the construction of the spanning tree, so that the tracing of the block chain is realized. In addition, when the spanning tree is constructed, each new child node is generated only by searching in the segmented block chain data interval, so that the traversal data volume is reduced, and the time cost is reduced.
FIG. 2 is a flowchart illustrating an embodiment of constructing a set of child spanning trees by servers according to the present invention. The method comprises the following steps:
in step 210, each server obtains any address from the mapping stored block resource transfer record as the root node of the child spanning tree.
In step 220, traverse the mapped and stored block resource transfer records, and generate tree nodes of the sub spanning tree according to the relationship between the addresses of the mapped and stored block resource transfer records. For example, traversing the block records, and taking all transfer records taking the root node as a direct target of resource transfer as a first-layer tree node of a sub spanning tree; and traversing again, taking all the transfer records taking the first-layer tree nodes as direct targets of resource transfer as new second-layer tree nodes, pointing the nodes to the corresponding first-layer tree node records, and so on to determine the tree nodes of each layer.
In step 230, the address of the block resource transfer record stored in the mapping of the created block is used as the leaf node of the child spanning tree, and a child spanning tree is constructed.
At step 240, the sub-spanning trees are combined to generate a set of sub-spanning trees. And after one spanning tree is constructed, taking an address from the block resource transfer records in the residual mapping storage as a root node of a new spanning tree, repeating the steps 220 to 230 until all the block resource transfer records in the mapping storage are generated into the spanning tree, and merging all the spanning trees to generate a spanning tree set.
In this embodiment, each server may generate the sub spanning trees in parallel, and when generating the tree nodes of the sub spanning trees, it is only necessary to traverse from the segmented block chain data interval, which reduces the amount of data to traverse and time cost.
Fig. 3 is a flowchart illustrating a blockchain source tracing method according to another embodiment of the present invention. The method comprises the following steps:
at step 310, the block chain is traversed according to the block generation order. Starting from the current block, the entire block chain is traversed in block generation order.
In step 320, resource transfer records of the block chain are mapped to a plurality of servers based on the output addresses of the blocks, wherein each server contains one block resource transfer record stored in the mapping.
In step 330, each server calculates the remaining amount of the block resource transfer record stored in the mapping manner. The servers may perform an authenticity check, for example, a signature check, on the mapped and stored block resource transfer records, and calculate a remaining amount of each mapped and stored block resource transfer record. For example, if the mapping-stored block resource transfer record includes an input address and an output address, the mapping-stored block resource transfer record margin is the sum of the input margin and the output margin; if the mapping stored block resource transfer record only comprises the input address, the mapping stored block resource transfer record allowance is the input allowance; and if the mapping stored block resource transfer record only comprises the output address, the mapping stored block resource transfer record allowance is the output allowance.
In step 340, merging the calculated margins of the servers to obtain the resource margins of the addresses to be traced. Merging the three types of address allowance sets of each server according to the addresses, calculating the total resource allowance of each address, and further obtaining the resource allowance of the address to be traced.
In the embodiment, based on the divide-and-conquer concept, the resource transfer records are mapped to a plurality of servers according to the output addresses of the blocks, and each server performs margin calculation on the resource transfer records of the blocks stored by mapping, and performs merging processing on each margin set according to the addresses, so that rapid resource margin calculation of the addresses to be traced is realized. According to the method and the device, the resource allowance calculation of the address to be traced can be realized without constructing an input spanning tree and an output spanning tree, so that the allowance calculation process is more convenient and faster.
The invention can be used in the fields of transaction supervision, audit, anti-money laundering and the like of large-scale financial institutions or platform block chain finance, tracking illegal use behaviors and illegal users, and product traceability and safety supervision of enterprises, institutions or governments in the fields of supply chain management, food safety and the like, and the invention is explained by taking the application in the financial field as an example.
Fig. 4 is a flowchart illustrating a blockchain source tracing method according to still another embodiment of the present invention.
In step 410, after receiving a certain blockchain address to be traced, the system traverses the entire blockchain according to the order of block generation. The block chain is formed by linking different blocks at a time according to the generation time, and each block is composed of a block head and a block body, as shown in fig. 5. The chunk header includes a previous chunk root hash value, a timestamp, a random number, and the like. The block of blocks contains all asset transaction transfer record information within the current block. Each transaction record contains previous transaction information and the next owner address (public key address). One public key address may have multiple payouts and revenues, each corresponding to a previous payout.
In step 420, according to the traversal result, the asset transfer records are mapped and distributed to different servers M1 and M2 … Mn according to different income addresses in the blocks.
At step 430, the servers build, in parallel, a set of child revenue generating trees C1, C2... Cm, respectively. For example, any income address from the asset transfer record is taken as a child income generating tree root node; traversing the block records, and taking all transaction records taking the root node as an asset transfer direct target as a first-layer tree node of the sub-income generating tree; traversing again, taking all transaction records taking the first-layer tree nodes as direct targets of asset transfer as new second-layer tree nodes, and pointing the nodes to corresponding first-layer tree node records; repeating the steps until the record of the founding block becomes all leaf nodes, and completing the construction of a child income generating tree; putting the obtained child income generating tree into the set Ci, taking an income address from the residual asset transfer records as a new child income generating tree root node, and repeating the steps; until all the asset transfer records generate the sub-revenue generating tree, and the sub-revenue generating tree is put into the set Ci.
In step 440, the address to be traced is used as a root node of the revenue generating tree, all the sub revenue generating tree sets Ci of each server are merged, and the revenue generating tree based on the address to be traced is constructed. For example, as shown in fig. 6, the owners J and L are the first-level tree nodes, which point directly to the root node, and these asset transfer records represent that these owners directly transfer assets to the addresses to be traced, which are the most direct asset revenue sources of the addresses to be traced.
At step 450, the resulting revenue spanning tree is traversed to obtain an asset transfer history for the address to be traceable.
In the embodiment, the parallel construction of the income/expense spanning tree is realized through mapping and dividing of different income address intervals, parallel processing and combination processing of the sub spanning tree set Ci. The method is suitable for map-reduce architecture, and solves the performance problem of tracing mass data by a single machine. In addition, when the spanning tree is constructed, each new child node is generated only by searching in the segmented block chain data interval, so that the traversal data volume is reduced, and the time cost is reduced.
Fig. 7 is a flowchart illustrating an embodiment of a method for calculating asset balance of a traceability address according to the present invention.
At step 710, the address asset to be traced is initialized to 0.
At step 720, the entire block chain is traversed, beginning with the current block, in block generation order.
In step 730, according to the traversal result, mapping into different intervals according to the expenditure address, and correspondingly distributing the blockchain asset transaction records to the servers M1 and M2.
In step 740, the servers perform an authenticity check on the transaction records, respectively, and calculate the balance of the expense address in each transaction. Wherein the balance of the expenditure address after deducting all expenditure amounts.
At step 750, based on the results, the accumulated address balance is calculated. If the address has both income and expenditure, the balance is all expenditure balance + all income balance; if only the address of income exists, the rest amount is equal to all income balance; if only the address of the expense is available, the balance is the balance of all expenses.
At step 760, the server type 3 address transaction balance sets are merged by address and the total asset balance for each address is calculated.
At step 770, the asset balance of the address to be traced is found.
In the embodiment, based on the divide and conquer idea, the asset transfer records are mapped to a plurality of servers according to the output addresses of the blocks, and the servers perform balance calculation on the asset transfer record blocks and merge the balance sets according to the addresses, so that rapid asset balance calculation of addresses to be traced is realized. According to the method and the device, the asset balance calculation of the address to be traced can be realized without constructing a income and expenditure spanning tree, so that the balance calculation process is more convenient and faster.
Fig. 9 is a schematic structural diagram of a blockchain traceability tracking apparatus according to an embodiment of the present invention. The system comprises a record mapping unit 910, a spanning tree construction unit 920 and a tracing unit 930, wherein:
the record mapping unit 910 is configured to traverse the block chain according to the block generation order, and map the resource transfer records of the block chain to a plurality of servers based on the addresses of the blocks. When the system receives a certain blockchain address to be traced, the record mapping unit 910 traverses the whole blockchain according to the sequence of block generation. And respectively mapping and distributing the resource transfer records to different servers according to the input address or the output address in the block, wherein each server comprises a block resource transfer record stored in a mapping manner.
The spanning tree construction unit 930 is configured to receive the sub spanning tree sets from the servers, merge the sub spanning tree sets constructed by the servers to construct a spanning tree, and merge the sub spanning tree sets of the servers with the address to be traced as a root node of the spanning tree, for example. And the server constructs a sub spanning tree set according to the block resource transfer records stored in the mapping mode. The servers may build the input sub-spanning tree set or the output sub-spanning tree set in parallel. For example, any address is obtained from the block resource transfer record stored in the mapping mode and is used as the root node of the sub spanning tree; traversing the block resource transfer records stored in the block mapping, and generating tree nodes of the sub spanning tree according to the relation between the addresses of the block resource transfer records stored in the mapping until the addresses of the block resource transfer records stored in the mapping of the created blocks are used as leaf nodes of the sub spanning tree; and combining the sub spanning trees to generate a sub spanning tree set.
The traceback unit 930 is configured to implement traceback on the block chain, for example, traverse the spanning tree to obtain a resource transfer history of the address to be traceback.
In the embodiment, based on the divide-and-conquer idea, the resource transfer records are mapped to a plurality of servers according to the addresses of the blocks, the servers parallelly construct sub spanning tree sets, and merge the sub spanning tree sets to realize the construction of the spanning tree, so that the tracing of the block chain is realized.
Fig. 10 is a schematic structural diagram of a blockchain traceability tracking apparatus according to another embodiment of the present invention. The system includes a record mapping unit 1010 and a resource margin calculation unit 1020, wherein:
the record mapping unit 1010 is configured to traverse the block chain according to the block generation order, and map the resource transfer records of the block chain to the plurality of servers based on the output addresses of the blocks. For example, starting from the current block, the entire block chain is traversed in block generation order, and the resource transfer records of the block chain are mapped to multiple servers based on the output addresses of the blocks. The resource allowance calculation unit 1020 is configured to receive the calculated allowance of the block resource transfer record mapped and stored from each server, merge the calculated allowances of each server, and obtain the resource allowance of the address to be traced. Merging the three types of address allowance sets of each server according to the addresses, calculating the total resource allowance of each address, and further obtaining the resource allowance of the address to be traced. And each server respectively calculates the surplus of the block resource transfer record which is mapped and stored. For example, each server may perform an authenticity check, for example, a signature check, on the mapped and stored block resource transfer records, and calculate a remaining amount of each mapped and stored block resource transfer record.
In the embodiment, based on the divide-and-conquer concept, the resource transfer records are mapped to a plurality of servers according to the output addresses of the blocks, and each server performs margin calculation on the resource transfer records of the blocks stored by mapping, and performs merging processing on each margin set according to the addresses, so that rapid resource margin calculation of the addresses to be traced is realized. According to the method and the device, the resource allowance calculation of the address to be traced can be realized without constructing an input spanning tree and an output spanning tree, so that the allowance calculation process is more convenient and faster.
Fig. 11 is a schematic structural diagram of a blockchain traceability tracking system according to an embodiment of the present invention. The system includes a blockchain traceability tracking device 1110 and a plurality of servers 1120, wherein the blockchain traceability tracking device 1110 is described in detail in the above embodiments and is not further explained here. The server 1120 is configured to, after receiving the block resource transfer records stored in the mapping manner, which are obtained by mapping the resource transfer records of the block chain by the block chain tracing apparatus 1110 based on the output address of the block, construct a sub-spanning tree set according to the block resource transfer records stored in the mapping manner, so as to send the sub-spanning tree set to the block chain tracing apparatus 1110, thereby enabling the block chain tracing apparatus 1110 to trace the block chain. The servers may build the input sub-spanning tree set or the output sub-spanning tree set in parallel. For example, any address is obtained from the block resource transfer record stored in the mapping mode and is used as the root node of the sub spanning tree; traversing the block resource transfer records stored in the block mapping, and generating tree nodes of the sub spanning tree according to the relation between the addresses of the block resource transfer records stored in the mapping until the addresses of the block resource transfer records stored in the mapping of the created blocks are used as leaf nodes of the sub spanning tree; and combining the sub spanning trees to generate a sub spanning tree set.
In the embodiment, based on the divide-and-conquer idea, the resource transfer records are mapped to a plurality of servers according to the addresses of the blocks, the servers parallelly construct sub spanning tree sets, and merge the sub spanning tree sets to realize the construction of the spanning tree, so that the tracing of the block chain is realized.
In another embodiment of the present invention, the servers 1120 are further configured to calculate the remaining amounts of the mapped and stored block resource transfer records, respectively, and send the calculated remaining amounts of the mapped and stored block resource transfer records to the blockchain tracing apparatus 1110, so that the blockchain tracing apparatus 1110 merges the calculated remaining amounts of the servers to obtain the resource remaining amount of the address to be traced. The servers may perform an authenticity check, for example, a signature check, on the mapped and stored block resource transfer records, and calculate a remaining amount of each mapped and stored block resource transfer record.
In the embodiment, based on the divide-and-conquer concept, the resource transfer records are mapped to a plurality of servers according to the output addresses of the blocks, and each server performs margin calculation on the resource transfer records of the blocks stored by mapping, and performs merging processing on each margin set according to the addresses, so that rapid resource margin calculation of the addresses to be traced is realized. The embodiment enables the margin calculation process to be more convenient and faster.
Thus far, the present invention has been described in detail. Some details well known in the art have not been described in order to avoid obscuring the concepts of the present invention. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
The method and apparatus of the present invention may be implemented in a number of ways. For example, the methods and apparatus of the present invention may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically indicated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as a program recorded in a recording medium, the program including machine-readable instructions for implementing a method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
Although some specific embodiments of the present invention have been described in detail by way of illustration, it should be understood by those skilled in the art that the above illustration is only for the purpose of illustration and is not intended to limit the scope of the invention. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims (8)

1. A method for tracing a source of a block chain, comprising:
traversing the block chain according to the block generation order;
mapping resource transfer records of the block chain to a plurality of servers based on addresses of the blocks, each server containing a block resource transfer record stored in a mapping, wherein the addresses comprise input addresses or output addresses;
each server acquires any address from the mapping and storage block resource transfer records as the root node of a sub spanning tree, traverses the mapping and storage block resource transfer records, generates the tree nodes of the sub spanning tree according to the relation between the addresses of the mapping and storage block resource transfer records until the address of the mapping and storage block resource transfer records of the created blocks is used as the leaf node of the sub spanning tree, and combines the sub spanning trees to generate a sub spanning tree set;
merging the sub spanning tree sets constructed by each server by taking the address to be traced as a root node of the spanning tree to construct the spanning tree;
and traversing the spanning tree to obtain a resource transfer history record of the address to be traced.
2. The method of claim 1, further comprising:
mapping resource transfer records of the block chain to a plurality of servers based on output addresses of the blocks;
each server respectively calculates the allowance of the block resource transfer record which is mapped and stored;
merging the margins calculated by the servers to obtain the resource margins of the addresses to be traced.
3. The method of claim 2, wherein the step of calculating the remaining amount of the block resource transfer record stored in the mapping by each server comprises:
each server respectively checks the mapping and storing block resource transfer records;
if the block resource transfer record stored in the mapping mode comprises an input address and an output address, the margin of the block resource transfer record stored in the mapping mode is the sum of the input margin and the output margin;
if the mapping stored block resource transfer record only comprises an input address, the mapping stored block resource transfer record allowance is an input allowance;
and if the block resource transfer record stored in the mapping mode only comprises an output address, the margin of the block resource transfer record stored in the mapping mode is the output margin.
4. A blockchain traceback apparatus, comprising:
the record mapping unit is used for traversing the block chain according to the block generation order and mapping the resource transfer record of the block chain to a plurality of servers based on the address of each block, wherein each server comprises a block resource transfer record stored in a mapping way, and the address comprises an input address or an output address;
the spanning tree construction unit is used for receiving a sub spanning tree set from each server, the sub spanning tree set is generated by the server according to a transfer record block construction sub spanning tree set, a to-be-traced address is used as a root node of the spanning tree, the sub spanning tree set constructed by each server is merged and processed to construct the spanning tree, wherein each server acquires any address from mapping and storing block resource transfer records to be used as the root node of the sub spanning tree, the block resource transfer records stored by block mapping are traversed, the tree nodes of the sub spanning tree are generated according to the relation among the addresses of the mapping and storing block resource transfer records until the address of the mapping and storing block resource transfer records of a created block is used as a leaf node of the sub spanning tree, and the sub spanning trees are merged to generate the sub spanning tree set;
and the source tracing unit is used for traversing the spanning tree to obtain the resource transfer history of the address to be traced.
5. The apparatus of claim 4, further comprising a resource margin calculation unit;
the record mapping unit is used for mapping the resource transfer record of the block chain to a plurality of servers based on the output address of the block;
the resource allowance calculation unit is used for receiving the calculated allowance of the block resource transfer record mapped and stored from each server, merging the calculated allowance of each server, and acquiring the resource allowance of the address to be traced.
6. A blockchain traceability tracking system, comprising a plurality of servers and the blockchain traceability tracking apparatus of claim 4 or 5;
each server is used for acquiring any address from the mapping and storage block resource transfer records as the root node of the sub spanning tree; traversing block resource transfer records stored in block mapping, and generating tree nodes of the sub spanning tree according to the relation between the addresses of the block resource transfer records stored in the mapping until the addresses of the block resource transfer records stored in the mapping of the created blocks are used as leaf nodes of the sub spanning tree; and combining the sub spanning trees to generate a sub spanning tree set.
7. The system of claim 6,
and each server is also used for respectively calculating the surplus of the block resource transfer record of the mapping storage.
8. The system of claim 7,
each server is also used for respectively checking the mapping and storing block resource transfer records; if the block resource transfer record stored in the mapping mode comprises an input address and an output address, the margin of the block resource transfer record stored in the mapping mode is the sum of the input margin and the output margin; if the mapping stored block resource transfer record only comprises an input address, the mapping stored block resource transfer record allowance is an input allowance; and if the block resource transfer record stored in the mapping mode only comprises an output address, the margin of the block resource transfer record stored in the mapping mode is the output margin.
CN201611112091.3A 2016-12-07 2016-12-07 Block chain source tracing method, device and system Active CN108171601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611112091.3A CN108171601B (en) 2016-12-07 2016-12-07 Block chain source tracing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611112091.3A CN108171601B (en) 2016-12-07 2016-12-07 Block chain source tracing method, device and system

Publications (2)

Publication Number Publication Date
CN108171601A CN108171601A (en) 2018-06-15
CN108171601B true CN108171601B (en) 2021-07-27

Family

ID=62525954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611112091.3A Active CN108171601B (en) 2016-12-07 2016-12-07 Block chain source tracing method, device and system

Country Status (1)

Country Link
CN (1) CN108171601B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11423474B1 (en) * 2018-02-14 2022-08-23 Block, Inc. Securing capital offers using blockchain transaction reconstruction
CN109254837B (en) * 2018-08-15 2021-02-19 泰链(厦门)科技有限公司 Block chain system and method for improving task execution speed of non-production node in block chain system
CN109190399B (en) * 2018-09-05 2020-02-14 贝富(广州)新技术有限公司 Anti-counterfeiting method, system and storage medium based on block chain
CN110008716B (en) * 2019-02-01 2020-12-11 创新先进技术有限公司 Block chain transaction method and device, electronic equipment and storage medium
CN109903161B (en) * 2019-02-28 2021-11-09 百度在线网络技术(北京)有限公司 Object processing method, device, equipment and medium based on block chain
CN111126987B (en) * 2019-12-02 2021-02-19 腾讯科技(深圳)有限公司 Resource transfer information processing method and device, storage medium and electronic device
CN111311278B (en) * 2020-02-13 2024-02-02 上海墨珩网络科技有限公司 Cross-department information tracing method and system
CN111709735B (en) * 2020-04-28 2023-10-20 上海墨珩网络科技有限公司 System and method for processing trusted transaction based on blockchain
CN112187788B (en) * 2020-09-27 2022-09-16 上海万向区块链股份公司 Block chain-based multi-level asset transfer method, system and traceability method
CN112231364A (en) * 2020-11-05 2021-01-15 浙江智联阀门科技有限公司 Data tracing method based on block chain
CN114185938B (en) * 2021-11-03 2023-04-18 北京亿欧网盟科技有限公司 Project traceability analysis method and system based on digital finance and big data traceability

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608146A (en) * 2015-12-17 2016-05-25 布比(北京)网络技术有限公司 Block chain tracing method
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN106097101A (en) * 2016-06-20 2016-11-09 深圳市淘淘谷信息技术有限公司 A kind of block chain realizes the management method of financial transaction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9870562B2 (en) * 2015-05-21 2018-01-16 Mastercard International Incorporated Method and system for integration of market exchange and issuer processing for blockchain-based transactions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608146A (en) * 2015-12-17 2016-05-25 布比(北京)网络技术有限公司 Block chain tracing method
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN106097101A (en) * 2016-06-20 2016-11-09 深圳市淘淘谷信息技术有限公司 A kind of block chain realizes the management method of financial transaction

Also Published As

Publication number Publication date
CN108171601A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
CN108171601B (en) Block chain source tracing method, device and system
US11710131B2 (en) Method and apparatus of identifying a transaction risk
US11295303B2 (en) Method, apparatus and electronic device for blockchain transactions
WO2020119294A1 (en) Data sharing method, apparatus, and system, and electronic device
CN111539731A (en) Block chain-based federal learning method and device and electronic equipment
CN111476667B (en) Block chain-based original work transaction method and device and electronic equipment
CN111898360A (en) Text similarity detection method and device based on block chain and electronic equipment
EP3321819A1 (en) Device, method and program for securely reducing an amount of records in a database
CN111737654B (en) Infringement detection method and device based on block chain and electronic equipment
AU2017222469A1 (en) System and method for controlling asset-related actions via a blockchain
EP3709568A1 (en) Deleting user data from a blockchain
Hayati et al. Blockchain based traceability system in food supply chain
CN105391594A (en) Method and device for recognizing characteristic account number
Heo et al. Design of blockchain system for protection of personal information in digital content trading environment
CN110119947B (en) Method and apparatus for shared workload proof computing power generation of symbiotic blockchains
Hisham et al. Combining multiple classifiers using ensemble method for anomaly detection in blockchain networks: A comprehensive review
CN109829076B (en) Method and equipment for generating block chain
US11334925B1 (en) Normalization and secure storage of asset valuation information
CN115375329A (en) Digital collection transaction traceability anti-counterfeiting management method and system
CN111383008B (en) Block chain transfer method and device based on account model
Sallam et al. Fraudulent account detection in the Ethereum’s network using various machine learning techniques
Felix Johannes Hardened Model Aggregation for Federated Learning backed by Distributed Trust Towards decentralizing Federated Learning using a Blockchain
Loporchio et al. An analysis of bitcoin dust through authenticated queries
CN107451179B (en) Query method and system for block chain for increasing overall error of block
CN115034794B (en) Node consensus method and device for block chain system

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