CN108563796A - Data compressing method, device and the electronic equipment of block chain - Google Patents

Data compressing method, device and the electronic equipment of block chain Download PDF

Info

Publication number
CN108563796A
CN108563796A CN201810423904.3A CN201810423904A CN108563796A CN 108563796 A CN108563796 A CN 108563796A CN 201810423904 A CN201810423904 A CN 201810423904A CN 108563796 A CN108563796 A CN 108563796A
Authority
CN
China
Prior art keywords
block
data
block chain
compact
attribute
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
Application number
CN201810423904.3A
Other languages
Chinese (zh)
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.)
Rose Information Technology Co Ltd
Original Assignee
Rose Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rose Information Technology Co Ltd filed Critical Rose Information Technology Co Ltd
Priority to CN201810423904.3A priority Critical patent/CN108563796A/en
Publication of CN108563796A publication Critical patent/CN108563796A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion 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/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • H03M7/42Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code using table look-up for the coding or decoding process, e.g. using read-only memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of data compressing method, device and the electronic equipments of block chain, are related to technical field of data processing, this method includes:Obtain the transaction request for carrying transaction data;Obtain the corresponding compact nature of block chain;Wherein, compact nature is the block's attribute of compressed processing;The compact block with compact nature is generated according to the transaction data, to realize the data compression process to block chain.Data compressing method, device and the electronic equipment of block chain provided by the invention, by the way that the block's attribute of block chain is optimized compression processing, compactedness optimization processing is carried out to block structure itself, realize simple and effective and homomorphism the compression of block chain data, in the case where not increasing validation verification complexity and enforcement difficulty, the memory space for reducing block chain data improves the optimization degree of block chain data storage capacity.

Description

