WO2014089760A1 - 一种数据压缩方法及装置 - Google Patents

一种数据压缩方法及装置 Download PDF

Info

Publication number
WO2014089760A1
WO2014089760A1 PCT/CN2012/086377 CN2012086377W WO2014089760A1 WO 2014089760 A1 WO2014089760 A1 WO 2014089760A1 CN 2012086377 W CN2012086377 W CN 2012086377W WO 2014089760 A1 WO2014089760 A1 WO 2014089760A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
fragment
shard
data
sequence
Prior art date
Application number
PCT/CN2012/086377
Other languages
English (en)
French (fr)
Inventor
左少夫
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/086377 priority Critical patent/WO2014089760A1/zh
Priority to CN201280002718.3A priority patent/CN104145263B/zh
Publication of WO2014089760A1 publication Critical patent/WO2014089760A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a data compression method and apparatus. Background technique
  • DD data deduplication
  • DD compression technology can be used to compress data. Different from video, audio, image and other general data compression technologies, DD compression technology not only pays attention to the duplication of data inside data objects, but also the duplication of data between data objects.
  • the processing flow is as follows: The data object is cut into pieces in advance, and the data fragment and its feature index library are established. When the corresponding data fragment appears again, a shorter fragment index is used instead of the longer fragment data, thereby realizing storage or transmission data compression, thereby saving storage space or improving transmission bandwidth utilization.
  • the data compression ratio is one of the important evaluation criteria of the compression effect, and is specifically expressed as the ratio of the original data to the number of bytes occupied by the compressed data.
  • a larger data compression ratio means higher resource utilization, less hardware deployment, and lower equipment operating and maintenance costs. Therefore, the ultimate data compression ratio has always been the goal of the industry without sacrificing the sacrifice of compressible data recoverability and data processing performance.
  • DD compression technology generally divides data based on content. After the fragmentation method and its parameters are selected, the data compression ratio, that is, the ratio of the number of bytes occupied by the data fragment to the fragment index is basically fixed.
  • a method of combining data fragmentation to increase the data compression ratio is provided.
  • the data fragment sequences with higher frequency appear to be merged into super fragments, and corresponding super-shard indexes are established, thereby replacing the scattered data fragments and their fragment indexes.
  • This is equivalent to indirectly amplifying the molecular portion of the data compression ratio, thereby improving the DD compression effect.
  • the applicability of the method to data changes is poor.
  • the super slice will fail and cannot be used as a reference for data deduplication for data compression.
  • Super-slice merged data fragmentation More, its ability to cope with data changes is worse.
  • the DD compression effect is deteriorated, the storage resources are wasted due to the failure of the super slice, and the cost is increased; and the data processing performance is low due to the increase of the super slice construction and the calculation of the corresponding super slice index.
  • the embodiments of the present invention provide a data compression method and apparatus, which solves the problems of poor compression performance, waste of storage resources, and high cost due to changes in original data in the prior art.
  • a first aspect of the embodiments of the present invention provides a data compression method, which may include:
  • the fragment index of the data fragment in the data fragment sequence is sequentially calculated to form a fragment index sequence, and the backward index descriptor is expanded for the fragment index, wherein the fragment index obtained from the same data object has data correlation.
  • the backward index descriptor is used to identify a subsequent fragment index that has data correlation with the fragment index; if not, the fragment index of the data correlation is concatenated according to the backward index descriptor Forming a fragment index reference sequence; an index, where the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence;
  • the fragment index is represented by a relative index according to the displacement amount of the fragment index relative to the reference index, otherwise the representation manner of the fragment index is not changed.
  • using a relative index Indicates the fragment index, including:
  • the displacement amount is increased by one, and if the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n, where n is greater than The natural number of 1.
  • the method further includes:
  • the first fragment index is used as a reference index of the subsequent m-1 fragment indexes according to the number m of fragment indexes in the consecutive fragment index, and the subsequent m is represented by a continuous index m-1.
  • the relative index is used to represent the fragment index
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the backward index descriptor includes a pointer or a number.
  • fragment index of the data correlation is concatenated according to the backward index descriptor to form a fragment index reference sequence, including:
  • fragment index with data correlation is concatenated according to the backward index descriptor to form a new fragment index reference sequence.
  • a second aspect of the embodiments of the present invention provides a data compression apparatus, which may include:
  • a calculation expansion unit configured to sequentially calculate a fragment index of the data fragment in the data fragment sequence, form a fragment index sequence, and expand a backward index descriptor for the fragment index, where the fragment is taken from the same data object
  • the index has a data correlation
  • the backward index descriptor is used to identify a subsequent fragment index having a data correlation with the fragment index
  • a sequence construction unit is configured to determine, when the first determining unit Fragment index library does not exist When the fragment index is indexed, the fragment index having the data correlation is connected in series according to the backward index descriptor to form a fragment index reference sequence;
  • a second determining unit configured to: when the first determining unit determines that an index exists in an existing fragment index library, where the reference index is before the fragment index in the established fragment index reference sequence a slice index;
  • An index indicating unit configured to: use the relative index to represent the fragment index according to the displacement amount of the fragment index relative to the reference index if the reference index exists, and otherwise not change the representation of the fragment index the way.
  • the index representation unit is further configured to:
  • the displacement amount is increased by one, and if the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n, where n is greater than 1 Natural number.
  • the index representation unit is further configured to:
  • the first fragment index is used as a reference index of the subsequent m-1 fragment indexes according to the number m of fragment indexes in the consecutive fragment index, and the subsequent m is represented by a continuous index m-1.
  • the relative index is used to represent the fragment index
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the device further includes:
  • a third determining unit configured to: when the first determining unit determines that the fragment index does not exist in the existing fragment index library, further determine whether there is a fragment index that has data correlation with the fragment index Reference sequence
  • sequence construction unit is instructed to concatenate the fragmentation index with data correlation into a new slice index reference sequence according to the backward index descriptor.
  • a third aspect of the embodiments of the present invention provides a data compression apparatus, which may include:
  • the memory is configured to store a program executed by the processor and various data and indexes generated in a data compression process
  • the processor is configured to sequentially calculate a fragment index of the data fragment in the data fragment sequence, form a fragment index sequence, and expand a backward index descriptor for the fragment index, where the fragment index is taken from the same data object.
  • the backward index descriptor is used to identify a subsequent fragment index having data relevance to the fragment index; if not, data correlation may exist according to the backward index descriptor
  • the slice index is concatenated to form a slice index reference sequence; an index, where the reference index is a previous slice index of the slice index in the established slice index reference sequence;
  • the fragment index is represented by a relative index according to the displacement amount of the fragment index relative to the reference index, otherwise the representation manner of the fragment index is not changed.
  • the processor is further configured to:
  • the displacement amount is increased by one, and if the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n, where n is greater than 1 Natural number.
  • the processor is further configured to: determine whether the consecutive fragment index in the established fragment index reference sequence exists in the fragment index sequence. The displacement of each adjacent fragment index in the continuous fragment index is 1;
  • the first fragmentation cable Referring to the reference index of the subsequent m-1 fragment index, the subsequent m-1 fragment indexes are represented by a continuous index m-1, where m is a natural number greater than 2;
  • the relative index is used to represent the fragment index
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the processor is further configured to: describe a fragment index reference sequence in which the fragment index has data correlation;
  • fragment index with data correlation is concatenated according to the backward index descriptor to form a new fragment index reference sequence.
  • Data compression by establishing a relative index does not destroy the original data fragment, nor does it change its distribution state.
  • the impact is limited to the fragment corresponding to the current data fragment. Index; the next fragment index of the current fragment index will be referenced by its previous fragment index, and the relative index will continue to be established, thus ensuring better adaptability to data changes; based on data correlation between fragment indexes
  • the compression is performed by using the relative positional relationship between the two, and the compression effect is improved obviously compared to the bundled data fragment or the fragment index, especially for the longer fragment index, and the compression effect is better; By traversing and comparing backwards, it is more efficient to construct a super-slice or merge-slice index method to construct a super-segment than the merged data sharding method; and the relative index is established by reference index, and the setup time can be greatly shortened; In the process of establishing, only one field needs to be expanded on the basis of the original index structure, and the storage overhead is small
  • FIG. 1 is a schematic flow chart of a first embodiment of a data compression method according to the present invention
  • FIG. 2 is a schematic flow chart of a second embodiment of a data compression method according to the present invention
  • 3 is a schematic flow chart of a third embodiment of a data compression method according to the present invention
  • FIG. 4 is a schematic flow chart of a fourth embodiment of a data compression method according to the present invention.
  • FIG. 5 is a schematic structural diagram of a first embodiment of a data compression apparatus according to the present invention.
  • FIG. 6 is a schematic structural diagram of a second embodiment of a data compression apparatus according to the present invention.
  • FIG. 7 is a schematic diagram showing the composition of a third embodiment of a data compression apparatus according to the present invention. detailed description
  • FIG. 1 is a schematic flowchart of a first embodiment of a data compression method according to the present invention.
  • the method includes the following steps:
  • Data correlation can be an interactive session in a network transmission, an archive file in a data store, or a synchronized data in a data backup.
  • Excellent DD technology solutions usually use data correlation to store related data fragments in the order in which they appear in the original data, and centrally manage them to reduce frequent access to storage devices, especially disks, and improve data recovery. effectiveness.
  • the slice index taken from the same data object has data correlation
  • the backward index descriptor is used to identify the next slice index having data correlation with the slice index.
  • the backward index descriptor can be a pointer or a number. Step S103, otherwise step S105 is performed. If yes, go to step S104, otherwise go to step S106.
  • the reference index is the previous one of the fragment indexes in the established fragment index reference sequence. Fragment index.
  • the relative index is used to represent the fragment index according to the displacement of the fragment index relative to the reference index.
  • the data stream is cut into data fragment sequences of ⁇ 811, Si2, Si3, Si4, Si5, Si6, ...>, which are sequentially calculated to obtain the corresponding ⁇ Ril, Ri2, Ri3, Ri4, Ri5, Ri6, .
  • the fragment index sequence of ..> Since the same data object is taken, all the fragment indexes in the fragment index sequence have data correlation and are not repeated, which fully satisfies the condition of the fragment index reference sequence. Therefore, the slice index reference sequence ⁇ 1 ⁇ 1, Ri2, Ri3, Ri4, Ri5, Ri6, ...: > can be formed by concatenating the slice indexes having the data correlation according to the backward index descriptor.
  • Ri4 is Ri3, and Ri5 is the backward index of Ri4, which can be represented by the symbol "1".
  • ⁇ Ril, Ri3, Ri4, Ri5> and Sj3 are not repeated, and the corresponding slice indexes Rjl, Rj2, and Rj3 have no reference sequence, and a relative index cannot be established.
  • the non-repeating fragment index may be concatenated by using the backward index field to form a new fragment index reference sequence ⁇ Rjl, Rj2, Rj3, ...> for subsequent repetition.
  • the fragmentation index establishes a reference for the relative fragmentation index.
  • the original data fragment is not destroyed, and the distribution state thereof is not changed.
  • the impact is limited to the current data fragment corresponding to the score.
  • Slice index The next fragment index of the current fragment index will be referenced by its previous fragment index, and the relative index will continue to be established, thereby ensuring better adaptability to data changes; based on the data correlation between the fragment indexes, The relative positional relationship between the two is compressed, and the compression effect is improved significantly compared to the bundled data fragment or the fragment index. Especially for the longer fragment index, the compression effect is better; only the compression process needs to be done later.
  • FIG. 2 it is a schematic flowchart of a second embodiment of a data compression method according to the present invention.
  • the method includes the following steps:
  • the fragment index of the data fragment in the data fragment sequence is sequentially calculated to form a fragment index sequence, and the backward index descriptor is expanded for the fragment index.
  • step S203 otherwise step S206 is performed. If yes, go to step S204, otherwise go to step S207.
  • the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence.
  • S204 Using the location of the reference index as a starting point, performing backward traversal on the fragment index sequence, and detecting a location of the fragment index.
  • the displacement amount is increased by 1. If the fragment index is detected when the displacement amount is increased to n, the fragment index is represented by a relative index n.
  • n is a natural number greater than one.
  • the present embodiment provides a method for establishing a relative index
  • the present invention is not limited thereto, and those skilled in the art should understand that the present invention may also include any other suitable index according to the fragment.
  • a method of establishing a relative index with respect to the amount of displacement of the reference index is not only calculates the cartridge, but also has an actual compression effect.
  • FIG. 3 it is a schematic flowchart of a third embodiment of a data compression method according to the present invention.
  • the method includes the following steps: S301. Calculate a fragment index of the data fragment in the data fragment sequence in sequence, form a fragment index sequence, and expand the backward index descriptor for the fragment index.
  • the fragment index from the same data object has data relevance, and the backward index descriptor is used to identify a subsequent fragment index that has data correlation with the fragment index.
  • step S303 Otherwise, step S307 is performed. If yes, go to step S304, otherwise go to step S308.
  • the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence.
  • step S304 Determine whether the consecutive fragment index in the established fragment index reference sequence exists in the fragment index sequence. If yes, go to step S309, otherwise go to step S305.
  • the displacement amount of each adjacent fragment index in the continuous fragment index is 1.
  • S305 Using the location of the reference index as a starting point, performing backward traversal on the fragment index sequence, and detecting a location of the fragment index.
  • the displacement amount is increased by 1. If the fragment index is detected when the displacement amount is increased to n, the fragment index is represented by a relative index n.
  • n is a natural number greater than one.
  • the first fragment index is used as a reference index of the subsequent m-1 fragment indexes according to the number m of fragment indexes in the consecutive fragment index, and the subsequent m-1 is represented by a continuous index m-1. Fragment index.
  • n is a natural number greater than 2.
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the data stream is cut into data fragment sequences of ⁇ 811, Si2, Si3, Si4, Si5, Si6, ...>, which are sequentially calculated to obtain the corresponding ⁇ Ril, Ri2, Ri3, Ri4, Ri5, Ri6, .
  • the fragment index sequence of ..> Due to the same data object, all the fragment indexes in the fragment index sequence have data correlation and are not repeated. Fully satisfy the conditions of the slice index reference sequence. Therefore, the fragment index having the data correlation may be concatenated according to the backward index descriptor to form a slice index reference sequence ⁇ 1 ⁇ 1, Ri2, Ri3, Ri4, Ri5, Ri6, ...: >.
  • Ri4 is Ri3, and Ri5 is the backward index of Ri4, which can be represented by the symbol "1".
  • ⁇ Ril, Ri3, Ri4, Ri5> and Sj3 are not repeated, and the corresponding slice indexes Rjl, Rj2, and Rj3 have no reference sequence, and a relative index cannot be established.
  • the non-repeating fragment index may be concatenated by using the backward index field to form a new fragment index reference sequence ⁇ Rjl, Rj2, Rj3, ...> for subsequent repetition.
  • the fragmentation index establishes a reference for the relative fragmentation index.
  • the above-mentioned relative slice index sequence can be further optimized to ⁇ 13 ⁇ 41, 2, 2> to improve the DD compression effect.
  • the latter symbol "2" indicates the number of consecutive indexes.
  • this representation can cause ambiguity and needs to be distinguished because the relative fragment index sequence corresponding to the fragment index sequence ⁇ Ril, Ri3, Ri5> is also ⁇ 13 ⁇ 41, 2, 2>.
  • at least one bit can be configured to distinguish the relative index from the continuous index. If the high order of the relative index is set to 1, the high order of the consecutive index is 0.
  • multiple bits can also be configured to differentiate. However, one bit occupies less storage resources and has substantially achieved the same distinction.
  • the method for accumulating counts for adjacent consecutive slice indexes is further optimized, so that the DD compression effect can be greatly improved. Compared with other methods for improving the DD compression effect, the method is not affected by the slice index itself. Length limit.
  • FIG. 4 it is a schematic flowchart of a fourth embodiment of a data compression method according to the present invention.
  • the method includes the following steps:
  • the fragment index obtained from the same data object has data correlation, and the backward index description
  • the token is used to identify the next fragment index that has data relevance to the fragmentation index. Step S403, otherwise step S407 is performed. If yes, step S404 is performed, otherwise step S410 is performed.
  • the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence.
  • step S404 Determine whether the consecutive fragment index in the established fragment index reference sequence exists in the fragment index sequence. If yes, go to step S411, otherwise go to step S405.
  • S405 Using the location of the reference index as a starting point, performing backward traversal on the fragment index sequence, and detecting a location of the fragment index.
  • the displacement amount is increased by 1. If the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n.
  • n is a natural number greater than one.
  • step S407 Determine whether there is a fragment index reference sequence that has data correlation with the fragment index. If yes, go to step S408, otherwise go to step S409.
  • S409 Concatenate the fragment indexes with data correlation according to the backward index descriptor to form a new fragment index reference sequence.
  • the first fragment index is used as a reference index of subsequent m-1 fragment indexes according to the number m of fragment indexes in the consecutive fragment index, and the subsequent m-1 is represented by a continuous index m-1. Fragment index.
  • n is a natural number greater than 2.
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • FIG. 5 is a schematic diagram of a composition of a first embodiment of a data compression apparatus according to the present invention.
  • the apparatus includes: a calculation expansion unit 100, a first determination unit 200, a sequence construction unit 300, and a second determination.
  • Unit 400 and index represent unit 500.
  • the calculation expansion unit 100 is configured to sequentially calculate a fragment index of the data fragment in the data fragment sequence, form a fragment index sequence, and expand the backward index descriptor for the fragment index, where the same data object is taken from the same data object.
  • the slice index has a data correlation, and the backward index descriptor is used to identify a subsequent slice index having a data correlation with the slice index;
  • the sequence construction unit 300 is configured to: when the first determination unit 200 determines that the existing fragment index library does not exist, the fragment index is not included. And, according to the backward index descriptor, the fragment index having the data correlation is connected in series to form a fragment index reference sequence;
  • the second determining unit 400 is configured to determine, when the first determining unit 200 determines that the fragment index exists in the existing fragment index library, whether the fragment index exists in the fragment index sequence. a reference index, where the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence;
  • the index indicating unit 500 is configured to: if the reference index exists, represent the fragment index by using a relative index according to the displacement amount of the fragment index relative to the reference index, otherwise, the fragment index is not changed. Representation.
  • the index representation unit 500 is further configured to:
  • the displacement amount is increased by one, and if the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n, where n is greater than The natural number of 1.
  • the index representation unit 500 is further configured to: determine whether the continuous fragment index in the established fragment index reference sequence exists in the fragment index sequence, where The displacement of each adjacent fragment index in the continuous fragment index is 1;
  • the first fragmentation cable Referring to the reference index of the subsequent m-1 fragment index, the subsequent m-1 fragment indexes are represented by a continuous index m-1, where m is a natural number greater than 2;
  • the relative index is used to represent the fragment index
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the backward index descriptor includes a pointer or a number.
  • the apparatus includes: a calculation expansion unit 100, a first determination unit 200, a sequence construction unit 300, and a second determination.
  • the third determining unit 600 is configured to: when the first determining unit 200 determines that the fragment index does not exist in the existing fragment index library, further determine whether there is data correlation with the fragment index. Fragment index reference sequence;
  • sequence construction unit 300 is instructed to concatenate the fragment indices with data dependencies according to the backward index descriptor to form a new slice index reference sequence.
  • FIG. 7 is a schematic structural diagram of a third embodiment of a data compression apparatus according to the present invention.
  • the device includes: a processor 700 and a memory 800 cooperating with the processor 700; the memory 800 is configured to store a program executed by the processor 700 and each generated during a data compression process Kind of data and index;
  • the processor 700 is configured to sequentially calculate a fragment index of a data fragment in a data fragment sequence, form a fragment index sequence, and expand a backward index descriptor for the fragment index, where the score is taken from the same data object.
  • the slice index has a data correlation, and the backward index descriptor is used to identify a subsequent slice index having a data correlation with the slice index; if not, the data will exist according to the backward index descriptor
  • the fragment index of the correlation is formed in tandem to form a fragment index reference sequence; an index, where the reference index is a previous fragment index of the fragment index in the established fragment index reference sequence; If the reference index exists, the fragment index is represented by a relative index according to the displacement amount of the fragment index relative to the reference index, otherwise the representation manner of the fragment index is not changed.
  • the processor 700 is further configured to:
  • the displacement amount is increased by one, and if the slice index is detected when the displacement amount is increased to n, the slice index is represented by a relative index n, where n is greater than 1 Natural number.
  • the processor 700 is further configured to: determine whether the continuous fragment index in the established fragment index reference sequence exists in the fragment index sequence, where the fragment index is used to represent the fragment index, where The displacement amount of each adjacent fragment index in the continuous fragment index is 1;
  • the first fragment index is used as a reference index of the subsequent m-1 fragment indexes according to the number m of fragment indexes in the consecutive fragment index, and the subsequent m is represented by a continuous index m-1.
  • the relative index is used to represent the fragment index
  • At least one bit is configured to distinguish the relative index from the continuous index.
  • the processor 700 is further configured to: describe a fragment index reference sequence in which a slice index has data correlation;
  • fragment index with data correlation is concatenated according to the backward index descriptor to form a new fragment index reference sequence.
  • the present invention has the following advantages:
  • the operation of the slice index method to build a super cable is more efficient; and the relative index is established by reference index, the setup time can be greatly shortened; and only one field needs to be expanded on the basis of the original index structure during the establishment process, and the storage overhead is small;
  • the adjacent continuous fragment index is further optimized by the method of accumulating counts, which can make the DD compression effect large. Upgrade.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (Random Access Memory).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本发明实施例提供了一种数据压缩方法及装置,该方法包括:依次计算数据分片序列中数据分片的分片索引,形成分片索引序列,为所述分片索引扩充后向索引描述符;判断已有的分片索引库中是否存在所述分片索引;若不存在,则根据所述后向索引描述符将存在数据相关性的分片索引串联形成分片索引参考序列;若存在,则进一步判断所述分片索引序列中是否存在所述分片索引的参考索引;若存在所述参考索引,则根据所述分片索引相对于所述参考索引的位移量,采用相对索引表示所述分片索引,否则不改变所述分片索引的表示方式。采用本发明,可提升数据压缩的效果和速率,降低分片索引的管理成本及存储成本。

