CN109274377A - Data processing method, device, medium and the electronic equipment of block chain network - Google Patents
Data processing method, device, medium and the electronic equipment of block chain network Download PDFInfo
- Publication number
- CN109274377A CN109274377A CN201810960091.1A CN201810960091A CN109274377A CN 109274377 A CN109274377 A CN 109274377A CN 201810960091 A CN201810960091 A CN 201810960091A CN 109274377 A CN109274377 A CN 109274377A
- Authority
- CN
- China
- Prior art keywords
- data
- block
- compression
- volume data
- chain network
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides data processing method, device, medium and the electronic equipment of a kind of block chain network, the data processing method of the block chain network comprises determining that the block head data and block volume data that the block data in block chain network is included;Data compression is carried out to the block volume data, obtains compressed block volume data;When storing the block data, the block head data and the compressed block volume data are stored.The technical solution of the embodiment of the present invention can either guarantee that the block head data being frequently read normally efficiently are read, while can compress again to block volume data, reduce the storage pressure of block chain node, improve the storage efficiency of block data.
Description
Technical field
The present invention relates to block chain technical fields, data processing method, dress in particular to a kind of block chain network
It sets, medium and electronic equipment.
Background technique
At present in block chain network, each block chain node requires a complete block chain data of storage, and
Each block chain node requires to participate in comparison of the operation to carry out block information in verification process, and this mode is to block chain
The storage capacity and operational capability of node have higher requirement, relatively limited especially for storage capacity and information processing capability
Mobile interchange equipment (such as mobile phone), seriously constrain the performance boost of block chain network.
It should be noted that information is only used for reinforcing the reason to background of the invention disclosed in above-mentioned background technology part
Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
Data processing method, device, medium and the electricity for being designed to provide a kind of block chain network of the embodiment of the present invention
Sub- equipment, and then the storage pressure of block chain node is reduced at least to a certain extent.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention
Practice and acquistion.
According to a first aspect of the embodiments of the present invention, a kind of data processing method of block chain network is provided, comprising: really
Determine the block head data and block volume data that the block data in block chain network is included;The block volume data is counted
According to compression, compressed block volume data is obtained;When storing the block data, the block head data and the pressure are stored
Block volume data after contracting.
In some embodiments of the invention, aforementioned schemes are based on, data compression, packet are carried out to the block volume data
It includes: determining the data block continuously repeated for including in the block volume data and repeat number;According to the number continuously repeated
According to block and number is repeated, the data block continuously repeated is converted into the group for repeating number and the single data block
It closes, to carry out data compression to the block volume data.
In some embodiments of the invention, aforementioned schemes are based on, data compression, packet are carried out to the block volume data
It includes: according to the sequence for the data block for including in the block volume data, being opened from first data block in the block volume data
Begin successively to determine the incremental data between adjacent data blocks;According to the incremental data between the adjacent data blocks, by the area
Block data compression is the combination of first data block and the incremental data.
In some embodiments of the invention, aforementioned schemes are based on, include pair in the compressed block volume data
The block volume data carries out the identification information of used compression algorithm when data compression.
In some embodiments of the invention, be based on aforementioned schemes, to the block volume data carry out data compression it
Before, the data processing method further include: extract partial data from the block volume data;Pass through a variety of compression algorithms pair
The partial data is compressed, with the corresponding compression effectiveness of the determination various compression algorithms;It is calculated based on the various compressions
The corresponding compression effectiveness of method selects the compression algorithm compressed to the block volume data from a variety of compression algorithms.
According to a second aspect of the embodiments of the present invention, a kind of data processing method of block chain network is provided, comprising: obtain
Block data to be processed is taken, includes block head data and compressed block body number in the block data to be processed
According to;Decompression processing is carried out to the compressed block volume data, the block volume data after being decompressed;Read the block head
Block volume data after data and the decompression.
In some embodiments of the invention, aforementioned schemes are based on, the compressed block volume data is decompressed
Processing, comprising: the identification information of used compression algorithm when compression is obtained from the compressed block volume data;According to
The identification information of the compression algorithm solves the block volume data by decompression algorithm corresponding with the compression algorithm
Pressure processing.
According to a third aspect of the embodiments of the present invention, a kind of data processing equipment of block chain network is provided, comprising: really
Order member, for determining block head data and block volume data that the block data in block chain network is included;Compression unit,
For carrying out data compression to the block volume data, compressed block volume data is obtained;Storage unit, in storage institute
When stating block data, the block head data and the compressed block volume data are stored.
In some embodiments of the invention, aforementioned schemes are based on, the compression unit, which is configured that, determines the block body
The data block continuously repeated and repetition number for including in data;According to the data block continuously repeated and number is repeated, it will
The data block continuously repeated is converted to the combination for repeating number and the single data block, to the block body number
According to progress data compression.
In some embodiments of the invention, aforementioned schemes are based on, the compression unit is configured that according to the block body
The sequence for the data block for including in data successively determines adjacent data from first data BOB(beginning of block) in the block volume data
Incremental data between block;It is described by the block volume compression according to the incremental data between the adjacent data blocks
The combination of first data block and the incremental data.
In some embodiments of the invention, aforementioned schemes are based on, include pair in the compressed block volume data
The block volume data carries out the identification information of used compression algorithm when data compression.
In some embodiments of the invention, aforementioned schemes are based on, the compression unit is also used to: from the block body number
Partial data is extracted in;The partial data is compressed by a variety of compression algorithms, with the determination various compressions
The corresponding compression effectiveness of algorithm;Based on the corresponding compression effectiveness of the various compression algorithms, selected from a variety of compression algorithms
Select the compression algorithm compressed to the block volume data.
According to a fourth aspect of the embodiments of the present invention, a kind of data processing equipment of block chain network is provided, comprising: obtain
Unit is taken, includes block head data and compression in the block data to be processed for obtaining block data to be processed
Block volume data afterwards;Decompression units, for carrying out decompression processing to the compressed block volume data, after being decompressed
Block volume data;Reading unit, for reading the block volume data after the block head data and the decompression.
In some embodiments of the invention, aforementioned schemes are based on, the decompression units are configured that from described compressed
The identification information of used compression algorithm when compression is obtained in block volume data;According to the identification information of the compression algorithm,
Decompression processing is carried out to the block volume data by decompression algorithm corresponding with the compression algorithm.
According to a fifth aspect of the embodiments of the present invention, a kind of computer-readable medium is provided, computer is stored thereon with
Program, when described program is executed by processor at the data of block chain network of the realization as described in first aspect in above-described embodiment
Reason method, and/or realize the data processing method of the block chain network as described in second aspect in above-described embodiment.
According to a sixth aspect of the embodiments of the present invention, a kind of electronic equipment is provided, comprising: one or more processors;
Storage device, for storing one or more programs, when one or more of programs are held by one or more of processors
When row, so that one or more of processors realize the data of the block chain network as described in first aspect in above-described embodiment
Processing method, and/or realize the data processing method of the block chain network as described in second aspect in above-described embodiment.
Technical solution provided in an embodiment of the present invention can include the following benefits:
In the technical solution provided by some embodiments of the present invention, since block head data can be frequently read, and
Block volume data is the block head for being just read out when needing using data, therefore being included by determining block data
Data and block volume data, then compress block volume data, in memory block data, memory block build data and
Compressed block volume data, so that can either guarantee that the block head data being frequently read normally efficiently are read, while again
Block volume data can be compressed, to reduce the storage pressure of block chain node, improve the storage efficiency of block data.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.It should be evident that the accompanying drawings in the following description is only the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.In the accompanying drawings:
Fig. 1 diagrammatically illustrates the stream of the data processing method of block chain network according to first embodiment of the invention
Cheng Tu;
Fig. 2 diagrammatically illustrates the stream of the data processing method of the block chain network of second embodiment according to the present invention
Cheng Tu;
Fig. 3 diagrammatically illustrates the stream of the data processing method of the block chain network of third embodiment according to the present invention
Cheng Tu;
The compression storing data of realizing in the block chain network that Fig. 4 diagrammatically illustrates embodiment according to the present invention is
The block diagram of system;
Fig. 5 diagrammatically illustrates the frame of the data processing equipment of block chain network according to an embodiment of the invention
Figure;
Fig. 6 diagrammatically illustrates the frame of the data processing equipment of block chain network according to another embodiment of the invention
Figure;
Fig. 7 shows the structural schematic diagram for being suitable for the computer system for the electronic equipment for being used to realize the embodiment of the present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the present invention will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
Fig. 1 diagrammatically illustrates the stream of the data processing method of block chain network according to first embodiment of the invention
Cheng Tu, the executing subject of the management method can be as the server of block chain node or terminal device etc..
As shown in Figure 1, the data processing method of block chain network according to first embodiment of the invention, including it is as follows
Step S110, step S120 and step S130, is illustrated in detailed below:
In step s 110, the block head data and block body number that the block data in block chain network is included are determined
According to.
In one embodiment of the invention, the head information that block is store in block head data, contains the area Shang Yige
The cryptographic Hash of block, the cryptographic Hash of local area block and timestamp etc..Block volume data contains the detailed data of the block, this
Data are recorded comprising several rows, be can be Transaction Information, are also possible to other certain information.
In the step s 120, data compression is carried out to the block volume data, obtains compressed block volume data.
In an embodiment of the present invention, carrying out data compression to block volume data in step S120 can be had by following two
The embodiment of body:
Embodiment 1:
In one embodiment of the invention, the data block continuously repeated for including and again can be determined in block volume data
Then multiple number according to the data block continuously repeated and repeats number, by the data block continuously repeated be converted to repetition number with
The combination of individual data block, to carry out data compression to the block volume data.
If than block volume data sequence are as follows: A-A-A-A-A-B-B-C-D (0x41-0x41-0x41-0x41-0x41-
0x42-0x42-0x43-0x44), since A is repeated 5 times, B is repeated 2 times, therefore the data obtained after compressing are 5-A-2-B-
1-C-1-D(0x05-0x41-0x02-0x42-0x01-0x43-0x01-0x44).As it can be seen that the technical solution of embodiment 1 is being compressed
After significantly reduce data volume.
Embodiment 2:
It in one embodiment of the invention, can be according to the sequence for the data block for including in block volume data, from block
First data BOB(beginning of block) in volume data successively determines the incremental data between adjacent data blocks;Then according to adjacent data blocks
Between incremental data, by block volume compression be first data block and the incremental data combination.
If than block volume data sequence are as follows: 1-2-3-5-5-6, due to 2 and 1 increment be 1,3 and 2 increment be also 1,
The increment that the increment that 5 and 3 increment is 2,5 and 5 is 0,6 and 5 is 1, therefore compressed data sequence is 1-1-1-2-0-1.
As it can be seen that the technical solution of embodiment 2 significantly reduces data volume upon compression.
In one embodiment of the invention, it can wrap in compressed block volume data containing to the progress of block volume data
The identification information of used compression algorithm when data compression, and then convenient for that can be believed according to the mark of compression algorithm in decompression
Breath selects suitable decompression algorithm to be decompressed.For example, there are many algorithms compressed to block volume data, when therefrom selecting
When a kind of pair of block volume data is compressed, compressed block body number can be written into the identification information of the compression algorithm of selection
In, in order to suitable decompression algorithm be selected to pressurize according to the identification information in decompression.
Optionally, in one embodiment of the invention, due to different compression algorithms to the compression ratio of different data and
Codec rate is different, therefore the compression algorithm in order to select suitable (compression ratio or codec rate are higher), can the area Xian Cong
Partial data is extracted in block data, then the partial data extracted is compressed by a variety of compression algorithms, with true
Determine the corresponding compression effectiveness of various compression algorithms, and then be based on the corresponding compression effectiveness of various compression algorithms, selects corresponding pressure
Compression algorithm compresses the block volume data.
In one embodiment of the invention, the partial data extracted from block volume data can be block head data
Preceding 500KB data (each block size is generally 1MB or more).A variety of compressions that the partial data extracted is compressed
Algorithm contains compression algorithm described in previous embodiment 1 and embodiment 2.
With continued reference to shown in Fig. 1, in step s 130, when storing the block data, the block head data are stored
With the compressed block volume data.
The technical solution of embodiment illustrated in fig. 1 makes in memory block data, memory block build data and compressed
Block volume data, so that can either guarantee that the block head data being frequently read normally efficiently are read, while again can be to area
Block data are compressed, and to reduce the storage pressure of block chain node, improve the storage efficiency of block data.
Fig. 2 diagrammatically illustrates the stream of the data processing method of the block chain network of second embodiment according to the present invention
Cheng Tu, the executing subject of the management method can be as the server of block chain node or terminal device etc..
As shown in Fig. 2, the data processing method of the block chain network of second embodiment according to the present invention, including it is as follows
Step S210, step S220 and step S230, is illustrated in detailed below:
In step S210, block data to be processed is obtained, includes block head in the block data to be processed
Data and compressed block volume data.
In an embodiment of the present invention, it takes since block head data can be written infrequently, is not compressed, and in order to
The storage pressure of block chain node is reduced, compression processing can be carried out to block volume data, to improve the storage effect of block data
Rate.
In one embodiment of the invention, the head information that block is store in block head data, contains the area Shang Yige
The cryptographic Hash of block, the cryptographic Hash of local area block and timestamp etc..Block volume data contains the detailed data of the block, this
Data are recorded comprising several rows, be can be Transaction Information, are also possible to other certain information.
In step S220, decompression processing is carried out to the compressed block volume data, the block body after being decompressed
Data.
In one embodiment of the invention, decompression processing is carried out to compressed block volume data, as used and pressure
The corresponding decompression algorithm of compression algorithm carries out decompression processing.Since the compression algorithm to block volume data is more, for the ease of
Suitable decompression algorithm is selected, the identification information for the compression algorithm compressed to block volume data can be written compressed
In block volume data, and then the mark of used compression algorithm when compression can be got from compressed block volume data
Know, to carry out decompression processing to block volume data by corresponding decompression algorithm according to the identification information of the compression algorithm.
With continued reference to the block body number shown in Fig. 2, in step S230, after reading the block head data and the decompression
According to.
The technical solution of embodiment illustrated in fig. 2 to can choose pair after carrying out compression processing to block volume data
The decompression algorithm answered gets block volume data, so can in the storage pressure for reducing block chain node, improve block counts
According to storage efficiency under the premise of, guarantee block data it is normal reading and processing.
Below in conjunction with Fig. 3 to Fig. 4, the realization details of the embodiment of the present invention is described in detail:
As shown in figure 3, the data processing method of the block chain network of third embodiment according to the present invention, including it is as follows
Step:
Step S310, block chain node and the building of block chain network.
It in one embodiment of the invention, can be based on selected block chain node after selected block chain node
To construct block chain network.Such as can be using base of insurance company operating agency as minimum node, and protect based on one or more
The participation of dangerous group/company constructs block chain network.
Step S320, based on the data structure and storage mode store transaction data in the embodiment of the present invention.
In one embodiment of the invention, transaction data can be insurance Transaction Information, and insurance Transaction Information includes handing over
The output of easy input and transaction.The input of transaction can be record of insuring, require to compensate the material provided and this transaction
The public-key cryptography of handler and signature;The output of transaction can be to the beneficiary that insures core pay for the amount of money, beneficiary disclose it is close
Key etc..Optionally, the data structure for insuring Transaction Information can be as shown in table 1:
The insured | Zhang San |
Beneficiary | Zhang San |
Time of policy purchase information | 2016.10.10 14:10:20 |
The public-key cryptography of handler | ATCGWKY123YTU |
Handler signature | XXXY |
Claims Resolution testimonial material | Kdkd49kdkkdkdkkdatcgmpq (link of Hash pointer) |
Core pays for the amount of money | 12345.00 |
Core pays for the application time | 11224455 |
Core pays for audit state | Refusal/pass through/core is paid for the amount of money and has been paid |
Beneficiary's public-key cryptography | 1392929293346 (to the mapping of account address) |
…… |
Table 1
In the data structure shown in table 1, since Claims Resolution testimonial material would generally include the data volumes such as some images, document
Bigger information, therefore in order to improve storage efficiency and solve the problems, such as that block information is excessive, in an embodiment of the present invention,
The bigger core such as image can be protected the instrument of evidence to store in the form of a link within a block, the value of this link is exactly to pass through
Hash function protects the cryptographic Hash, such as SHA1 etc. that the instrument of evidence is encrypted to core, this to be referred to by hash function
The mode of needle link can guarantee that content can not distort.And the actual core guarantor instrument of evidence can both be stored in block chain node
In local storage device, and it can be stored in a manner of cloud storage.Meanwhile in order to guarantee that core protects the highly reliable of instrument of evidence storage
Property, can protect the instrument of evidence to core by the way of redundancy encoding stores, and for example encodes (i.e. Reed-Solomon using RS
Codes is a kind of channel coding of forward error correction, effective to the multinomial as caused by correction over-sampling data) or LDPC
Mode etc. of (Low Density Parity Check Code, low density parity check code) coding to core protect the instrument of evidence into
The processing of row redundancy encoding.
Step S330 selects suitable compression algorithm to compress the block volume data in block data.
In an embodiment of the present invention, for each block data in block chain network, block head is partially due to often
It is read, therefore in storage without compression;For the data of block body portion, suitable compression can be chosen in storage
Algorithm carries out data compression, to reduce the storage pressure of block chain node, improves storage efficiency.
In one embodiment of the invention, the algorithm compressed to block volume data may include: free code compression
(Run length Encoding) algorithm and delta compression (Delta Encoding) algorithm.Free code compression algorithm is a kind of
Data are specifically regarded as a linear order by the lossless data compression algorithms being simple and efficient, for continuous repeated data block
The Compression Strategies of use are first and corresponding data word to be stored after the byte with a duplicate number of byte representation data block
Section itself.Such as: original data sequence is A-A-A-A-A-B-B-C-D (0x41-0x41-0x41-0x41-0x41-0x42-
0x42-0x43-0x44), by being 5-A-2-B-1-C-1-D (0x05-0x41-0x02- after free code compression algorithm compression
0x42-0x01-0x43-0x01-0x44).Delta compression algorithm saves data mainly by way of calculating increment, in this way
Better compression ratio can be reached, the effect data that or data segment continuous for preservation occurs in a stability range is more
It is good.Such as: original data sequence 1-2-3-5-5-6 is 1-1-1-2- by the data sequence after delta compression compression algorithm
0-1, continuous in this way 1 can obtain better compression ratio in data compression.Meanwhile block volume data is carried out in order to identify
Used compression algorithm when compression, the identification information that can define free code compression algorithm is 0, the mark of delta compression algorithm
Information is 1, and when carrying out compression storage to block volume data by a kind of compression algorithm, the identification information of the compression algorithm is simultaneously
It is written into block body (in the first character section of such as write area block), in order to read out the identification information in decompression and select
It selects suitable decompression algorithm and carries out decompression processing.
In one embodiment of the invention, block volume data is pressed in order to select suitable data compression algorithm
Contracting, can be sampled block volume data, such as can extract data (each block of the preceding 500KB in block volume data
Size is generally 1MB or more), then with free code compression algorithm and delta compression algorithm, (compression algorithm is only to show herein respectively
Example, however it is not limited to both compression algorithms) compression trial is carried out, and then need to select compression ratio or compile to solve according to application scenarios
The code higher compression method of speed compresses the block volume data.
Step S340 updates optimization system parameter based on system compresses effect.
In one embodiment of the invention, system compresses effect includes compression ratio and encoding and decoding speed etc., can be passed through
Compression ratio and encoding and decoding speed are assessed come the data compression performance to block chain network, and then based on assessment result come not
The data storage of disconnected optimization lifting system and data-handling efficiency, to greatly improve the transaction and confirmation of entire block chain network
The efficiency of equal operations, and the block chain network section that block chain technical application can be promoted relatively limited in storage and processing ability
Point in.
The device of the invention embodiment is introduced below in conjunction with attached drawing.
The compression storing data of realizing in the block chain network that Fig. 4 diagrammatically illustrates embodiment according to the present invention is
The block diagram of system.
Referring to shown in Fig. 4, the system that compression storing data is realized in block chain network of embodiment according to the present invention,
It include: block chain network building subsystem 410, data format definition subsystem 420, block data is partially compressed and part is non-depressed
Mixing storage subsystem 430, data decompression subsystem 440 and the Information Compression evaluation subsystem 450 of contracting.
Wherein, block chain network building subsystem 410 is responsible for building, update and maintenance mechanism and the area of block chain node
Building, update and the maintenance of block chain network.Such as can be using base of insurance company operating agency as minimum node, and it is based on one
Or the participations of multiple insurance pool/companies constructs block chain network.
Data format definition subsystem 420 can carry out store transaction data according to data structure shown in above-mentioned table 1.Than
If transaction data can be insurance Transaction Information, insurance Transaction Information includes the input of transaction and the output of transaction.That trades is defeated
Enter can be record of insuring, require to compensate public-key cryptography and the signature of the material provided and this transaction handler;Transaction
Output, which can be, pays for the amount of money, public-key cryptography of beneficiary etc. to the core for the beneficiary that insures.
Block data is partially compressed and the uncompressed mixing storage subsystem 430 in part is for pressing block volume data
Contracting.Mainly since block head lease making is often read, in storage without compression;And for the number of block body portion
According to, suitable compression algorithm, which can be chosen, in storage carries out data compression, to reduce the storage pressure of block chain node, raising
Storage efficiency.
In one embodiment of the invention, the algorithm compressed to block volume data may include: free code compression
Algorithm and delta compression algorithm.Free code compression algorithm is a kind of lossless data compression algorithms being simple and efficient, specifically number
According to a linear order is regarded as, the Compression Strategies used for continuous repeated data block are first with a byte representation data block
Duplicate number, and corresponding data byte itself is stored after the byte.Such as: original data sequence A-A-A-A-A-B-
B-C-D (0x41-0x41-0x41-0x41-0x41-0x42-0x42-0x43-0x44), after free code compression algorithm compression
For 5-A-2-B-1-C-1-D (0x05-0x41-0x02-0x42-0x01-0x43-0x01-0x44).Delta compression algorithm is mainly
Data are saved by way of calculating increment, better compression ratio can be reached in this way, for saving continuous or data
The effect data occurred in Duan Yi stability range is more preferable.Such as: original data sequence 1-2-3-5-5-6 passes through increment
The compressed data sequence of compression algorithm is 1-1-1-2-0-1, and continuous in this way 1 can obtain better pressure in data compression
Contracting ratio.Meanwhile used compression algorithm when being compressed to identify to block volume data, free code compression can be defined and calculated
The identification information of method is 0, and the identification information of delta compression algorithm is 1, when by a kind of compression algorithm to the progress of block volume data
When compression storage, the identification information of the compression algorithm is written into block body (the first character section of such as write area block simultaneously
In), in order to read out the identification information in decompression and suitable decompression algorithm is selected to carry out decompression processing.
In one embodiment of the invention, block volume data is pressed in order to select suitable data compression algorithm
Contracting, can be sampled block volume data, and then with free code compression algorithm and delta compression algorithm, (compression algorithm exists respectively
This is merely illustrative, however it is not limited to both compression algorithms) compression trial is carried out, and then select to compress according to the needs of application scenarios
Rate or the higher compression method of encoding and decoding speed compress the block volume data.
Data decompression subsystem 440 for realizing data decompression process.In one embodiment of the invention, exist
When carrying out reading data, it can be believed according to the mark of the compression algorithm stored (in first character section) in block volume data
Breath, selects suitable decompression algorithm to unzip it processing to block volume data.
Information Compression evaluation subsystem 450 is used for through compression ratio and encoding and decoding speed come the data to block chain network
Compression performance is assessed, and then data storage and the data-handling efficiency of lifting system are continued to optimize based on assessment result,
To greatly improve the efficiency of the operations such as transaction and the confirmation of entire block chain network, and block chain technical application can be promoted
In the relatively limited block chain network node of storage and processing ability.
Fig. 5 diagrammatically illustrates the frame of the data processing equipment of block chain network according to an embodiment of the invention
Figure.
Referring to Figure 5, the data processing equipment 500 of block chain network according to an embodiment of the invention, comprising:
Determination unit 502, compression unit 504 and storage unit 506.
Wherein it is determined that unit 502 is used to determine the block head data and area that the block data in block chain network is included
Block data;Compression unit 504 is used to carry out data compression to the block volume data, obtains compressed block volume data;
Storage unit 506 is used for when storing the block data, stores the block head data and the compressed block body number
According to.
In one embodiment of the invention, compression unit 504 is configured that the company for determining and including in the block volume data
Continue duplicate data block and repeats number;According to the data block continuously repeated and number is repeated, is continuously repeated described
Data block is converted to the combination for repeating number and the single data block, to carry out data pressure to the block volume data
Contracting.
In one embodiment of the invention, compression unit 504 is configured that according to the number for including in the block volume data
According to the sequence of block, the incremental number between adjacent data blocks is successively determined from first data BOB(beginning of block) in the block volume data
According to;According to the incremental data between the adjacent data blocks, by the block volume compression be first data block with
The combination of the incremental data.
In some embodiments of the invention, aforementioned schemes are based on, include pair in the compressed block volume data
The block volume data carries out the identification information of used compression algorithm when data compression.
In one embodiment of the invention, compression unit 504 is also used to: extracting part from the block volume data
Data;The partial data is compressed by a variety of compression algorithms, with the corresponding compression of the determination various compression algorithms
Effect;Based on the corresponding compression effectiveness of the various compression algorithms, selection is to the block body from a variety of compression algorithms
The compression algorithm that data are compressed.
Fig. 6 diagrammatically illustrates the frame of the data processing equipment of block chain network according to another embodiment of the invention
Figure.
Referring to shown in Fig. 6, the data processing equipment 600 of block chain network according to another embodiment of the invention, packet
It includes: acquiring unit 602, decompression units 604 and reading unit 606.
Wherein, acquiring unit 602 includes in the block data to be processed for obtaining block data to be processed
Block head data and compressed block volume data;Decompression units 604 are for solving the compressed block volume data
Pressure processing, the block volume data after being decompressed;Reading unit 606 is for after reading the block head data and the decompression
Block volume data.
In one embodiment of the invention, decompression units 604 are configured that and obtain from the compressed block volume data
The identification information of used compression algorithm when pressure contracting;According to the identification information of the compression algorithm, by with the compression
The corresponding decompression algorithm of algorithm carries out decompression processing to the block volume data.
Due to the block chain network of example embodiments of the present invention data processing equipment each functional module with it is above-mentioned
The step of example embodiment of the data processing method of block chain network, is corresponding, therefore for not draping over one's shoulders in apparatus of the present invention embodiment
The details of dew please refers to the embodiment of the data processing method of the above-mentioned block chain network of the present invention.
Below with reference to Fig. 7, it illustrates the computer systems 700 for the electronic equipment for being suitable for being used to realize the embodiment of the present invention
Structural schematic diagram.The computer system 700 of electronic equipment shown in Fig. 7 is only an example, should not be to the embodiment of the present invention
Function and use scope bring any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in
Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and
Execute various movements appropriate and processing.In RAM 703, it is also stored with various programs and data needed for system operatio.CPU
701, ROM 702 and RAM 703 is connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to bus
704。
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.;
And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because
The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon
Computer program be mounted into storage section 708 as needed.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 709, and/or from detachable media
711 are mounted.When the computer program is executed by central processing unit (CPU) 701, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs
When standby execution, so that the electronic equipment realizes the data processing method such as above-mentioned block chain network as described in the examples.
For example, the electronic equipment may be implemented as shown in Figure 1: step S110 is determined in block chain network
The block head data and block volume data that block data is included;Step S120 carries out data compression to the block volume data,
Obtain compressed block volume data;Step S130 stores block head data and described when storing the block data
Compressed block volume data.
For another example, each step as shown in Figures 2 and 3 may be implemented in the electronic equipment.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description
Member, but this division is not enforceable.In fact, embodiment according to the present invention, it is above-described two or more
Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould
The feature and function of block or unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention
Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.
Claims (10)
1. a kind of data processing method of block chain network characterized by comprising
Determine the block head data and block volume data that the block data in block chain network is included;
Data compression is carried out to the block volume data, obtains compressed block volume data;
When storing the block data, the block head data and the compressed block volume data are stored.
2. the data processing method of block chain network according to claim 1, which is characterized in that the block volume data
Carry out data compression, comprising:
It determines the data block continuously repeated for including in the block volume data and repeats number;According to the number continuously repeated
According to block and number is repeated, the data block continuously repeated is converted into the group for repeating number and the single data block
It closes, to carry out data compression to the block volume data;Or
According to the sequence for the data block for including in the block volume data, opened from first data block in the block volume data
Begin successively to determine the incremental data between adjacent data blocks;According to the incremental data between the adjacent data blocks, by the area
Block data compression is the combination of first data block and the incremental data.
3. the data processing method of block chain network according to any one of claim 1 to 2, which is characterized in that described
The mark of used compression algorithm when including to block volume data progress data compression in compressed block volume data
Know information.
4. the data processing method of block chain network according to any one of claim 1 to 2, which is characterized in that right
Before the block volume data carries out data compression, the method also includes:
Partial data is extracted from the block volume data;
The partial data is compressed by a variety of compression algorithms, with the corresponding compression effect of the determination various compression algorithms
Fruit;
Based on the corresponding compression effectiveness of the various compression algorithms, selection is to the block body number from a variety of compression algorithms
According to the compression algorithm compressed.
5. a kind of data processing method of block chain network characterized by comprising
Block data to be processed is obtained, includes block head data and compressed block in the block data to be processed
Volume data;
Decompression processing is carried out to the compressed block volume data, the block volume data after being decompressed;
Block volume data after reading the block head data and the decompression.
6. the data processing method of block chain network according to claim 5, which is characterized in that the compressed area
Block data carry out decompression processing, comprising:
The identification information of used compression algorithm when compression is obtained from the compressed block volume data;
According to the identification information of the compression algorithm, by decompression algorithm corresponding with the compression algorithm to the block body number
According to progress decompression processing.
7. a kind of data processing equipment of block chain network characterized by comprising
Determination unit, for determining block head data and block volume data that the block data in block chain network is included;
Compression unit obtains compressed block volume data for carrying out data compression to the block volume data;
Storage unit, for storing the block head data and the compressed block body when storing the block data
Data.
8. a kind of data processing equipment of block chain network characterized by comprising
Acquiring unit includes block head data in the block data to be processed for obtaining block data to be processed
With compressed block volume data;
Decompression units, for carrying out decompression processing to the compressed block volume data, the block volume data after being decompressed;
Reading unit, for reading the block volume data after the block head data and the decompression.
9. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is executed by processor
The data processing method of Shi Shixian block chain network according to any one of claims 1 to 4, and/or realize as right is wanted
The data processing method of block chain network described in asking any one of 5 to 6.
10. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing
When device executes, so that one or more of processors realize block chain network according to any one of claims 1 to 4
Data processing method, and/or realize the data processing method of the block chain network as described in any one of claim 5 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810960091.1A CN109274377A (en) | 2018-08-22 | 2018-08-22 | Data processing method, device, medium and the electronic equipment of block chain network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810960091.1A CN109274377A (en) | 2018-08-22 | 2018-08-22 | Data processing method, device, medium and the electronic equipment of block chain network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109274377A true CN109274377A (en) | 2019-01-25 |
Family
ID=65154319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810960091.1A Pending CN109274377A (en) | 2018-08-22 | 2018-08-22 | Data processing method, device, medium and the electronic equipment of block chain network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109274377A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110163755A (en) * | 2019-04-30 | 2019-08-23 | 阿里巴巴集团控股有限公司 | Data compression, querying method and device and electronic equipment based on block chain |
CN110321723A (en) * | 2019-07-08 | 2019-10-11 | 白静 | A kind of block chain security information processing system and method, electronic equipment, medium |
CN110474776A (en) * | 2019-07-19 | 2019-11-19 | 上海朝夕网络技术有限公司 | A kind of believable block data dynamic deletes method |
CN110647582A (en) * | 2019-09-17 | 2020-01-03 | 腾讯科技(深圳)有限公司 | Method and device for block chain network consensus checking, storage medium and computer equipment |
US10795882B2 (en) | 2019-04-30 | 2020-10-06 | Alibaba Group Holding Limited | Blockchain-based data compression and searching |
CN112287391A (en) * | 2020-11-18 | 2021-01-29 | 广东新禾道信息科技有限公司 | Block chain-based data secure storage method and system |
CN112422525A (en) * | 2020-11-03 | 2021-02-26 | 珠海格力电器股份有限公司 | Fault data transmission method, device, equipment and storage medium |
CN114567670A (en) * | 2022-01-25 | 2022-05-31 | 浙江数秦科技有限公司 | Block chain network data transmission method |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070096954A1 (en) * | 2005-10-27 | 2007-05-03 | Evault, Inc. | Methods and apparatus for performing adaptive compression |
CN101841337A (en) * | 2010-05-06 | 2010-09-22 | 华为终端有限公司 | Data compression and decompression processing method and mobile storage device |
US20130342375A1 (en) * | 2012-06-22 | 2013-12-26 | Micron Technology, Inc. | Data compression and management |
US20140233376A1 (en) * | 2013-02-15 | 2014-08-21 | Exalt Communications Incorporated | Selective compression in a wireless communication system |
CN105512120A (en) * | 2014-09-22 | 2016-04-20 | 中国石油化工股份有限公司 | Earthquake data compression method, compression storage structure and random access method |
CN105871382A (en) * | 2016-03-29 | 2016-08-17 | 中海油信息科技有限公司 | Micaps fourth-class lattice point data lossless compression algorithm |
CN106936441A (en) * | 2017-02-27 | 2017-07-07 | 深圳国泰安教育技术股份有限公司 | A kind of data compression method and device |
CN108197168A (en) * | 2017-12-18 | 2018-06-22 | 中国移动通信集团广东有限公司 | A kind of data compression method, equipment and computer readable storage medium |
-
2018
- 2018-08-22 CN CN201810960091.1A patent/CN109274377A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070096954A1 (en) * | 2005-10-27 | 2007-05-03 | Evault, Inc. | Methods and apparatus for performing adaptive compression |
CN101841337A (en) * | 2010-05-06 | 2010-09-22 | 华为终端有限公司 | Data compression and decompression processing method and mobile storage device |
US20130342375A1 (en) * | 2012-06-22 | 2013-12-26 | Micron Technology, Inc. | Data compression and management |
US20140233376A1 (en) * | 2013-02-15 | 2014-08-21 | Exalt Communications Incorporated | Selective compression in a wireless communication system |
CN105512120A (en) * | 2014-09-22 | 2016-04-20 | 中国石油化工股份有限公司 | Earthquake data compression method, compression storage structure and random access method |
CN105871382A (en) * | 2016-03-29 | 2016-08-17 | 中海油信息科技有限公司 | Micaps fourth-class lattice point data lossless compression algorithm |
CN106936441A (en) * | 2017-02-27 | 2017-07-07 | 深圳国泰安教育技术股份有限公司 | A kind of data compression method and device |
CN108197168A (en) * | 2017-12-18 | 2018-06-22 | 中国移动通信集团广东有限公司 | A kind of data compression method, equipment and computer readable storage medium |
Non-Patent Citations (3)
Title |
---|
刘靖雅: "移动互联网原始码流数据包头压缩算法的设计与实现", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
孙晨华: "《计算机网络与卫星通信网络融合技术》", 30 November 2016, 国防工业出版社 * |
贾永红: "《数字图像处理技巧》", 31 January 2017, 武汉大学出版社 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10795882B2 (en) | 2019-04-30 | 2020-10-06 | Alibaba Group Holding Limited | Blockchain-based data compression and searching |
WO2020220764A1 (en) * | 2019-04-30 | 2020-11-05 | 创新先进技术有限公司 | Blockchain-based data compression and query method and apparatus, and electronic device |
CN110163755A (en) * | 2019-04-30 | 2019-08-23 | 阿里巴巴集团控股有限公司 | Data compression, querying method and device and electronic equipment based on block chain |
CN112750037A (en) * | 2019-04-30 | 2021-05-04 | 创新先进技术有限公司 | Block chain-based data compression and query method and device and electronic equipment |
CN112750037B (en) * | 2019-04-30 | 2024-10-29 | 蚂蚁链技术有限公司 | Block chain-based data compression and query method and device and electronic equipment |
CN110321723A (en) * | 2019-07-08 | 2019-10-11 | 白静 | A kind of block chain security information processing system and method, electronic equipment, medium |
CN110474776A (en) * | 2019-07-19 | 2019-11-19 | 上海朝夕网络技术有限公司 | A kind of believable block data dynamic deletes method |
CN110647582B (en) * | 2019-09-17 | 2024-01-02 | 腾讯科技(深圳)有限公司 | Method, device, storage medium and computer equipment for block chain network consensus verification |
CN110647582A (en) * | 2019-09-17 | 2020-01-03 | 腾讯科技(深圳)有限公司 | Method and device for block chain network consensus checking, storage medium and computer equipment |
CN112422525A (en) * | 2020-11-03 | 2021-02-26 | 珠海格力电器股份有限公司 | Fault data transmission method, device, equipment and storage medium |
CN112287391A (en) * | 2020-11-18 | 2021-01-29 | 广东新禾道信息科技有限公司 | Block chain-based data secure storage method and system |
CN114567670B (en) * | 2022-01-25 | 2024-04-05 | 浙江数秦科技有限公司 | Block chain network data transmission method |
CN114567670A (en) * | 2022-01-25 | 2022-05-31 | 浙江数秦科技有限公司 | Block chain network data transmission method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109274377A (en) | Data processing method, device, medium and the electronic equipment of block chain network | |
US10116325B2 (en) | Data compression/decompression device | |
CN108900364A (en) | Management method, device, medium and the electronic equipment of block chain network | |
CN107395209B (en) | Data compression method, data decompression method and equipment thereof | |
CN116506073B (en) | Industrial computer platform data rapid transmission method and system | |
CN104205035B (en) | File Mapping compresses | |
CN110913218A (en) | Video frame prediction method and device and terminal equipment | |
CN111510718B (en) | Method and system for improving compression ratio through inter-block difference of image file | |
CN108197324A (en) | For storing the method and apparatus of data | |
EP4038551A2 (en) | Neural network representation formats | |
CN115208414A (en) | Data compression method, data compression device, computer device and storage medium | |
JP5079110B2 (en) | System for storing and transferring compressed integer data | |
CN116303297A (en) | File compression processing method, device, equipment and medium | |
US12073080B2 (en) | System and method for improving reliability of a data storage system | |
WO2021097624A1 (en) | File processing method, file processing apparatus, and terminal device | |
CN102982046B (en) | A kind of web data compression and storage method and system | |
CN114490547A (en) | Data compression method, device, equipment and medium | |
CN113709553A (en) | Screen recording method, device, chip and terminal | |
WO2024149207A1 (en) | Data processing method and apparatus, and medium and computer device | |
CN111124851A (en) | Method, system, terminal and storage medium for processing historical performance data of storage device | |
CN114513209A (en) | Data compression method, device, equipment and storage medium | |
CN115550650A (en) | Method and device for effectively adjusting compression rate of reference frame image and electronic equipment | |
CN114282141A (en) | Processing method and device for compression format data, electronic equipment and readable storage medium | |
CN118573876B (en) | Video encoding method, apparatus, computer device, readable storage medium, and program product | |
CN111083499A (en) | Video frame reconstruction method and device and terminal equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190125 |
|
RJ01 | Rejection of invention patent application after publication |