Data compressing method, device and the electronic equipment of block chain
Technical field
The present invention relates to technical field of data processing, more particularly, to a kind of data compressing method of block chain, dress It sets and electronic equipment.
Background technology
Block chain technology is as a kind of distributed account book technology, and due to its " can not distort ", " unique credible ", " data add It is close " characteristic so that the application field of block chain technology is more and more extensive.And the core of block chain technology-distribution account book, it is One chained list for only increasing orderly block.For the application of block chain, with growing, the block chain of time and trading volume Account book it is increasingly longer, required memory space constantly increases, and the copy of full dose account book more allows the need of memory space between node Geometric type of hoping for success increases.Therefore it in order to meet market business demand and challenge, needs using block dilatation, compact and compression storage Method stores to improve block chain block, improves block exchange and efficiency of transmission is very urgent.
Block chain generally existing dilatation problem.With the growth of block chain number of transaction, the account book size of block chain is year-on-year Increase, all multi-tiling chain scheme increasing rapidly with trading volume are enlarged block capacity, but block capacity expands Appearance is not silver bullet, because after block capacity expansion, is not easy to the transimission and storage of block, such as bit coin, so simple to hand over The trading frequency of easy type, low speed, if by the capacity enlargement of block to 30MB, the transaction data generated will also account within 1 year With the space of 1.5TB, this brings greatly storage pressure for common machines node;And if block dilatation arrived 300MB, the transaction data of 1 year 15TB, probably I guess most of node is unaffordable.
Use conventional compression mode by one data block of respective block boil down to of full dose node in the prior art, to basis The data block generates compression transaction and is issued.However this method optimizing degree is limited, and having when node account book synchronizes Complexity is increased in terms of the verification of effect property;In addition, this user sends out the alliance of the mode of compression transaction more than the public chain or node The enforcement difficulty of chain scene is larger.
Invention content
In view of this, the purpose of the present invention is to provide a kind of data compressing method, device and the electronics of block chain Equipment improves the optimization degree of block chain data storage capacity to reduce the memory space of block chain data.
In a first aspect, an embodiment of the present invention provides a kind of data compressing methods of block chain, including:
Obtain the transaction request for carrying transaction data;
Obtain the corresponding compact nature of the block chain;Wherein, the compact nature is the block's attribute of compressed processing;
The compact block with the compact nature is generated according to the transaction data, to realize the number to the block chain According to compression processing.
With reference to first aspect, an embodiment of the present invention provides the first possible embodiments of first aspect, wherein institute It states and obtains the corresponding compact nature of the block chain, including:
Compressed encoding is carried out to the primitive attribute of the block chain according to preset encoder dictionary, obtains compact nature.
The possible embodiment of with reference to first aspect the first, an embodiment of the present invention provides second of first aspect Possible embodiment, wherein it is described that compressed encoding is carried out to the primitive attribute of the block chain according to preset encoder dictionary, Compact nature is obtained, including:
By inquiring the encoder dictionary, the primitive attribute of the block chain is converted to the compact category of single-byte character Property.
The possible embodiment of with reference to first aspect the first, an embodiment of the present invention provides the third of first aspect Possible embodiment, wherein the encoder dictionary is with index;It is described according to preset encoder dictionary to the block chain Primitive attribute carries out compressed encoding, obtains compact nature, including:
The primitive attribute for inquiring the block chain in the encoder dictionary by the index, obtains the compact category Property.
With reference to first aspect, an embodiment of the present invention provides the 4th kind of possible embodiments of first aspect, wherein institute It states and the compact block with the compact nature is generated according to the transaction data, including:
According to preset data format, the transaction data and the compact nature are written in corresponding block, obtained The compact block.
With reference to first aspect, an embodiment of the present invention provides the 5th kind of possible embodiments of first aspect, wherein institute The method of stating further includes:
The block data of the compact block is compressed, and compressed compression block data is stored in database In;Wherein, the block data includes the transaction data and the compact nature.
With reference to first aspect, an embodiment of the present invention provides the 6th kind of possible embodiments of first aspect, wherein institute It states after generating the compact block with the compact nature according to the transaction data, the method further includes:
When receiving transaction data inquiry request, the compressed data of the compact block storage is obtained;
Compact nature in the compressed data is converted into primitive attribute, obtains decompression data;
It is exported the decompression data as query result.
Second aspect, the embodiment of the present invention also provide a kind of data compression process device of block chain, including:
Acquisition request module, for obtaining the transaction request for carrying transaction data;
Attribute acquisition module, for obtaining the corresponding compact nature of the block chain;Wherein, the compact nature is through pressure Contract the block's attribute handled;
Block generation module, for generating the compact block with the compact nature according to the transaction data, with reality Now to the data compression process of the block chain.
In conjunction with second aspect, an embodiment of the present invention provides the first possible embodiments of second aspect, wherein institute Stating device further includes:
Data acquisition module, the pressure for when receiving transaction data inquiry request, obtaining the compact block storage Contracting data;
Data conversion module obtains decompression number for the compact nature in the compressed data to be converted to primitive attribute According to;
As a result output module, for being exported the decompression data as query result.
The third aspect, the embodiment of the present invention also provide a kind of electronic equipment, including memory, processor, the memory In be stored with the computer program that can be run on the processor, the processor is realized when executing the computer program State the method described in first aspect or its any possible embodiment.
The embodiment of the present invention brings following advantageous effect:
In the embodiment of the present invention, the transaction request for carrying transaction data is obtained first;Then it is corresponding to obtain block chain Compact nature;Wherein, compact nature is the block's attribute of compressed processing;Finally being generated according to the transaction data has compact nature Compact block, to realize to the data compression process of block chain.At the data compression of block chain provided in an embodiment of the present invention Manage method, apparatus and electronic equipment, by the way that the block's attribute of block chain is optimized compression processing, i.e., to block structure itself into Row compactedness optimization processing realizes simple and effective and homomorphism the compression of block chain data, multiple not increasing validation verification In the case of miscellaneous degree and enforcement difficulty, reduces the memory space of block chain data, improve the excellent of block chain data storage capacity Change degree.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification It obtains it is clear that understand through the implementation of the invention.The purpose of the present invention and other advantages are in specification and attached drawing Specifically noted structure is realized and is obtained.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, in being described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, other drawings may also be obtained based on these drawings.
Fig. 1 is a kind of flow diagram of the data compressing method of block chain provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of the transaction data querying method of block chain provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of the data compressing method of block chain provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the data compression process device of block chain provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of the data compression process device of another block chain provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Lower obtained every other embodiment, shall fall within the protection scope of the present invention.
The block structure of block chain is as shown in table 1 below, block include block head (build) and block data (block number evidence) this Two data fields.Wherein, block head stores the basic description information of block:The Hash HASH of block size, block version, father's block It is worth (preceding piece of cryptographic Hash), the HASH values of current block, timestamp etc.;Block data is the main contents of block, including the block In all transaction data, part alliance chain realize in each transaction also need to record call the information of intelligence contract, input, Output, the identity information of negotiator and endorser and signature etc..Endorser is the block chain completed the transaction and participate in common recognition process Participant, a transaction can have multiple endorsers, so having endorsement list.Behavior list in table 1 is the transaction Specific steps, a transaction can equally have multiple steps, including obtain what data, be written with what data, wherein The mode of write-in includes newly-increased, modification and deletes.Some block chains also have tail portion, such as the identity and label of record block producer Name etc..
Table 1
Conventional compression method optimization degree is limited at present, and complexity is increased in terms of the validation verification when node account book synchronizes Degree, and the enforcement difficulty of alliance's chain scene more than the public chain or node is larger.Based on this, one kind provided in an embodiment of the present invention Data compressing method, device and the electronic equipment of block chain can be with by carrying out compactedness optimization to block structure itself Simple and effective and homomorphism compression is realized, in the case where not increasing validation verification complexity and enforcement difficulty, it is possible to reduce The memory space of block chain data improves the optimization degree of block chain data storage capacity.
For ease of understanding the present embodiment, the data pressure first to a kind of block chain disclosed in the embodiment of the present invention Contracting processing method describes in detail.
Embodiment one:
It is fixed according to block structure, the limited feature of attribute-name, the data compression process of block chain provided in this embodiment Method is a kind of compactedness optimization method based on encoder dictionary, specific as follows:
Fig. 1 is a kind of flow diagram of the data compressing method of block chain provided in an embodiment of the present invention, such as Fig. 1 Shown, this method includes following steps:
Step S102 obtains the transaction request for carrying transaction data.
Specifically, it receives client and sends transaction request;Parsing obtains transaction data from the transaction request.Specific solution Analysis method is compared with technology, and which is not described herein again.
Step S104 obtains the corresponding compact nature of block chain;Wherein, compact nature is the block's attribute of compressed processing.
No matter which kind of block chain technology is realized, the block's attribute of block be it is geostationary, as version, blocknum, Header, timestamp, channel correlation, chaincode correlations etc..It can be replaced with shorter character by encoder dictionary Change these longer character attibute names.It is said from realization and one-to-one dictionary has only been added to map, original block chain is deposited Storage structure and application method do not influence substantially, only need to be compiled according to built-in encoder dictionary in deposit and reading Code and decoding.
Based on this, after getting transaction request, can according to preset encoder dictionary to the primitive attribute of block chain into Row compressed encoding, obtains compact nature.Specifically, all block's attributes can be listed according to the block structure of such as table 1, led to Inquiry encoder dictionary is crossed, all block's attributes is made to be mapped to shorter number or character, i.e., primitive attribute is converted into compact category Property.
In order to improve compression ratio, in some possible embodiments, by inquiring encoder dictionary, by the original of block chain Attribute is converted to the compact nature of single-byte character.The attribute-name of block is fixed, type is limited, substantially just using single-byte character It can indicate all attribute-names.Table 2 is a kind of encoder dictionary mapping table of block chain, as shown in table 2, it is contemplated that at present The block's attribute of block chain is relatively fewer, can be replaced with one character of temporary.
Table 2
Single attribute-name is mostly between 5-10 character, and for the attribute-name compression ratio of block chain 10% to 20%, this is right It is a letter for the block stored using JSON (JavaScript Object Notation, JS object tag) format Single effective and homomorphism compression method.Certainly, for different block chains, compression ratio is also to have different.Table 3 For a kind of encoder dictionary mapping table of bit coin block chain, as shown in table 3 below, the type number of block's attribute is 21, block category Property character total length be 119, it is assumed that block's attribute occurs primary in each block, and compression ratio is:119 ÷ 21=5.66 times.And Total number for Hyperledger Fabric block chains, one block merchandised containing 4 of citing, block's attribute is 375, block Attribute character total length is 2673, wherein there is 322 repetition block's attributes, 53 attribute need to be finally replaced, so can still use individual character Symbol continues to replace, and compression ratio is:2673 ÷ 375=7.12 times.
Table 3
In addition, encoder dictionary can also be arranged to obtain by User Defined, to meet the individual demand of user.
When more in view of block's attribute, for the ease of the quick search of encoder dictionary, in other possible embodiments In, encoder dictionary inquires the primitive attribute of block chain in encoder dictionary by indexing, obtains compact nature with index.
Step S106 generates the compact block with above-mentioned compact nature according to above-mentioned transaction data, to realize to block The data compression process of chain.
Specifically, according to preset data format, above-mentioned transaction data and compact nature is written in corresponding block, obtained To compact block.
In the embodiment of the present invention, the transaction request for carrying transaction data is obtained first;Then it is corresponding to obtain block chain Compact nature;Wherein, compact nature is the block's attribute of compressed processing;Finally being generated according to the transaction data has compact nature Compact block, to realize to the data compression process of block chain.At the data compression of block chain provided in an embodiment of the present invention Reason method carries out at compactedness optimization block structure itself by the way that the block's attribute of block chain is optimized compression processing Reason, realizes simple and effective and homomorphism the compression of block chain data, is not increasing validation verification complexity and enforcement difficulty In the case of, reduce the memory space of block chain data, improves the optimization degree of block chain data storage capacity.
In order to further increase the optimization degree of block chain data storage capacity, the above method further includes:To above-mentioned compact block Block data compressed, and by compressed compression block data storage in the database;Wherein, which includes Transaction data and compact nature.
Specifically, by above-mentioned, the compactedness optimization based on encoder dictionary, block structure itself are to be based on JSON formats, can To consider that, using compression, compression is very effective to the content of text class.Table 4 shows some existing compression algorithms and correspondence Compression ratio, compression speed and decompression speed.As shown in table 4, the compression algorithm of some mainstreams can reach 2~3 times of compression Than compression effectiveness is preferable.
Table 4
Compression algorithm Compression ratio Compression speed Decompress speed
zstd 1.1.3-1 2.877 430MB/s 1110MB/s
zlib 1.2.8-1 2.743 110MB/s 400MB/s
brotli 0.5.2-0 2.708 400MB/s 430MB/s
quicklz 1.5.0-1 2.238 550MB/s 710MB/s
lzo1x 2.09-1 2.108 650MB/s 830MB/s
lz4 1.7.5 2.101 720MB/s 3600MB/s
snappy 1.1.3 2.091 500MB/s 1650MB/s
Fig. 2 is a kind of flow diagram of the transaction data querying method of block chain provided in an embodiment of the present invention, such as Fig. 2 Shown, based on the data compression method of above-mentioned block chain, which includes following steps:
Step S202 obtains the compressed data of compact block storage when receiving transaction data inquiry request.
Compact nature in compressed data is converted to primitive attribute by step S204, obtains decompression data.
Step S206 is exported above-mentioned decompression data as query result.
Block's attribute presses encoder dictionary densification, to block chain storage user provide one it is transparent backward compatible compact Storage scheme.Fig. 3 is a kind of schematic diagram of the data compressing method of block chain provided in an embodiment of the present invention, such as Fig. 3 institutes Show, when generating block chain block, store the operation of primitive attribute, by the conversion of encoder dictionary, is changed to storage compact nature, it is raw At the compact block of block chain, compact block chain is formed.When needing to carry out inquiry operation by primitive attribute, by encoder dictionary pair The conversion of querying attributes, is converted to and is inquired by compact nature, from compact block chain obtain compact nature query result it Afterwards, then encoder dictionary Gray code is pressed, compact nature is converted to primitive attribute, returns to primitive attribute result.
To sum up, the data compressing method of block chain provided in this embodiment has the advantages that:1, it faces directly complete The storage problem for measuring account book, is greatly decreased the memory space of account book.2, it is suitable for various block chain technologies, including publicly-owned chain, connection Alliance's chain and privately owned chain, relevance grade are wide.
Embodiment two:
Fig. 4 is a kind of structural schematic diagram of the data compression process device of block chain provided in an embodiment of the present invention, such as Fig. 4 Shown, which includes:
Acquisition request module 42, for obtaining the transaction request for carrying transaction data;
Attribute acquisition module 44, for obtaining the corresponding compact nature of block chain;Wherein, compact nature is compressed processing Block's attribute;
Block generation module 46, for generating the compact block with compact nature according to above-mentioned transaction data, to realize To the data compression process of block chain.
In some possible embodiments, above-mentioned attribute acquisition module 44 is specifically used for:According to preset encoder dictionary pair The primitive attribute of block chain carries out compressed encoding, obtains compact nature.
In order to improve compression ratio, above-mentioned attribute acquisition module 44 is specifically used for:By inquiring encoder dictionary, by block chain Primitive attribute is converted to the compact nature of single-byte character.
When more in view of block's attribute, for the ease of the quick search of encoder dictionary, encoder dictionary is with index, above-mentioned category Property acquisition module 44 is specifically used for:The primitive attribute for inquiring block chain in encoder dictionary by indexing, obtains compact nature.
In some possible embodiments, above-mentioned block generation module 46 is specifically used for:It, will according to preset data format Transaction data and compact nature are written in corresponding block, obtain compact block.
In order to further increase the optimization degree of block chain data storage capacity, above-mentioned apparatus further includes:Data compressing module, should Data compressing module is connect with block generation module 46, is compressed for the block data to compact block, and will be after compression Compression block data storage in the database;Wherein, which includes transaction data and compact nature.
Fig. 5 is the structural schematic diagram of the data compression process device of another block chain provided in an embodiment of the present invention, such as Shown in Fig. 5, on the basis of Fig. 4, which further includes:
Data acquisition module 52, the compression for when receiving transaction data inquiry request, obtaining compact block storage Data;
Data conversion module 54 is decompressed for the compact nature in above-mentioned compressed data to be converted to primitive attribute Data;
As a result output module 56, for being exported above-mentioned decompression data as query result.
In the embodiment of the present invention, the transaction request for carrying transaction data is obtained first;Then it is corresponding to obtain block chain Compact nature;Wherein, compact nature is the block's attribute of compressed processing;Finally being generated according to the transaction data has compact nature Compact block, to realize to the data compression process of block chain.At the data compression of block chain provided in an embodiment of the present invention Reason device carries out at compactedness optimization block structure itself by the way that the block's attribute of block chain is optimized compression processing Reason, realizes simple and effective and homomorphism the compression of block chain data, is not increasing validation verification complexity and enforcement difficulty In the case of, reduce the memory space of block chain data, improves the optimization degree of block chain data storage capacity.
Embodiment three:
Referring to Fig. 6, the embodiment of the present invention also provides a kind of electronic equipment 100, including:Processor 60, memory 61, bus 62 and communication interface 63, the processor 60, communication interface 63 and memory 61 connected by bus 62;Processor 60 is for holding The executable module stored in line storage 61, such as computer program.
Wherein, memory 61 may include high-speed random access memory (RAM, Random Access Memory), May further include nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.By at least One communication interface 63 (can be wired or wireless) realizes the communication between the system network element and at least one other network element Connection can use internet, wide area network, local network, Metropolitan Area Network (MAN) etc..
Bus 62 can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data Bus, controlling bus etc..Only indicated with a four-headed arrow for ease of indicating, in Fig. 6, it is not intended that an only bus or A type of bus.
Wherein, memory 61 is for storing program, and the processor 60 executes the journey after receiving and executing instruction Sequence, the method performed by device that the stream process that aforementioned any embodiment of the embodiment of the present invention discloses defines can be applied to handle In device 60, or realized by processor 60.
Processor 60 may be a kind of IC chip, the processing capacity with signal.During realization, above-mentioned side Each step of method can be completed by the integrated logic circuit of the hardware in processor 60 or the instruction of software form.Above-mentioned Processor 60 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), application-specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or other are programmable Logical device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute in the embodiment of the present invention Disclosed each method, step and logic diagram.General processor can be microprocessor or the processor can also be to appoint What conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processing Device executes completion, or in decoding processor hardware and software module combination execute completion.Software module can be located at Machine memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register etc. are originally In the storage medium of field maturation.The storage medium is located at memory 61, and processor 60 reads the information in memory 61, in conjunction with Its hardware completes the step of above method.
It is apparent to those skilled in the art that for convenience and simplicity of description, the block of foregoing description The data compression process device of chain and the specific work process of electronic equipment can refer to corresponding in preceding method embodiment Journey, details are not described herein.
The data compression process device and electronic equipment of block chain provided in an embodiment of the present invention are provided with above-described embodiment The data compressing method technical characteristic having the same of block chain reach so can also solve identical technical problem Identical technique effect.
In all examples being illustrated and described herein, any occurrence should be construed as merely illustrative, without It is as limitation, therefore, other examples of exemplary embodiment can have different values.
Flow chart and block diagram in attached drawing show device, method and the computer journey of multiple embodiments according to the present invention 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 for a part for one module, section or code of table, the module, section or code includes one or more uses The executable instruction of the logic function as defined in realization.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two continuous boxes can essentially base Originally it is performed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.It is also noted that It is the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, can uses and execute rule The dedicated hardware based system of fixed function or action is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
The computer program product of the data compressing method for the progress block chain that the embodiment of the present invention is provided, including Store the computer readable storage medium of the executable non-volatile program code of processor, the finger that said program code includes It enables and can be used for executing the method described in previous methods embodiment, specific implementation can be found in embodiment of the method, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.The apparatus embodiments described above are merely exemplary, for example, the division of the unit, only A kind of division of logic function, formula that in actual implementation, there may be another division manner, in another example, multiple units or component can combine Or it is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed phase Coupling, direct-coupling or communication connection between mutually can be by some communication interfaces, the INDIRECT COUPLING of device or unit or Communication connection can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in the executable non-volatile computer read/write memory medium of a processor.Based on this understanding, of the invention Technical solution substantially the part of the part that contributes to existing technology or the technical solution can be with software in other words The form of product embodies, which is stored in a storage medium, including some instructions use so that One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the present invention State all or part of step of method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read- Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with Store the medium of program code.
Finally it should be noted that:Embodiment described above, only specific implementation mode of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, it will be understood by those of ordinary skill in the art that:Any one skilled in the art In the technical scope disclosed by the present invention, it can still modify to the technical solution recorded in previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover the protection in the present invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. a kind of data compressing method of block chain, which is characterized in that including:
Obtain the transaction request for carrying transaction data;
Obtain the corresponding compact nature of the block chain;Wherein, the compact nature is the block's attribute of compressed processing;
The compact block with the compact nature is generated according to the transaction data, to realize the data pressure to the block chain Contracting is handled.
2. according to the method described in claim 1, it is characterized in that, described obtain the corresponding compact nature of the block chain, packet It includes:
Compressed encoding is carried out to the primitive attribute of the block chain according to preset encoder dictionary, obtains compact nature.
3. according to the method described in claim 2, it is characterized in that, it is described according to preset encoder dictionary to the block chain Primitive attribute carries out compressed encoding, obtains compact nature, including:
By inquiring the encoder dictionary, the primitive attribute of the block chain is converted to the compact nature of single-byte character.
4. according to the method described in claim 2, it is characterized in that, the encoder dictionary is with index;It is described according to preset Encoder dictionary carries out compressed encoding to the primitive attribute of the block chain, obtains compact nature, including:
The primitive attribute for inquiring the block chain in the encoder dictionary by the index, obtains the compact nature.
5. according to the method described in claim 1, it is characterized in that, described generate according to the transaction data with described compact The compact block of attribute, including:
According to preset data format, the transaction data and the compact nature are written in corresponding block, obtained described Compact block.
6. according to the method described in claim 1, it is characterized in that, the method further includes:
The block data of the compact block is compressed, and in the database by the storage of compressed compression block data; Wherein, the block data includes the transaction data and the compact nature.
7. according to the method described in claim 1, it is characterized in that, described generate according to the transaction data with described compact After the compact block of attribute, the method further includes:
When receiving transaction data inquiry request, the compressed data of the compact block storage is obtained;
Compact nature in the compressed data is converted into primitive attribute, obtains decompression data;
It is exported the decompression data as query result.
8. a kind of data compression process device of block chain, which is characterized in that including:
Acquisition request module, for obtaining the transaction request for carrying transaction data;
Attribute acquisition module, for obtaining the corresponding compact nature of the block chain;Wherein, the compact nature is compressed place The block's attribute of reason;
Block generation module, for generating the compact block with the compact nature according to the transaction data, with realization pair The data compression process of the block chain.
9. device according to claim 8, which is characterized in that described device further includes:
Data acquisition module, the compression number for when receiving transaction data inquiry request, obtaining the compact block storage According to;
Data conversion module obtains decompression data for the compact nature in the compressed data to be converted to primitive attribute;
As a result output module, for being exported the decompression data as query result.
10. a kind of electronic equipment, including memory, processor, it is stored with and can runs on the processor in the memory Computer program, which is characterized in that the processor, which is realized when executing the computer program in the claims 1-7, appoints Method described in one.
CN201810423904.3A 2018-05-04 2018-05-04 Data compressing method, device and the electronic equipment of block chain Pending CN108563796A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810423904.3A CN108563796A (en) 2018-05-04 2018-05-04 Data compressing method, device and the electronic equipment of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810423904.3A CN108563796A (en) 2018-05-04 2018-05-04 Data compressing method, device and the electronic equipment of block chain

