CN112765682B - Block data structure of block distributed block chain, storage medium and electronic equipment - Google Patents

Block data structure of block distributed block chain, storage medium and electronic equipment Download PDF

Info

Publication number
CN112765682B
CN112765682B CN202110370471.1A CN202110370471A CN112765682B CN 112765682 B CN112765682 B CN 112765682B CN 202110370471 A CN202110370471 A CN 202110370471A CN 112765682 B CN112765682 B CN 112765682B
Authority
CN
China
Prior art keywords
block
node
data structure
data
hash
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
CN202110370471.1A
Other languages
Chinese (zh)
Other versions
CN112765682A (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.)
Dark Chain Technology Shenzhen Co ltd
Original Assignee
Dark Chain Technology Shenzhen Co 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 Dark Chain Technology Shenzhen Co ltd filed Critical Dark Chain Technology Shenzhen Co ltd
Priority to CN202110370471.1A priority Critical patent/CN112765682B/en
Publication of CN112765682A publication Critical patent/CN112765682A/en
Application granted granted Critical
Publication of CN112765682B publication Critical patent/CN112765682B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of block chains, in particular to a block data structure, a storage medium and electronic equipment of a block distributed block chain. The block data structure of the block distributed block chain comprises a block body and a block head, wherein the block body comprises service data and a father node list, the father node list comprises node information of a plurality of father nodes under the same block height, the father nodes are authoritative nodes where the father block data structure of the current block data structure is located, and the block head comprises the block height, the father block hash and the block body hash. Therefore, based on the block data structure provided in this embodiment, the parent node list is used to form an interlocking relationship with the block data structures of different block heights, and the interlocking relationship is dispersedly stored in different authoritative nodes while maintaining the characteristics of decentralization, transparency and non-falsification, and super blocks of different block heights can form a block distributed block chain, so that the use efficiency of the block chain and the flexibility of the storage block are improved in this embodiment.

Description