Description

一种数据压缩方法及装置 技术领域
本发明涉及计算机技术领域, 尤其涉及一种数据压缩方法及装置。 背景技术
随着信息化社会的飞速发展, 需要存储或传输的数据呈指数级增长, 数据占 用的空间急剧膨胀, 但是用于数据存储的容量空间与用于数据传输的网络带宽 却受限于存储系统和网络设备高昂的架设、 管理以及维护成本而难以与当今庞 大的数据量相匹配。 在数据存储或网络传输过程中存在大量的重复数据。 为了 緩解数据量飞快增长与硬件设施更新緩慢之间的矛盾, 可采用数据去重(Data Deduplication, 筒称 DD )压缩技术对数据进行压缩处理。 有别于视频、 音频、 图像以及其它通用的数据压缩技术, DD压缩技术不仅关注数据对象内部数据的 重复, 还关注数据对象之间数据的重复。 其处理流程如下: 预先将数据对象切 割成片, 并建立数据分片及其特征索引库。 当相应的数据分片再次出现时, 使 用较短的分片索引代替较长的分片数据, 从而实现存储或传输的数据压缩, 达 到节省存储空间或提升传输带宽利用率的效果。 其中, 数据压缩比是压缩效果 的重要评估标准之一, 具体表示为原始数据与压缩数据占用字节数的比值。 更 大的数据压缩比, 意味着更高的资源利用率、 更少的硬件部署以及更低的设备 运营和维护成本。 因此, 在不以过分牺牲压缩数据可恢复性和数据处理性能为 代价的前提下, 极限的数据压缩比一直是业界追求的目标。 DD压缩技术一般基 于内容对数据进行分片, 在分片方法及其参数选定之后, 其数据压缩比, 即数 据分片与分片索引平均占用字节数的比值, 基本固定。
现有技术中, 提供了一种采用合并数据分片来提高数据压缩比的方法。 通 过统计分析, 将出现频率较高的数据分片序列合并成超级分片, 并为之建立对 应的超级分片索引, 从而取代零散的数据分片及其分片索引。 这样相当于间接 放大了数据压缩比的分子部分, 进而实现 DD压缩效果的提升。 但是该方法对 数据变化的适用性较差, 一旦超级分片对应的原始数据发生变化, 超级分片将 失效, 不能作为数据去重的参考以进行数据压缩。 超级分片合并的数据分片越 多, 其应对数据变化的能力就越差。 从而导致 DD压缩效果恶化, 存储资源将 因超级分片失效而浪费, 提升了成本; 此外由于增加了超级分片的构建及对应 超级分片索引的计算, 数据处理性能较低。
现有技术中, 还提供了一种采用合并分片索引来提高数据压缩比的方法。 通过统计分析, 将出现频率较高的分片索引序列合并成超级索引, 从而取代零 散的分片索引。 这样相当于间接缩小了数据压缩比的分母部分, 进而实现 DD 压缩效果的提升。 但是该方法同样面临超级索弓 I对应的原始数据发生变化导致 超级索引失效而带来的压缩效果差、 存储资源浪费、 成本高的缺点, 同时因为 增加了超级索引的构建且在数据恢复过程中需要对分片索引作二次检索, 数据 处理性能同样较低。 发明内容
有鉴于此, 本发明实施例提供了一种数据压缩方法及装置, 以解决现有技 术中由于原始数据发生变化而带来的压缩效果差、 存储资源浪费和成本高的问 题。
本发明实施例第一方面提供一种数据压缩方法, 可包括:
依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所 述分片索引扩充后向索引描述符, 其中, 取自同一数据对象的分片索引存在数 据相关性, 所述后向索引描述符用于标识与所述分片索引存在数据相关性的后 一个分片索引; 若不存在, 则根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列; 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引;
若存在所述参考索引, 则根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片索引的表示方式。
可选的, 根据所述分片索引相对于所述参考索引的位移量, 采用相对索引 表示所述分片索引, 包括:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中, n为大于 1的自 然数。
可选的, 在采用相对索引表示所述分片索引之前, 还包括:
判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
其中, 配置至少一个比特位用于区别所述相对索引与所述连续索引。
可选的, 所述后向索引描述符包括指针或编号。
可选的, 根据所述后向索引描述符将存在数据相关性的分片索引串联形成 分片索引参考序列, 包括:
判断是否存在与所述分片索引存在数据相关性的分片索引参考序列; 若存在, 则将所述分片索引插入所述分片索引参考序列并更新所述分片索 引参考序列;
否则根据所述后向索引描述符将存在数据相关性的分片索引串联形成新的 分片索引参考序列。
本发明实施例第二方面提供一种数据压缩装置, 可包括:
计算扩充单元, 用于依次计算数据分片序列中数据分片的分片索引, 形成 分片索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数据对 象的分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片索引 存在数据相关性的后一个分片索引; 序列构建单元, 用于当所述第一判断单元判定已有的分片索引库中不存在 所述分片索引时, 根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列;
第二判断单元, 用于当所述第一判断单元判定已有的分片索引库中存在所 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引;
索引表示单元, 用于若存在所述参考索引, 则根据所述分片索引相对于所 述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片 索引的表示方式。
可选的, 所述索引表示单元进一步用于:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中 n为大于 1的自 然数。
可选的, 在采用相对索引表示所述分片索引之前, 所述索引表示单元还用 于:
判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
可选的, 所述装置还包括:
第三判断单元, 用于当所述第一判断单元判定已有的分片索引库中不存在 所述分片索引时, 进一步判断是否存在与所述分片索引存在数据相关性的分片 索引参考序列;
若存在, 则指示所述序列构建单元将所述分片索引插入所述分片索引参考 序列并更新所述分片索引参考序列;
否则指示所述序列构建单元根据所述后向索引描述符将存在数据相关性的 分片索引串联形成新的分片索引参考序列。
本发明实施例第三方面提供一种数据压缩装置, 可包括:
处理器及与所述处理器相配合的存储器;
所述存储器用于存储所述处理器执行的程序及数据压缩过程中产生的各种 数据和索引;
所述处理器用于依次计算数据分片序列中数据分片的分片索引, 形成分片 索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数据对象的 分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片索引存在 数据相关性的后一个分片索引; 若不存在, 则根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列; 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引;
若存在所述参考索引, 则根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片索引的表示方式。
可选的, 所述处理器进一步用于:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中 n为大于 1的自 然数。
可选的, 在采用相对索引表示所述分片索引之前, 所述处理器还用于: 判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
可选的, 所述处理器还用于: 述分片索引存在数据相关性的分片索引参考序列;
若存在, 则将所述分片索引插入所述分片索引参考序列并更新所述分片索 引参考序列;
否则根据所述后向索引描述符将存在数据相关性的分片索引串联形成新的 分片索引参考序列。
实施本发明实施例, 具有如下有益效果:
通过建立相对索引的方式进行数据压缩, 不会破坏原始数据分片, 也未改 变其分布状态, 当特定数据分片对应的原始数据发生改变时, 其影响仅限于当 前数据分片对应的分片索引; 当前分片索引的后一分片索引将以其前一分片索 引作为参考, 继续建立相对索引, 从而保证了对数据变化的较佳适应性; 基于 分片索引之间的数据相关性, 利用彼此之间的相对位置关系进行压缩, 相对于 筒单地捆绑数据分片或分片索引, 压缩效果提升明显, 尤其对于较长的分片索 引, 压缩效果更佳; 压缩过程中只需要作后向遍历和比较, 比合并数据分片方 法构建超级分片或合并分片索引方法构建超级索弓 )的操作更高效; 且相对索引 以参考索引为标准建立, 建立时间可大大缩短; 且建立过程中只需要在原索引 结构基础上扩充一个字段, 存储开销小。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例。
图 1为本发明数据压缩方法的第一实施例的流程示意图;
图 2为本发明数据压缩方法的第二实施例的流程示意图; 图 3为本发明数据压缩方法的第三实施例的流程示意图;
图 4为本发明数据压缩方法的第四实施例的流程示意图;
图 5为本发明数据压缩装置的第一实施例的组成示意图;
图 6为本发明数据压缩装置的第二实施例的组成示意图;
图 7为本发明数据压缩装置的第三实施例的组成示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。
请参照图 1 , 为本发明数据压缩方法的第一实施例的流程示意图; 在本实施 例中, 所述方法包括以下步骤:
S101 , 依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所述分片索引扩充后向索引描述符。
在数据存储和传输过程中, 特定的数据分片并不是孤立地复现。 在数据分 片过程中, 被同时切割出来的数据分片往往会以很高的机率复现, 甚至彼此之 间先后顺序也保持不变。 对于这种数据分片之间隐藏的相互关系, 可称之为数 据相关性。 数据相关性可以是网络传输中的一次交互会话、 数据存储中的一个 归档文件或数据备份中的一份同步数据。 优秀的 DD技术方案通常会利用数据 相关性, 将关联的数据分片按其在原始数据中出现的先后顺序统一存放, 集中 管理, 以减少对存储设备, 尤其是磁盘的频繁访问, 提高数据恢复效率。
在本实施例中, 取自同一数据对象的分片索引存在数据相关性, 所述后向 索引描述符用于标识与所述分片索引存在数据相关性的后一个分片索引。
所述后向索引描述符可以是指针或编号。 骤 S103 , 否则执行步骤 S105。 若是, 则执行步骤 S104, 否则执行步骤 S106。
其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前一 个分片索引。
5104, 根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表 示所述分片索引。
5105 , 根据所述后向索引描述符将存在数据相关性的分片索引串联形成分 片索引参考序列。
5106, 不改变所述分片索引的表示方式。
例如, 数据流被切割成<811, Si2, Si3, Si4, Si5, Si6, ...>的数据分片序列, 依 次计算可得到对应的 <Ril, Ri2, Ri3, Ri4, Ri5, Ri6, ...>的分片索引序列。由于取自 同一数据对象, 分片索引序列内所有分片索引均存在数据相关性, 而且不重复, 充分满足分片索引参考序列的条件。 因此可以根据所述后向索引描述符将存在 数据相关性的分片索引串联形成分片索引参考序列<1^1, Ri2, Ri3, Ri4, Ri5, Ri6, …: >。 当新的数据流被切割成<811, Sjl, Sj2, Si3, Si4, Si5, Sj3,…; >的数据分片 序列, 对应<1¾1, 1, 2, 1¾3, 1¾4, 1¾5, 3, ...>的分片索引序列。 其中, 数据分 片 Sil、 Si3、 Si4和 Si5重复, 按照分片索引参考序列<1¾1, Ri2, Ri3, Ri4, Ri5, Ri6, ...>, 取 Ril作为参考, 则 Ri3可以筒单地使用符号 "2"代替, 表示二者之 间在分片索引参考序列上的相对位置偏移了 2个分片索引。类似地, Ri4是 Ri3, Ri5是 Ri4的后向索引, 均可以使用符号 "1" 表示。 于是, <Ril, Ri3, Ri4, Ri5> 和 Sj3不重复, 对应的分片索引 Rjl、 Rj2和 Rj3没有参考序列, 无法建立相对 索引。 但是, 基于当前数据的相关性, 可以利用后向索引字段, 将上述不重复 的分片索引串联起来, 组成新的分片索引参考序列 <Rjl, Rj2, Rj3, ...>, 为后续 重复的分片索引建立相对分片索引提供参考。
通过本实施例所述的数据压缩方法, 不会破坏原始数据分片, 也未改变其 分布状态, 当特定数据分片对应的原始数据发生改变时, 其影响仅限于当前数 据分片对应的分片索引。 当前分片索引的后一分片索引将以其前一分片索引作 为参考, 继续建立相对索引, 从而保证了对数据变化的较佳适应性; 基于分片 索引之间的数据相关性, 利用彼此之间的相对位置关系进行压缩, 相对于筒单 地捆绑数据分片或分片索引, 压缩效果提升明显, 尤其对于较长的分片索引, 压缩效果更佳; 压缩过程中只需要作后向遍历和比较, 比合并数据分片方法构 建超级分片或合并分片索引方法构建超级索引的操作更高效; 且相对索引以参 考索引为标准建立, 建立时间可大大缩短; 且建立过程中只需要在原索引结构 基础上扩充一个字段, 存储开销小。
请参照图 2, 为本发明数据压缩方法的第二实施例的流程示意图; 在本实施 例中, 所述方法包括以下步骤:
S201 , 依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所述分片索引扩充后向索引描述符。
其中, 取自同一数据对象的分片索引存在数据相关性, 所述后向索引描述 符用于标识与所述分片索引存在数据相关性的后一个分片索引。 骤 S203 , 否则执行步骤 S206。 是, 则执行步骤 S204, 否则执行步骤 S207。
其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前一 个分片索引。
5204, 将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向 遍历, 检测所述分片索引的位置。
5205 , 每向后遍历 1 个分片索引, 所述位移量增加 1 , 若位移量增加至 n 时检测到所述分片索引, 则将所述分片索引采用相对索引 n表示。
其中, n为大于 1的自然数。
5206, 根据所述后向索引描述符将存在数据相关性的分片索引串联形成分 片索引参考序列。
5207, 不改变所述分片索引的表示方式。
需要说明的是, 虽然本实施例给出了一种建立相对索引的方法, 但是本发 明并不限于此, 本领域技术人员应当理解, 本发明还可以包括其他任意合适的 根据所述分片索引相对于所述参考索引的位移量建立相对索引的方法。 但是本 实施例所述的方法不但计算筒单, 而且实际压缩效果较佳。
请参照图 3 , 为本发明数据压缩方法的第三实施例的流程示意图; 在本实施 例中, 所述方法包括以下步骤: S301 , 依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所述分片索引扩充后向索引描述符。
其中, 取自同一数据对象的分片索引存在数据相关性, 所述后向索引描述 符用于标识与所述分片索引存在数据相关性的后一个分片索引。
S303, 否则执行步骤 S307。 若是, 则执行步骤 S304, 否则执行步骤 S308。
其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前一 个分片索引。
5304, 判断所述分片索引序列中是否存在所述已建立的分片索引参考序列 中的连续分片索引。 若是, 则执行步骤 S309, 否则执行步骤 S305。
其中, 所述连续分片索引中各个相邻分片索引的位移量为 1。
5305 , 将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向 遍历, 检测所述分片索引的位置。
5306, 每向后遍历 1 个分片索引, 所述位移量增加 1 , 若位移量增加至 n 时检测到所述分片索引, 则将所述分片索引采用相对索引 n表示。
其中, n为大于 1的自然数。
5307, 根据所述后向索引描述符将存在数据相关性的分片索引串联形成分 片索引参考序列。
5308, 不改变所述分片索引的表示方式。
5309, 根据所述连续分片索引中分片索引的数目 m, 将第一个分片索引作 为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1个分 片索引。
其中, m为大于 2的自然数。
配置至少一个比特位用于区别所述相对索引与所述连续索引。
例如, 数据流被切割成<811, Si2, Si3, Si4, Si5, Si6, ...>的数据分片序列, 依 次计算可得到对应的 <Ril, Ri2, Ri3, Ri4, Ri5, Ri6, ...>的分片索引序列。由于取自 同一数据对象, 分片索引序列内所有分片索引均存在数据相关性, 而且不重复, 充分满足分片索引参考序列的条件。 因此可以根据所述后向索引描述符将存在 数据相关性的分片索引串联形成分片索引参考序列<1^1, Ri2, Ri3, Ri4, Ri5, Ri6, …: >。 当新的数据流被切割成<811, Sjl, Sj2, Si3, Si4, Si5, Sj3,…; >的数据分片 序列, 对应<1¾1, 1, 2, 1¾3, 1¾4, 1¾5, 3, ...>的分片索引序列。 其中, 数据分 片 Sil、 Si3、 Si4和 Si5重复, 按照分片索引参考序列<1¾1, Ri2, Ri3, Ri4, Ri5, Ri6, ...>, 取 Ril作为参考, 则 Ri3可以筒单地使用符号 "2"代替, 表示二者之 间在分片索引参考序列上的相对位置偏移了 2个分片索引。类似地, Ri4是 Ri3, Ri5是 Ri4的后向索引, 均可以使用符号 "1" 表示。 于是, <Ril, Ri3, Ri4, Ri5> 和 Sj3不重复, 对应的分片索引 Rjl、 Rj2和 Rj3没有参考序列, 无法建立相对 索引。 但是, 基于当前数据的相关性, 可以利用后向索引字段, 将上述不重复 的分片索引串联起来, 组成新的分片索引参考序列 <Rjl, Rj2, Rj3, ...>, 为后续 重复的分片索引建立相对分片索引提供参考。
考虑到分片索引 Ri3、 Ri4和 Ri5在参考序列中连续的特殊性, 上述相对分 片索引序列可以进一步优化成<1¾1, 2, 2>, 以提升 DD压缩效果。 其中, 后一符 号 "2"表示连续索引的数量。 然而, 这种表示方法会引发歧义, 需要加以区别, 因为分片索引序列 <Ril, Ri3, Ri5>对应的相对分片索引序列也是<1¾1, 2, 2>。 为 了避免沖突, 可以配置至少一个比特位用于区别所述相对索引与所述连续索引。 如配置相对索引的高位为 1 , 连续索引的高位为 0。 当然, 也可以配置多个比特 位来进行区别。 但是一个比特位占用存储资源较少且已经基本能实现区别的目 的。
在本实施例中, 对于相邻连续的分片索引采用累加计数的方法作进一步优 化, 可以使 DD压缩效果大幅提升, 相对于其它提升 DD压缩效果的方法, 本方 法不受分片索引本身的长度限制。
请参照图 4, 为本发明数据压缩方法的第四实施例的流程示意图; 在本实施 例中, 所述方法包括以下步骤:
S401 , 依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所述分片索引扩充后向索引描述符。
其中, 取自同一数据对象的分片索引存在数据相关性, 所述后向索引描述 符用于标识与所述分片索引存在数据相关性的后一个分片索引。 骤 S403 , 否则执行步骤 S407。 若是, 则执行步骤 S404, 否则执行步骤 S410。
其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前一 个分片索引。
5404, 判断所述分片索引序列中是否存在所述已建立的分片索引参考序列 中的连续分片索引。 若是, 则执行步骤 S411 , 否则执行步骤 S405。
5405 , 将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向 遍历, 检测所述分片索引的位置。
5406, 每向后遍历 1 个分片索引, 所述位移量增加 1 , 若位移量增加至 n 时检测到所述分片索引, 则将所述分片索引采用相对索引 n表示。
其中, n为大于 1的自然数。
5407 , 判断是否存在与所述分片索引存在数据相关性的分片索引参考序列。 若是, 则执行步骤 S408, 否则执行步骤 S409。
5408 , 将所述分片索引插入所述分片索引参考序列并更新所述分片索引参 考序列。
5409, 根据所述后向索引描述符将存在数据相关性的分片索引串联形成新 的分片索引参考序列。
5410, 不改变所述分片索引的表示方式。
5411 , 根据所述连续分片索引中分片索引的数目 m, 将第一个分片索引作 为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1个分 片索引。
其中, m为大于 2的自然数。
配置至少一个比特位用于区别所述相对索引与所述连续索引。
在本实施例中, 给出了更新及建立分片索引参考序列的方法, 通过这样不 断的循环可得到越来越多的参分片索引参考序列, 利于更好的实现基于相对索 引的方式进行数据压缩, 进一步提升压缩效果。 请参照图 5 , 为本发明数据压缩装置的第一实施例的组成示意图; 在本实施 例中,所述装置包括:计算扩充单元 100、第一判断单元 200、序列构建单元 300、 第二判断单元 400及索引表示单元 500。
所述计算扩充单元 100用于依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数 据对象的分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片 索引存在数据相关性的后一个分片索引;
引; ^ 、' ': 、 、' ': 、 ,、 , ,、 所述序列构建单元 300用于当所述第一判断单元 200判定已有的分片索引 库中不存在所述分片索引时, 根据所述后向索引描述符将存在数据相关性的分 片索引串联形成分片索引参考序列;
所述第二判断单元 400用于当所述第一判断单元 200判定已有的分片索引 库中存在所述分片索引时, 进一步判断所述分片索引序列中是否存在所述分片 索引的参考索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分 片索引的前一个分片索引;
所述索引表示单元 500用于若存在所述参考索引, 则根据所述分片索引相 对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所 述分片索引的表示方式。
具体地, 所述索引表示单元 500进一步用于:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中, n为大于 1的自 然数。
在采用相对索引表示所述分片索引之前, 所述索引表示单元 500还用于: 判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
其中, 所述后向索引描述符包括指针或编号。
请参照图 6, 为本发明数据压缩装置的第二实施例的组成示意图; 在本实施 例中,所述装置包括:计算扩充单元 100、第一判断单元 200、序列构建单元 300、 第二判断单元 400、 索引表示单元 500及第三判断单元 600。
所述第三判断单元 600用于当所述第一判断单元 200判定已有的分片索引 库中不存在所述分片索引时, 进一步判断是否存在与所述分片索引存在数据相 关性的分片索引参考序列;
若存在, 则指示所述序列构建单元 300将所述分片索引插入所述分片索引 参考序列并更新所述分片索引参考序列;
否则指示所述序列构建单元 300根据所述后向索引描述符将存在数据相关 性的分片索引串联形成新的分片索引参考序列。
请参照图 7, 为本发明数据压缩装置的第三实施例的组成示意图。 在本实施 例中, 所述装置包括: 处理器 700及与所述处理器 700相配合的存储器 800; 所述存储器 800用于存储所述处理器 700执行的程序及数据压缩过程中产 生的各种数据和索引;
所述处理器 700用于依次计算数据分片序列中数据分片的分片索引, 形成 分片索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数据对 象的分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片索引 存在数据相关性的后一个分片索引; 若不存在, 则根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列; 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引; 若存在所述参考索引, 则根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片索引的表示方式。
所述处理器 700进一步用于:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中 n为大于 1的自 然数。
在采用相对索引表示所述分片索引之前, 所述处理器 700还用于: 判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
所述处理器 700还用于: 述分片索引存在数据相关性的分片索引参考序列;
若存在, 则将所述分片索引插入所述分片索引参考序列并更新所述分片索 引参考序列;
否则根据所述后向索引描述符将存在数据相关性的分片索引串联形成新的 分片索引参考序列。
本说明书中的各个实施例均采用递进的方式描述, 每个实施例重点说明的 都是与其它实施例的不同之处, 各个实施例之间相同相似的部分互相参见即可。 对于装置实施例而言, 由于其与方法实施例基本相似, 所以描述的比较筒单, 相关之处参见方法实施例的部分说明即可。
通过上述实施例的描述, 本发明具有以下优点:
通过建立相对索引的方式进行数据压缩, 不会破坏原始数据分片, 也未改 变其分布状态, 当特定数据分片对应的原始数据发生改变时, 其影响仅限于当 前数据分片对应的分片索引; 当前分片索引的后一分片索引将以其前一分片索 引作为参考, 继续建立相对索引, 从而保证了对数据变化的较佳适应性; 基于 分片索引之间的数据相关性, 利用彼此之间的相对位置关系进行压缩, 相对于 筒单地捆绑数据分片或分片索引, 压缩效果提升明显, 尤其对于较长的分片索 引, 压缩效果更佳; 压缩过程中只需要作后向遍历和比较, 比合并数据分片方 法构建超级分片或合并分片索引方法构建超级索弓 )的操作更高效; 且相对索引 以参考索引为标准建立, 建立时间可大大缩短; 且建立过程中只需要在原索引 结构基础上扩充一个字段, 存储开销小; 对于相邻连续的分片索引采用累加计 数的方法作进一步优化, 可以使 DD压缩效果大幅提升。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于一计算 机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆体(Read-Only Memory, ROM )或随机存取存储器(Random Access Memory, 筒称 RAM )等。
以上所揭露的仅为本发明较佳实施例而已, 当然不能以此来限定本发明之 权利范围, 因此依本发明权利要求所作的等同变化, 仍属本发明所涵盖的范围。

