CN109391645B - Block chain lightweight processing method, block chain node and storage medium - Google Patents

Block chain lightweight processing method, block chain node and storage medium Download PDF

Info

Publication number
CN109391645B
CN109391645B CN201710657510.XA CN201710657510A CN109391645B CN 109391645 B CN109391645 B CN 109391645B CN 201710657510 A CN201710657510 A CN 201710657510A CN 109391645 B CN109391645 B CN 109391645B
Authority
CN
China
Prior art keywords
block
chain
blocks
parameter
deleted
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
CN201710657510.XA
Other languages
Chinese (zh)
Other versions
CN109391645A (en
Inventor
阎军智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201710657510.XA priority Critical patent/CN109391645B/en
Priority to PCT/CN2018/097415 priority patent/WO2019024780A1/en
Publication of CN109391645A publication Critical patent/CN109391645A/en
Application granted granted Critical
Publication of CN109391645B publication Critical patent/CN109391645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0609Buyer or seller confidence or verification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the invention discloses a block chain lightweight processing method, a block chain node and a computer storage medium. The block chain lightweight processing method applied to the first block chain node comprises the following steps: generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer; deleting the N blocks in the transaction chain; storing the parameter blocks, wherein the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain, wherein the parent blocks of the parameter blocks are: the sub-region of the parameter block is a previous block of the N deleted blocks in the transaction chain: the latter region of the deleted N blocks in the transaction chain.

Description

Block chain lightweight processing method, block chain node and storage medium
Technical Field
The present invention relates to the field of information technology, and in particular, to a block chain lightweight processing method, a block chain node, and a computer storage medium.
Background
The block chain technology which is emerging in recent years is a chain data structure which combines data blocks in a sequential connection mode according to time sequence and guarantees the distributed account book which is not falsifiable and counterfeitable in a cryptographic mode. The core technology of the blockchain is to utilize a blockchain type data structure to verify and store data, utilize a distributed node consensus algorithm to generate and update data, and utilize a cryptographic mode to ensure the safety of data transmission and access.
One of the big problems of the blockchain is that all historical transactions are contained in the blockchain, as the transaction amount increases, the blocks in the blockchain are increased, the data of the whole blockchain is larger and larger, and the demand on the node storage and calculation resources is higher and higher.
Disclosure of Invention
In view of the above, embodiments of the present invention are directed to a method for processing a block chain with reduced weight, a block chain node, and a computer storage medium, which at least partially solve the problem of large resource consumption, such as storage resources, in the block chain technology.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a first aspect of an embodiment of the present invention provides a block chain lightweight processing method, applied to a first block chain node, including:
generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer;
deleting the N blocks in the transaction chain;
storing the parameter blocks, wherein the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain, wherein the parent blocks of the parameter blocks are: the sub-region of the parameter block is a previous block of the N deleted blocks in the transaction chain: the latter region of the deleted N blocks in the transaction chain.
Based on the above scheme, the method further comprises:
judging whether N blocks continuously distributed in a transaction chain meet a preset deleting condition or not;
the generating a parameter block based on the N blocks to be deleted that are continuously distributed in the transaction chain includes:
and if the preset deleting condition is met, generating a parameter block based on the N blocks.
Based on the above scheme, the parameter block at least includes: a head pointer and a tail pointer;
the head pointer points to a previous block in the deleted N blocks in the transaction chain;
the tail pointer points to a next block of the N deleted blocks in the transaction chain.
Based on the above scheme, the head pointer comprises: a hash value of a previous block of the deleted N blocks in the transaction chain;
the tail pointer includes: hash values of a block subsequent to the deleted N regions in the transaction chain.
Based on the above scheme, the generating the parameter block based on the N blocks to be deleted that are continuously distributed in the transaction chain includes:
calculating a check value by using the hash values of the N blocks to be deleted, wherein the parameter block further comprises the check value, and the check value is used for verifying the optimization chain by the link point of the second block when the optimization chain is sent to the node of the second block chain.
Based on the above scheme, the method further comprises:
when a block to be deleted is newly added in the optimization chain, updating the parameter block according to the block parameter of the newly added block to be deleted; wherein the updated parameter block is to be linked to a subsequent block of the transaction chain that satisfies the preset deletion condition;
and deleting the newly added block to be deleted.
A second aspect of the embodiments of the present invention provides a block chain lightweight processing method, applied to a second block chain node, including:
sending a replication request of the block chain to a first block chain link point;
when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
receiving the block parameters returned by the third block chain node;
verifying a parameter block in the optimization chain based on the block parameter;
storing the optimization blocks to form the optimization chain when the parameter blocks are verified.
Based on the foregoing solution, when the first block link point returns to the optimization chain based on the replication request, and based on the parameter block in the optimization chain, the sending an obtaining request for obtaining block parameters of N blocks deleted in the optimization chain to a third block chain node includes:
determining a first hash value and a second hash value based on the parameter block, wherein the first hash value is: the hash value of the first block of the N consecutive blocks from which the deletion has been performed is: the hash values of the last blocks of the deleted consecutive respective N blocks; wherein the block parameters at least include: deleting hash values of 2 nd to N-1 th blocks in the N blocks which are distributed continuously; the parameter block further comprises: checking a value;
sending an acquisition request carrying the first hash value and the second hash value to the third block chain node;
the verifying the parameter blocks in the optimization chain based on the block parameters comprises:
generating a function value by using a preset function based on the deleted hash values of the N blocks which are continuously distributed;
matching the generated function value with the check value;
and if the matching is consistent, determining that the parameter block passes the verification.
A third aspect of the embodiments of the present invention provides a block link node, where the block link node is a first block link node, and the block link node includes:
the generating unit is used for generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer;
a deletion unit configured to delete the N blocks in the transaction chain;
a first storage unit, configured to store the parameter block, where the parameter block and an undeleted block in the transaction chain together form an optimization chain, where a parent block of the parameter block is: the sub-region of the parameter block is a previous block of the N deleted blocks in the transaction chain: the latter region of the deleted N blocks in the transaction chain.
A fourth aspect of the embodiments of the present invention provides a block link node, where the block link node is a second block link node, including:
a sending unit, configured to send a replication request of a block chain to a first block link point; when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
a receiving unit, configured to receive the block parameter returned by the third block chain node;
a verification unit, configured to verify a parameter block in the optimization chain based on the block parameter;
a second storage unit for storing the optimized blocks to form the optimized chain when the parameter blocks pass verification.
A fifth aspect of an embodiment of the present invention provides a block link point, including: a transceiver, a memory, a processor, and a computer program stored on the memory and processed by the processor;
the processor is connected to the transceiver and the memory, and configured to control information interaction of the transceiver and information storage of the memory by executing the computer program, and execute the block chain lightweight processing method provided in any one or more of the foregoing technical solutions.
A fifth aspect of the embodiments of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is capable of implementing a block chain lightweight processing method according to any one or more of the above-mentioned technical solutions when executed.
In order to reduce the data amount of the block chain, the block chain lightweight processing method, the block chain node and the computer storage medium provided by the embodiment of the invention generate a parameter block based on the block parameter of the block to be deleted, and the parameter block can link the previous block and the next block of the deleted block to form an optimized optimization chain. The number of blocks of the optimization chain is usually less than the number of blocks of the transaction chain where complete blocks are kept, and the data size of the parameter blocks is usually less than the data size of the blocks including transaction information in one transaction chain, so that the data size of the optimization chain as a whole is much less than the transaction size. If the blockchain node only stores the optimized chain, obviously, the storage resources consumed by blockchain storage can be reduced, and meanwhile, the calculation resources consumed by subsequent query operations and the like are facilitated, so that the calculation resources consumed by query operations and the like of all blockchains can be saved. Therefore, the problem of large resource consumption of storage resources and the like in the prior block chain technology is solved.
Drawings
FIG. 1 is a schematic diagram of a blockchain;
FIG. 2 is a schematic diagram of another block chain structure;
fig. 3 is a schematic flow chart of a first block chain weight reduction process according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a second block chain weight reduction process according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a transaction chain according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the optimized chain formed after optimization of the trade chain shown in FIG. 5;
fig. 7 is a schematic flow chart of a third block chain weight reduction process according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an optimized chain that is optimized again based on the optimized chain shown in FIG. 6;
fig. 9 is a schematic flow chart of a fourth block chain weight reduction process according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a first blockchain node according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a second blockchain node according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a block chain node according to an embodiment of the present invention.
Detailed Description
The technical solution of the present invention is further described in detail with reference to the drawings and the specific embodiments of the specification.
The following describes information about blocks of the transaction chain.
As shown in fig. 1, in the blockchain technique, blocks are sequentially generated and connected into a chain one by one in time sequence, each block records transaction information generated during creation, and recognized transactions based on a consensus mechanism of each blockchain link point in the blockchain network are obtained and are permanently stored in the blockchain. As shown in fig. 1, the data structure of a block is generally divided into a block header and a block body. As shown in fig. 2, the block header of each block contains the hash value of the previous block (i.e., the parent block), thereby forming a chain from the created block to the current block, and determining the position of each block in the entire block chain. Typically the block header of the next block comprises the hash value stored within the block header of the previous block. To prevent tampering with transactions in a block, the blockchain uses the merkel (Merkle) tree to accommodate all transactions in a block, the Merkle root is the summary of all transactions, and any change in transaction information in a block changes the Merkle root. The tile body contains verified transaction information generated during the tile creation process. As shown in fig. 2, the block header of block k includes the hash value in the block header of block k-1; and the block header of each block also contains information such as random number, time stamp of generation time, etc. One block may record multiple transaction messages, where the timestamp may also be the transaction timestamp of each transaction.
An embodiment of the present invention provides a block chain lightweight processing method, applied to a first block chain node, as shown in fig. 3, including:
step S110: generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer;
step S120: deleting the N blocks in the transaction chain;
step S130: storing the parameter blocks, wherein the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain, wherein the parent blocks of the parameter blocks are: the sub-region of the parameter block is a previous block of the N deleted blocks in the transaction chain: the latter region of the deleted N blocks in the transaction chain.
The method for processing a blockchain with reduced weight according to this embodiment is a method for substantially reducing the data size of a blockchain, so that the blockchain has a light weight in terms of data size.
In this embodiment, the first blockchain node may be any accounting node in the blockchain network. In this embodiment, in order to save the data storage amount of the local storage block chain and the computing resource for maintaining the data storage, the accounting node may delete some blocks in the original block chain (i.e., the transaction chain) formed by the blocks, which satisfy the deletion condition. In this embodiment, the N blocks distributed continuously, preferably a plurality of blocks distributed continuously, can reduce the generation of parameter blocks to the maximum extent, and reduce the data amount of the optimization chain.
However, after deleting these blocks, it is necessary to ensure the chain structure of the block chain, and a parameter block, which is a block that can replace a plurality of blocks already deleted and links the blocks not deleted in the transaction chain, is formed into an optimized chain with a data volume much smaller than that of the original transaction chain. In this way, the chain structure of the block chain is still completely preserved.
Therefore, the first block chain link point can only store the optimized chain by deleting the corresponding block, so that the occupation of the storage resources of the block chain can be reduced, and the consumption of the system resources required by maintaining the block chains can be reduced.
In some embodiments, as shown in fig. 4, the method further comprises:
step S100: judging whether N blocks continuously distributed in a transaction chain meet a preset deleting condition or not;
the step S110 may specifically include step S111; the step S111 may include:
and if the preset deleting condition is met, generating a parameter block based on the N blocks.
There are various ways to determine whether the N blocks that are continuously distributed satisfy the predetermined deletion condition, and several alternative ways are provided below.
The first alternative is as follows:
the step S100 may include:
judging whether the transaction contents recorded by the N blocks which are continuously distributed exceed the validity period or not;
when the transaction content recorded by the N blocks which are continuously distributed exceeds the validity period, the N blocks which are continuously distributed are considered to meet the preset deleting condition.
For example, the block of each block in the transaction chain stores therein the certificate information assigned to the corresponding user, and the certificate information is of a certain timeliness, and when the certificate information has exceeded the validity period, that is, the timeliness has been lost, the certificate information stored in the block of the block may be considered to be invalid, and the block may be deleted in order to save the storage space. The information status of the block can be considered to satisfy the preset storage condition. The certificate information may be one of the aforementioned transaction information. The certificate information here may include: authorization certificates, user information of the authorization certificates, and the like.
The second option is:
the step S100 may include:
extracting the time stamp of each block in the transaction chain or the optimization chain; the timestamp comprises a generation time of the corresponding block;
judging whether the time difference between the current time and the generation time exceeds a preset time threshold value or not;
if the time difference exceeds a preset time threshold, the corresponding block can be considered as the block meeting the preset deleting condition.
For example, in some cases, although some blocks may not be hard to design the validity of the information, the probability that the corresponding transaction information in the block can be subsequently queried is almost zero, or is smaller than a preset probability. For example, blocks are generated that have a time exceeding a time threshold. The time threshold may be 1 year, 2 years, 5 years, or the like.
The optional mode three:
the step S100 may include:
extracting the number of blocks spaced between the historical blocks in the transaction chain or the optimization chain and the last generated block;
and when the number of the blocks exceeds the number threshold, the corresponding block is considered as the block to be deleted meeting the preset deleting condition.
For example, a historical block with a predetermined number of blocks separated from the current newest block in the transaction chain, for example, the transaction chain a currently includes 5.3 ten thousand blocks, and if the predetermined number is 1 ten thousand, blocks before the 4.3 rd ten thousand blocks (except for the created block) are all blocks that can be deleted.
It should be noted that the deletable block in this embodiment does not include a created block in the transaction chain, where the created block is the first block in the transaction chain.
In short, in this embodiment, the deletion of valid information caused by deleting a block is avoided, and only a block satisfying a preset deletion condition in the transaction chain or the optimization chain is deleted, so as to ensure that the optimized block after deleting the corresponding block can satisfy the requirements of subsequent information query and/or verification, and the requirements of information query are satisfied as much as possible while reducing storage resources and calculation resources occupied by data amount.
In this embodiment, the introduction of step S100 is equivalent to deleting only the blocks satisfying the preset deletion condition in the first block chain node, and in some cases, the first block chain node may selectively use the storage of the discarded partial blocks according to the usage status of its own storage resource, and the like, without determining which blocks satisfy the preset deletion condition. For example, in an application scenario, the current utilization rate of the memory resource of the blockchain node a is higher than the maximum utilization rate threshold, and in order to ensure the normal operation of the blockchain node, a part of the memory resource must be released. Then, according to a selection mode such as a random algorithm, the blocks in one or more transaction chains are set as the blocks to be deleted, and partial storage resources are released through deletion of the blocks and storage of the optimized chains.
Optionally, the parameter block at least includes: a head pointer and a tail pointer;
the head pointer points to a previous block in the deleted N blocks in the transaction chain;
the tail pointer points to a next block of the N deleted blocks in the transaction chain.
For example, in the transaction chain, N blocks deleted are the ith to jth blocks, the head pointer points to the (i-1) th block in the transaction chain, and the tail pointer points to the (j +1) th block. The head pointer and the tail pointer may be block identifiers for executing corresponding blocks, and/or the storage address and the like may uniquely identify the block or the position of the block in the zone chain. In this embodiment, the block chain may include: a trade chain that completely contains all tiles may also include an optimization chain that introduces parameter tiles.
Fig. 5 is a schematic diagram of a complete transaction chain. Preferably, the head pointer includes: a hash value of a previous block of the deleted N blocks in the transaction chain; the tail pointer includes: hash values of a block subsequent to the deleted N regions in the transaction chain.
Fig. 6 is a schematic diagram of an optimization chain with a plurality of consecutive blocks in the transaction chain shown in fig. 5 removed and with parameter blocks introduced. Based on the above example, the head pointer may be the hash value of the i-1 th block, and the tail pointer may be the hash value of the j +1 th block. In FIG. 6, the head pointer of the parameter block is hi-1; where hi-1 is the hash value of the block header of block i-1; the tail pointer of the parameter block is hj + 1; the hj +1 may be a hash value of a block header of block j + 1.
A hash value is a chain of blocks that links two adjacent blocks in a chain of blocks. Typically, the hash value of a child chunk is generated based on the hash value of a parent chunk, which is one of the pieces of information that can uniquely identify the location of the chunk in a transaction chain.
Optionally, the step S110 may include:
calculating a check value by using the hash values of the N blocks to be deleted, wherein the parameter block further comprises the check value, and the check value is used for verifying the optimization chain by the link point of the second block when the optimization chain is sent to the node of the second block chain.
In this embodiment, the check value may be calculated based on the hash value of each chunk by using a predetermined function such as a hash function. In this embodiment, a logical operation may be performed between the hash value of the 1 st block to be deleted and the hash value of the 2 nd block to be deleted according to the distribution sequence of the N blocks in the transaction chain, in short, the hash value of the ith block to be deleted and the (i +1) th hash value to be deleted perform a logical operation, and after N-1 times of logical operations are completed, a function value of the preset function may be obtained by taking a result of the logical operation as a dependent variable of the preset function, and the function value may be stored in the parameter block as the check value as a part of the parameter block. The logical operations herein may be: after converting the corresponding hash value into a binary code, an and operation or an or operation between binary systems is performed, or an operation result of various logical operations such as and, or, not, etc., of different types is performed a plurality of times. Of course, the above is only one way to calculate the check value, and in a specific implementation process, other operation ways may also be included.
For example, according to the generation time of the block, the corresponding hash values are sequentially input to a preset function as dependent variables to be calculated to obtain function values, the function values calculated last time and the function values calculated last time are subjected to a second function operation to obtain corresponding check values, and the loop is executed until all the hash values of the blocks to be deleted participate in the calculation, so that the corresponding check values are obtained.
Through the introduction of the check value, when the corresponding optimization chain is copied to other block chain nodes, the check of the other block chain nodes on the parameter block is facilitated, and the problem that the information stored in the optimization chain is wrong due to the falsification of the parameter block is solved. For example, by tampering with the head pointer or the tail pointer of the parameter block, the parameter block can be linked into a forged block chain, and by introducing the check value, the occurrence of such a phenomenon can be avoided or reduced.
In some embodiments, the method as shown in fig. 7, further comprising:
step S140: when the optimization chain has a block meeting the preset deleting condition, updating the parameter block according to the block parameter of the newly added block to be deleted; wherein the updated parameter block is to be linked to a subsequent block of the transaction chain that satisfies the preset deletion condition;
step S150: and deleting the newly added block to be deleted.
Since the blocks in the transaction chain are generated according to the time, and the blocks to be deleted may also be generated based on the generation time, after one optimization is completed in one optimization chain, a plurality of newly added blocks to be deleted meeting the preset deletion condition may be generated after the originally deleted blocks at the next optimization time, and at this time, only the parameter block needs to be updated, and a brand new parameter block does not need to be generated. Fig. 8 is a schematic structural diagram of a re-optimization chain formed after newly adding a to-be-deleted block based on the optimization chain shown in fig. 6. It is apparent that in FIG. 8, the tail pointer of the parameter block is changed from hj +1 to hj + 2; so that the block pointed to by the end of the parameter block is block j + 2.
Specifically, the step S140 may include:
determining a next block of the newly added block to be deleted;
and extracting the block identifier of the next block of the newly added block to be deleted, for example, the hash value of the block, and revising the content of the tail pointer in the parameter block, thereby realizing the updating of the parameter block.
In still other embodiments, the step S140 may further include:
updating the check value in the parameter block according to the hash value of the newly added block to be deleted,
in short, once an optimization chain is generated, re-optimization of the optimization chain can be realized by updating partial information in the parameter block, and a re-optimization chain with a closer optimization effect is generated.
In some cases, the parameter block corresponding to one optimization chain may include only one, and in still other embodiments, the parameter block may include a plurality of parameter blocks, but the plurality of parameter blocks are not distributed adjacently in the optimization chain, and if two parameter blocks are distributed adjacently, one parameter block may be generated based on merging of head and tail pointers in the two parameter blocks, so as to simplify the parameter block as much as possible.
In some embodiments, the method further comprises: in order to distinguish the parameter blocks in the optimization chain from other blocks storing actual transaction information, the parameter blocks are also provided with type marks of the parameter blocks, so that different blocks in the block chain can be distinguished through quick comparison of the type marks of the blocks in the subsequent information query or copy process. In some embodiments, the optimization chain may also facilitate type differentiation of subsequent blocks and different processing of different types of blocks by separate storage of different types of blocks.
As shown in fig. 9, the present embodiment further provides a block chain lightweight processing method applied to a second block chain node, including:
step S210: sending a replication request of the block chain to a first block chain link point;
step S220: when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
step S230: receiving the block parameters returned by the third block chain node;
step S240: verifying a parameter block in the optimization chain based on the block parameter;
step S250: storing the optimization blocks to form the optimization chain when the parameter blocks are verified.
In some embodiments, there are multiple distributed blockchain nodes in the blockchain network, and these nodes may duplicate the stored blockchain with each other.
In the embodiment, the generation of the optimized chains is locally generated in one blockchain node, and if the other blockchain nodes copy the stored optimized chains, in order to ensure the authenticity and reliability of the optimized chains, the other blockchain nodes may need to check the copied optimized chains.
The other blockchain nodes are collectively referred to as second blockchain nodes that distinguish the first blockchain nodes forming the optimized chain in this embodiment.
The second blockchain node sends a replication request to the first blockchain node. After the first block link node receives the replication request, the first block link node sends the optimization chain to the second block link node because part of the blocks have been previously deleted, which results in the first block link node storing locally only the optimization chain, not the complete trade chain.
After the second block link node receives the optimization chain, the currently received optimization chain can be found instead of the complete transaction chain through type identification, statistics of the number of blocks and the like.
The second block link node also stores the block chain with as few storage resources as possible, that is, only the optimization chain is stored, and then the block information of the missing block in the optimization chain is requested from the third block chain node storing the complete transaction chain.
In this embodiment, generally, the first blockchain node and the second blockchain node may be both client nodes, and the third blockchain node may be a server node. Typically the server node must store the complete transaction chain for at least a period of time class. The acquisition request may be sent to the server node in step S220. At least a predetermined number of server nodes storing complete transaction chains are included in a blockchain node system. The predetermined number here may be only one. This is of course also merely an example. In some cases, if some transaction information is invalid based on the validity of the transaction information in the transaction chain, the server node may also delete the corresponding block, only store information used for subsequent optimization chain verification, such as hash values of the corresponding block, or even store no information used for verification, and only send a verification-free indication of deletion of the corresponding block to the entire system, so that the optimization chain between the nodes of the subsequent block chain is copied, and then the corresponding part is verified-free.
After sending the acquisition request, the third blockchain node returns corresponding block information for checking the parameter block by the second blockchain node. In this embodiment, the checking the parameter block at least includes: the checking of the tail pointer in the parameter block, of course, also includes: and checking a head pointer.
The verification can ensure that the optimization chain which is currently copied from the first block chain link point is credible, and ensure the authenticity and credibility of the information of the block chain.
Further, the step S220 may include:
determining a first hash value and a second hash value based on the parameter block, wherein the first hash value is: the hash value of the first block of the N consecutive blocks from which the deletion has been performed is: the hash values of the last blocks of the deleted consecutive respective N blocks;
wherein the block parameters at least include: the hash values of the 2 nd to the N-1 st blocks among the N blocks distributed consecutively have been deleted.
In some embodiments, the hash value is mainly used as a head pointer and a tail pointer in the parameter block, so in this embodiment, when the acquisition request is sent to the third block chain node, the first hash value serving as the head pointer and the second hash value serving as the tail pointer in the parameter block may be carried in the acquisition request.
After the third block chain node receives the first hash value and the second hash value, inquiring the transaction chain or inquiring the optimized chain still comprising the corresponding blocks, obtaining the hash values of the (i +1) th to (j-1) th blocks between the ith block corresponding to the first hash value and the jth block corresponding to the second hash value, and returning the hash values to the second block chain node as the request response of the obtaining request.
After receiving the hash values, the second block node performs a function calculation based on a pre-negotiated preset function or a function defined based on a consensus mechanism, and using the hash values as at least one of the dependent variables to obtain a function value. And comparing the function value with the check value carried in the corresponding parameter block to check the parameter block. Specifically, the step S240 may include:
generating a function value by using a preset function based on the deleted hash values of the N blocks which are continuously distributed;
matching the generated function value with the check value;
and if the matching is consistent, determining that the parameter block passes the verification.
By calculating the function value and matching the function value with the check value, the authenticity and reliability of the information in the parameter block can be ensured, so that the reliability and authenticity of the currently received optimization chain are ensured.
Therefore, the second block chain link point is the optimized chain from the beginning, various resources such as storage resources consumed by the block chain are greatly reduced, and the accounting processing of some block chain link points with less storage resources is facilitated.
The embodiment of the invention also provides a block chain lightweight processing method applied to a third block chain node, which comprises the following steps:
receiving an acquisition request sent by a second block chain;
inquiring a transaction chain based on the acquisition request or an optimization chain comprising block parameters of a block corresponding to the acquisition request;
and sending the inquired block parameters to a second block chain node, wherein the block parameters are used for the second block chain node to verify the parameter block in the optimization chain.
The relevant descriptions and differences of the optimization chain and the trade chain can be seen in the foregoing embodiments, and are not repeated here.
The block parameters may include: hash values or other chunk identifications of the deleted chunks in the optimization chain.
The obtaining request may carry a first hash value of a 1 st deleted block of the N deleted blocks in the optimization chain, and a second hash value of a last block of the N deleted blocks.
As shown in fig. 10, the present embodiment provides a block link node, where the block link node is a first block link node, and the block link node includes:
a generating unit 110, configured to generate parameter blocks based on N blocks to be deleted that are continuously distributed in a transaction chain, where N is a positive integer;
a deleting unit 120, configured to delete the N blocks in the transaction chain;
a first storage unit 130, configured to store the parameter blocks, where the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain, where a parent block of the parameter block is: the sub-region of the parameter block is a previous block of the N deleted blocks in the transaction chain: the latter region of the deleted N blocks in the transaction chain.
The present embodiment provides a schematic structural diagram of a block link point.
The generating unit 110 and the deleting unit 120 may both correspond to a connection structure of a processor and a memory of a physical node where the block link point is located. The memory can be used for storing various information; the processor is connected with the memory based on a bus interface such as an integrated circuit bus, and by executing executable codes such as a computer program, a transaction chain can be optimized, and an optimization chain with less data volume can be generated.
The processor can be a Central Processing Unit (CPU), a Microprocessor (MCU), a Digital Signal Processor (DSP), an Application Processor (AP), a programmable logic array (PLC), an Application Specific Integrated Circuit (ASIC), or the like, which can perform information processing.
The first storage unit 130 may correspond to a storage medium and may be used for storing the parameter block.
In this embodiment, the first block chain node deletes some blocks that can be deleted in the block chain, and in order to ensure the chain structure of the block chain, generates a corresponding parameter block, and forms an optimized block chain. Generally, the number of blocks included in the optimized optimization chain is less than that of a block tree included in the complete transaction chain, and the data size of the parameter block is generally less than that of a block including transaction information in one transaction amount, so that the data size of the optimization chain is far smaller than that of the transaction chain as a whole. Therefore, if only the optimized chain is stored, compared with a storage transaction chain, the storage resource is obviously greatly saved, and the calculation resource of subsequent query is saved. For example, the information stored in the deleted block is invalid or information with a low access frequency, if a query request is received, if the transaction chain is queried based on the hash value, if the transaction chain includes M blocks, the hash values of the M blocks may need to be compared, and if the optimized chain only includes M-N blocks, the maximum matching times in the query process is M-N, which obviously saves the query matching times.
Optionally, the first blockchain node further includes:
the judging unit is used for judging whether N blocks continuously distributed in the transaction chain meet preset deleting conditions or not;
the generating unit 110 is specifically configured to generate a parameter block based on the N blocks if the preset deletion condition is satisfied.
The determination unit here may also correspond to a processor or a processing circuit.
Optionally, the first storage unit 130 is specifically configured to point to a previous block in the N deleted blocks in the transaction chain by using a head pointer included in the parameter block; and pointing to the next block in the deleted N blocks in the transaction chain by using a tail pointer included in the parameter block.
Further, the head pointer includes: a hash value of a previous block of the deleted N blocks in the transaction chain; the tail pointer includes: hash values of a block subsequent to the deleted N regions in the transaction chain.
In some embodiments, the generating unit 110 is specifically configured to calculate a check value by using the hash values of the N blocks to be deleted, where the parameter block further includes the check value, and the check value is used for verifying the optimization chain by the second block link node when the optimization chain is sent to the second block link node.
In still other implementations, the first block-to-node further comprises:
the updating unit is used for updating the parameter block according to the block parameter of the newly added block to be deleted when the newly added block to be deleted exists in the optimization chain; wherein the updated parameter block is to be linked to a subsequent block of the transaction chain that satisfies the preset deletion condition;
and the deleting unit is also used for deleting the newly added block to be deleted.
The deleting unit here may also correspond to a processor or a processing circuit.
As shown in fig. 11, the present embodiment further provides a block link node, where the block link node is a second block link node, and the block link node includes:
a sending unit 210, configured to send a replication request of a block chain to a first block link point; when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
a receiving unit 220, configured to receive the block parameter returned by the third blockchain node;
a verifying unit 230, configured to verify a parameter block in the optimization chain based on the block parameter;
a second storage unit 240, configured to store the optimized blocks to form the optimized chain when the parameter blocks pass verification.
In this embodiment, a second blockchain node is provided. The block link point includes: the sending unit 210 and the receiving unit 220 may correspond to a network interface of a physical node where the block link point is located. The network interface may be a cable interface, a fiber optic cable interface, and/or a transceiver antenna, etc. The physical nodes may be various communication devices, such as a network server, a personal communication device such as a cell phone or desktop computer, and so on.
The authentication unit 230 may correspond to a processor; the description of the processor can be found in the foregoing embodiments and will not be repeated here.
The second storage unit 240 may correspond to a local storage medium of the second blockchain node, and the storage medium is preferably a non-transient storage medium, and may be used for a non-transient storage optimization chain, so that through optimization of the transaction chain, consumption of stored resources and consumption of computing resources of other subsequent operations are reduced.
Optionally, the second blockchain node may include a determination unit that may also correspond to a processor; the determining unit may be configured to determine a first hash value and a second hash value based on the parameter block, where the first hash value is: the hash value of the first block of the N consecutive blocks from which the deletion has been performed is: the hash values of the last blocks of the deleted consecutive respective N blocks; wherein the block parameters at least include: deleting hash values of 2 nd to N-1 th blocks in the N blocks which are distributed continuously; the parameter block further comprises: and checking the value.
The sending unit 210 may be configured to send an obtaining request carrying the first hash value and the second hash value to the third block chain node;
the verification unit 230 is specifically configured to generate a function value by using a preset function based on the deleted hash values of the N blocks that are continuously distributed; matching the generated function value with the check value; and if the matching is consistent, determining that the parameter block passes the verification.
In this embodiment, the second blockchain link point may directly copy or duplicate the optimized chain from other blockchain nodes, so as to reduce the storage resources consumed by blockchain storage, or the computing resources consumed by subsequent operations, and the like.
As shown in fig. 12, the present embodiment also provides a block link point, including: a transceiver 310, a memory 320, a processor 330, and a computer program stored on the memory 320 and processed by the processor 330;
the processor 330 is connected to the transceiver 310 and the memory 320, respectively, and configured to control information interaction of the transceiver 310 and information storage of the memory 320 by executing the computer program, and the block chain lightweight processing method provided by one or more of the foregoing technical solutions.
For example, the processor 330 may implement the block chain lightweight processing method shown in fig. 3, 4, 7, and/or 9 through execution of a computer program.
The blockchain node provided in this embodiment may be a first blockchain node, a second blockchain node, a third blockchain node, and other various blockchain nodes.
The processor 330 may be connected to the transceiver 310 and the memory 320 through an integrated circuit (IIC) bus.
The transceiver 310 may include various communication interfaces for connecting physical nodes to a network, such as a cable interface, a fiber optic cable interface, and a transceiver antenna, among others.
An embodiment of the present invention further provides a computer storage medium, where a computer program is stored, and the computer program, when executed, is capable of implementing the method for block chain lightweight processing provided in one or more of the foregoing technical solutions, for example, the method for block chain lightweight processing shown in fig. 3, 4, 7 and/or 9.
The computer storage medium provided by the embodiment of the invention comprises: a mobile storage device, 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. Alternatively, the computer storage medium may be a non-transitory storage medium.
One specific example is provided below in connection with the above embodiments:
example 1:
the method is suitable for scenes with a large number of blocks which can be deleted, and a local node is required to record a plurality of groups of parameters, wherein each group of parameters corresponds to one group of continuous deletable blocks. Each set of parameters consists of:
head pointer: a parent block header hash value for a first block in a set of consecutive deletable blocks is recorded.
Tail pointer: a sub-chunk header hash value for a last chunk in a set of consecutive erasures is recorded.
And (3) checking the value: and calculating the hash values of all block headers in a group of continuous deletable blocks, and storing the calculation result as a check value. The calculation method is shown in the following example.
Taking the block chain shown in fig. 5 as an example, the hash value of the block header of block k is denoted as hk, and if blocks i to j need to be deleted, the node needs to calculate the following parameters:
head pointer: hi-1
Tail pointer: hj +1
And (3) checking the value: h (… H (H) (hi) | hi +1) | … | | hj-1) | | hj), where H is a one-way function.
After calculating the parameters, the node may delete block i, block j, and all blocks in between, and connect block i-1 with block j +1 using the parameters, as shown in fig. 6.
Further optimization is performed on the basis of the optimization chain shown in fig. 6, and if the block (block j +1) identified by the tail pointer can also be deleted, further optimization is performed on the basis, and the block chain after optimization is shown in fig. 7. In addition, the check value is recalculated, and only H (H | | hj +10) needs to be calculated on the basis of the check value H in fig. 6, so that the optimization chain shown in fig. 8 is obtained.
Since the parameter block contains the check value, the node can verify the parameter block by inquiring the complete block header, so that the correctness of the parameter block can be ensured.
Expansibility: the present proposal has extensibility, and the examples in fig. 5 and fig. 6 illustrate that if the block identified by the tail pointer can also be deleted, only the existing parameter block and the block information shown by the tail pointer need to be used to calculate a new parameter block, and no other block data need to be used.
Storage efficiency: one set of parameters may identify several consecutive blocks and multiple sets of parameters may identify multiple sets of consecutive blocks, so that a free pruning of blocks may be achieved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
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, that is, 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, all the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (11)

