CN107181797B - Block compression method and system of block chain - Google Patents

Block compression method and system of block chain Download PDF

Info

Publication number
CN107181797B
CN107181797B CN201710329643.4A CN201710329643A CN107181797B CN 107181797 B CN107181797 B CN 107181797B CN 201710329643 A CN201710329643 A CN 201710329643A CN 107181797 B CN107181797 B CN 107181797B
Authority
CN
China
Prior art keywords
block
compression
mark
new
preset
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
CN201710329643.4A
Other languages
Chinese (zh)
Other versions
CN107181797A (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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN201710329643.4A priority Critical patent/CN107181797B/en
Publication of CN107181797A publication Critical patent/CN107181797A/en
Application granted granted Critical
Publication of CN107181797B publication Critical patent/CN107181797B/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/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application 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
    • 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
    • H04L9/3239Cryptographic 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 involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The application discloses a block compression method and a system of a block chain, which are applied to terminal equipment of a block chain system, and particularly mark a new block in a way of adding mark points in the process of generating the new block according to a given workload certification method; then, sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks; and finally, compressing the uncompressed new blocks before the compression mark every time a new compression mark is generated. Therefore, the file size of the generated block is effectively reduced, and when a data block in a block chain is downloaded by a new terminal, the data volume required to be downloaded can be effectively reduced, so that the downloading efficiency is improved.

Description

Block compression method and system of block chain
Technical Field
The present application relates to the field of blockchain technology, and more particularly, to a method and system for block compression of blockchains.
Background
Blockchains are a decentralized technique that consists of a list of what are called blocks, with records that grow continuously and are well-aligned. Each tile contains a HASH value linked to the previous tile, so that the data is not tampered with, and any transaction information for the blockchain, once recorded, will be permanently recorded in a tile.
The blockchain design is a protective measure, such as for highly fault-tolerant distributed computing systems, which makes blockchains suitable for event, title, medical records and other activities requiring the inclusion of data, identification management, transaction flow management and provenance management.
The book wisdom proposed the concept of blockchains, which in the following years became the core component of electronic currency bitcoins, i.e. as a common ledger for all transactions. By utilizing a peer-to-peer network and distributed timestamp servers, the blockchain database can be managed autonomously. The blockchain invented for bitcoin makes it the first digital currency to solve the repeat consumption problem.
In the current blockchain technique, each time a new block is generated, the new block is added to the existing blockchain, and each terminal participating in the blockchain calculation maintains the same chain of blocks. With the continuous growth of the block chain, a newly added terminal can participate in the calculation of the whole block chain after all blocks need to be downloaded, the data downloading amount is very large, and the downloading can be completed in a very long time. Taking the bitcoin block chain as an example, through the rapid development of several years, the downloading of the existing blocks takes several days or even ten days.
Disclosure of Invention
In view of this, the present application provides a block compression method and system for a block chain, which are used to compress data blocks in the block chain to reduce the amount of data to be downloaded by a newly added terminal, thereby improving the downloading efficiency.
In order to achieve the above object, the following solutions are proposed:
a block compression method of a block chain is applied to terminal equipment of a block chain system, and the block compression method specifically comprises the following steps:
marking a new block in a way of adding a marking point in the process of generating the new block according to a given workload certification method;
sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks;
every time a new compression mark is generated, the new block which is not compressed before the compression mark is compressed.
Optionally, the marking the new block by adding a marking point includes:
in the process of generating the new block, if the new block is generated when the first n bits of the hash value are 0 according to the workload proving method, taking the new block with the n +1 bits of the hash value as a preset value as a mark block to be added, wherein n is a positive integer;
and adding the mark points into the to-be-added mark block to obtain a marked new block.
Optionally, adding the mark point into the to-be-added mark block includes:
and adding the mark point into the block head of the block to be added with the mark.
Optionally, the judging the mark point according to a preset judgment rule includes:
calculating the mark point by using a preset calculation formula to obtain a calculation result;
and if the calculation result accords with a preset result rule, judging that the mark point accords with the judgment rule.
Optionally, the compressing the uncompressed new block before the compression flag includes:
and only in the case that a plurality of compression marks exist, compressing a new block which is before the compression mark before the current compression mark and is not subjected to compression processing according to a preset compression mode.
Optionally, the plurality of compression flags are at least greater than or equal to 2 compression flags.
A block compression system of a block chain is applied to a terminal device of the block chain system, and the block compression system specifically comprises:
the block marking module is used for marking a new block in a way of adding a marking point in the process of generating the new block according to a given workload certification method;
the mark judgment module is used for sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, the mark points which accord with the judgment rule are used as compression marks;
and the compression processing module is used for compressing the uncompressed new block before the compression mark every time a new compression mark is generated.
Optionally, the block marking module includes:
a block selection unit, configured to, in the process of generating the new block, if the new block is generated when the first n bits of the hash value calculated according to the workload certification method are 0, take a new block in which n +1 bits of the hash value are a preset value as a to-be-added mark block, where n is a positive integer;
and the mark adding unit is used for adding the mark points into the block to be marked to obtain a new marked block.
Optionally, the mark adding unit includes:
and the block head processing subunit is used for adding the mark point into the block head of the block to be added with the mark block.
Optionally, the mark judging module includes:
the mark calculation unit is used for calculating the mark point by using a preset calculation formula to obtain a calculation result;
and the compliance judgment unit is used for judging that the mark points accord with the judgment rule if the calculation result accords with a preset result rule.
Optionally, the compression processing module includes:
and the data compression unit is used for compressing a new block which is before the previous compression mark of the current compression mark and is not subjected to compression processing according to a preset compression mode only under the condition that a plurality of compression marks exist.
Optionally, the plurality of compression flags are at least greater than or equal to 2 compression flags.
It can be seen from the above technical solutions that the present application discloses a block compression method and system for a block chain, which is applied to a terminal device of a block chain system, and specifically, in the process of generating a new block according to a given workload certification method, the new block is marked by way of adding a mark point; then, sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks; and finally, compressing the uncompressed new blocks before the compression mark every time a new compression mark is generated. Therefore, the file size of the generated block is effectively reduced, and thus, when a data block in a block chain is downloaded by a new terminal, the data volume required to be downloaded can be effectively reduced, and the downloading efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating steps of an embodiment of a block compression method for a block chain according to the present disclosure;
fig. 2 is a block diagram of an embodiment of a block compression system for a block chain according to the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
Example one
Fig. 1 is a flowchart illustrating a block compression method for a block chain according to an embodiment of the present invention.
As shown in fig. 1, the block compression method of a block chain provided in this embodiment is applied to a terminal device of a block chain system, and is used for compressing a data block in the block chain system to reduce a downloaded data amount of a newly added terminal device, where the specific block compression method includes the following steps:
s101: in the new block generation process, the generated new block is marked.
The method for generating new blocks is also based on the traditional workload certification method, called POW (proof of work), and the simple understanding is a certification used for confirming that you have done a certain amount of work. The overall process of monitoring the work is often extremely inefficient, and authenticating the results of the work to justify the corresponding amount of work is a very efficient way. Such as graduation certificates, driver licenses, etc., in real life, are also certificates obtained by means of verifying the results (by means of a relevant examination).
Workload certification systems (or protocols, functions), are an economic strategy to combat denial of service attacks and other abuses of service. It requires a certain amount of computation by the initiator, which means that a certain time is consumed by the computer. This concept was first proposed in the academic paper by Cynthia Dwork and Moni Naor 1993. The term proof of work (POW) was really proposed in 1999 by Markus Jakobsson and Ari Juels.
Hash cash is a workload proof mechanism that was invented by Adam Back in 1997 to resist denial of service attacks on mail and spam gateway abuse. Hashed cash is used for spam filtering before bitcoins, and is also used by microsoft in hotmail/exchange/outlook, etc. (microsoft uses a format incompatible with hashed cash and names it as an electronic postmark).
Hash cash is also used by Haar Fenni in a cryptocurrency experiment prior to one bitcoin in the form of reusable proof of work (RPOW). Moreover, pioneers of Bitty (Bit-Gold) from B-money of Daiwei, Nick Sabo, all dig under the frame of Hash cash.
A Hash Function (Hash Function), also called Hash Function, given an input x, it computes a corresponding output h (x). The main characteristics of the hash function are: the input x may be a string of any length and the length of the output, h (x), is fixed.
The process of calculating h (x) is efficient (for a string x of length n, the time complexity of h (x) should be o (n)), while for a hash function used in an encryption system such as bitcoin it needs to be additionally collision-free and covert.
Collision-free, i.e. no input x ≠ y, but h (x) ═ h (y). The characteristic is not true in theory, for example, the SHA256 algorithm used by the bit currency has 2^256 outputs, and if we input 2^256+1 times, a collision will be generated; even from a probabilistic perspective, performing 2^130 inputs has 99% of the potential collisions to occur. However, we can calculate that, assuming a computer hash 10000 times per second, it takes 10^27 years to complete 2^128 hashes! Even so, even if all computers manufactured by human beings have been operated from birth until today, the probability of finding a collision is extremely small.
Concealment, i.e. the desire to reverse the input x for a given output result h (x), is computationally infeasible.
The workload proving system is mainly characterized in that the client needs to do work with certain difficulty to obtain a result, and the verifying party can easily check whether the client does corresponding work or not through the result. One of the core features of this scheme is asymmetry: the work is moderate for the requesting party and easy for the verifying party. It is different from the verification code, and the design starting point of the verification code is easy to be solved by human and not easy to be solved by a computer.
For example, in a typical blockchain system such as Bingworth, if one wants to create a new blockchain and write it to, one must solve the problem of workload proofs by the Bingworth network. The key three elements of this topic are the workload attestation function, the blocks, and the difficulty value. The workload proving function is a calculation method of the question, the blocks determine input data of the question, and the difficulty value determines the required calculation amount of the question.
The proof of workload function used in bitcoin systems is the SHA 256. SHA is an abbreviation for secure hash Algorithm (secure hash Algorithm), a family of cryptographic hash functions. This set of functions is designed by the National Security Agency (NSA), issued by the National Institute of Standards and Technology (NIST), and is primarily applicable to the digital signature standard. SHA256 is one of this family of functions, and is a hash algorithm with 256 bits of output value. To date, no effective attack has emerged on the SHA256 algorithm.
The block of bitcoin consists of a block header and a transaction list contained in the block. The block header is 80 bytes in size and is composed of a version number of 4 bytes, a Hash value of the last block of 32 bytes, a Merkle Root Hash of 32 bytes, a time affix (current time) of 4 bytes, a current difficulty value of 4 bytes, and a random number of 4 bytes. The block contains a transaction list appended to the block header, where the first transaction is a money base transaction, a special transaction for the miners to receive rewards and commission fees.
Each block has an 80 byte fixed length block header, which is the input string for bitcoin workload certification. Therefore, in order to enable the block header to represent all transactions contained in the block, in the block construction process, the transaction list to be contained in the block needs to be generated by a Merkle Tree algorithm and stored in the block header as the summary of the transaction list.
The difficulty value (difficuty) is an important reference index for miners during mining, and determines how many hash operations are required for the miners to generate a legal block. The blocks of bitcoins are generated approximately every 10 minutes, and if the generation of new blocks is to be maintained at substantially this rate under different full network power conditions, the difficulty value must be adjusted in response to changes in the full network power. In short, the difficulty value is set such that the new block generation rate is maintained at 10 minutes one regardless of the ore-cutting ability.
The adjustment of difficulty occurs automatically in each complete node independently. Every 2016 blocks, all nodes will automatically adjust the difficulty according to a uniform formula, which is obtained by comparing the duration spent for the most recent 2016 blocks with the expected duration (the expected duration is 20160 minutes, i.e., two weeks, which is the total duration calculated at the generation rate of one block every 10 minutes), and adjusting (or making difficult or easy) accordingly according to the ratio of the actual duration to the expected duration. That is, the difficulty is increased if the rate of block generation is faster than 10 minutes and decreased if it is slower than 10 minutes.
This formula can be summarized in the form:
new difficulty value old difficulty value (past 2016 blocks spent long/20160 minutes)
The workload proves to have a target value. The Target value (Target) of the bitcoin workload certification is calculated as follows:
target value-maximum target value/difficulty value
Wherein the maximum target value is a constant value:
0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
the magnitude of the target value is inversely proportional to the stiffness value. The bitcoin workload justification is achieved in that the block hash value calculated by the miners must be less than the target value.
It can also be simply understood that the process of bitcoin workload certification is a process of finding a hash value of a specific format (i.e. requiring a certain number of leading 0 s) by performing SHA256 hash operations with a constantly transformed block header (i.e. trying different nouce values) as an input. The greater the number of leading 0 s required, the greater the difficulty.
We can roughly summarize the steps of the bitcoin miner solving this workload proving problem as follows:
generating a Coinbase transaction, forming a transaction list with all other transactions prepared to be packed into a block, and generating a Merkle Root Hash through a Merkle Tree algorithm;
assembling Merkle Root Hash and other related fields into a Block Header, and taking 80 bytes of data (Block Header) of the Block Header as input of workload certification;
continuously changing the random number in the Block head, namely the numerical value of the nonce, performing double SHA256 operation (namely SHA256(SHA256(Block _ Header)) on the Block head after each change), comparing the result value with the target value of the current network, if the result value is smaller than the target value, successfully solving the problem, and finishing the workload certification.
Based on the above description, the present embodiment also uses the basic method to generate a new block. For example, a new block may be generated when n bits are 0 before the hash value is calculated, where n is a positive integer, and n may be selected to be 4.
In the marking process of the new blocks, each new block can not be marked, if so, the number of the new blocks needing to be marked is too large, and the purpose of reducing the downloading workload cannot be achieved. When determining that a new block is generated when the first n bits of each calculated Hash value are 0, taking the new block with the first n +1 bits as a preset value as a mark block to be added, wherein the preset value can be a numerical value, a caption or a specific character; and then adding the preset mark points to the mark block to be added to finish the marking work of the new block.
In addition, since the block is composed of a block header and a transaction list, in order not to affect the integrity of the transaction list, the present application adds a marker point to the block header of the new block. And for identifying the marker points, markers Mx with sequence numbers can be generally used as the marker points, such as M1, M2, M3, … …, M10, … …, M20, … … and M30 … ….
S102: and selecting a proper mark point as a compression mark through judging the mark point.
And when a certain mark point meets the judgment rule, the mark point is taken as a compression mark.
Specifically, the above-mentioned judgment rule can be understood as a calculation formula for calculating the marked points, for example, for the marked points with sequence numbers, a simple division formula can be used to divide X in Mx by 10, so as to obtain a result, where the result is an integer or a common rational number or irrational number with a treelet; if the above result is in accordance with the preset result rule, for example, if the whole result is an integer, the marked point is determined as a compression mark, and if the divisor is selected to be 10, the marked points M10, M20, M30, and M40 … … are determined as compression marks.
S103: and according to the newly generated compression mark, compressing the block before the compression mark.
In the process of generating the compression marks by judging the marks and the mark points of the new blocks in the process of generating the compression marks, each time a new compression mark is generated, the new compression mark indicates that a certain number of new blocks are generated. In this case, in order to reduce the data amount of the block and not affect the linking of the subsequent blocks, the block before the newly generated compression flag may be subjected to data compression, and the compression method may be selected from rar, zip, z7, and the like.
During specific compression, the block before the compression label of the newly generated compression label is subjected to data compression, that is, the block before the newly generated compression label and the block before the previous compression label are not subjected to data compression, so as to ensure the continuity between the new block and the original block.
Thus, for the entire block chain, the data compression processing is performed on the block only after at least two compression tags are generated. And specifically, the blocks before and after the previous compression flag carrying the newly generated compression flag, and including the block having the previous compression flag, are respectively compressed or collectively compressed. The term "separately compress" means that each block is compressed into a compressed file, and the term "overall compress" means that the aforementioned blocks are compressed into a compressed file, and the specific compression method can be determined according to actual situations.
It can be seen from the foregoing technical solutions that, the present embodiment provides a block compression method for a block chain, which is applied to a terminal device of a block chain system, and specifically, in a process of generating a new block according to a predetermined workload certification method, marks the new block by way of adding a mark point; then, sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks; and finally, compressing the uncompressed new blocks before the compression mark every time a new compression mark is generated. Therefore, the file size of the generated block is effectively reduced, and thus, when a data block in a block chain is downloaded by a new terminal, the data volume required to be downloaded can be effectively reduced, and the downloading efficiency is improved.
Example two
Fig. 2 is a block diagram of a block compression system of a block chain according to an embodiment of the present invention.
As shown in fig. 2, the block compression system of the block chain provided in this embodiment is applied to a terminal device of the block chain system, and is configured to compress data blocks in the block chain system to reduce the amount of downloaded data newly added to the terminal device, where the block compression system specifically includes a block marking module 10, a marking judgment module 20, and a compression processing module 30.
The block marking module is used for marking the generated new block in the new block generating process.
The generation method of the new blocks is also based on the conventional workload proof method POW. Based on the detailed description of the previous embodiment, the present embodiment also uses the basic method described above to generate a new block. For example, a new block may be generated when n bits are 0 before the hash value is calculated, where n is a positive integer, and n may be selected to be 4.
The module specifically comprises a block selecting unit 11 and a mark adding unit 12, each new block can not be marked in the marking process of the new block, if so, the number of the new blocks needing to be marked is too large, and the purpose of reducing the downloading workload cannot be achieved. The block selection unit is used for taking the new block with the front n +1 bits as a preset value as a mark block to be added when the front n bits of each calculated Hash value are determined to be 0 and generating a new block, wherein the preset value can be a numerical value, a caption or a specific character; and the mark adding unit adds the preset mark points to the mark block to be added to complete the marking work of the new block.
In addition, the mark adding unit specifically includes a block header processing subunit 121, and in order not to affect the integrity of the transaction list, the present application uses the block header processing subunit to add the mark point to the block header of the new block, considering that the block is composed of the block header and the transaction list. And for identifying the marker points, markers Mx with sequence numbers can be generally used as the marker points, such as M1, M2, M3, … …, M10, … …, M20, … … and M30 … ….
The mark judging module is used for selecting a proper mark point as a compression mark through judging the mark point
And when a certain mark point meets the judgment rule, the mark point is taken as a compression mark.
The module specifically includes a mark calculation unit 21 and a compliance determination unit 22, and specifically, the above-mentioned determination rule may be understood as a calculation formula for calculating the mark points, for example, for the mark points with sequence numbers, the mark calculation unit divides X in Mx by 10 by using a simple division formula to obtain a result, where the result is an integer or a common rational number or irrational number with a treelet; the compliance determination unit determines the marked point as a compression mark when the result meets a preset result rule, for example, the whole result is an integer, and if the divisor is selected to be 10, the marked points M10, M20, M30 and M40 … … are determined as the compression mark.
The compression processing module is used for compressing the block before the compression mark according to the newly generated compression mark.
In the process of generating the compression marks by judging the marks and the mark points of the new blocks in the process of generating the compression marks, each time a new compression mark is generated, the new compression mark indicates that a certain number of new blocks are generated. In this case, in order to reduce the data amount of the block and not affect the linking of the subsequent blocks, the block before the newly generated compression flag may be subjected to data compression, and the compression method may be selected from rar, zip, z7, and the like.
The module includes a data compression unit 31, and during the specific compression, the data compression unit performs data compression on the block before the compression tag of the newly generated compression tag, that is, does not perform data compression on the block before the newly generated compression tag and the previous compression tag, so as to ensure the continuity between the new block and the original block.
Thus, for the entire block chain, the data compression processing is performed on the block only after at least two compression tags are generated. And specifically, the blocks before and after the previous compression flag carrying the newly generated compression flag, and including the block having the previous compression flag, are respectively compressed or collectively compressed. The term "separately compress" means that each block is compressed into a compressed file, and the term "overall compress" means that the aforementioned blocks are compressed into a compressed file, and the specific compression method can be determined according to actual situations.
It can be seen from the foregoing technical solutions that, the present embodiment provides a block compression system of a block chain, where the system is applied to a terminal device of a block chain system, and specifically, in a process of generating a new block according to a predetermined workload certification method, a new block is marked by way of adding a mark point; then, sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks; and finally, compressing the uncompressed new blocks before the compression mark every time a new compression mark is generated. Therefore, the file size of the generated block is effectively reduced, and thus, when a data block in a block chain is downloaded by a new terminal, the data volume required to be downloaded can be effectively reduced, and the downloading efficiency is improved.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The technical solutions provided by the present invention are described in detail above, and the principle and the implementation of the present invention are explained in this document by applying specific examples, and the descriptions of the above examples are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention. .

Claims (6)

1. A block compression method of a block chain is applied to terminal equipment of a block chain system, and is characterized in that the block compression method specifically comprises the following steps:
marking a new block in a way of adding a marking point in the process of generating the new block according to a given workload certification method;
sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, taking the mark points which accord with the judgment rule as compression marks;
every time a new compression mark is generated, compressing the uncompressed new block before the compression mark;
the marking the new block by means of marking points comprises the following steps:
in the process of generating the new block, if the new block is generated when the first n bits of the hash value are 0 according to the workload proving method, taking the new block with the n +1 bits of the hash value as a preset value as a mark block to be added, wherein n is a positive integer;
adding the mark points into the to-be-added mark block to obtain a marked new block;
the judging the mark point according to a preset judging rule comprises the following steps:
calculating the mark point by using a preset calculation formula to obtain a calculation result;
if the calculation result accords with a preset result rule, judging that the mark point accords with the judgment rule;
the compressing the new block which is not compressed before the compression mark comprises:
and only in the case that a plurality of compression marks exist, compressing a new block which is before the compression mark before the current compression mark and is not subjected to compression processing according to a preset compression mode.
2. The block compression method of claim 1, wherein said adding the marker point into the to-be-added marker block comprises:
and adding the mark point into the block head of the block to be added with the mark.
3. A block compression method as claimed in claim 1, wherein said plurality of compression flags are at least greater than or equal to 2 compression flags.
4. A block compression system of a block chain is applied to a terminal device of the block chain system, and is characterized in that the block compression system specifically comprises:
the block marking module is used for marking a new block in a way of adding a marking point in the process of generating the new block according to a given workload certification method;
the mark judgment module is used for sequentially judging the mark points according to a preset judgment rule, and when the mark points accord with the judgment rule, the mark points which accord with the judgment rule are used as compression marks;
a compression processing module, configured to, each time a new compression flag is generated, perform compression processing on the new uncompressed block before the compression flag;
the block marking module includes:
a block selection unit, configured to, in the process of generating the new block, if the new block is generated when the first n bits of the hash value calculated according to the workload certification method are 0, take a new block in which n +1 bits of the hash value are a preset value as a to-be-added mark block, where n is a positive integer;
the mark adding unit is used for adding the mark points into the to-be-added mark block to obtain a marked new block;
the mark judging module includes:
the mark calculation unit is used for calculating the mark point by using a preset calculation formula to obtain a calculation result;
a compliance judgment unit, configured to judge that the mark point conforms to the judgment rule if the calculation result conforms to a preset result rule;
the compression processing module comprises:
and the data compression unit is used for compressing a new block which is before the previous compression mark of the current compression mark and is not subjected to compression processing according to a preset compression mode only under the condition that a plurality of compression marks exist.
5. The block compression system of claim 4, wherein the flag adding unit comprises:
and the block head processing subunit is used for adding the mark point into the block head of the block to be added with the mark block.
6. The block compression system of claim 4, wherein the plurality of compression flags are at least greater than or equal to 2 compression flags.
CN201710329643.4A 2017-05-11 2017-05-11 Block compression method and system of block chain Active CN107181797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710329643.4A CN107181797B (en) 2017-05-11 2017-05-11 Block compression method and system of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710329643.4A CN107181797B (en) 2017-05-11 2017-05-11 Block compression method and system of block chain

Publications (2)

Publication Number Publication Date
CN107181797A CN107181797A (en) 2017-09-19
CN107181797B true CN107181797B (en) 2020-03-06

Family

ID=59832617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710329643.4A Active CN107181797B (en) 2017-05-11 2017-05-11 Block compression method and system of block chain

Country Status (1)

Country Link
CN (1) CN107181797B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107728941B (en) * 2017-09-28 2019-09-24 中国银行股份有限公司 A kind of block chain data compression method and system
CN108595535B (en) * 2018-03-30 2020-11-17 李欣宇 Knowledge question-answering system and method based on same-root double-chain block chain
CN108830712A (en) * 2018-05-17 2018-11-16 易链科技(深圳)有限公司 Method, apparatus, equipment and the medium that block generates
CN109189327B (en) * 2018-07-27 2020-05-05 阿里巴巴集团控股有限公司 Compression processing method and device for block chain data
CN108876314B (en) * 2018-08-06 2021-08-06 河南真二互联网科技有限公司 Career professional ability traceable method and platform
CN109189853B (en) * 2018-08-08 2021-05-28 众安信息技术服务有限公司 Method and device for synchronizing data between block chains
EP3609120B1 (en) 2018-08-09 2022-04-13 Nokia Technologies Oy Distributed data storage
CN109003003A (en) * 2018-09-03 2018-12-14 夸克链科技(深圳)有限公司 A kind of work quantity algorithm difficulty stacking method
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
CN111431696B (en) * 2020-03-26 2023-10-17 深圳市欧欣泰科技有限公司 Block chain seal mechanism based on identity
CN111797086A (en) * 2020-07-03 2020-10-20 杭州复杂美科技有限公司 Data clipping method, device and storage medium
CN114065283B (en) * 2020-11-20 2024-05-28 北京邮电大学 Lightweight circularly regenerated blockchain storage method and device
CN112905704A (en) * 2021-03-18 2021-06-04 南威软件股份有限公司 Method and system for improving writing performance of block link points

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8156241B1 (en) * 2007-05-17 2012-04-10 Netapp, Inc. System and method for compressing data transferred over a network for storage purposes
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN105741095A (en) * 2016-01-29 2016-07-06 彭军红 Dynamic compression and access method of block chain
CN106126722A (en) * 2016-06-30 2016-11-16 中国科学院计算技术研究所 A kind of prefix compound tree based on checking and method for designing
CN106326641A (en) * 2016-08-13 2017-01-11 深圳市樊溪电子有限公司 Data processing method for block chain system based on compressed sensing and sparse reconstruction algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8156241B1 (en) * 2007-05-17 2012-04-10 Netapp, Inc. System and method for compressing data transferred over a network for storage purposes
CN105741095A (en) * 2016-01-29 2016-07-06 彭军红 Dynamic compression and access method of block chain
CN105630609A (en) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 Block chain packing and storing method
CN106126722A (en) * 2016-06-30 2016-11-16 中国科学院计算技术研究所 A kind of prefix compound tree based on checking and method for designing
CN106326641A (en) * 2016-08-13 2017-01-11 深圳市樊溪电子有限公司 Data processing method for block chain system based on compressed sensing and sparse reconstruction algorithm

Also Published As

Publication number Publication date
CN107181797A (en) 2017-09-19

Similar Documents

Publication Publication Date Title
CN107181797B (en) Block compression method and system of block chain
US20230410215A1 (en) Cryptographic method and system for secure extraction of data from a blockchain
Cucurull et al. Distributed immutabilization of secure logs
US11233657B2 (en) Method and system for registering digital documents
CN107342867B (en) Signature verification method and device
EP3609125A1 (en) Blockchain-assisted hash-based data signature system and method
US20190379531A1 (en) Method For Registration Of Data In A Blockchain Database And A Method For Verifying Data
US10754848B2 (en) Method for registration of data in a blockchain database and a method for verifying data
EP3552158B1 (en) System and method for information protection
KR20200106000A (en) System and method for implementing blockchain-based digital certificate
CN108009445B (en) Semi-centralized trusted data management system
US10498535B2 (en) Method and system for verifying information of a data item in a plurality of different data items
US20090238365A1 (en) Method and system to provide fine granular integrity to digital data
CN112054897B (en) Outsourcing Internet of things data for protecting privacy based on block chain and integrity verification method for backup of outsourcing Internet of things data
US20200259663A1 (en) One-Time Data Signature System and Method with Untrusted Server Assistance
CN108964916A (en) Signature generating method, generating means, signature verification method and verifying device
CN111866134B (en) Method and system for generating hash value and address of block chain transaction and storage medium
JP2002530709A (en) Time stamping using binary link system
WO2018219425A1 (en) Method for validating and/or authenticating online curriculum vitae using blockchain distributed ledger technology
CN116069856A (en) Data integrity verification method and system based on blockchain
CN112737793B (en) Method and device for updating block chain domain name configuration
CN110837659B (en) Renewable digital signature method for private key with label and application of renewable digital signature method in PoS block chain protocol
CN110535663B (en) Method and system for realizing trusted timestamp service based on block chain
CN113051625B (en) Data storage method and device based on blockchain
CN117473557B (en) Trusted setting 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