Claims

权 利 要 求
1、 一种数据压缩方法, 其特征在于, 包括:
依次计算数据分片序列中数据分片的分片索引, 形成分片索引序列, 为所 述分片索引扩充后向索引描述符, 其中, 取自同一数据对象的分片索引存在数 据相关性, 所述后向索引描述符用于标识与所述分片索引存在数据相关性的后 一个分片索引; 若不存在, 则根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列; 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引;
若存在所述参考索引, 则根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片索引的表示方式。
2、 如权利要求 1所述的方法, 其特征在于, 根据所述分片索引相对于所述 参考索引的位移量, 采用相对索引表示所述分片索引, 包括:
将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中, n为大于 1的自 然数。
3、 如权利要求 1或 2所述的方法, 其特征在于, 在采用相对索引表示所述 分片索引之前, 还包括:
判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
其中, 配置至少一个比特位用于区别所述相对索引与所述连续索引。
4、 如权利要求 1-3任一项所述的方法, 其特征在于, 所述后向索引描述符 包括指针或编号。
5、 如权利要求 1-4任一项所述的方法, 其特征在于, 根据所述后向索引描 述符将存在数据相关性的分片索引串联形成分片索引参考序列, 包括:
判断是否存在与所述分片索引存在数据相关性的分片索引参考序列; 若存在, 则将所述分片索引插入所述分片索引参考序列并更新所述分片索 引参考序列;
否则根据所述后向索引描述符将存在数据相关性的分片索引串联形成新的 分片索引参考序列。
6、 一种数据压缩装置, 其特征在于, 包括:
计算扩充单元, 用于依次计算数据分片序列中数据分片的分片索引, 形成 分片索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数据对 象的分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片索引 存在数据相关性的后一个分片索引; 序列构建单元, 用于当所述第一判断单元判定已有的分片索引库中不存在 所述分片索引时, 根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列;
第二判断单元, 用于当所述第一判断单元判定已有的分片索引库中存在所 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引; 索引表示单元, 用于若存在所述参考索引, 则根据所述分片索引相对于所 述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片 索引的表示方式。
7、如权利要求 6所述的装置, 其特征在于, 所述索引表示单元进一步用于: 将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中 n为大于 1的自 然数。
8、 如权利要求 6或 7所述的装置, 其特征在于, 在采用相对索引表示所述 分片索引之前, 所述索引表示单元还用于:
判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
9、 如权利要求 6-8任一项所述的装置, 其特征在于, 所述后向索引描述符 包括指针或编号。
10、 如权利要求 6-9任一项所述的装置, 其特征在于, 所述装置还包括: 第三判断单元, 用于当所述第一判断单元判定已有的分片索引库中不存在 所述分片索引时, 进一步判断是否存在与所述分片索引存在数据相关性的分片 索引参考序列;
若存在, 则指示所述序列构建单元将所述分片索引插入所述分片索引参考 序列并更新所述分片索引参考序列;
否则指示所述序列构建单元根据所述后向索引描述符将存在数据相关性的 分片索引串联形成新的分片索引参考序列。
11、 一种数据压缩装置, 其特征在于, 包括: 处理器及与所述处理器相配 合的存储器;
所述存储器用于存储所述处理器执行的程序及数据压缩过程中产生的各种 数据和索引;
所述处理器用于依次计算数据分片序列中数据分片的分片索引, 形成分片 索引序列, 为所述分片索引扩充后向索引描述符, 其中, 取自同一数据对象的 分片索引存在数据相关性, 所述后向索引描述符用于标识与所述分片索引存在 数据相关性的后一个分片索引; 若不存在, 则根据所述后向索引描述符将存在数据相关性的分片索引串联 形成分片索引参考序列; 索引, 其中, 所述参考索引为已建立的分片索引参考序列中所述分片索引的前 一个分片索引;
若存在所述参考索引, 则根据所述分片索引相对于所述参考索引的位移量, 采用相对索引表示所述分片索引, 否则不改变所述分片索引的表示方式。
12、 如权利要求 11所述的装置, 其特征在于, 所述处理器进一步用于: 将所述参考索引的位置作为起始点, 对所述分片索引序列进行后向遍历, 检测所述分片索引的位置;
每向后遍历 1个分片索引, 所述位移量增加 1 , 若位移量增加至 n时检测到 所述分片索引, 则将所述分片索引采用相对索引 n表示, 其中 n为大于 1的自 然数。
13、 如权利要求 11或 12所述的装置, 其特征在于, 在采用相对索引表示 所述分片索引之前, 所述处理器还用于:
判断所述分片索引序列中是否存在所述已建立的分片索引参考序列中的连 续分片索引, 其中, 所述连续分片索引中各个相邻分片索引的位移量为 1 ;
若存在, 则根据所述连续分片索引中分片索引的数目 m, 将第一个分片索 引作为后续 m-1个分片索引的参考索引, 采用连续索引 m-1表示所述后续 m-1 个分片索引, 其中, m为大于 2的自然数;
若不存在, 则采用相对索引表示所述分片索引;
配置至少一个比特位用于区别所述相对索引与所述连续索引。
14、 如权利要求 11至 13任一项所述的装置, 其特征在于, 所述处理器还 用于: 述分片索引存在数据相关性的分片索引参考序列;
若存在, 则将所述分片索引插入所述分片索引参考序列并更新所述分片索 引参考序列;
否则根据所述后向索引描述符将存在数据相关性的分片索引串联形成新的 分片索引参考序列。
PCT/CN2012/086377 2012-12-11 2012-12-11 一种数据压缩方法及装置 WO2014089760A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/086377 WO2014089760A1 (zh) 2012-12-11 2012-12-11 一种数据压缩方法及装置
CN201280002718.3A CN104145263B (zh) 2012-12-11 2012-12-11 一种数据压缩方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/086377 WO2014089760A1 (zh) 2012-12-11 2012-12-11 一种数据压缩方法及装置