1. A block chain lightweight processing method is applied to a first block chain node and comprises the following steps:
generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer;
deleting the N blocks in the transaction chain;
storing the parameter blocks, wherein the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain, wherein the parent blocks of the parameter blocks are: a previous block of the N blocks deleted in the transaction chain, a sub-block of the parameter block being: a block subsequent to the deleted N blocks in the transaction chain;
the method further comprises the following steps: calculating a check value by using the hash values of the N blocks to be deleted, wherein the parameter block further comprises the check value, and the check value is used for verifying the optimization chain by the link point of the second block when the optimization chain is sent to the node of the second block chain.
2. The method of claim 1, further comprising:
judging whether N blocks continuously distributed in a transaction chain meet a preset deleting condition or not;
the generating a parameter block based on the N blocks to be deleted that are continuously distributed in the transaction chain includes:
and if the preset deleting condition is met, generating a parameter block based on the N blocks.
3. The method according to claim 1,
the parameter block at least comprises: a head pointer and a tail pointer;
the head pointer points to a previous block in the deleted N blocks in the transaction chain;
the tail pointer points to a next block of the N deleted blocks in the transaction chain.
4. The method of claim 3,
the head pointer includes: a hash value of a previous block of the deleted N blocks in the transaction chain;
the tail pointer includes: a hash value of a block subsequent to the deleted N blocks in the transaction chain.
5. The method of claim 2, further comprising:
when a block to be deleted is newly added in the optimization chain, updating the parameter block according to the block parameter of the newly added block to be deleted; wherein the updated parameter block is to be linked to a subsequent block of the transaction chain that satisfies the preset deletion condition;
and deleting the newly added block to be deleted.
6. A block chain lightweight processing method is applied to a second block chain node and comprises the following steps:
sending a replication request of the block chain to a first block chain link point;
when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
receiving the block parameters returned by the third block chain node;
verifying a parameter block in the optimization chain based on the block parameter;
storing an optimization block to form the optimization chain when the parameter block passes verification;
the parameter block further comprises a check value; the check value is used for verifying the optimization chain by the second block link point; and the check value is obtained by calculating the hash value of the N blocks to be deleted.
7. The method of claim 6,
when the first block link point returns to the optimization chain based on the replication request, sending an obtaining request for obtaining block parameters of N deleted blocks in the optimization chain to a third block chain node based on a parameter block in the optimization chain, including:
determining a first hash value and a second hash value based on the parameter block, wherein the first hash value is: the hash value of the first block of the N blocks distributed consecutively after deletion is: the hash values of the last blocks in the deleted N blocks distributed continuously; wherein the block parameters at least include: deleting hash values of 2 nd to N-1 th blocks in the N blocks which are distributed continuously; the parameter block further comprises: checking a value;
sending an acquisition request carrying the first hash value and the second hash value to the third block chain node;
the verifying the parameter blocks in the optimization chain based on the block parameters comprises:
generating a function value by using a preset function based on the deleted hash values of the N blocks which are continuously distributed;
matching the generated function value with the check value;
and if the matching is consistent, determining that the parameter block passes the verification.
8. A block link node, wherein the block link node is a first block link node, comprising:
the generating unit is used for generating parameter blocks based on N blocks to be deleted, which are continuously distributed in a transaction chain, wherein N is a positive integer; wherein the parameter blocks and the undeleted blocks in the transaction chain together form an optimization chain;
the parameter block further comprises a check value, and the check value is used for verifying the optimization chain by the second block chain link node when the optimization chain is sent to the second block chain node; the check value is obtained by calculating the hash value of N blocks to be deleted;
a deletion unit configured to delete the N blocks in the transaction chain;
a first storage unit, configured to store the parameter block, where a parent block of the parameter block is: a previous block of the N blocks deleted in the transaction chain, a sub-block of the parameter block being: a block subsequent to the deleted N blocks in the transaction chain.
9. A block link node, wherein the block link node is a second block link node, comprising:
a sending unit, configured to send a replication request of a block chain to a first block link point; when the first block link point returns to be an optimization chain based on the replication request, sending an acquisition request to a third block link node based on a parameter block in the optimization chain, wherein the third block link node is a block link point which finishes storing a transaction chain corresponding to the optimization chain; the obtaining request is used for obtaining N deleted and continuously distributed blocks in the optimization chain, wherein N is a positive integer;
a receiving unit, configured to receive the block parameter returned by the third block chain node; the parameter block further comprises a check value, and the check value is used for verifying the optimization chain by the second block chain link node when the optimization chain is sent to the second block chain node; the check value is obtained by calculating the hash value of N blocks to be deleted;
a verification unit, configured to verify a parameter block in the optimization chain based on the block parameter;
a second storage unit for storing an optimization block to form the optimization chain when the parameter block passes verification.
10. A block link point, comprising: a transceiver, a memory, a processor, and a computer program stored on the memory and processed by the processor;
the processor is connected to the transceiver and the memory, respectively, and is configured to control information exchange of the transceiver and information storage of the memory by executing the computer program, and execute the block chain lightweight processing method according to any one of claims 1 to 7.
11. A computer storage medium storing a computer program that, when executed, is capable of implementing the block chain weight reduction processing method provided in any one of claims 1 to 7.
CN201710657510.XA 2017-08-03 2017-08-03 Block chain lightweight processing method, block chain node and storage medium Active CN109391645B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710657510.XA CN109391645B (en) 2017-08-03 2017-08-03 Block chain lightweight processing method, block chain node and storage medium
PCT/CN2018/097415 WO2019024780A1 (en) 2017-08-03 2018-07-27 Light-weight processing method for blockchain, and blockchain node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710657510.XA CN109391645B (en) 2017-08-03 2017-08-03 Block chain lightweight processing method, block chain node and storage medium