Block data structure of block distributed block chain, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of block chains, in particular to a block data structure, a storage medium and electronic equipment of a block distributed block chain.
Background
Because the blockchain technology has the characteristics of decentralization and non-falsification, the blockchain technology is widely pursued and can be applied to various service scenes.
Generally, a block of an existing block chain includes a block header and a block body, data of the block header is generally used for assisting in checking the validity of the block and increasing the difficulty of tampering, and data of the block body is generally service data.
Based on the design thought and the block design structure of the existing block chain, as the service life of the block account book increases, the number of blocks of the block account book increases, and the data volume of some block chains gradually becomes too large, for example, the data volume of the block chain of the ether house exceeds 1TB, so that the accounting node cannot bear the storage pressure sooner or later and quits the accounting, and the block chain system is finally paralyzed or gradually centralized and loses the capability of 'mechanism credibility'.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a block data structure of a block distributed block chain, a storage medium, and an electronic device, which can improve the use efficiency of the block chain.
In a first aspect, an embodiment of the present invention provides a block data structure of a block distributed block chain, including:
the block body comprises service data and a father node list, the father node list comprises node information of a plurality of father-right nodes at the same block height, and the father-authority nodes are authority nodes where father block data structures of the current block data structures are located;
the chunk header includes the chunk height, parent chunk hash, and chunk hash.
In a second aspect, embodiments of the present invention provide a storage medium storing computer-executable instructions for causing an electronic device to generate a block data structure of a block distributed block chain as described above.
In a third aspect, embodiments of the present invention provide a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by an electronic device, cause the electronic device to generate a chunk data structure of the above-described chunk distributed chunk chain.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to generate the above-described chunk data structure for a chunk distributed blockchain.
In a fifth aspect, an embodiment of the present invention provides a block distributed blockchain system, including the electronic device.
Compared with the prior art, the invention at least has the following beneficial effects: in the block data structure of the block distributed block chain provided in the embodiment of the present invention, the block data structure includes a block body and a block head, the block body includes service data and a parent node list, the parent node list includes node information of a plurality of parent nodes at the same block height, the parent nodes are authoritative nodes where the parent block data structure of the current block data structure is located, and the block head includes a block height, a parent block hash, and a block body hash. Therefore, based on the block data structure provided in this embodiment, the parent node list is used to form an interlocking relationship with the block data structures of different block heights, which can be stored in different authoritative nodes in a distributed manner while maintaining the characteristics of decentralization, transparency and non-falsification, and super blocks of different block heights can form a block distributed block chain.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a schematic view of an application scenario of a distributed blockchain system according to an embodiment of the present invention;
fig. 2a to fig. 2e are schematic structural diagrams of a block distributed blockchain according to an embodiment of the present invention;
fig. 3 is a schematic circuit block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
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 the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. The terms "first", "second", "third", and the like used in the present invention do not limit data and execution order, but distinguish the same items or similar items having substantially the same function and action.
Fig. 1 is a schematic view of an application scenario of a distributed blockchain system according to an embodiment of the present invention, as shown in fig. 1, a distributed blockchain system 100 includes a client 11 and a blockchain network 12, where the client 11 is in communication connection with the blockchain network 12, where the communication mode includes a wireless communication mode or a wired communication mode supporting any suitable communication protocol.
The clients 11 are used to communicate with the blockchain network 12 to complete relevant business logic, such as transactions, synchronizing data, retrieving query data, uploading data, and the like. In some embodiments, the client 11 comprises a smartphone, tablet, laptop or desktop computer, or the like.
The blockchain network 12 includes various nodes serving as various service roles in a blockchain system, as shown in fig. 1, the various nodes include a block exit node 121, an authoritative node 122 and a common node 123, and the block exit node 121, the authoritative node 122 and the common node 123 are in communication connection with each other.
The out-block nodes 121 are configured to recognize the superblock, and when the common knowledge passes through the superblock, the superblock is written into the authority nodes 122, where the number of the out-block nodes 121 may be multiple, and the out-block nodes 121 may use any suitable common knowledge algorithm to complete the common knowledge of the superblock, such as a long-old community common knowledge mechanism, a workload certification (Proof of Work, PoW), a rights and interests certification (Proof of behaviour, POS), a shares certification (release of behaviour, DPoS), a Practical Bypath Fault Tolerance (PBFT), a licensed bypath Fault Tolerance (DBFT), and the like.
The superblocks described herein may be blocks of any suitable data type, any suitable data size, and no undue restrictions are imposed on the data type and/or data size of the superblocks herein.
The authoritative node 122 is used for storing the super blocks passed by the consensus of the block-out nodes 121, and generally, the authoritative node 122 is written into the super blocks earliest and is a node determined by the consensus algorithm of each block-out node 121, so that the super blocks locally stored by the authoritative node 122 have the highest authenticity, wherein the number of the authoritative nodes 122 may be multiple.
The common node 123 is a node with an accounting function, and can initiate an accounting book transaction and record a block, and can also record a super block from other nodes synchronously to update a local accounting book.
It will be appreciated that in some embodiments, some nodes in the blockchain network 12 may concurrently assume multiple business roles, e.g., the out-of-blockchain node 121 may not only commonly identify superblocks, but may also have accounting or transaction functions, and therefore, in this context, no undue restrictions are made on the business logic that the blockchain node is capable of performing. In some embodiments, a tile link point may comprise a smartphone, tablet, laptop, desktop, or server, among others.
As an aspect of the embodiments of the present invention, the embodiments of the present invention provide a chunk data structure of a chunk distributed chunk chain, and it is understood that the "chunk data structure" described herein may be understood as a "super chunk", where the super chunk may be a chunk of any suitable data type and any suitable data size.
In this embodiment, the block data structure includes a block body and a block header, the block body includes service data and a parent node list, the parent node list includes node information of a plurality of father nodes at the same block height, and the block header includes a block height, a parent block hash and a block hash.
In this embodiment, the service data may be data in any suitable service scenario, and the data content may be content in any form, for example, in the transaction scenario, the service data is transaction data of both parties, and the data content is content of a payer, a payee, a payment amount, and the like, or in order to prevent a certain technical data from being lost and unable to effectively restore a certain technology, in the important data storage scenario, the service data is important technical data of an industry, and the data content is technical content capable of restoring the industry or a certain technical segment.
In this embodiment, the service data may be packed into a candidate block, in some embodiments, before the service data is packed into the candidate block, it may be determined whether the service data meets a preset packing condition, if so, the service data is packed into the candidate block, if not, another group of service data is continuously obtained or the service data is waited to meet the preset packing condition, for example, in an important data storage scenario, it is necessary to first determine whether the current service data is sufficient to restore a certain technology, and if not, the service data is continuously searched, and the service data is waited to meet the preset packing condition. For another example, if the data amount of the current service data is smaller than the preset data threshold, the service data needs to be waited for to be equal to or larger than the preset data threshold, so that the service data can be packed into the candidate block.
In this embodiment, any suitable consensus algorithm may be adopted to consensus the candidate blocks, so as to obtain super blocks, after obtaining the super blocks, the block output node may write a specified number of super blocks into at least one new authoritative node, and the super blocks of different block heights may form a block distributed block chain.
In this embodiment, the block chain network defines the number of super blocks written by the block node into the new authority node as a designated number, and the block node writes the designated number of super blocks into the same new authority node according to the convention rule, where the designated number may be one or more than two, and the block heights of the super blocks written into the same new authority node may be different.
In this embodiment, in the blockchain network, the number of authoritative nodes may be multiple, and super blocks with different block heights may be stored in different authoritative nodes, or may be stored in the same authoritative node. When the current specified number of superblocks are written, the current authoritative node is a new authoritative node.
It can be understood that the number of the new authoritative nodes written into the super block with the specified number can be one or more than two, when more than two new authoritative nodes are written into the super block, the super block can be stored more safely, the risk that a certain new authoritative node is attacked maliciously and cannot provide the super block normally is reduced, and the efficiency of synchronizing the super block is also improved.
In this embodiment, superblocks stored by different authoritative nodes or superblocks of the same authoritative node are interlocked, so as to form a block distributed block chain.
For example, referring to fig. 2a, authority node 1-1 writes a super block with a block height of 1, authority node 2-1 writes a super block with a block height of 2, authority node 3-1 writes a super block with a block height of 3, and so on, so in fig. 2a, each authority node writes one super block, and the super blocks of each authority node form an interlocking relationship with each other, thereby forming a block distributed block chain.
For another example, referring to fig. 2b, the authority node 1-1, the authority node 1-2, and the authority node 1-3 all write a super block with a block height of 1, the authority node 2-2, and the authority node 2-3 all write a super block with a block height of 2, the authority node 3-1, the authority node 3-2, and the authority node 3-3 all write a super block with a block height of 3, and so on, so in fig. 2b, the super blocks with the same block height are respectively written into a plurality of authority nodes, each authority node writes into a super block, and the super blocks of each authority node form an interlocking relationship with each other, thereby forming a block distributed block chain.
For example, referring to fig. 2c, the authority node 1-1 writes superblocks with block heights of 1 and 2, the authority node 2-1 writes superblocks with block heights of 3 and 4, the authority node 3-1 writes superblocks with block heights of 5 and 6, and so on, so that in fig. 2c, each authority node writes two superblocks with consecutive block heights, and the superblocks of each authority node and the superblocks of the same authority node form an interlocking relationship with each other, thereby forming a block distributed block chain.
For example, referring to fig. 2d, a plurality of authority nodes 1-1 all write super blocks with block heights of 1 and 2, a plurality of authority nodes 2-1 all write super blocks with block heights of 3 and 4, a plurality of authority nodes 3-1 all write super blocks with block heights of 5 and 6, and so on, so in fig. 2d, a plurality of authority nodes write two super blocks with continuous block heights, and the super blocks of each authority node and the super blocks of the same authority node form an interlocking relationship with each other, thereby forming a block distributed block chain.
It is understood that the super block written into the authority node may be multiple, and multiple authority nodes 1-1 write the super blocks with block heights of 1, 2 and 3 respectively.
It is further understood that the block heights of the superblocks written to the same authoritative node may be continuous or discontinuous, the block chain network may self-agree on block writing rules, and each out-block node may complete writing of the superblock according to the block writing rules. As shown in fig. 2e, a plurality of authority nodes 1-1 write super blocks with block heights of 1 and 3, a plurality of authority nodes 2-1 write super blocks with block heights of 2 and 4, a plurality of authority nodes 3-1 write super blocks with block heights of 5 and 7, and so on, so in fig. 2e, a plurality of authority nodes write two super blocks with discontinuous block heights, and the super blocks of each authority node and the super blocks of the same authority node form an interlocking relationship with each other, thereby forming a block distributed block chain.
According to the embodiments, compared with the existing block chain, the method can break the existing block chain, dispersedly store the super blocks, the dispersed super blocks can form the block distributed block chain, when the block distributed block chain is synchronized by the following related accounting nodes, the whole block chain does not need to be synchronized as in the prior art, and only the corresponding super blocks need to be accounted according to the self requirements, so that the use efficiency of the block chain is improved. And on the premise of improving the flexibility of the storage blocks, the distributed block chain of the blocks provided by the embodiment can be ensured to have the characteristics of decentralization, transparency and no tampering. Even along with the increase of the service time of the block chain, the embodiment can balance and coordinate the storage capacity of the accounting node, and avoid the situation that the accounting node stores too much block data to cause breakdown or quit accounting.
In addition, the existing block chain depends on the timed block output of the accounting content, so that the block is idle and full, and the operation benefit is poor.
In some embodiments, after each new authority node stores a specified number of superblocks, configured in a closed mode in which it is prohibited from receiving other superblocks, the superblocks are in read-only mode.
The read-only mode is a mode that the data of the super block can only be read but modification, deletion or updating is forbidden.
In some embodiments, after each authoritative node enters the closed mode, although it prohibits writing other blocks, it may also receive writing of auxiliary data other than blocks, for example, the auxiliary data includes address information of other authoritative nodes and the block height of the super block.
Therefore, as the authority node enters the closed mode, the super blocks can be prevented from being added or deleted due to malicious attack of the authority node, and the order, the safety and the stability of the block distributed block chain are favorably maintained. And moreover, the super block enters a read-only mode after being written into the authority node, so that malicious nodes are prevented from tampering or deleting the super block, and the data stability and the security of the super block are maintained.
In some embodiments, the number of superblocks with different block heights is 1, and the superblocks with different block heights are distributed in different authoritative nodes to form a block distribution type block chain, that is, the block chain structure is as shown in fig. 2a, and by adopting the block chain structure, the real-time performance of the block chain can be improved, which is beneficial to enhancing the safety and transparency of the block chain.
For more secure and reliable shaping of the block distributed block chain, please refer to table 1 in some embodiments:
TABLE 1
Figure 330865DEST_PATH_IMAGE001
As shown in table 1, the super block includes a block body including service data and a parent node list, the block header includes a block height, a parent block hash and a block body hash, and the parent node list includes node information of each parent node at the same block height.
In this embodiment, the parent node list is a list containing node information of each father node at the same block height, the block height is the arrangement height of the current superblock in the bdb chain, the parent block hash is the hash of a block arranged in front of the current superblock in the bdb chain, and the block hash is used to anchor each data in the block, and in some embodiments, the block hash may be the hash of all data in the block, and may also include the service data hash and the parent node list hash, please refer to table 2:
TABLE 2
Figure 505494DEST_PATH_IMAGE002
As shown in table 2, the service data hash is a hash of the service data in the zone block, and the parent node list hash is a hash of the parent node list in the zone block. Since the block hash is divided into the service data hash and the parent node list hash, when the super block is verified subsequently, the method can be beneficial to other nodes to reliably and safely verify the validity of the super block in a multi-dimensional manner.
As shown in table 1 or table 2, the father node is the authority node where the parent superblock of the current superblock is located, for example, referring to fig. 2b, the second superblock with block height of 1 is the parent of the first superblock with block height of 2, i.e. the second superblock and the first superblock are in a parent-child relationship, so that authority node 1-1 is the father node of authority node 2-1.
In some embodiments, since the parent node list includes node information of each supernode at the same block height, when the validity of the current super block is verified at a later stage, the block link point may extract node information of each supernode in the parent node list from the current super block, obtain the parent super block according to the node information of the supernode, calculate a parent block hash of the parent super block, compare the parent block hash with the parent block hash of the current super block, if the parent block hash is consistent with the parent block hash of the current super block, the current super block is legal at the point, and if the parent block hash is inconsistent with the parent block hash, the current super block is illegal. Therefore, by adopting the method, the block distributed block chain can be shaped more safely and reliably.
In some embodiments, the node information of each authoritative node includes a node hash and/or a node public key, the node hash of the authoritative node is used for identifying the authoritative node, the node hash may be a hash of a device serial number of the authoritative node, or may be calculated according to a hash algorithm from a character or a character string representing the device information of the authoritative node, or may be a hash representing an address of the authoritative node, and at a later stage, other block chain nodes may access the authoritative node according to the node information of the authoritative node. The node public key is used for assisting in verifying the validity of the related service participated by the authoritative node, wherein the node public key of the authoritative node can be broadcasted in the block chain network, and the node public key of the authoritative node can be obtained by the related block chain node.
In some embodiments, the block header of the superblock includes a node signature of the out-of-block node, and subsequent related nodes may verify the validity of the superblock based on the node signature of the out-of-block node.
Generally, based on the block data structure provided in this embodiment, the parent node list is used to form an interlocking relationship with the block data structures of different block heights, which can be stored in different authoritative nodes in a distributed manner while maintaining the characteristics of decentralization, transparency and non-falsification, and super blocks of different block heights can form a block distributed block chain, so that the present embodiment can improve the utilization efficiency of the block chain and improve the flexibility of the storage block.
Typically, the data in the blocks of an existing blockchain is consistent, e.g., in an existing blockchain, both block chain node a1 and block link point a2 hold the same block book, which includes block S with a block height of 100, wherein, the block S with block height 100 at block link point a1 and the block S with block height 100 at block link point a2 are the same, i.e. the data of both blocks are identical, however, because superblocks of the block distributed block chain are stored in different authoritative nodes in a scattered manner, the authoritative nodes do not store all blocks on the block chain as in the existing block chain, the relationship between a current block and a local node or a father node cannot be effectively reflected in the block distributed block chain by the block structure, and the superblocks are easily attacked by subsequent blocks or malicious nodes which cannot be verified efficiently.
Therefore, in some embodiments, the superblock block further includes a data variable area, the data of the data variable area in each superblock may be inconsistent at the same block height, and the data of the data variable area may be variable before the superblock is linked and may not be variable after the superblock is linked, for example, superblock B1 is written into authoritative node C1, which includes data variable area D1. Superblock B2 writes to authority node C2, which includes data variable region D2.
Superblock B3 writes to authority node C3, which includes data variable region D3. The superblocks B1, B2 and B3 all have a block height of 150, and the data in the data variable region D1 and D2 are consistent, and the data in the data variable region D1 and D3 are inconsistent.
Before superblock B1 is written to authority node C1, i.e., superblock B1 is linked to the distributed block chain of blocks, the data in data variable region D1 may be modified, updated or deleted, and after being written to authority node C1, i.e., superblock B1 is linked to the distributed block chain of blocks, at which time the data in data variable region D1 is immutable, e.g., superblock B1 is configured to enter a read-only mode. For superblocks B2 and B3, the data change of the data variable region can be deduced according to the reasoning described above, and will not be described herein.
Therefore, the super block is additionally provided with the data variable area, so that the forming relationship of the super block in the block distributed block chain can be more flexibly and comprehensively described, and the use efficiency, the operation efficiency and the safety of the block distributed block chain are improved.
It will be appreciated that the content representation of the data variable regions in each superblock can be logically derived and self-determined by those skilled in the art in light of the disclosure herein.
In some embodiments, the data variable region includes local feature data associated with the local node, the local feature data being used to represent features of the local superblock and/or the local node, wherein the local node may be not only a local authority node, but also any role node that holds the superblock, for example, in a normal node holding superblock, the data variable region includes the local feature data.
In some embodiments, please refer to table 3:
TABLE 3
Figure 247185DEST_PATH_IMAGE003
In table 3, the chunk hash is a hash of the service data, a hash of the parent node list, or a hash calculated by the service data and the parent node list together.
As shown in table 3, the local feature data includes a local node field for indicating local node information for storing the superblock and/or a local block source field for indicating source node information for the superblock.
For example, superblock E1 is stored in regular node F1, and its local node field is used to indicate node information of regular node F1. Superblock E2 is stored in authoritative node F2, and its local node field is used to represent the node information of authoritative node F2.
Assuming that the normal node F1 synchronizes the superblock E2 from the daughtercard F2, thereby obtaining the local superblock E1, since the superblock E1 is originated from the superblock E2, the authoritative node F2 is the source node of the normal node F1, and thus, the local block source field is used to represent the node information of the authoritative node F2.
Further assuming that the superblock E3 is stored in the regular node F3, wherein the regular node F3 synchronizes the superblock E1 from the regular node F1, thereby obtaining the local superblock E3, since the superblock E3 is originated from the superblock E1, the regular node F1 is the source node of the regular node F3, and thus, the local block source field is used to indicate the node information of the regular node F1. It will be appreciated that when the local node is an authoritative node, the local block source field is empty.
Therefore, by adopting the method, when the number of synchronization times of a certain super block is more, each super block can also form a certain degree of interlocking relation based on the local characteristic data, if the data of the local super block is maliciously modified by a certain block chain node, the next block chain node of the super block is synchronized, except for the verification according to the method provided above, the super block can also be verified through the local characteristic data, if the super block is verified to be illegal, the related block chain node having inheritance relation with the super block can be easily locked through the local characteristic data, the investigation is carried out from the related block chain node, and the investigation result is broadcasted in the block chain network, so that the corresponding block chain node can execute corresponding safe operation, and the block distributed block chain can be effectively and safely maintained and operated.
In some embodiments, the local node field comprises a local node hash and/or a local block priority and/or a local node public key and/or a local signature field of the local node.
The local node hash includes a hash of the device information and/or the node address of the local node.
The local block priority is used to indicate the priority of each super block with the same block height stored by the corresponding node, wherein the local block priorities of different super blocks with the same block height at different nodes may be the same or different.
For example, superblock G1 is stored in authority node H1, superblock G2 is stored in normal node H2, superblock G3 is stored in normal node H3, superblock G4 is stored in normal node H4, wherein superblock G2 and superblock G3 are synchronized by normal node H2 and normal node H3 respectively with superblock G1 of authority node H1, superblock G4 is synchronized by normal node H4 with superblock G3 of normal node H3, so that, although superblock G1, superblock G2, superblock G3 and superblock G4 have the same block height, superblock G1 has a local block priority higher than superblock G2 and superblock G3, superblock G2 has a local block priority equal to that of superblock G3, superblock G4 has a local priority lower than super block 3, and requires synchronization with superblock G5, superblock G1 of authority node H1 may be prioritized for synchronization.
The local node public key is used for assisting in verifying the validity of a related service participated by the local node, wherein the node public key of the local node can be broadcasted in the block chain network, and the node public key of the local node can be obtained by the related block chain node.
The local signature field is the signature of the local node on the data in the data variable area except the local signature field, and other subsequent block chain nodes can verify whether the data in the data variable area is tampered or not through the local signature field, so that the method is favorable for efficiently and safely checking the data in the data variable area on the premise that the data variable area is added to the super block.
In some embodiments, the local superblock origin field includes an inheritance field for indicating node information of an inheritance node corresponding to the superblock to be inherited and/or a root origin field for indicating node information of a root origin node corresponding to the local superblock, the root origin node being the node that retroactively stores the local superblock earliest.
For example, as previously described, superblock G1 is the super block inherited to superblock G2 or G3, and thus authoritative node H1 is the successor node to normal node H2 and normal node H3. Similarly, for superblock G4, superblock G3 is the inherited superblock, so ordinary node H3 is the successor node of ordinary node H4, and therefore, in superblock G4 of ordinary node H4, the node information written in its successor field is the node information of ordinary node H3.
As another example, assume that regular node H5 synchronizes superblock G1 to authoritative node H1, resulting in superblock G5. The ordinary node H6 synchronizes the superblock G4 of the ordinary node H4 to obtain a superblock G6, the ordinary node H7 synchronizes the superblock G6 of the ordinary node H6 to obtain a superblock G7, and the ordinary node H8 synchronizes the superblock G7 of the ordinary node H7 to obtain a superblock G8. For the normal node H8, the superblock G8 is a local superblock, the synchronization path of the superblock G8 is G8-G7-G6-G4-G3-G1, and the superblock G1 is stored in the authoritative node H1, so that the node which stores the superblock G8 retrospectively is the authoritative node H1, that is, the authoritative node H1 is the root node, and therefore, in the superblock G8 of the normal node H8, the node information written in the root field is the node information of the authoritative node H1.
Assuming that the normal node H4 storing the superblock G4 disappears in the blockchain network, for example, the normal node H4 is crashed off-line by malicious attack or lost by physical destruction, and therefore, the superblock G4 also disappears following the disappearance of the normal node H4, for the superblock G8, when the normal node H8 traces back to the superblock G6 of the normal node H6, the origin of the superblock G8 cannot be traced back, and therefore, the normal node H8 can trace back to the node storing the superblock G8 as the earliest as the normal node H6, that is, the normal node H6 is the root node, and therefore, in the superblock G8 of the normal node H8, the node information written in the root field is the node information of the normal node H6.
Therefore, by adding the inheritance field and/or the root field, the synchronization path of the corresponding superblock can be simply, reliably, comprehensively and safely restored under the block distributed storage form, and the block distributed block chain can be more effectively and safely maintained.
In some embodiments, the node information of the inheritance node comprises the inheritance node hash and/or the inheritance node priority and/or the inheritance node public key and/or the local signature field of the inheritance node, and the local signature field of the inheritance node is a signature of the local node on data in the data variable region except the local signature field of the inheritance node. And/or the node information of the root node comprises the hash of the root node and/or the priority of the root node and/or the public key of the root node and/or the local signature field of the root node, and the local signature field of the root node is the signature of the local node on the data except the local signature field of the root node in the data variable region.
Referring to fig. 3, fig. 3 is a schematic circuit block diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 3, the electronic device 300 includes one or more processors 31 and a memory 32. In fig. 3, one processor 31 is taken as an example.
The processor 31 and the memory 32 may be connected by a bus or other means, such as the bus connection in fig. 3.
The memory 32 is used as a storage medium for storing nonvolatile software programs, nonvolatile computer-executable programs, and modules, such as program instructions/modules corresponding to the data transmission method based on the block chain in the embodiment of the present invention. The processor 31 implements the function of generating a block data structure of the block distributed block chain by running non-volatile software programs, instructions and modules stored in the memory 32.
The memory 32 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 32 may optionally include memory located remotely from the processor 31, and these remote memories may be connected to the processor 31 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The program instructions/modules are stored in the memory 32 and, when executed by the one or more processors 31, generate a chunk data structure for a chunk distributed chunk chain.
Embodiments of the present invention also provide a non-transitory computer storage medium storing computer-executable instructions, which are executed by one or more processors, such as one of the processors 31 in fig. 3, to enable the one or more processors to generate a block data structure of a block distributed block chain.
Embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by an electronic device, cause the electronic device to generate a chunk data structure for a chunk distributed chain of chunks.
The above-described embodiments of the apparatus or device are merely illustrative, wherein the unit modules described as separate parts may or may not be physically separate, and the parts displayed as module units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions substantially or contributing to the related art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for generating a block data structure, applied to a block distributed block chain, includes:
generating a block body, wherein the block body comprises service data and a father node list, the father node list comprises node information of a plurality of father-right nodes at the same block height, and the father-right nodes are authoritative nodes where a father block data structure of a current block data structure is located;
and generating a block header, wherein the block header comprises a block height, a parent block hash and a block hash, and the block data structure comprises the block body and the block header, wherein each authoritative node stores a specified number of block data structures, and the block data structures with different block heights can form a block distributed block chain.
2. The method according to claim 1, wherein the node information of each authoritative node comprises a node hash and/or a node public key.
3. The method of claim 1, wherein the block header comprises a node signature of a block output node, and wherein the block output node is configured to pack the service data into the block data structure.
4. The method of claim 1, wherein the zone block hash comprises a traffic data hash and a parent node list hash.
5. The method of claim 1, wherein each authoritative node, after storing a specified number of block data structures, is configured in a closed mode to prohibit receiving other blocks, said block data structures being in a read-only mode.
6. The method according to claim 1, wherein the specified number is 1, and the block data structures of different block heights are distributed in different authoritative nodes to form a block distributed block chain.
7. A storage medium storing computer-executable instructions for causing an electronic device to perform the method of generating a tile data structure according to any one of claims 1 to 6.
8. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method of generating a tile data structure according to any one of claims 1 to 6.
9. A block distributed blockchain system comprising the electronic device of claim 8.
CN202110370471.1A 2021-04-07 2021-04-07 Block data structure of block distributed block chain, storage medium and electronic equipment Active CN112765682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110370471.1A CN112765682B (en) 2021-04-07 2021-04-07 Block data structure of block distributed block chain, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110370471.1A CN112765682B (en) 2021-04-07 2021-04-07 Block data structure of block distributed block chain, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112765682A CN112765682A (en) 2021-05-07
CN112765682B true CN112765682B (en) 2022-08-05