Publications (1)

Publication Number Publication Date
WO2014089760A1 true WO2014089760A1 (zh) 2014-06-19

Family

ID=50933683

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/086377 WO2014089760A1 (zh) 2012-12-11 2012-12-11 一种数据压缩方法及装置

Country Status (2)

Country Link
CN (1) CN104145263B (zh)
WO (1) WO2014089760A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011159322A1 (en) * 2010-06-18 2011-12-22 Hewlett-Packard Development Company, L.P. Data deduplication
CN102467523A (zh) * 2010-11-03 2012-05-23 英业达股份有限公司 索引文件的建立方法与利用索引文件查询数据区块的方法
CN102609442A (zh) * 2010-12-28 2012-07-25 微软公司 用于数据去重复的自适应索引

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8751561B2 (en) * 2008-04-08 2014-06-10 Roderick B. Wideman Methods and systems for improved throughput performance in a distributed data de-duplication environment
JP5339432B2 (ja) * 2009-02-25 2013-11-13 日本電気株式会社 ストレージシステム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011159322A1 (en) * 2010-06-18 2011-12-22 Hewlett-Packard Development Company, L.P. Data deduplication
CN102467523A (zh) * 2010-11-03 2012-05-23 英业达股份有限公司 索引文件的建立方法与利用索引文件查询数据区块的方法
CN102609442A (zh) * 2010-12-28 2012-07-25 微软公司 用于数据去重复的自适应索引