Publications (1)

Publication Number Publication Date
CN108563796A true CN108563796A (en) 2018-09-21

Family

ID=63537871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810423904.3A Pending CN108563796A (en) 2018-05-04 2018-05-04 Data compressing method, device and the electronic equipment of block chain

Country Status (1)

Country Link
CN (1) CN108563796A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508334A (en) * 2018-11-23 2019-03-22 中科驭数(北京)科技有限公司 For the data compression method of block chain database, access method and system
CN109711839A (en) * 2018-12-13 2019-05-03 平安科技(深圳)有限公司 Block chain storage method, device, equipment and storage medium based on data compression
CN110245147A (en) * 2019-06-19 2019-09-17 腾讯科技(深圳)有限公司 Block chain data processing method, device, readable storage medium storing program for executing and computer equipment
CN110264189A (en) * 2019-04-29 2019-09-20 北京清红微谷技术开发有限责任公司 Block chain node data storage method and system, terminal and block catenary system
CN111404958A (en) * 2020-03-26 2020-07-10 国金公用通链(海南)信息科技有限公司 Universal block chain block compression technology
US10764062B2 (en) 2019-06-03 2020-09-01 Alibaba Group Holding Limited Blockchain ledger compression
CN111695885A (en) * 2019-03-14 2020-09-22 中国科学技术大学 Digital certificate block chain compression method based on transaction input reduction
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
WO2020244240A1 (en) * 2019-06-03 2020-12-10 创新先进技术有限公司 Compression method for blockchain ledger, device, and equipment
CN112163019A (en) * 2020-09-29 2021-01-01 台州师同人信息技术有限公司 Trusted electronic batch record processing method based on block chain and block chain service platform
CN112202936A (en) * 2020-09-24 2021-01-08 普华云创科技(北京)有限公司 Account address coordinating method and system
CN112835975A (en) * 2020-06-05 2021-05-25 支付宝(杭州)信息技术有限公司 Method for deploying, updating and calling intelligent contracts in block chain
US20210174349A1 (en) * 2019-12-10 2021-06-10 Mastercard International Incorporated Method and system for optimization of data storage for distributed ledgers
CN113454619A (en) * 2019-08-19 2021-09-28 Dlt全球公司 Relational data management and organization using distributed ledger techniques
CN111414412B (en) * 2019-01-07 2023-04-07 国际商业机器公司 Video compression based on machine learning
CN117812092A (en) * 2024-02-28 2024-04-02 中国信息通信研究院 Predicate-based block compression transmission method and apparatus, device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0375221B1 (en) * 1988-12-09 1996-02-28 BRITISH TELECOMMUNICATIONS public limited company Data compression
US6320523B1 (en) * 1999-07-30 2001-11-20 Unisys Corporation Method and apparatus for reducing the time required for compressing data
CN103326732A (en) * 2013-05-10 2013-09-25 华为技术有限公司 Method for packing data, method for unpacking data, coder and decoder
CN104467868A (en) * 2014-11-04 2015-03-25 深圳市元征科技股份有限公司 Chinese text compression method
CN107451175A (en) * 2017-05-23 2017-12-08 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107728941A (en) * 2017-09-28 2018-02-23 中国银行股份有限公司 A kind of block chain data compression method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0375221B1 (en) * 1988-12-09 1996-02-28 BRITISH TELECOMMUNICATIONS public limited company Data compression
US6320523B1 (en) * 1999-07-30 2001-11-20 Unisys Corporation Method and apparatus for reducing the time required for compressing data
CN103326732A (en) * 2013-05-10 2013-09-25 华为技术有限公司 Method for packing data, method for unpacking data, coder and decoder
CN104467868A (en) * 2014-11-04 2015-03-25 深圳市元征科技股份有限公司 Chinese text compression method
CN107451175A (en) * 2017-05-23 2017-12-08 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107728941A (en) * 2017-09-28 2018-02-23 中国银行股份有限公司 A kind of block chain data compression method and system

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508334A (en) * 2018-11-23 2019-03-22 中科驭数(北京)科技有限公司 For the data compression method of block chain database, access method and system
CN109711839A (en) * 2018-12-13 2019-05-03 平安科技(深圳)有限公司 Block chain storage method, device, equipment and storage medium based on data compression
CN111414412B (en) * 2019-01-07 2023-04-07 国际商业机器公司 Video compression based on machine learning
CN111695885B (en) * 2019-03-14 2023-08-29 中国科学技术大学 Digital voucher block chain compression method based on reduced transaction input
CN111695885A (en) * 2019-03-14 2020-09-22 中国科学技术大学 Digital certificate block chain compression method based on transaction input reduction
CN110264189A (en) * 2019-04-29 2019-09-20 北京清红微谷技术开发有限责任公司 Block chain node data storage method and system, terminal and block catenary system
CN110264189B (en) * 2019-04-29 2021-10-26 北京清红微谷技术开发有限责任公司 Block chain link point data storage method and system, terminal and block chain system
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
US10958440B2 (en) 2019-06-03 2021-03-23 Advanced New Technologies Co., Ltd. Blockchain ledger compression
WO2020244240A1 (en) * 2019-06-03 2020-12-10 创新先进技术有限公司 Compression method for blockchain ledger, device, and equipment
US10764062B2 (en) 2019-06-03 2020-09-01 Alibaba Group Holding Limited Blockchain ledger compression
CN110245147A (en) * 2019-06-19 2019-09-17 腾讯科技(深圳)有限公司 Block chain data processing method, device, readable storage medium storing program for executing and computer equipment
CN110245147B (en) * 2019-06-19 2021-08-13 腾讯科技(深圳)有限公司 Block chain data processing method and device, readable storage medium and computer equipment
CN113454619A (en) * 2019-08-19 2021-09-28 Dlt全球公司 Relational data management and organization using distributed ledger techniques
US11580533B2 (en) * 2019-12-10 2023-02-14 Mastercard International Incorporated Method and system for optimization of data storage for distributed ledgers
US20230169493A1 (en) * 2019-12-10 2023-06-01 Mastercard International Incorporated Method and system for optimization of data storage for distributed ledgers
US20210174349A1 (en) * 2019-12-10 2021-06-10 Mastercard International Incorporated Method and system for optimization of data storage for distributed ledgers
CN111404958A (en) * 2020-03-26 2020-07-10 国金公用通链(海南)信息科技有限公司 Universal block chain block compression technology
CN112835975A (en) * 2020-06-05 2021-05-25 支付宝(杭州)信息技术有限公司 Method for deploying, updating and calling intelligent contracts in block chain
CN112202936A (en) * 2020-09-24 2021-01-08 普华云创科技(北京)有限公司 Account address coordinating method and system
CN112202936B (en) * 2020-09-24 2023-12-19 广东九河云计算有限公司 Account address coordinated method and system
CN112163019A (en) * 2020-09-29 2021-01-01 台州师同人信息技术有限公司 Trusted electronic batch record processing method based on block chain and block chain service platform
CN117812092A (en) * 2024-02-28 2024-04-02 中国信息通信研究院 Predicate-based block compression transmission method and apparatus, device and medium
CN117812092B (en) * 2024-02-28 2024-05-14 中国信息通信研究院 Predicate-based block compression transmission method and apparatus, device and medium