Family

ID=75691330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110370471.1A Active CN112765682B (en) 2021-04-07 2021-04-07 Block data structure of block distributed block chain, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112765682B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338673A (en) * 2021-12-30 2022-04-12 马上消费金融股份有限公司 Transaction data processing method, device, equipment, system and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111768202A (en) * 2019-04-24 2020-10-13 北京京东尚科信息技术有限公司 Payment verification method, payment verification node, full-amount node and storage medium
CN110471795B (en) * 2019-07-31 2020-10-02 阿里巴巴集团控股有限公司 Block chain state data recovery method and device and electronic equipment
CN110784501B (en) * 2019-07-15 2022-02-25 杭州复杂美科技有限公司 Method, system, device and storage medium for packaging and broadcasting transaction group containing block
CN112486977B (en) * 2019-08-20 2023-12-22 本无链科技(深圳)有限公司 Method and system for forging block by chain type mobile terminal
CN110690974B (en) * 2019-12-10 2020-06-23 腾讯科技(深圳)有限公司 Block chain based data verification method, device, equipment and readable storage medium
CN111159289B (en) * 2019-12-17 2024-03-01 深圳前海微众银行股份有限公司 Method and device for synchronizing blocks
CN111258986A (en) * 2020-01-17 2020-06-09 杭州龙纪科技有限公司 Rollback method of block chain
CN112052235A (en) * 2020-09-21 2020-12-08 深圳前海微众银行股份有限公司 Method and device for migrating block chain transaction data
CN112039926B (en) * 2020-11-04 2021-03-26 南京金宁汇科技有限公司 Method for realizing double-layer chain type architecture of block chain