Also Published As

Publication number Publication date
CN104145263B (zh) 2017-07-25
CN104145263A (zh) 2014-11-12

Similar Documents

Publication Publication Date Title
CN107665191B (zh) 一种基于扩展前缀树的私有协议报文格式推断方法
US9514209B2 (en) Data processing method and data processing device
Lu et al. Frequency based chunking for data de-duplication
Pal et al. Detecting file fragmentation point using sequential hypothesis testing
JP6028567B2 (ja) データ格納プログラム、データ検索プログラム、データ格納装置、データ検索装置、データ格納方法及びデータ検索方法
JP4975724B2 (ja) 低冗長記憶システム内のサブブロックの存在を検出する方法
WO2013086969A1 (zh) 重复数据查找方法、装置及系统
WO2017020576A1 (zh) 一种键值存储系统中文件压实的方法和装置
CN103098035A (zh) 存储系统
US20070143286A1 (en) File management method in file system and metadata server therefor
US10628050B2 (en) Data processing method and apparatus
WO2014067063A1 (zh) 重复数据检索方法及设备
CN107545021A (zh) 一种数据存储方法及装置
US10339124B2 (en) Data fingerprint strengthening
WO2014000458A1 (zh) 小文件处理方法及装置
WO2014059889A1 (zh) 一种更新路由查找树的方法及装置
US20150142763A1 (en) Bitmap compression for fast searches and updates
WO2017001109A1 (en) Real time index generation
CN108306780B (zh) 一种基于云环境的虚拟机通信质量自优化的系统和方法
WO2014089760A1 (zh) 一种数据压缩方法及装置
JP6378044B2 (ja) データ処理装置、データ処理方法およびプログラム
WO2023029917A1 (zh) 一种数据分片方法、装置以及电子设备
JP5340185B2 (ja) ファイル処理装置及びプログラム
CN114844770B (zh) 一种告警事件处理方法、装置、设备及介质
CN114253933A (zh) 一种数据集切分和还原的方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12889999

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12889999

Country of ref document: EP

Kind code of ref document: A1