CN110941673A - Block chain data structure and task processing method and device - Google Patents

Block chain data structure and task processing method and device Download PDF

Info

Publication number
CN110941673A
CN110941673A CN201911172077.6A CN201911172077A CN110941673A CN 110941673 A CN110941673 A CN 110941673A CN 201911172077 A CN201911172077 A CN 201911172077A CN 110941673 A CN110941673 A CN 110941673A
Authority
CN
China
Prior art keywords
block
chain
hash value
transaction
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911172077.6A
Other languages
Chinese (zh)
Other versions
CN110941673B (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.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
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 Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN201911172077.6A priority Critical patent/CN110941673B/en
Publication of CN110941673A publication Critical patent/CN110941673A/en
Application granted granted Critical
Publication of CN110941673B publication Critical patent/CN110941673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • General Health & Medical Sciences (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Development Economics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention belongs to the technical field of computer block chains, and particularly relates to a block chain data structure and a task processing method and a device, wherein the data structure stores data through a bidirectional linked list, interactive data with different privacy protection requirements are stored in different linked lists, and hash values of a previous block and a next block are stored in the blocks in the linked lists so as to realize bidirectional verification of the blocks from front to back and from back to front; furthermore, transaction data are separated by establishing a bidirectional chain pool, transactions are separated into single chains according to privacy protection requirements, but the first blocks of the chains are connected again to form a new chain, and by combining the bidirectional chain table and the chain pool, the blocks on the chains are tightly coupled with each other while the transaction data are separated, confidentiality and integrity protection are achieved, meanwhile, the difficulty of computational attack is increased, and the method has important guiding significance on block chain information safety.

Description

Block chain data structure and task processing method and device
Technical Field
The invention belongs to the technical field of computer block chains, and particularly relates to a block chain data structure and a task processing method and device.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. The Blockchain (Blockchain) is an important concept of the bitcoin, which is essentially a decentralized database, and is used as the underlying technology of the bitcoin, and is a series of data blocks which are generated by using a cryptographic method to be related, wherein each data block contains information of a batch of bitcoin network transactions, and the information is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The single chain structure of the traditional block chain is a single-chain table, namely the blocks in the chain store the integrity hash value of the previous block. When the integrity of the block chain is verified, the block chain is verified sequentially from back to front. According to this authentication mechanism, to tamper with a block, all subsequent blocks must be tampered with. This integrity verification mechanism holds two conditions: enough blocks on one chain; the attacker generates the dummy blocks faster than all other people in the chain. In the context of applications such as bitcoin, the above conditions hold. In the private block chain, for the purpose of privacy protection, the single-chain block chain structure is often converted into a multi-chain structure or a tree structure similar to the multi-chain structure, so that the above-mentioned precondition is not always satisfied. The underlying data structure of a classical chunk chain is a single chain structure in which each chunk, except the first, holds the integrity hash value of the previous chunk. Classical bitcoins use this data structure. This structure provides a good guarantee of data integrity for the blocks because if an attacker tampers with any one block, he must tamper with all subsequent blocks of that block. Meanwhile, as blocks are increasing, attackers who want to tamper with subsequent blocks must have more than all of the other computing power of the blockchain platform in order to be able to succeed. This is a so-called 51% attack. At present, a parallel multi-chain structure is proposed, and the purpose is to realize a block chain platform with high expandability. In such a multi-chain structure, the platform has multiple chains at the same time; the structure can well meet the requirement of data privacy protection, and different privacy protection requirements can share one chain without crossing other chains; however, the multi-chain structure also has problems: the length of the chain and the computing capacity on the chain are reduced, according to the principle of 51% attack, an attacker needs to have the capacity of more than 51% of the total computing capacity of the platform to start the attack originally, and only 51% of the computing capacity on a certain chain of the platform is needed at present. Existing blockchain tree structures, in which the main chain serves as the root of the tree and the different blockchains serve as independent tree branches of the main chain; the structure is beneficial to the separation of transaction data and the protection of private data; however, as with the multi-chain structure, since the different regional chains form independent tree branches, the number of blocks in a single path is reduced, which is not beneficial to defending 51% attacks. There is also a block chain structure that no longer uses the traditional single chain, but uses a directed acyclic graph as the infrastructure; in such a structure, block chain forking will be a common occurrence, and like a tree structure, the directed acyclic graph helps to protect private data and is convenient to deploy in a private/enterprise block chain, but the structure also faces a reduction in the number of blocks in a single path, which is not beneficial to defending against 51% attacks.
Disclosure of Invention
Therefore, the invention provides a block chain data structure, a task processing method and a task processing device, which are used for separating transaction data, protecting privacy data and defending 51% of attacks, so that the whole block chain becomes a more compact whole, and the confidentiality and integrity protection of data are realized.
According to the design scheme provided by the invention, the data structure of the block chain is provided, the data structure stores data through a bidirectional linked list, interactive data with different privacy protection requirements are stored in different linked lists, and hash values of a previous block and a next block are stored in the blocks in the linked list, so that bidirectional verification of the blocks from front to back and from back to front is realized.
Further, the data structure of the block chain provided by the invention can also store data through a bidirectional chain pool; the blocks in the bidirectional chain pool are divided into transaction data blocks and transaction initiating blocks, wherein the transaction data blocks are used for recording transaction data with different privacy protection requirements, and the blocks with the same privacy protection requirements are connected by adopting a bidirectional chain table to form a transaction data sub-chain; each transaction data subchain is connected to a transaction initiation block; the transaction initiating block is used for recording the start of a new transaction, and subsequent transaction data are sequentially updated into the transaction data block; all transaction initiating blocks are connected by adopting a bidirectional linked list to form a transaction initiating subchain; the double linked list adopts the double linked list in the block data structure.
As the blockchain data structure of the present invention, further, the data structure of the transaction initiation block comprises a blockhead and a blockbody, wherein the blockhead comprises a version number, a timestamp, a forward hash value for recording a hash value of a previous blockhead, a mocule root, a backward hash value for recording a hash value of a next blockhead, a backward signature value for recording a computation result endorsement of the backward hash value by the next blockhead, a subchain hash value for recording a node hash value of a subchain, and a subchain signature value for recording generation endorsement of the subchain hash value by the first blockhead node of the subchain; the block body is used for recording transaction data description information and recording an integrity hash value by utilizing a Mokol tree root.
As the blockchain data structure of the present invention, further, the data structure of the transaction data block includes a block header and a block body, where the block header includes a version number, a timestamp, a forward hash value for recording a hash value of a previous block, a mocoude root, a backward hash value for recording a hash value of a next block, and a backward signature value for recording an endorsement of a current block on a calculation result of the backward hash value; the block body is used for recording transaction data, and each transaction corresponds to a leaf node of the Mokol tree.
Further, the invention also provides a task processing method based on the block chain data structure, and the data are stored by adopting the block chain data structure.
As the task processing method based on the blockchain data structure, new transaction data further determines a blockmaker and adds a new blockin in the doubly linked chain subchain through a consensus mechanism.
As the task processing method based on the blockchain data structure of the present invention, further, in adding a new block, the block forward hash value performs two update operations, including: after the completion of the supplementation of the backward hash value of the previous block, updating the forward hash value and the backward hash value of the previous block; and calculating and updating the forward hash value of the new block.
As the task processing method based on the block chain data structure, further, in the consensus mechanism, a plurality of users participate in consensus, each user generates a random number and discloses a verification factor and a signature result of the random number in advance, a winner is selected by guessing the average number, the users are encouraged to participate in block generation by using an incentive mechanism, and a block generator is finally determined.
As the task processing method based on the block chain data structure, further, when a plurality of users participate in consensus, the consensus participating user group is split, the consensus participating user range is reduced, and the consensus is graded; after reaching consensus in each reduced range, the winner of the group is used as the group representative, and the hierarchy recursion completes multi-level consensus.
Further, the present invention also provides a task processing device based on a blockchain data structure, which includes a unit for executing the above task processing method based on a blockchain data structure.
The invention has the beneficial effects that:
aiming at the problems of a multi-chain structure adopted by the privacy protection of an enterprise block chain, the invention adopts the basic structure of the two-way linked list to ensure that the block verification on the chain is not only verified from back to front but also verified from front to back, so that if an attacker tampers any one block, the attacker tampers not only the subsequent block of the block but also the leading block of the block, and the attacker tampers all the blocks on the whole chain to achieve the aim of tampering any one block; furthermore, transaction data are separated by establishing a bidirectional chain pool, transactions are separated into single chains according to privacy protection requirements, but the first blocks of the chains are connected again to form a new chain, and the bidirectional chain table and the chain pool are combined, so that the blocks on the chains are tightly coupled with each other while the transaction data are separated, confidentiality and integrity protection are realized, computational attack difficulty is increased, and the method has important guiding significance on block chain information safety.
Description of the drawings:
FIG. 1 is a schematic diagram of a doubly linked list structure in an embodiment of the present invention;
FIG. 2 is a diagram illustrating a conventional singly linked list structure according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a bidirectional chain pool structure according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating a transaction initiation block according to an embodiment of the present invention;
FIG. 5 is a block diagram of transaction data according to an embodiment of the invention.
The specific implementation mode is as follows:
in order to make the objects, technical solutions and advantages of the present invention clearer and more obvious, the present invention is further described in detail below with reference to the accompanying drawings and technical solutions.
Any individual or group in the world can send a transaction and the transaction can be validated against the blockchain, and anyone can participate in their consensus process. The block chain general ledger technology is only used for accounting, and the block chain general ledger technology can be a company or an individual and can solely share the writing authority of the block chain. Private chains are often applied to small-scale companies, research institutes, units and the like, personnel entering a platform are limited, and data held by the platform, such as online transaction data, goods logistics information and the like, usually have confidentiality protection requirements and cannot be read by unauthorized people, so that the benefit of a small department is not damaged. And the block chain links all the blocks together in a Hash cascade mode. This data organization allows an attacker to tamper with the contents of any block and must tamper with that block and all blocks subsequent to that block. Meanwhile, the block chain is generated continuously, and the tampering speed of an attacker must exceed the block generation speed. Therefore, tampering success is only possible if the attacker has more than 51% of the total computation. The basic data of the block chain represented by bitcoin is a single chain structure, as shown in fig. 2, HASH inside the shading is the calculation result of the data in the block. The blocks on the chain store the hash value of the previous block, and all blocks are logically connected in sequence to form the chain. This data organization allows an attacker to tamper with the contents of any block, which must be tampered with as well as all blocks following the block, and to perform the attack only if the attacker has more than 51% of the total computation. In order to protect private data in a blockchain, there are two main types of methods: firstly, through separating different grade data, filter the user who visits data, to the basic data structure of block chain, mainly increase chain or subchain, make different transaction data be located different chains/branches. Another method is to use a cryptographic algorithm to store the transaction data in an encrypted manner, or store only the integrity hash value of the transaction data in the block. In the embodiment of the present invention, referring to fig. 1, a block chain data structure is provided, where the data structure stores data by using a bidirectional linked list, and stores interactive data with different privacy protection requirements in different linked lists, and blocks in the linked list store hash values of a previous block and a next block, so as to implement bidirectional authentication of the blocks from front to back and from back to front. The chain is branched, so that the transaction data is classified and stored, and block verification on the chain can be verified not only from back to front, but also from front to back. Thus, if an attacker tampers with any block, the attacker must not only tamper with the subsequent blocks of the block, but also tamper with the leading block of the block, so that the attacker tampers with all blocks in the entire chain to achieve the purpose of tampering with any one of the blocks.
Further, a blockchain data structure provided in the embodiment of the present invention, as shown in fig. 3, stores data through a bidirectional chain pool; the blocks in the bidirectional chain pool are divided into transaction data blocks and transaction initiating blocks, wherein the transaction data blocks are used for recording transaction data with different privacy protection requirements, and the blocks with the same privacy protection requirements are connected by adopting a bidirectional chain table to form a transaction data sub-chain; each transaction data subchain is connected to a transaction initiation block; the transaction initiating block is used for recording the start of a new transaction, and subsequent transaction data are sequentially updated into the transaction data block; all transaction initiating blocks are connected by adopting a bidirectional linked list to form a transaction initiating subchain; the double linked list adopts the double linked list in the block data structure.
In fig. 3, the blocks are divided into a transaction initiation block and a transaction data block. The transaction data blocks are used for recording transaction data with different privacy protection requirements, and the blocks with the same privacy protection requirements are connected together in a form of a two-way linked list to form a transaction data sub-chain. The platform has multiple transactions and multiple sub-chains of transaction data, but they are not completely isolated from each other, and they are linked together by a transaction initiation block. Each sub-chain of transactions is linked to a transaction initiation block. All transaction initiation blocks are connected together in a form of a bidirectional linked list to form a transaction initiation subchain. The bidirectional chain pool has the following characteristics: (1) one platform only has one chain, which comprises a transaction initiation sub-chain and a plurality of transaction data sub-chains; (2) each transaction data subchain needs to be linked to a node of a transaction initiating subchain; (3) each transaction initiating node only allows one transaction data subchain to be linked; (4) the lengths of the sub chains of the transaction data are different and can be long or short according to actual conditions; (5) each sub-chain of transaction data is not allowed to diverge. For example, if an enterprise sales department initiates a certain privacy transaction service, transaction participants generate a new block together, which is not marked as a head _ node, and the new block is added to a transaction initiation sub-chain as a tail node; after the transaction data are produced in a large quantity, generating a first transaction data block which is not marked as a data _ node; the transaction data block data _ node is connected to the transaction initiation block head _ node; after the blocks generated by the subsequent transaction data are linked to the data _ node, relatively independent sub-chains of the transaction data are formed. In short, the transaction initiation block is used to record the start of a new transaction, and the subsequent transaction data is sequentially updated into the transaction data block.
By storing different transaction data in chains, connecting a plurality of sub-chains through a chain pool, and tightly coupling the blocks with the blocks through bidirectional verification, 51% of computational power attack is not reduced while data privacy is ensured. Although the embodiment stores the data in a chain, the storage is logical, and not physical. Logically, the transaction data with different privacy protection requirements are stored in different sub-chains and are not interacted with each other. Physically, the integrity verification path of the block is not shortened due to the presence of the sub-chain, but the method of bidirectional verification is adopted to advance the integrity verification of the single chain to the whole chain. Therefore, the support of sub-chain data privacy protection is guaranteed, the integrity verification of chain data is also guaranteed, and the method is applicable to private chains. The important point of the private chain is data privacy protection, and the application range of the private chain is mainly small-scale organizations such as enterprises and unit departments. In this context, a node must be authenticated to enter the platform, which means that some basic conditions of the node are public to other nodes in the chain, such as certificates and identities, etc., while some necessary secret parameters can also be assigned to the node. Secondly, the nodes in the chain are benign rather than malicious, the benign nodes mean that the nodes do not implement malicious attack behaviors, but the nodes can be attacked and controlled by enemies, and a small number of internal nodes are not excluded from being colluded with the enemies to implement attacks. The attack capability assumption is that: an attacker can control a small number of nodes in the chain, and the number of attacked nodes does not exceed 1/3 of the total number of nodes in the chain generally; an attacker may have a degree of computing power, and a powerful attacker may implement an attack with the help of off-platform computing power, but the attacker does not have the ability to tamper with all blocks in the chain.
As a blockchain data structure in the embodiment of the present invention, further, as shown in fig. 4, the data structure of the transaction initiation block includes a block header and a block body, where the block header includes a version number, a timestamp, a forward hash value for recording a hash value of a previous block, a mockel root, a backward hash value for recording a hash value of a next block, a backward signature value for recording an endorsement of a calculation result of the backward hash value by the next block, a subchain hash value for recording a subchain first block node hash value, and a subchain signature value for recording a subchain first block node generation endorsement of the subchain hash value by the subchain first block node; the block body is used for recording transaction data description information and recording an integrity hash value by utilizing a Mokol tree root.
Like the conventional block structure, the transaction initiation block mainly differs from the conventional block chain structure in terms of a block header in that the conventional block chain records only the hash value of the previous block, and three hash values are included in the transaction initiation block, which represent: the hash value of the previous block, the hash value of the next block, and the hash value of the first node of the child chain are respectively referred to as: a forward hash value, a backward hash value, and a child chain hash value. The backward signature value is an endorsement of a backward hash value calculation result of the next block; the subchain signature value is an endorsement that the first chunk of the subchain generates a subchain hash value. The block body no longer records specific data of the transaction, but records description information of the transaction data, such as: who the transaction initiator is, the time the transaction is initiated, etc. The specific content is determined by the transaction initiator. The content of the block can record the integrity hash value by using a Mokol tree, and can also directly record the hash value, and the transaction initiator determines the content.
As a block chain data structure in the embodiment of the present invention, further, as shown in fig. 5, the data structure of the transaction data block includes a block header and a block body, where the block header includes a version number, a timestamp, a forward hash value for recording a hash value of a previous block, a mockel root, a backward hash value for recording a hash value of a next block, and a backward signature value for recording an endorsement of a current block to a calculation result of the backward hash value; the block body is used for recording transaction data, and each transaction corresponds to a leaf node of the Mokol tree.
The transaction data chunk does not include a child chain hash value as compared to the transaction initiation chunk. In other words, after a transaction data block, no new sub-chain of transaction data is allowed to be generated, and only subsequent blocks are allowed to be linked. Similarly, the forward hash value and the backward hash value of a transaction data chunk represent the integrity hash values of the previous chunk and the next chunk, respectively. More specifically, the first block of the child chain is the forward hash value of a certain block in the transaction initiation child chain. The backward signature value is an endorsement of a backward hash value calculation result of the current block to the previous block; the block body contains specific transaction data, each transaction usually corresponds to one leaf node of the Mokol tree, and the Mokol tree root is used for reflecting the integrity of the whole transaction data.
Further, an embodiment of the present invention further provides a task processing method based on the blockchain data structure, and the blockchain data structure is used to store data.
As a task processing method based on a blockchain data structure in the embodiment of the present invention, further, new transaction data determines a blockmaker and adds a new blockin a doubly linked chain subchain through a consensus mechanism.
As a task processing method based on a blockchain data structure in the embodiment of the present invention, further, in adding a new block, a block forward hash value performs two update operations, including: after the completion of the supplementation of the backward hash value of the previous block, updating the forward hash value and the backward hash value of the previous block; and calculating and updating the forward hash value of the new block.
Block generation is divided into three cases: the transaction initiation sub-chain generates a new chunk, the transaction data sub-chain generates a new chunk, and a new transaction sub-chain is generated.
And adding blocks in the transaction data subchain to represent the confirmation of new transaction data. Compared with the traditional block structure, three fields are newly added, including: a forward hash value, a backward hash value, and a backward signature value. The same part as the conventional block structure still adopts the conventional method, and the following example describes the updating of the new field:
description of the drawings: now that n blocks have been organized into a chain, the block with number n +1 (denoted by node (n)) is completing the chaining operation by user a, and is ready to be chained to the block with number n as its subsequent block; the block forward hash value is represented by pre _ hash, and the backward hash value is represented by next _ hash; the forward hash value of the block numbered n is represented by node (n), pre _ hash, and so on; the block head structure can be divided into three parts: pre _ hash, next _ hash, and other parts (denoted by others); the user A holds a public key and a private key; the symbol hash () represents a hash calculation, and a specific hash algorithm is not limited; the | | represents the entity set participating in the hash calculation and does not strictly reflect the front-back order of the entities. The method comprises the following steps:
(1) node (n) has been in the access chain, but node (n) next _ hash is empty;
(2) user A fills in node (n +1).
(3) User a calculates a hash (node (n), others node (n), pre _ hash), updates the calculation result to node (n +1), pre _ hash, noting that node (n), next _ hash and node (n +1), next _ hash are empty at this time;
(4) the user A calculates the hash (node (n +1), others | | | node (n +1), pre _ hash), and updates the calculation result to the node (n), next _ hash, namely the generator of the block n +1 is the backward hash value assignment of the block n;
(5) the user A signs the backward hash value by using a private key, and a signature result is attached to the block head;
(6) user a calculates a hash (node (n), others node (n), pre _ hash node (n), next _ hash), and updates the calculation result to node (n +1), pre _ hash, which is the final forward hash value of node (n +1).
There are two update operations for the forward hash value of any one chunk. When updating for the first time, since the backward hash value of the previous block is null, the calculation range of the forward hash value does not include the backward hash value of the previous block. After the backward hash value of the previous block is supplemented, the updating of the previous block is finished, and the block has a forward hash value and a backward hash value; the forward hash value of the new chunk is calculated again, and the forward hash value of the chunk is updated, which is the second update. To summarize, see:
(1) the calculation process of the forward hash value of the block n +1 can be described as follows:
node(n+1).pre_hash=hash(node(n).others||node(n).pre_hash||hash(node(n+1).others||hash(node(n).others||node(n).pre_hash)))
(2) the calculation process of the backward hash value of the block n can be described as follows:
node(n).next_hash=hash(node(n+1).others||hash(node(n).others||node(n).pre_hash))
and generating a new block in the transaction initiation subchain, wherein the new block represents a new type of transaction generation. There are three newly added fields for the transaction initiation block: a forward hash value, a backward hash value, and a child chain hash value. In this operation, only the forward hash value and the backward hash value are updated, and the child chain hash value is null. Regarding the forward hash value and the backward hash value update, it can be as described above.
A sub-chain of transaction data is generated representing that a new transaction has begun and the first transaction data block is about to be linked into the designated transaction initiation block. In this case, the sub-chain hash value acts as the backward hash value, except that it points to the first block of the sub-chain of the transaction data, rather than the subsequent block of the sub-chain of the transaction initiator, and the specific process can be as described above.
Any user, if needing to verify the integrity of the blockchain, can use the following algorithm:
(1) when a user is in n blocks on a chain, the integrity of the preamble blocks can be verified forward in sequence according to the field of the forward hash value, and the verification method comprises the following steps:
node(n).pre_hash=hash(node(n-1).others||node(n-1).pre_hash||node(n-1).next_hash)
(2) when a user is in a n number of blocks on a chain, the integrity of the preamble blocks can be sequentially verified backwards according to the field of the backward hash value, and the verification method comprises the following steps:
node(n).next_hash=hash(node(n).others||node(n).pre_hash||hash(node(n+1).others||
hash(node(n).others||node(n).pre_hash)))
(3) when a user is in the first block node _ data of the transaction data subchain, the integrity of the block node _ head corresponding to the transaction initiating subchain is verified according to the field of the forward hash value, and the verification method comprises the following steps:
node _ data.pre _ hash-hash (node _ head.other/| node _ head.pre _ hash/| node _ head.sublink (where node _ head.sublink represents a sublink hash value for a transaction initiation block)
(4) When the user is in the transaction initiating block, the integrity of the first block of the transaction data is verified according to the sub-chain hash value, and the verification method comprises the following steps:
node_head.sublink=hash(node_head.others||node_head.pre_hash||hash_data.others||
hash(node_head.others||node_head.pre_hash)))
as a task processing method based on a block chain data structure in the embodiment of the present invention, further, in a consensus mechanism, a plurality of users participate in consensus, each user generates a random number and discloses a verification factor and a signature result of the random number in advance, a winner is selected by guessing an average number, and the users are encouraged to participate in block generation by using an incentive mechanism, so as to finally determine a block generator.
The consensus mechanism requires high consensus efficiency and can meet the requirement of transaction achievement speed. Due to the limitation of application background, the platform can be mainly a private block chain, and each node can enter the platform after being authenticated, so that each node is not completely unknown, and basic support is provided for quickly achieving consensus. This consensus mechanism may be referred to as a guess-number consensus algorithm. The specific algorithm can be designed as follows:
Figure BDA0002288985720000091
Figure BDA0002288985720000101
in the guess consensus algorithm, each participant discloses a verification factor of a random number (i.e., a hash value of the random number) and a signature result in advance. Thus, when random numbers are disclosed, any one participant can verify the origin and integrity and authenticity of the other random numbers. By the method, the situation that the participants repudiate the behaviors in order to avoid consensus can be avoided. But the participants may borrow the non-received message to reject the consensus. In this regard, participants may be encouraged to participate in tile generation through a corresponding incentive mechanism. In the private chain, the incentive mechanism may be implemented based on methods such as points. There may be three reasons why there are multiple winners. First, under normal conditions, two or more winners give the same random value, and the value meets the final winning condition. This situation can be avoided as much as possible by extending the accuracy of the random numbers. Secondly, in the broadcasting process, the situation of message loss exists, so that the average values calculated by different users are different. This is inevitable, especially when there are a large number of co-aware users involved. The last case is the presence of users under the control of attackers who may maliciously hide messages or illegally send illegal messages.
As the task processing method based on the block chain data structure in the embodiment of the invention, further, when a plurality of users participate in consensus, the consensus participating user group is split, the consensus participating user range is narrowed, and the consensus is graded; after reaching consensus in each reduced range, the winner of the group is used as the group representative, and the hierarchy recursion completes multi-level consensus.
In order to avoid the last two situations after the number guessing consensus algorithm is executed, the embodiment of the invention provides a multi-stage number guessing consensus algorithm. The core idea is to achieve consensus in a small range, then gradually expand the consensus range until the consensus is obtained at last, and the algorithm can be designed as follows:
Figure BDA0002288985720000102
Figure BDA0002288985720000111
essentially, the "multi-stage guess consensus" is to reduce the participation range of consensus to obtain consensus when the consensus is difficult to be achieved by a large group, and then the consensus of the sub-group participates in the last level of consensus. This approach helps to quickly reach consensus. There are many existing consensus algorithms. The 'guess number consensus' and the 'multi-stage guess number consensus' provided in the embodiment of the invention are only one, are suitable for the private chain, and do not exclude other consensus algorithms to realize the consensus processing process in the block chain.
Further, an embodiment of the present invention further provides a device for processing a task based on a blockchain data structure, where the device includes a unit configured to execute the method for processing a task based on a blockchain data structure as described above.
Unless specifically stated otherwise, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
Based on the foregoing method, an embodiment of the present invention further provides a server, including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method described above.
Based on the above method, the embodiment of the present invention further provides a computer readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the above method.
The system/apparatus provided by the embodiment of the present invention has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, no mention is made in the system/apparatus embodiments, and reference may be made to the corresponding contents in the foregoing method embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the system/apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example 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, it need not be further defined and explained in subsequent figures.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and 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 of devices or units through some communication interfaces, 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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A block chain data structure is characterized in that the data structure stores data through a bidirectional linked list, interactive data with different privacy protection requirements are stored in different linked lists, and blocks in the linked lists store hash values of a previous block and a next block so as to realize bidirectional verification of the blocks from front to back and from back to front.
2. A blockchain data structure, wherein the data structure stores data via a pool of bidirectional chains; the blocks in the bidirectional chain pool are divided into transaction data blocks and transaction initiating blocks, wherein the transaction data blocks are used for recording transaction data with different privacy protection requirements, and the blocks with the same privacy protection requirements are connected by adopting a bidirectional chain table to form a transaction data sub-chain; each transaction data subchain is connected to a transaction initiation block; the transaction initiating block is used for recording the start of a new transaction, and subsequent transaction data are sequentially updated into the transaction data block; all transaction initiating blocks are connected by adopting a bidirectional linked list to form a transaction initiating subchain; the doubly linked list employs the doubly linked list in the block data structure of claim 1.
3. The blockchain data structure of claim 2, wherein the data structure of the transaction initiation block comprises a block header and a block body, wherein the block header comprises a version number, a timestamp, a forward hash value for recording a previous block hash value, a mocoude root, a backward hash value for recording a next block hash value, a backward signature value for recording an endorsement of a subsequent block to the backward hash value calculation result, a sub-chain hash value for recording a sub-chain first block node hash value, and
the child chain signature value is used for recording the generation of endorsement of a child chain hash value by a first block node of the child chain; the block body is used for recording transaction data description information and recording an integrity hash value by utilizing a Mokol tree root.
4. The blockchain data structure of claim 2, wherein the data structure of the transaction data block comprises a block header and a block body, wherein the block header comprises a version number, a timestamp for recording a forward hash value of a previous block hash value, a mocoude root for recording a backward hash value of a next block hash value, and a backward signature value for endorsement of a current block to a backward hash value calculation result; the block body is used for recording transaction data, and each transaction corresponds to a leaf node of the Mokol tree.
5. A task processing method based on a blockchain data structure, characterized in that the blockchain data structure of any one of claims 1 to 4 is used for storing data.
6. A method for processing tasks based on blockchain data structures according to claim 5, characterized in that new transaction data is used to determine the block generator and add new blocks in the doubly linked sub-chain by means of a consensus mechanism.
7. The method for processing tasks based on blockchain data structures of claim 6, wherein in the new block addition, the block forward hash value is updated twice, comprising: after the completion of the supplementation of the backward hash value of the previous block, updating the forward hash value and the backward hash value of the previous block; and calculating and updating the forward hash value of the new block.
8. The method of claim 6, wherein the consensus mechanism comprises a plurality of users participating in consensus, each user generating a random number and disclosing the verification factor and signature result of the random number in advance, and wherein a winner is selected by guessing the average number, and the users are encouraged to participate in the block generation by using an incentive mechanism to determine the block generator.
9. The method of claim 8, wherein when multiple users participate in the consensus, the group of users participating in the consensus is split, the range of users participating in the consensus is narrowed, and the consensus is graded; after reaching consensus in each reduced range, the winner of the group is used as the group representative, and the hierarchy recursion completes multi-level consensus.
10. A task processing apparatus based on a blockchain data structure, the apparatus comprising means for performing the method according to any one of claims 5 to 9.
CN201911172077.6A 2019-11-26 2019-11-26 Block chain data structure and task processing method and device Active CN110941673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911172077.6A CN110941673B (en) 2019-11-26 2019-11-26 Block chain data structure and task processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911172077.6A CN110941673B (en) 2019-11-26 2019-11-26 Block chain data structure and task processing method and device

Publications (2)

Publication Number Publication Date
CN110941673A true CN110941673A (en) 2020-03-31
CN110941673B CN110941673B (en) 2023-03-24

Family

ID=69908810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911172077.6A Active CN110941673B (en) 2019-11-26 2019-11-26 Block chain data structure and task processing method and device

Country Status (1)

Country Link
CN (1) CN110941673B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598569A (en) * 2020-05-21 2020-08-28 昆明大棒客科技有限公司 Tree block chain expansion method and device
CN111626680A (en) * 2020-06-02 2020-09-04 重庆云创科技有限公司 Transaction data chain storage method and block chain storage method for credit evaluation
CN112000993A (en) * 2020-07-30 2020-11-27 杭州趣链科技有限公司 Block chain-based data storage verification method, equipment and storage medium
CN112422526A (en) * 2020-11-03 2021-02-26 山西特信环宇信息技术有限公司 Cone block chain consensus system, method and network
US11018873B1 (en) 2020-01-16 2021-05-25 Tyson York Winarski Collision resistant digital signatures
CN113438237A (en) * 2021-06-24 2021-09-24 上海万向区块链股份公司 Data security collaborative computing method and system
CN113515778A (en) * 2021-07-07 2021-10-19 建信金融科技有限责任公司 Multi-party privacy data fusion method and device and electronic equipment
CN113553613A (en) * 2021-06-29 2021-10-26 福建师范大学 Spatial crowdsourcing method based on deep reinforcement learning and block chain
CN113656408A (en) * 2021-08-19 2021-11-16 龙兴(杭州)航空电子有限公司 Full-life-cycle management method and system for aviation material based on RFID combined block chain technology
CN113868231A (en) * 2021-12-03 2021-12-31 南昌龙旗信息技术有限公司 Data structure updating method and device
CN114153375A (en) * 2021-08-13 2022-03-08 北京天德科技有限公司 Block storage system and block storage method based on block chain technology
WO2022222568A1 (en) * 2021-04-23 2022-10-27 华为技术有限公司 Blockchain data management method and apparatus
WO2023075713A1 (en) * 2021-08-06 2023-05-04 Goksoy Omer A blockchain system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105553695A (en) * 2015-12-08 2016-05-04 南阳理工学院 IP data flow management method based on two-level bidirectional Hash list
CN107656812A (en) * 2017-09-27 2018-02-02 咪咕文化科技有限公司 block chain processing method, system, node device, terminal and storage medium
WO2019019056A1 (en) * 2017-07-26 2019-01-31 杭州复杂美科技有限公司 Method for frontal machine to participate in block chain consensus
CN109726146A (en) * 2018-12-29 2019-05-07 杭州趣链科技有限公司 The scalable caching method of customizable replacement policy based on block height

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105553695A (en) * 2015-12-08 2016-05-04 南阳理工学院 IP data flow management method based on two-level bidirectional Hash list
WO2019019056A1 (en) * 2017-07-26 2019-01-31 杭州复杂美科技有限公司 Method for frontal machine to participate in block chain consensus
CN107656812A (en) * 2017-09-27 2018-02-02 咪咕文化科技有限公司 block chain processing method, system, node device, terminal and storage medium
CN109726146A (en) * 2018-12-29 2019-05-07 杭州趣链科技有限公司 The scalable caching method of customizable replacement policy based on block height

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
柳二月: ""比特币的发展及监管研究"", 《中国市场》 *
翟社平等: "区块链中的隐私保护技术", 《西安邮电大学学报》 *
胡浩: ""基于可信计算的分布式访问控制研究"", 《中国博士学位论文(电子期刊)全文数据库》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11018873B1 (en) 2020-01-16 2021-05-25 Tyson York Winarski Collision resistant digital signatures
CN111598569A (en) * 2020-05-21 2020-08-28 昆明大棒客科技有限公司 Tree block chain expansion method and device
CN111598569B (en) * 2020-05-21 2023-09-08 昆明大棒客科技有限公司 Tree block chain expansion method and device
CN111626680A (en) * 2020-06-02 2020-09-04 重庆云创科技有限公司 Transaction data chain storage method and block chain storage method for credit evaluation
CN112000993A (en) * 2020-07-30 2020-11-27 杭州趣链科技有限公司 Block chain-based data storage verification method, equipment and storage medium
CN112000993B (en) * 2020-07-30 2023-12-05 杭州趣链科技有限公司 Block chain-based data storage verification method, equipment and storage medium
CN112422526A (en) * 2020-11-03 2021-02-26 山西特信环宇信息技术有限公司 Cone block chain consensus system, method and network
CN112422526B (en) * 2020-11-03 2023-02-03 山西特信环宇信息技术有限公司 Cone block chain consensus system, method and network
WO2022222568A1 (en) * 2021-04-23 2022-10-27 华为技术有限公司 Blockchain data management method and apparatus
CN113438237A (en) * 2021-06-24 2021-09-24 上海万向区块链股份公司 Data security collaborative computing method and system
CN113553613A (en) * 2021-06-29 2021-10-26 福建师范大学 Spatial crowdsourcing method based on deep reinforcement learning and block chain
CN113553613B (en) * 2021-06-29 2023-05-05 福建师范大学 Space crowdsourcing method based on deep reinforcement learning and blockchain
CN113515778A (en) * 2021-07-07 2021-10-19 建信金融科技有限责任公司 Multi-party privacy data fusion method and device and electronic equipment
WO2023075713A1 (en) * 2021-08-06 2023-05-04 Goksoy Omer A blockchain system
CN114153375A (en) * 2021-08-13 2022-03-08 北京天德科技有限公司 Block storage system and block storage method based on block chain technology
CN113656408A (en) * 2021-08-19 2021-11-16 龙兴(杭州)航空电子有限公司 Full-life-cycle management method and system for aviation material based on RFID combined block chain technology
CN113868231A (en) * 2021-12-03 2021-12-31 南昌龙旗信息技术有限公司 Data structure updating method and device
CN113868231B (en) * 2021-12-03 2022-03-18 南昌龙旗信息技术有限公司 Data structure updating method and device

Also Published As

Publication number Publication date
CN110941673B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN110941673B (en) Block chain data structure and task processing method and device
US11677550B2 (en) Methods and apparatus for a distributed database including anonymous entries
TWI721699B (en) System and method for parallel-processing blockchain transactions
JP6986519B2 (en) Distributed transaction propagation and validation system
Vujičić et al. Blockchain technology, bitcoin, and Ethereum: A brief overview
Zohar Bitcoin: under the hood
Kaur et al. Blockchain: A path to the future
US20200067697A1 (en) Method for operating a blockchain
KR20190093012A (en) The method for block generation and validation in block-chain system
Gayvoronskaya et al. Blockchain
CN110868286A (en) Method for generating random number based on block chain intelligent contract
CN115485042A (en) Fair demonstrable game using blockchains
Lucas et al. Consensus algorithm for a private blockchain
KR20190093011A (en) The block-chain system with enhanced security and the method of generating a data block using a double block-chain structure
KR20190099365A (en) Data management and item transaction of Mobile game users based on Blockchain
Van Hijfte Blockchain platforms: A look at the underbelly of distributed platforms
KR102349014B1 (en) Method and system for building fast synchronizable decentralized distributed database
Chaum et al. W-OTS+ up my sleeve! a hidden secure fallback for cryptocurrency wallets
Suliyanti et al. Evaluation of hash rate-based double-spending based on proof-of-work blockchain
Costa et al. A blockchain using proof-of-download
Fekkes et al. Comparing Bitcoin and Ethereum
Raj Demystifying the blockchain technology
Pathak et al. Blockchain and Bitcoin security in industry 4.0
Alam Information and Communication Technology Cryptography
Melander et al. Blockchain-What it is, and a non-financial use case

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