Publications (2)

Publication Number Publication Date
CN109391645A CN109391645A (en) 2019-02-26
CN109391645B true CN109391645B (en) 2020-09-11

Family

ID=65233411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710657510.XA Active CN109391645B (en) 2017-08-03 2017-08-03 Block chain lightweight processing method, block chain node and storage medium

Country Status (2)

Country Link
CN (1) CN109391645B (en)
WO (1) WO2019024780A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222052A (en) * 2019-05-20 2019-09-10 重庆金融资产交易所有限责任公司 Block chain data processing method, device, computer equipment and storage medium
US10764062B2 (en) 2019-06-03 2020-09-01 Alibaba Group Holding Limited Blockchain ledger compression
CN110362568B (en) * 2019-06-03 2020-07-24 阿里巴巴集团控股有限公司 Compression method, device and equipment for block chain type account book
CN112153085B (en) * 2019-06-26 2022-05-17 华为技术有限公司 Data processing method, node and block chain system
CN110490741B (en) * 2019-08-13 2023-03-24 山大地纬软件股份有限公司 Device and method for managing data validity and controllability in block chain
CN110636042B (en) * 2019-08-14 2021-07-16 创新先进技术有限公司 Method, device and equipment for updating verified block height of server
CN110570196B (en) * 2019-09-05 2024-06-28 腾讯科技(深圳)有限公司 Transaction data processing method, device, terminal equipment and storage medium
EP3798772B1 (en) 2019-09-25 2022-11-02 Schneider Electric Industries SAS Industrial process control
US11941611B2 (en) * 2019-12-11 2024-03-26 Intuit Inc. Shareable and nested transactions on hash chains
CN111611319A (en) * 2020-06-08 2020-09-01 杭州复杂美科技有限公司 Distributed data storage method, device and storage medium
CN111897826A (en) * 2020-06-27 2020-11-06 中国建设银行股份有限公司 Parameter information updating method and device, electronic equipment and readable storage medium
CN111917572B (en) * 2020-07-12 2022-10-25 中信银行股份有限公司 Transaction request processing method and device, electronic equipment and readable storage medium
CN111913978B (en) * 2020-09-02 2023-07-25 度小满科技(北京)有限公司 Block deleting method, device and system
CN113592639B (en) * 2021-05-21 2023-10-13 上海简苏网络科技有限公司 Block chain transaction deleting method and system
CN114331443B (en) * 2022-03-10 2022-06-21 南京金宁汇科技有限公司 Method and device for deleting block chain data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015116998A3 (en) * 2014-01-30 2015-11-05 Gary Kremen Electronic transfer and obligation enforcement system
CN106251216A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 A kind of method and system for alleviating node storage pressure
CN106503589A (en) * 2016-10-26 2017-03-15 北京瑞卓喜投科技发展有限公司 The method of calibration of block chain Transaction Information correctness, apparatus and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9684569B2 (en) * 2015-03-30 2017-06-20 Western Digital Technologies, Inc. Data deduplication using chunk files
WO2016161073A1 (en) * 2015-03-31 2016-10-06 Nasdaq, Inc. Systems and methods of blockchain transaction recordation
CN106897352B (en) * 2016-12-29 2020-09-15 北京瑞卓喜投科技发展有限公司 Method and system for generating block chain modified in expansion

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015116998A3 (en) * 2014-01-30 2015-11-05 Gary Kremen Electronic transfer and obligation enforcement system
CN106251216A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 A kind of method and system for alleviating node storage pressure
CN106503589A (en) * 2016-10-26 2017-03-15 北京瑞卓喜投科技发展有限公司 The method of calibration of block chain Transaction Information correctness, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"The Mini-Blockchain Scheme";J.D.Bruce;《cryptonite.info》;20140731;1-13 *