Similar Documents

Publication Publication Date Title
CN108563796A (en) Data compressing method, device and the electronic equipment of block chain
CN108681572A (en) Date storage method, device and the electronic equipment of block chain
CN102402605B (en) Mixed distribution model for search engine indexing
AU2016345990A1 (en) A system and method for processing big data using electronic document and electronic file-based system that operates on RDBMS
US8572110B2 (en) Textual search for numerical properties
CN102831127A (en) Method, device and system for processing repeating data
CN111352935B (en) Index creating method, device and equipment in block chain type account book
CN106156070B (en) A kind of querying method, file mergences method and relevant apparatus
CN101582081A (en) Data comparison method and device
CN106855861A (en) File merging method and device and electronic equipment
CN106202438A (en) The method and system of storage associated data
CN101222434B (en) Storage policy control list, policy searching method and tri-state addressing memory
CN111274454B (en) Spatio-temporal data processing method and device, electronic equipment and storage medium
CN109726295A (en) Brand knowledge map display methods, device, figure server and storage medium
CN108197338A (en) A kind of browser bookmark generation method, system and terminal device
CN107729330B (en) Method and apparatus for acquiring data set
JP5016996B2 (en) Financial document preparation system and financial document preparation method
CN103077214A (en) File storage method and device
CN105930323B (en) A kind of document generating method and device
CN103020189A (en) Data processing device and method
CN106775586B (en) Data reordering method and device
CN109068286A (en) A kind of method, medium and the equipment of information parsing
CN105095283A (en) Quasi-friend recommending method in social networking system and quasi-friend recommending system in social networking system
CN104932982A (en) Message access memory compiling method and related apparatus
CN107491501A (en) A kind of method and device for being grouped push

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
CB02 Change of applicant information

Address after: 315000 room 803, office building twenty, Meishan Road business center, Beilun District, Ningbo, Zhejiang.

Applicant after: Rose Tree Technology Co., Ltd

Address before: 315000 room 803, office building twenty, Meishan Road business center, Beilun District, Ningbo, Zhejiang.

Applicant before: QIANGWEI INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20180921

RJ01 Rejection of invention patent application after publication