Also Published As

Publication number Publication date
CN112765682A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
US10630463B2 (en) Meta block chain
CN109313763B (en) Hierarchical network system and node for hierarchical network system
EP3552343B1 (en) Method and apparatus for creating a finite blockchain
CN106372533B (en) Content storage method based on block chain technology
WO2018112949A1 (en) Block chain mining method, device, and node apparatus
CN109543455B (en) Data archiving method and device for block chain
CN110868440A (en) Block chain male chain
CN111630507A (en) Distributed blockchain data storage under account model
CN111444196B (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN111630830A (en) Distributed blockchain data storage under account model
CN111061769A (en) Consensus method of block chain system and related equipment
CN112765137B (en) Block synchronization method based on block distributed block chain and electronic equipment
CN111373693A (en) Indexing and recovering encoded blockchain data
CN109492049B (en) Data processing, block generation and synchronization method for block chain network
CN109409882A (en) A kind of credit accreditation storage method and device based on block chain
CN113901005A (en) Portable file storage method, system and medium based on block chain
CN111010284B (en) Processing method of block to be identified, related device and block chain system
CN115769206A (en) Cryptographic data entry blockchain data structure
CN111033491A (en) Storing shared blockchain data based on error correction coding
CN112765682B (en) Block data structure of block distributed block chain, storage medium and electronic equipment
CN111226206A (en) Taking snapshots of blockchain data
CN115134069A (en) Block chain editing method and block chain link point
CN112765683B (en) Block data structure of block chain, storage medium and electronic equipment
CN111316256A (en) Taking snapshots of blockchain data
CN112765222B (en) Block chain-based data transmission method, storage medium and electronic device

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