Also Published As

Publication number Publication date
CN109391645A (en) 2019-02-26
WO2019024780A1 (en) 2019-02-07

Similar Documents

Publication Publication Date Title
CN109391645B (en) Block chain lightweight processing method, block chain node and storage medium
EP3693886B1 (en) Optimizations for verification of interactions system and method
US11973869B2 (en) Maintaining blocks of a blockchain in a partitioned blockchain network
CN107169865B (en) Asset data processing system based on block chain technology
US11036395B2 (en) Secure and transparent pruning for blockchains
CN108648084B (en) Data processing method, device and equipment of block chain network and storage medium
CN111061769B (en) Consensus method of block chain system and related equipment
CN110889729A (en) Data verification method and device based on block chain network
CN109347868B (en) Information verification method, device and storage medium
CN110599169B (en) Data processing method, device, terminal and medium
CN110738472B (en) Block chain storage method and node of block chain
JPWO2019038839A1 (en) Blockchain management device, blockchain management method and program
CN113826355A (en) Short transaction identifier collision detection and coordination
CN111343212B (en) Message processing method, device, equipment and storage medium
CN112988073A (en) Stepped data storage method and system capable of reducing block chain storage overhead
CN113242305B (en) Cross-chain transaction processing method, device, computer equipment and medium
CN111033491A (en) Storing shared blockchain data based on error correction coding
CN112785408A (en) Account checking method and device based on Hash
CN109391643B (en) Block chain lightweight processing method, block chain node and storage medium
CN109685657B (en) Method and node device for processing transactions in a blockchain network and storage medium
CN111951112A (en) Intelligent contract execution method based on block chain, terminal equipment and storage medium
CN110928923A (en) Data storage method and system based on block chain
CN109993526B (en) Block chain checking method, processing node and storage medium
CN109951275A (en) Key generation method, device, computer equipment and storage medium
CN111768196B (en) Transaction information confirmation method and 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