WO2013127309A1 - 数据处理方法及数据处理设备 - Google Patents

数据处理方法及数据处理设备 Download PDF

Info

Publication number
WO2013127309A1
WO2013127309A1 PCT/CN2013/071725 CN2013071725W WO2013127309A1 WO 2013127309 A1 WO2013127309 A1 WO 2013127309A1 CN 2013071725 W CN2013071725 W CN 2013071725W WO 2013127309 A1 WO2013127309 A1 WO 2013127309A1
Authority
WO
WIPO (PCT)
Prior art keywords
segment
sub
fingerprint
block
digest
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.)
Ceased
Application number
PCT/CN2013/071725
Other languages
English (en)
French (fr)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP13754635.4A priority Critical patent/EP2717476A4/en
Publication of WO2013127309A1 publication Critical patent/WO2013127309A1/zh
Priority to US14/186,226 priority patent/US9514209B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • 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/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3091Data deduplication
    • 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/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3091Data deduplication
    • H03M7/3095Data deduplication using variable length segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Definitions

  • the present invention relates to a message processing technology, and in particular, to a data processing method and a data processing device.
  • Data compression is an algorithmic processing of message content to reduce the amount of data, but does not affect the process of information transfer. Data compression is to save network transmission bandwidth and accelerate application.
  • a duplicate database containing a variable block, a fingerprint of the variable block, and a digest of the variable block is generated according to the CDC (Content-Defined Chunking) variable block algorithm.
  • the fingerprint of the data segment matches the fingerprint of the variable block, then the data The summary of the fragment does not match the summary of the variable block.
  • the CDC algorithm considers that the duplicate database needs to be updated and uses the delimited sliding window mechanism to generate new variable blocks.
  • the new variable block granularity may be relatively large, reducing the probability that subsequent data to be compressed will match the updated duplicate database. This may result in a decrease in compression efficiency.
  • Embodiments of the present invention provide a data processing method and a data processing device, which are used to improve data compression efficiency.
  • the embodiment of the present invention provides a data processing method, including: calculating, according to a fingerprint algorithm, a first fingerprint of a first segment in the data to be compressed, a starting location of the first segment, and the data to be compressed.
  • the starting position is the same, the length of the first segment is the same as the length of the first sliding window; searching the first fingerprint in the first local repeat database, the first local repeat database is used to store duplicate data, a fingerprint of the duplicate data and a summary of the duplicate data; If the first fingerprint exists in the first local duplicate database, acquiring a first variable block in the first local duplicate database and a summary of the first variable block according to the first fingerprint, The first fingerprint is the same as the fingerprint of the first initial block in the first variable block calculated according to the fingerprint algorithm, the starting position of the first initial block and the starting of the first edgeable block.
  • the start position is the same, the length of the first initial block is the same as the length of the first sliding window, and the digest of the first variable block is calculated by calculating a digest of the first variable block according to a digest algorithm. ;
  • a digest of the second segment in the data to be compressed where a starting position of the second segment is the same as a starting position of the data to be compressed, and a length of the second segment is related to the length
  • the length of the first variable block is the same; comparing the digest of the second segment with the digest of the first variable block; if the digest of the second segment is different from the digest of the first variable block, acquiring a first sub-segment of the second segment, the first sub-segment being the same as a first sub-variable block of the first variable block, a starting position of the first sub-segment and the first
  • the starting position of the second segment is the same, the starting position of the first sub-variable block is the same as the starting position of the first variable block, and the second bit in the second segment is the same as the first
  • the first bit in the variable block is different, the second bit is a next bit of the first sub-segment in the second segment, and the first bit is the first one in
  • the embodiment of the present invention further provides a data compression device, including: a first fingerprint calculation unit, configured to calculate, according to a fingerprint algorithm, a first fingerprint of a first segment in the data to be compressed, where the first segment is The starting position is the same as the starting position of the data to be compressed, The length of the first segment is the same as the length of the first sliding window; the searching unit is configured to search the first fingerprint in the first local repeat database, where the first local repeat database is used to store duplicate data, the repetition a fingerprint of the data and a summary of the duplicate data; a duplicate content obtaining unit, configured to acquire the first local duplicate database according to the first fingerprint if the first fingerprint exists in the first local duplicate database a first variable block and a digest of the first variable block, the first fingerprint being the same as a fingerprint of a first initial block in the first variable block calculated according to the fingerprint algorithm, a starting position of the first initial block is the same as a starting position of the first edge block, a length of the first initial block is the same as a length
  • a summary calculation unit configured to calculate, according to the digest algorithm, a digest of the second segment in the data to be compressed, where a starting position of the second segment is the same as a starting position of the data to be compressed, and the second a length of the segment is the same as a length of the first variable block; a summary comparing unit, configured to compare a digest of the second segment with a digest of the first variable block; a first sub-segment obtaining unit, if The digest of the second segment is different from the digest of the first variable block, and then acquiring a first sub-segment in the second segment, where the first sub-segment and the first variable block a child variable block is identical, a starting position of the first sub-segment is the same as a starting position of the second segment, and a starting position of the first sub-variable block is opposite to a first variable block
  • the starting position is the same, the second bit in the second segment is different from the first bit in the first variable block, and the second bit is
  • the embodiment of the present invention further provides a data decompression device, including: a first fingerprint calculation unit, configured to calculate, according to a fingerprint algorithm, a first fingerprint of a first segment in the data to be compressed, the first segment The starting position of the data is the same as the starting position of the data to be compressed, the length of the first segment is the same as the length of the first sliding window, and the searching unit is configured to search for the first fingerprint in the first local repeat database.
  • a data decompression device including: a first fingerprint calculation unit, configured to calculate, according to a fingerprint algorithm, a first fingerprint of a first segment in the data to be compressed, the first segment The starting position of the data is the same as the starting position of the data to be compressed, the length of the first segment is the same as the length of the first sliding window, and the searching unit is configured to search for the first fingerprint in the first local repeat database.
  • the first local repeat database is configured to store duplicate data, a fingerprint of the duplicate data, and a summary of the duplicate data; a duplicate content obtaining unit, configured to: if the first fingerprint exists in the first local duplicate database And acquiring, according to the first fingerprint, a first variable block in the first local repeat database and a digest of the first variable block, where the first fingerprint is calculated according to the fingerprint algorithm.
  • the fingerprint of the first initial block in the first variable block is the same, the starting position of the first initial block is the same as the starting position of the first edgeable block, the first initial The same length of the first length of the sliding window, the first variable block digest is the digest obtained by calculating the first variable according to block digest algorithm;
  • a summary calculation unit configured to calculate, according to the digest algorithm, a digest of the second segment in the data to be compressed, where a starting position of the second segment is the same as a starting position of the data to be compressed, and the second a length of the segment is the same as a length of the first variable block; a summary comparing unit, configured to compare a digest of the second segment with a digest of the first variable block; a first sub-segment obtaining unit, if The digest of the second segment is different from the digest of the first variable block, and then acquiring a first sub-segment in the second segment, where the first sub-segment and the first variable block a child variable block is identical, a starting position of the first sub-segment is the same as a starting position of the second segment, and a starting position of the first sub-variable block is opposite to a first variable block
  • the starting position is the same, the second bit in the second segment and the first one in the first variable block Different bits, the second bit is
  • a first adding unit configured to add, to the first local repeat database, the first sub-segment, the fingerprint of the first sub-segment, and the digest of the first sub-segment, to generate a second local duplicate database, where
  • the fingerprint of the first sub-segment is the same as the first fingerprint, and the digest of the first sub-segment is calculated by calculating the digest of the first sub-segment according to the digest algorithm.
  • the generated granularity is smaller than the generated data.
  • the new variable block has a smaller granularity, which improves the probability that subsequent data to be compressed matches the updated duplicate database, thereby improving the efficiency of compression.
  • FIG. 1 is a flowchart of a data processing method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an application scenario of a data processing method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of another application scenario of a data processing method according to an embodiment of the present invention
  • FIG. 5 is a flowchart of another data processing method according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a package format of a compressed message in a data processing method according to an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of a data processing method applied to a data compression side device according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a data compression device according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an application scenario of a data compression device according to an embodiment of the present disclosure.
  • FIG. 10 is a networking diagram of another application scenario of a data compression device according to an embodiment of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • DRE Data Redundancy Elimination
  • WOC WAN Optimization Controller
  • DRE DRE technology is generally applied to WOC (WAN Optimization Controller) to reduce the amount of data that needs to be transmitted by WAN, which is equivalent to increasing WAN bandwidth and saving valuable WAN resources.
  • WOC is an application acceleration device.
  • the object to be processed may be based on an IP packet, or may be based on one session (ie, multiple consecutive IP packets in the same session).
  • the IP packet-based processing is simple to implement and does not require buffering of packets. The performance is high. However, because duplicate data may be included in multiple packets, it is not easy to identify and cache duplicate data.
  • Different types of packets (such as different protocols, or different formats) are difficult to obtain a higher compression ratio.
  • Session-based processing requires multiple packets of a session to be cached. There is a limit to the performance of online processing, but duplicate data can be identified to the greatest extent, and the same session generally belongs to the same type, which can be higher when performing algorithm compression. Compression ratio.
  • the DRE implementation process includes: compressing the local DRE module of the device to analyze the message, judging and determining the corresponding data block; comparing the determined data block with the stored data block in the duplicate database, if the same block is found to exist, Transmitting the data block (that is, repeating data), in which case the data block is replaced by a fingerprint in the message; the data block not found is added to the duplicate database; optionally, the de-duplicated message is further processed. Compression; the DRE module of the remote device is decompressed (optional), and then the fingerprint is replaced with the original data block, and then the message is sent to the user; the local DRE module and the remote DRE module need to synchronize the data block and the fingerprint.
  • the DRE technology performs weight-based processing based on binary data, and does not need to perceive the specific protocol type of the upper layer.
  • the key point is to identify and replace duplicate data, that is, to identify duplicate data with the same content, and to establish a duplicate database (including buffering duplicate data and establishing a fingerprint), when the subsequently transmitted data has cached content (ie, When the data is repeated, the fingerprint is used instead.
  • DRE technology is also known as Byte Cache technology.
  • the identification and replacement of duplicate data is based on data blocks.
  • the identification algorithms for data blocks include FSP (Fixed-Sized Partition), CDC, and SB (Sliding Block).
  • the CDC algorithm uses a sliding window (hereinafter referred to as a sliding window) to block the data to be compressed, and the sliding window moves backwards in bytes from the data, and uses a specific hash (HASH) algorithm (such as rabin).
  • HASH specific hash
  • HASH, ELF HASH, etc. calculate the fingerprint information of the sliding window.
  • certain conditions for example, the modulo result for a specific value is a certain set value
  • the sliding window is slid backward, and the fingerprint information of the sliding window is calculated again.
  • the calculation condition is established, Then the boundary of the next data block is found, whereby the entire data can be divided into a plurality of data blocks of variable size.
  • SHA-1 SHA-1, MD5, etc.
  • these algorithms can extract information from a large amount of data to form a fixed-length field. Due to the specificity of the algorithm, the probability of the same raw data is the same. Low, can be ignored) to calculate the content of the data block, and use the result of the calculation as a fingerprint to find the local duplicate database. If it exists, it indicates that the data block with the same content exists, the current data block is a duplicate data block, if the fingerprint If it does not exist, the fingerprint and block content of the current data block are added to the cache (repeated database) for the next check.
  • SHA-1 SHA-1, MD5, etc.
  • the block demarcation algorithm of the CDC algorithm may cause the block to be too large because the calculation condition is always unsatisfiable.
  • the upper and lower limits of the block size may be set, and the block is forced when the upper and lower limit conditions are met.
  • FIG. 1 is a flowchart of a data processing method according to an embodiment of the present invention. As shown in Figure 1, the data processing method includes:
  • a fingerprint algorithm calculates, according to a fingerprint algorithm, a first fingerprint of the first segment in the data to be compressed, where a starting position of the first segment is the same as a starting position of the data to be compressed, and a length of the first segment is different from a first sliding window. The length is the same.
  • the first sliding window is an existing sliding window for delimiting the data block.
  • the first local duplicate database is used to store duplicate data, a fingerprint of the duplicate data, and a summary of the duplicate data.
  • the first fingerprint exists in the first local duplicate database, acquiring a first variable block in the first local duplicate database and a summary of the first variable block according to the first fingerprint, the first fingerprint And the first initial block of the first variable block calculated according to the fingerprint algorithm
  • the fingerprint is the same, the starting position of the first initial block is the same as the starting position of the first edge block, the length of the first initial block is the same as the length of the first sliding window, and the summary of the first variable block is The calculation is performed on the digest of the first variable block according to the digest algorithm.
  • the second segment is a basic unit data block for performing matching compression processing in the existing CDC algorithm.
  • the digest of the second segment is different from the digest of the first variable block, acquiring a first sub-segment in the second segment, the first sub-segment and a first one of the first variable block
  • the variable block is the same, the starting position of the first sub-segment is the same as the starting position of the second sub-segment, and the starting position of the first sub-variable block is the same as the starting position of the first variable block,
  • the second bit in the second segment is different from the first bit in the first variable block, the second bit is the next bit of the first sub-segment in the second segment, the first bit is the first bit The next bit of the first sub-variable block in the variable block.
  • the first sub-segment, the fingerprint of the first sub-segment, and the digest of the first sub-segment are added to the first local duplicate database to generate a second local duplicate database, and the fingerprint of the first sub-segment and the first A fingerprint is the same, and the digest of the first sub-segment is calculated by calculating the digest of the first sub-segment according to the digest algorithm.
  • the data to be compressed includes the same data segment as the first half of the variable block in the duplicate database and is different from the second half of the variable block, the generated granularity is smaller than the generated data. Match the new variable block of the variable block and add the new variable block to the duplicate database.
  • the new variable block has a smaller granularity, which improves the probability that subsequent data to be compressed matches the updated duplicate database, thereby improving the efficiency of compression.
  • the above 11 to 17 can be performed by the compression side device or by the decompression device. If the device on the compression side receives a packet to be redundant, the packet includes a packet header and a payload, and the payload is data to be compressed, and the compression side device processes the payload according to the foregoing 11 to 17. Or if the decompressing side device receives a de-duplicated message, the de-duplicated message includes a packet header and a payload, but the payload is compressed data of the compression side device. That is, part of the data has been replaced with a fingerprint. At this time, the data to be compressed processed by the decompression side device, that is, the remaining unreplaced original data in the payload.
  • the data processing method provided by the embodiment of the present invention may further include: receiving a first packet, where the first packet includes a first packet header and a first payload, the first net The payload includes a first payload segment, the length of the first payload segment being the same as the length of the first sub-segment; calculating a fingerprint of the second initial block in the first payload segment according to the fingerprint algorithm, the second initial block a starting position is the same as a starting position of the first payload segment, and a length of the second initial block is the same as a length of the first sliding window;
  • the second payload segment in the packet generates a second packet, where the second packet includes a second packet header and a second payload, and the second packet header is the same as the first packet header.
  • the second payload includes a fingerprint of the first sub-segment.
  • the second payload further includes location information of the first sub-segment in the first packet.
  • the decompressing device may determine the location information according to the location information of the first sub-segment included in the first packet included in the second payload. The original position of a sub-segment in the first message, and then the first message is restored.
  • the location information of the first sub-segment in the first message may be the offset of the highest bit of the first sub-segment relative to the highest bit of the header of the first message.
  • the data processing method provided by the embodiment of the present invention may further include: calculating, according to the fingerprint algorithm, a fingerprint of a third initial block of the second sub-segment in the data to be compressed,
  • the starting position of the second sub-segment is the second bit, and the ending position of the second sub-segment is the same as the ending position of the data to be compressed;
  • the starting position of the third initial block is the second bit, the first The length of the three initial blocks is equal to the length of the first sliding window;
  • the second sliding window And acquiring, by the second sliding window, a first detection block in the second sub-variable block, where a starting position of the second sliding window corresponds to a third bit in the second sub-variable block, where the third bit is a bit between a start position of the second sub-variable block and an end position of the second sub-variable block, the length of the second sliding window being equal to the length of the first sliding window, the second sub-variable block
  • the starting position is the first bit
  • the ending position of the second sub-variable block is the same as the ending position of the first variable block
  • the second sliding window can be defined as a content sliding window, which is specifically used to determine whether the duplicate database exists.
  • the method of calculating the fingerprint can be the same as the existing sliding window, except that the sliding window in the prior art is only used for delimitation.
  • Calculating a fingerprint of the first detection block according to the fingerprint algorithm comparing a fingerprint of the third initial block with a fingerprint of the first detection block; if the fingerprint of the third initial block is the same as the fingerprint of the first detection block, comparing a digest of the third sub-variable block in the second sub-variable block and a digest of the third sub-segment in the second sub-segment, a starting position of the third sub-variable block and the first detecting block
  • the starting position is the same
  • the ending position of the third sub-variable block is the same as the ending position of the first variable block
  • the starting position of the third sub-segment is the same as the starting position of the second sub-segment.
  • the length of the three sub-segments and the third sub- The length of the variable block is equal, and the digest of the third sub-variable block is calculated according to the summary algorithm, and the digest of the third sub-variable is If the digests of the variable blocks are equal, the third sub-segment, the fingerprint of the third sub-segment, and the digest of the third sub-segment are added to the second local repeat database to generate a third local repeat database, the third sub-segment
  • the fingerprint of the third sub-segment is calculated by the digest of the third sub-segment according to the digest algorithm.
  • the digest of the third sub-segment is equal to the digest of the third sub-variable block, and the third sub-segment, the fingerprint of the third sub-segment, and the digest of the third sub-segment are added to the second local repeat
  • the data processing method provided by the embodiment of the present invention may further include: receiving a third packet, where the third packet includes a third packet header and a third payload, where the third payload includes a second payload And a third payload segment, the length of the second payload segment being the same as the length of the first sub-segment, the length of the third payload segment being the same as the length of the third sub-segment; calculating according to the fingerprint algorithm a fingerprint of a fourth initial block in the second payload segment, and calculating, according to the fingerprint algorithm, a fingerprint of a fifth initial block in the third payload segment, a starting position of the fourth initial block and a second payload segment The starting position is the same, the length of the
  • the fourth payload further includes location information of the first sub-segment in the third packet, and location information of the third sub-segment in the third packet.
  • the third sub-segment is similar to the first sub-segment and is a data block smaller than the second fragment granularity, so that the data compression efficiency can be further improved.
  • the location information of the first sub-segment in the third message may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the message header of the third message.
  • the data block A to be compressed is different from the digest of the corresponding data block A in the duplicate database. It can be understood that the data block A sent last time is modified to become a data block ⁇ , and is transmitted again.
  • the data block A to be compressed that is, the second segment, repeats the corresponding data block A in the database, that is, the first variable block.
  • the data block A saved in the duplicate database when the data was last transmitted corresponds to the data block A in the currently transmitted data.
  • the fingerprint is calculated, if the database is duplicated If there is the same fingerprint, it means that there is a corresponding data block in the duplicate database, and the corresponding data block here is A.
  • the digest of the data block A is calculated and compared with the digest of the data block A. Obviously, the digest of data block A, is different from the digest of data block A, because the content of data block A is different from that of data block A. Then, the same part of the data block A, the same as the data block A, and the different parts are found, and further compression processing is performed. Specifically, the data block A is compared byte by byte, and when the corresponding data block A in the database is repeated to the second split point, and the data block A to be compressed is to be compressed to the first split point, the comparison result is obtained.
  • the block length in the HASH entry and the length of the third split point to the boundary are utilized. Calculating the length of the first split point to the boundary in the data block A to be compressed, then calculating the summary of the first split point to the boundary, and calculating the summary of the third split point to the boundary of the data block A in the duplicate database, Compare the calculated two digests.
  • Data block A2 the remaining two sub-blocks A1, A3 are unchanged, so that Alternatively fingerprint A1 or A3, accurate compression of data, to improve data compression efficiency.
  • the sub-data block A1 in the data block A to be compressed is the first sub-segment
  • the sub-data block A3 in the data block A to be compressed is the third sub-segment. Repeating the sub-block A1 in the database, that is, the first sub-variable block described above, repeating the initial block of the sub-block A3 in the database, that is, starting from the first bit of the sub-block A3 in the duplicate database.
  • the data block of the sliding window length that is, the first detection block of the second sub-variable block.
  • Replacing A1 or A3 can also be done in other ways. For example, you can replace A1 or A3 with fingerprint, block length, and offset values.
  • the data processing method provided by the embodiment of the present invention may further include:
  • a fingerprint a starting position of the fourth sub-variable block is the first bit
  • an ending position of the fourth sub-variable block is the same as an ending position of the first variable block
  • a starting position of the sixth initial block For the first bit, the length of the sixth initial block is equal to the length of the first sliding window
  • Obtaining a second detection block in the fourth sub-segment where a starting position of the second detection block corresponds to a fourth bit in the fourth sub-segment, where the fourth bit is between a starting position of the third segment and the a bit between the end positions of the third segment, the length of the second detection block is equal to the length of the first sliding window, the starting position of the third segment is the second bit, and the ending position of the third segment is determined
  • the bounding algorithm determines that the third segment is a segment in the data to be compressed, the fourth sub-segment is a sub-segment in the third segment, and a starting position of the fourth sub-segment and a start of the second detecting block The position is the same, the length of the fourth sub-segment is the same as the length of the fourth sub-variable block;
  • the database generates a fourth local repeat database, and the fingerprint of the fourth sub-segment is the same as the fingerprint of the sixth initial block.
  • the digest of the fourth sub-segment is the same as the digest of the fourth sub-variable block, and the fourth sub-segment, the fingerprint of the fourth sub-segment, and the digest of the fourth sub-segment are added to the first
  • the data processing method provided by the embodiment of the present invention may further include: receiving a fifth packet, where the fifth packet includes a fifth packet header and a fifth payload, and the fifth payload a fourth payload slice and a fifth payload segment, the length of the fourth payload slice being the same as the first sub-segment, the length of the fifth payload segment being the same as the length of the fourth sub-segment;
  • the fingerprint algorithm calculates a fingerprint of the seventh initial block in the fourth payload segment, and calculates a fingerprint of the eighth initial block in the fifth payload segment according to the fingerprint algorithm, where the starting position of the seventh initial block and the fourth The starting position of the payload segment is the same, the length of the seventh initial block
  • the length of the eight initial block is the same as the length of the first sliding window; the digest of the fourth payload segment is calculated according to the digest algorithm, and the digest of the fifth payload segment is calculated according to the digest algorithm; if the seventh initial block is Deleting the fingerprint of the first sub-segment in the fourth local duplicate database, and the digest of the fourth payload segment is equal to the digest of the first sub-segment, deleting the fourth in the fifth packet Payload fragment, such as The fingerprint of the eighth initial block is equal to the fingerprint of the fourth sub-segment in the fourth local repeat database, and the digest of the fifth payload segment is equal to the digest of the fourth sub-segment, and the fifth report is deleted.
  • the fifth payload segment in the text generates a sixth text, where the sixth text includes a sixth header and a sixth payload, and the sixth header is the same as the fifth header, the sixth net
  • the fingerprint includes the fingerprint of the first sub-segment and the fingerprint of the fourth sub-segment.
  • the sixth payload further includes location information of the first sub-segment in the fifth packet, and location information of the fourth sub-segment in the fifth packet.
  • the fourth sub-segment is similar to the first sub-segment, and is a data block smaller than the second fragment granularity, which can further improve data compression efficiency.
  • the location information of the first sub-segment in the fifth message may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the packet header of the fifth message.
  • the data processing method provided by the embodiment of the present invention may further include: determining, by using a delimiting algorithm, the ending position of the third segment, including: Sliding from the second bit to the third sliding window in the delimiting algorithm, and determining whether the data corresponding to the third sliding window meets the delimiting condition in the delimiting algorithm, when the third sliding window appears for the first time When the corresponding data meets the delimitation condition, the third sliding window is continuously slid backward in the first distance, and it is determined whether the data corresponding to the third sliding window meets the delimiting condition, and if the third sliding window corresponds to When the first data meets the delimitation condition, determining that the end position of the first data is the end position of the third segment, and the length of the third sliding window is the same as the length of the first sliding window, the first The length of one distance
  • the upper data block A to which the data block to be compressed belongs is different from the summary content of the corresponding data block A in the repeated data block, and it can be understood that the data block A sent last time is modified to become a data block. , and send again, so that the data block A saved in the duplicate database when the data was last transmitted corresponds to the data block A in the currently transmitted data, specifically, when the sliding window slides to the data block A, Calculate the fingerprint. If there is the same fingerprint in the duplicate database, it means that there is a corresponding data block in the duplicate database, where the corresponding data block is A.
  • the upper data block A to which the data block to be compressed belongs may be determined by sliding window delimitation. Compute a summary of data block A, and compare it with the summary of data block A. Obviously, the digest of data block A, is different from the digest of data block A, because the content of data block A is different from that of data block A. Then, the same part of the data block A, the same as the data block A, and the different parts are found, and further compression processing is performed. Specifically, the data block A is compared byte by byte, and when the corresponding data block A in the database is repeated to the second split point, and the data block A to be compressed is to be compressed to the first split point, the comparison result is obtained. Is inconsistent.
  • sliding the sliding window to the second split point to calculate the fingerprint in the upper data block A, sliding the sliding window to the first split point to calculate the fingerprint, and comparing with the fingerprint at the second split point, If they are inconsistent, continue to slide the sliding window backwards, calculate the fingerprint after the first split point, and continue to compare with the fingerprint at the second split point. If they are inconsistent, continue to slide the sliding window backward until the calculated fingerprint and The fingerprint at the second split point is the same, or until the sliding window slides to the end of block A, Boundary.
  • the fingerprint at the fourth split point of the data block A coincides with the fingerprint at the second split point of the data block A in the duplicate database.
  • the fingerprint at the fourth split point of the data block A coincides with the fingerprint at the second split point of the data block A
  • the summary of the fourth split point to the boundary is calculated, and the data block A in the duplicate database is calculated.
  • the second split point to the summary of the boundary compare the calculated two summaries, when inconsistent, compare the byte after the fourth split point with the byte after the first split point according to the foregoing operation, until the calculation
  • the fingerprint is consistent with the fingerprint at the second split point, or until the sliding window slides to the end boundary of the data block A; when it is consistent, the upper data block A is split by the first split point and the fourth split point. It is divided into three sub-blocks A1, A3, and A2.
  • the data block A in the duplicate database is split into two sub-blocks A1 and A2 by the second split point.
  • the sub-block A2 in the data block A to be compressed is the fourth sub-segment.
  • the initial block of the sub-block A2 in the data block A to be compressed that is, the data block having the length of the first sliding window from the first bit of the sub-block A2 in the data block A to be compressed, that is, the above The first detection block of the four sub-segments. Replacing A1 or A2 can be done by other methods.
  • the data processing method provided by the embodiment of the present invention may further include: synchronizing the fingerprint of the first sub-segment and the digest of the first sub-segment to the compression side Duplicate database. After the duplicate database on the compression side is synchronized, the compression side device can perform the weight reduction processing on the packet by using the existing CDC algorithm, that is, compress the data in the packet, so that when the packet includes the first sub-segment, It will be deleted, which will further improve the efficiency of data compression.
  • the existing CDC algorithm that is, compress the data in the packet, so that when the packet includes the first sub-segment, It will be deleted, which will further improve the efficiency of data compression.
  • the data processing method provided by the embodiment of the present invention may further include: the first sub-segment, the fingerprint of the first sub-segment, and the first sub-segment
  • the summary is synchronized to the duplicate database on the decompression side. In this way, after the first sub-segment in the subsequent message is deleted, the decompressing side device can recover the compressed data by using the first sub-segment stored in the duplicate database to implement decompression.
  • the data processing method provided by the embodiment of the present invention may further include: deleting the data to be compressed
  • the first sub-segment of the first sub-segment, the length of the first sub-segment, and the location information of the first sub-segment in the data to be compressed are added to the payload of the seventh packet,
  • the data to be compressed is the payload of the seventh message.
  • the location information of the first sub-segment in the data to be compressed may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the data to be compressed.
  • the compression side device can not only match the first sub-segment, but also create a first sub-segment in the local duplicate database, and can also compress the data to be compressed, and delete the first A sub-segment.
  • the length of the first sub-segment is added to the de-redundant packet because the second fragment is already in the duplicate database on the decompression side.
  • the decompression device When the de-redundant packet is sent to the decompression device, the decompression device is Finding a corresponding second segment according to the fingerprint of the first sub-segment, using the length of the first sub-segment and the position of the first sub-segment in the data to be compressed, that is, the original position of the first sub-segment in the pre-compression message Finding the first sub-segment in the second segment, and recovering the de-duplicated message to implement decompression.
  • the ending position of the third segment is determined by the delimiting algorithm, and may include: sliding the third sliding window in the delimiting algorithm from the second bit, and determining whether the data corresponding to the third sliding window meets the requirement The delimitation condition in the bounding algorithm, when the data corresponding to the third sliding window first appears to meet the delimiting condition, the third sliding window is continuously slid backward in the first distance, And determining whether the data corresponding to the third sliding window meets the delimitation condition, and if the first data corresponding to the third sliding window meets the delimitation condition, determining that the end position of the first data is the first The end position of the three segments, the length of the third sliding window is the same as the length of the first sliding window, and the length of the first distance is the same as the length of the first sliding window.
  • the third sliding window is slid backward from the second bit to determine whether the fingerprint of the data corresponding to the third sliding window satisfies the delimiting condition in the delimiting algorithm.
  • the third sliding window is continued to slide backward.
  • the first occurrence means that the data corresponding to the third sliding window for the first time meets the delimitation condition.
  • the length of the third sliding window is equal to the length of the first sliding window.
  • the length of the third sliding window can be 64 bytes.
  • the distance of each sliding can be 1 byte.
  • FIG. 4 is a schematic diagram of a specific implementation manner of a data compression method according to an embodiment of the present invention. As shown in FIG. 4, according to the demarcation principle of the CDC algorithm, three pieces of message data are divided, wherein the middle block indicates that three sub-blocks are divided according to the optimization algorithm.
  • the data block is split into a first sub-block 3356B and a second sub-block, and the second sub-block is composed of sub-blocks 4505B, 4520B and 2988B.
  • the first sub-block 3356B and the second sub-block are respectively saved in the duplicate database.
  • the first sub-block 3356B becomes the data block 3356B
  • the sub-block 4520B is deleted in the second sub-block
  • the sub-blocks 4505B and 2988B are assumed as one data block as the data block C.
  • FIG. 5 is a flowchart of another data processing method according to an embodiment of the present invention.
  • the data processing method includes:
  • the sliding window is the content sliding window, and the sliding window of the content can be combined with the delimited sliding window (that is, the sliding window in the prior art), that is, HASH is performed on the same length of data.
  • the fingerprint is calculated, except that the content sliding window applies the fingerprint to determine whether the content of the data block changes, and the delimited sliding window applies the fingerprint to the data block delimitation.
  • HASH entry Determine whether there is a HASH entry. Specifically, the fingerprint calculated by the content sliding window is used as a search key (KEY) to search for a duplicate database, and it is determined whether there is a HASH entry in the duplicate database.
  • the HASH entry includes the fingerprint calculated by the above 51. If there is no HASH entry, it indicates that the data block corresponding to the fingerprint is the newly added content. Execute 531 and add the newly added content to the duplicate database.
  • the block information can also contain the original data content of the data block.
  • the sliding window (called the bounding sliding window) performs block delimiting, and the delimiting method is the same, that is, the fingerprint is calculated, and whether the delimiting condition is satisfied according to the fingerprint is determined, and if it is satisfied, the boundary of the data is determined.
  • the delimiting process of the CDC algorithm is optimized a bit, because it is possible that the content of the data block has changed, the content causes the delimiting condition to be established in advance, and the changed content is calculated into the next data block, and the result may result in A block cannot be judged as duplicate data (actually this part is indeed duplicate data), because the boundary that satisfies the condition for the first time is a pseudo-boundary, and then slides back a part of the distance (which can be called data disturbance), if again If it is found that the delimitation condition is satisfied, then the latter is considered to be the real boundary (which can be called the definite boundary, the previous one is called the pseudo-boundary), otherwise the previous one is the real boundary (the definite boundary).
  • the length of the data block has a range limit, and an upper limit can be set in advance, for example, the maximum length cannot exceed 64Kbytes (bytes).
  • an upper limit can be set in advance, for example, the maximum length cannot exceed 64Kbytes (bytes).
  • the data block is delimited, and then 534 is performed; if the length of the data block determined by 531 does not exceed the upper limit, 532 is performed.
  • minimum boundary check Referring to 532 above, generally only one upper limit is preset to define the longest length that the data block can have, and a lower limit is also preset to define the shortest length that the data block can have, such as the shortest cannot be shorter than 64 bytes.
  • the case of less than the lower limit is not compressed as fragmented data. This is to prevent the data block of the database from being too fragmented and occupying system resources, so that the compression process has no meaning. If a byte is a block, this is meaningless, and it wastes system resources. .
  • a summary of the current data block is calculated and compared with the summary in the duplicate database. Determine if they are consistent; if yes, execute 58; otherwise, execute 542.
  • the data block to which the byte corresponding to the sliding window of the above step 51 belongs is directly determined by using the block length of the HASH entry in the duplicate database, and then the digest of the data block is calculated.
  • the current block of the current data that is, the data block to which the byte corresponding to the fingerprint belongs is located according to the block length value stored in the HASH entry, and the checksum of the current block is calculated by an algorithm such as SHA-1/MD5. The calculated checksum is compared with the checksum saved in the table item.
  • the current block is considered to be duplicate data, and the bounding sliding window and the content sliding window are directly slid over the data block found this time, and the next block is determined. Boundary and content comparison.
  • the data block 3356B in FIG. 4 what is found this time is actually a repeating block, after which the content sliding window is first slid to the next data block C, and it is checked whether the corresponding fingerprint exists in the duplicate database. That is, the content sliding window fingerprint is used as the search key to search for HASH entries in the duplicate database.
  • the checksum of the data block C is calculated by using the block length in the entry, and is compared with the checksum in the entry. When the checksum currently calculated is inconsistent with the checksum saved in the entry, the data block is indicated. C is different from the content of the corresponding data block in the duplicate database, and 542 splits the data block C and repeats the corresponding data block in the database.
  • the matching is performed byte by byte from the initial part of the current block until the byte that is different from the duplicate database is found, the current block is split from the different bytes, and the sliding window is used to check If the split point is backward, is there a fingerprint that is the same as the subsequent fingerprint of the current block. If it exists, check the part that exactly matches the two, and save it as a new block to the duplicate database. This process is mainly to identify the case where a small portion of the original data is deleted.
  • 55 Perform a minimum bound check on the sub-block. If the length of the sub-block is greater than the lower limit, perform 543 on the sub-block; if the length of the sub-block is less than the lower limit, perform 57 on the sub-block. 55 can be executed in the process of executing 542, that is, each time a piece of data is split, 542 is executed 55, and a minimum bound check is performed. After the splitting is completed, a minimum bound check is performed on all the split subblocks. Then 543 is performed on all of the split data blocks whose length is greater than the lower limit.
  • 55 can also be executed between 542 and 543, that is, 542 completes the splitting of the data block first, then executes 55, executes 55 for all the sub-blocks that are split, and executes 57 or 543 for the judgment result of 55.
  • Non-repetitive content processing Specifically, the non-block content, that is, the fragmentary data whose length is less than the lower limit, is separately processed, and the part of the data is retained in the packet, and is not compressed, and the processing of the bytes in the current sliding window is completed, and the sliding window is further slid backward.
  • the delimited sliding window and the content sliding window can be the same sliding window, and only the data block delimitation is performed according to the calculated result (fingerprint), and the block content in the database is searched and compared.
  • the compression method flow is divided into The demarcation sliding window process and the content sliding window process, the final processing results exist in three cases: one is to split the original data block, and update the duplicate database; Is not able to match the block content and does not meet the conditions of adding duplicate database (such as the length is too short), this part of the data is placed directly into the message as non-repeating content; another result is to find duplicate data, which will indicate the repetition
  • the fingerprint and related information of the data are put into the message in a certain format and sent to the other device.
  • the encapsulated format of the compressed message is as shown in FIG. 6.
  • the location of the non-duplicate data in the mode 1 is unchanged, except that the data blocks before and after the non-duplicate data are replaced as duplicate data, and the mode 2 is replaced.
  • the position of the format in the compressed message is specified.
  • the replacement format includes the fingerprint, the block length, and the offset of the replaced data block in the message.
  • the data block 6788B When it is specifically applied to the data block 6788B, when the sliding window is first slid to the initial part of the data block 6788B, the above 51 operation is performed, the fingerprint of the initial part is calculated, and then 52 is executed to determine whether the duplicate database has a HASH entry containing the fingerprint.
  • the data block 6788B is a duplicate data block. Therefore, the execution 541 is performed to calculate the digest of the data block 6788B, and compared with the digest stored in the HASH entry in the duplicate database, and the judgment is consistent.
  • the judgment result is consistent, that is, The content portion is repeated, and execution 58, the content of the data block 6788B in the data is deleted, replaced with a fingerprint, and the processing of the data block 6788B is completed. Then, the sliding window slides to the initial portion of the data block 3356B, and executes 51 to calculate the fingerprint of the initial portion. Execute 52, find the corresponding HASH entry from the duplicate database, and obtain block information such as the block length of the data block 3356B.
  • Execute 541 and calculate a digest of the data block 3356B, which is consistent with the digest in the HASH entry of the duplicate data block, indicating that the content of the data block 3356B is completely overlapped with the data block content of the corresponding HASH entry in the duplicate database, and executing 58 deletes the data.
  • the contents of the data block 3356B are replaced with fingerprints, and the processing of the data block 3356B is completed.
  • the sliding window slides to the initial portion of the data block C, and executes 51 to calculate the fingerprint of the initial portion.
  • Execute 52 search for the duplicate database, and determine whether there is a HASH entry containing the fingerprint. In this example, the HASH entry of the data block C exists in the duplicate database.
  • executing 541 defining a data block C according to the block length in the found HASH entry, and calculating a summary of the data block C, And determine whether it is consistent with the summary in the HASH entry.
  • the digest of the data block C is inconsistent with the digest in the HASH entry, and then 542 is performed.
  • the content of the data block corresponding to the HASH entry is compared byte by byte from the initial part of the data block C until the different bytes are found, and the data block corresponding to the HASH entry in the data block C and the duplicate database is from here. That is, the splitting is performed at the same byte.
  • the data block C is split into the sub-block 4505B and the sub-block 2988B, where the sub-block 4505B is duplicated with the data in the duplicate database, but due to the data sent this time.
  • the sub-block 4520B between the sub-block 4505B and the sub-block 2988B is deleted in the block C, causing the content of the data block C to not match the content in the duplicate database.
  • 543 is executed, and the splitted portions 4505B and 2988B are saved as a new data block to the duplicate database, and a new HASH entry is generated to replace the previously found HASH entry.
  • the 4520B in the repeat database satisfies the data block length requirement, it is saved as a new data block, otherwise, it is deleted. Then, 544 is performed, and the block length and the digest of the sub-block 4505B and the sub-block 2988B are calculated and added to the new HASH entry, so as to be used for deleting the data content of the 4505B and 2988B as the data block for the next time, and replacing the data content.
  • Improve data compression efficiency For the data to be compressed, continue sliding the sliding window backward to the initial portion of the data block 4800B, and execute 51 to calculate the fingerprint of the initial portion.
  • Execution 52 find the corresponding HASH entry from the duplicate database, and obtain block information such as the block length of the data block 4800B.
  • Execute 541 and calculate a digest of the data block 4800B, which is consistent with the digest in the HASH entry of the duplicate data block, indicating that the content of the data block 4800B and the data block content of the corresponding HASH entry in the duplicate database are all duplicated, and executing 58 deletes the data.
  • the content of the intermediate data block 4800B is replaced with a fingerprint, and the processing of the data block 4800B is completed.
  • the compression side device such as the WOC, sends the message to the decompression side device.
  • the compression device parses the received packet to obtain the payload of the packet.
  • a data processing method performs compression processing on data in a payload.
  • the compressed data is encapsulated into a new message.
  • the decompression side device decompresses the payload in the new packet by using the duplicate database. Specifically, the replacement format or the fingerprint in the packet is deleted, and the replacement format or the fingerprint is replaced with a data block corresponding to the replacement format or the fingerprint, and the decompressed data is encapsulated into a packet.
  • the generation of the duplicate database can be done only on one end of the device, and then the data (deduplication fingerprint and/or data content) is synchronized to the peer.
  • the data traffic is mainly downlink, that is, the server side flows to the user side (for example, the user downloads the file)
  • the algorithm can be implemented on the WOC device close to the user side, and the content of the duplicate data block is saved, and the WOC device near the server side only needs to synchronize the fingerprint.
  • the information is OK, there is no need to cache all the content, otherwise the WOC device on the server side processes the algorithm and saves the content.
  • both sides can calculate and save content, but only increase resource requirements.
  • the data processing device includes: a first fingerprint calculation unit 81, a search unit 82, and a duplicate content acquisition unit. 83.
  • the first fingerprint calculation unit 81 is configured to calculate a first fingerprint of the first segment in the data to be compressed according to a fingerprint algorithm, where a starting position of the first segment is the same as a starting position of the data to be compressed, and a length of the first segment The same as the length of the first sliding window; the searching unit 82 is configured to search the first local duplicate database for storing the duplicate data, the fingerprint of the duplicate data, and the summary of the repeated data.
  • the duplicate content obtaining unit 83 is configured to acquire the first variable block in the first local repeat database and the first variable block according to the first fingerprint if the first fingerprint exists in the first local repeat database Abstract, the first fingerprint and the first variable calculated according to the fingerprint algorithm
  • the fingerprint of the first initial block in the block is the same, the starting position of the first initial block is the same as the starting position of the first edge block, and the length of the first initial block is the same as the length of the first sliding window.
  • the digest of the first variable block is obtained by calculating the digest of the first variable block according to the digest algorithm; the digest computing unit 84 is configured to calculate, according to the digest algorithm, a digest of the second segment in the data to be compressed, The starting position of the second segment is the same as the starting position of the data to be compressed, and the length of the second segment is the same as the length of the first variable block; the digesting unit 85 is configured to compare the digest of the second segment with the a first sub-segment acquisition unit 86, configured to acquire a first sub-segment in the second fragment if the digest of the second fragment is different from the digest of the first variable block, the a sub-segment is the same as the first sub-variable block in the first variable block, the starting position of the first sub-segment is the same as the starting position of the second segment, and the start of the first sub-variable block Position is opposite to the starting position of the first variable block Similarly, the second bit in the second segment is different from the first bit in the first
  • the data compression device may further include: a first packet receiving unit, configured to receive a first packet, where the first packet includes a first packet header and a first payload, and the first payload a first payload segment, the length of the first payload segment being the same as the length of the first sub-segment; a second initial fingerprint calculation unit, configured to calculate a second initial block in the first payload segment according to the fingerprint algorithm Fingerprint, the starting position of the second initial block and the starting bit of the first payload segment Set the same, the length of the second initial block is the same as the length of the first sliding window;
  • a first payload summary calculation unit configured to calculate a summary of the first payload segment according to the digest algorithm
  • a second message generating unit configured to: if the fingerprint of the second initial block is equal to the fingerprint of the first sub-segment in the second local repeat database, and the digest of the first payload segment and the first sub-segment If the sum of the digests is equal, the first payload segment in the first packet is deleted, and the second packet is generated, where the second packet includes a second packet header and a second payload, and the second packet header Same as the first packet header, the second payload includes a fingerprint of the first sub-segment.
  • the second payload may further include location information of the first sub-segment in the first packet.
  • the location information of the first sub-segment in the first message may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the header of the first message.
  • the data compression device provided by the embodiment of the present invention may further include:
  • a third initial fingerprint calculation unit configured to calculate, according to the fingerprint algorithm, a fingerprint of a third initial block of the second sub-segment in the data to be compressed, where a starting position of the second sub-segment is the second bit, the second The end position of the sub-segment is the same as the end position of the data to be compressed; the starting position of the third initial block is the second bit, and the length of the third initial block is equal to the length of the first sliding window; And acquiring, by the second sliding window, a first detection block in the second sub-variable block, where a starting position of the second sliding window corresponds to a third bit in the second sub-variable block, the third bit a bit between the start position of the second sub-variable block and the end position of the second sub-variable block, the length of the second sliding window being equal to the length of the first sliding window, the second sub- The starting position of the variable block is the first bit, and the ending position of the second sub-variable block is the same as the ending position
  • the detection block fingerprint calculation unit calculates a fingerprint of the first detection block according to the fingerprint algorithm; and the fingerprint comparison unit is configured to compare the fingerprint of the third initial block with the fingerprint of the first detection block; a third summary comparing unit, configured to compare a digest of the third sub-variable block in the second sub-variable block with the second sub-if if the fingerprint of the third initial block is the same as the fingerprint of the first detection block a summary of the third sub-segment in the segment, the start position of the third sub-variable block is the same as the start position of the first detection block, the end position of the third sub-variable block and the first variable block The end position is the same, the start position of the third sub-segment is the same as the start position of the second sub-segment, and the length of the third sub-segment is equal to the length of the third sub-variable block, and the third sub- The digest of the variable block is obtained by calculating the digest of the third sub-variable block according to the digest algorithm;
  • a third adding unit configured to: if the digest of the third sub-segment is equal to the digest of the third sub-variable block, the third sub-segment, the fingerprint of the third sub-segment, and the digest of the third sub-segment Adding to the second local repeat database, generating a third local repeat database, the fingerprint of the third sub-segment is equal to the fingerprint of the third initial block, and the digest of the third sub-segment is the third sub-segment according to the digest algorithm The summary is calculated.
  • the data compression device may further include: a third packet receiving unit, configured to receive a third packet, where the third packet includes a third packet header and a third payload, and the third payload a second payload segment and a third payload segment, the length of the second payload segment being the same as the length of the first sub-segment, the length of the third payload segment being the same as the length of the third sub-segment; a fourth initial fingerprint calculation unit, configured to calculate a fingerprint of a fourth initial block in the second payload segment according to the fingerprint algorithm, and calculate a fingerprint of a fifth initial block in the third payload segment according to the fingerprint algorithm, the fourth initial The starting position of the block is the same as the starting position of the second payload segment, the length of the fourth initial block is the same as the length of the first sliding window, the starting position of the fifth initial block and the third payload The starting position of the segment is the same, and the length of the fifth initial block is the same as the length of the first sliding window;
  • a third payload summary calculation unit configured to calculate a digest of the second payload segment according to the digest algorithm, and calculate a digest of the third payload segment according to the digest algorithm
  • a fourth text generating unit configured to: if the fingerprint of the fourth initial block is equal to the fingerprint of the first sub-segment in the third local repeat database, and the digest of the second payload segment and the first sub-segment If the digest is equal, the second payload segment in the third packet is deleted, if the fingerprint of the fifth initial block is equal to the fingerprint of the third sub-segment in the third local duplicate database, and the third net is If the digest of the fragment is equal to the digest of the third sub-segment, the third payload fragment in the third packet is deleted, and a fourth packet is generated, where the fourth packet includes the fourth packet header and the first packet.
  • a fourth payload, the fourth header is the same as the third header, and the fourth payload includes a fingerprint of the first sub-segment and a fingerprint of the third
  • the fourth payload further includes location information of the first sub-segment in the third packet, and location information of the third sub-segment in the third packet.
  • the position information of the first sub-segment in the third message may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the message header of the third message.
  • the data compression device may further include: an initial block fingerprint calculation unit, configured to calculate, according to the fingerprint algorithm, a fingerprint of a sixth initial block of the fourth sub-variable block in the first variable block, where the The starting position of the four sub-variable block is the first bit, the ending position of the fourth sub-variable block is the same as the ending position of the first variable block, and the starting position of the sixth initial block is the first bit Bit, the length of the sixth initial block is equal to the length of the first sliding window;
  • an initial block fingerprint calculation unit configured to calculate, according to the fingerprint algorithm, a fingerprint of a sixth initial block of the fourth sub-variable block in the first variable block, where the The starting position of the four sub-variable block is the first bit, the ending position of the fourth sub-variable block is the same as the ending position of the first variable block, and the starting position of the sixth initial block is the first bit Bit, the length of the sixth initial block is equal to the length of the first sliding window;
  • a detection block acquiring unit configured to acquire a second detection block in the fourth sub-segment, where a start position of the second detection block corresponds to a fourth bit in the fourth sub-segment, and the fourth bit is in a third a bit between the start position of the segment and the end position of the third segment, the length of the second detection block is equal to the length of the first sliding window, and the starting position of the third segment is the second bit, the first The end position of the three segments is determined by a delimiting algorithm, the third segment is a segment in the data to be compressed, the fourth sub-segment is a sub-segment in the third segment, and the starting position of the fourth sub-segment The starting position of the second detecting block is the same, the length of the fourth sub-segment and the length of the fourth sub-variable block the same;
  • a detection block fingerprint calculation unit configured to calculate a fingerprint of the second detection block according to the fingerprint algorithm
  • a fingerprint comparison unit configured to compare a fingerprint of the sixth initial block with a fingerprint of the second detection block
  • a fourth summary comparison unit And if the fingerprint of the sixth initial block is the same as the fingerprint of the second detection block, comparing the digest of the fourth sub-variable block with the digest of the fourth sub-segment, the digest of the fourth sub-variable block is Calculating the digest of the fourth sub-variable block according to the digest algorithm, where the digest of the fourth sub-segment is calculated according to the digest algorithm to calculate the digest of the fourth sub-segment;
  • a fourth adding unit configured to: if the digest of the fourth sub-segment is the same as the digest of the fourth sub-variable block, the fourth sub-segment, the fingerprint of the fourth sub-segment, and the digest of the fourth sub-segment Adding to the second local repeat database, generating a fourth local repeat database, the fingerprint of the fourth sub-segment is the same as the fingerprint of the sixth initial block.
  • the data compression device provided by the embodiment of the present invention may further include:
  • a fifth packet receiving unit configured to receive a fifth packet, where the fifth packet includes a fifth packet header and a fifth payload, where the fifth payload includes a fourth payload fragment and a fifth payload fragment
  • the length of the fourth payload slice is the same as the length of the first sub-segment
  • the length of the fifth payload segment is the same as the length of the fourth sub-segment
  • a seventh initial fingerprint calculation unit configured to calculate a fingerprint of a seventh initial block in the fourth payload segment according to the fingerprint algorithm, and calculate a fingerprint of an eighth initial block in the fifth payload segment according to the fingerprint algorithm, where the seventh The starting position of the initial block is the same as the starting position of the fourth payload segment, the length of the seventh initial block is the same as the length of the first sliding window, and the starting position of the eighth initial block and the fifth net The starting position of the charged segment is the same, and the length of the eighth initial block is the same as the length of the first sliding window;
  • a fifth payload summary calculation unit configured to calculate the fourth payload segment according to the digest algorithm Abstract, calculating a summary of the fifth payload segment according to the digest algorithm
  • a sixth message generating unit configured to: if the fingerprint of the seventh initial block is equal to the fingerprint of the first sub-segment in the fourth local repeat database, and the digest of the fourth payload segment and the first sub-segment If the digests are equal, the fourth payload segment in the fifth packet is deleted, if the fingerprint of the eighth initial block is equal to the fingerprint of the fourth sub-segment in the fourth local duplicate database, and the fifth If the summary of the payload fragment is equal to the digest of the fourth sub-segment, the fifth payload fragment in the fifth packet is deleted, and a sixth packet is generated, where the sixth packet includes a sixth packet header and a sixth payload, the sixth header is the same as the fifth header, and the sixth payload includes a fingerprint of the first sub-segment and a fingerprint of the fourth sub-segment.
  • the sixth payload may further include location information of the first sub-segment in the fifth message, and location information of the fourth sub-segment in the fifth message.
  • the position information of the first sub-segment in the fifth message may be the offset of the highest bit of the first sub-segment with respect to the highest bit of the message header of the fifth message.
  • the third sliding window is further slid backward in the first distance, and it is determined whether the data corresponding to the third sliding window meets the delimiting condition, if the first occurrence occurs When the first data corresponding to the three sliding windows meets the delimiting condition, determining that the ending position of the first data is the ending position of the third segment, the length of the third sliding window and the length of the first sliding window Similarly, the length of the first distance is the same as the length of the first sliding window.
  • the data compression device configured to synchronize the first sub-segment, the fingerprint of the first sub-segment, and the digest of the first sub-segment to a duplicate database on the decompression side.
  • the data compression device may further include: a compression processing unit, configured to delete the first sub-segment in the data to be compressed, the fingerprint of the first sub-segment, the length of the first sub-segment, and the location information of the first sub-segment in the data to be compressed
  • the data to be compressed is added to the payload of the seventh packet, and the data to be compressed is the payload of the seventh packet.
  • the location information of the first sub-segment in the data to be compressed may be the offset of the highest bit of the first sub-segment relative to the highest bit of the data to be compressed.
  • the data compression device provided by the embodiment of the present invention may be woc. Those skilled in the art should understand that in addition to the above functional units, the WOC should have basic functional units such as message receiving and network connection, and details are not described herein again.
  • the data decompression device provided by the embodiment of the present invention includes:
  • a first fingerprint calculation unit configured to calculate, according to a fingerprint algorithm, a first fingerprint of the first segment in the data to be compressed, where a starting position of the first segment is the same as a starting position of the data to be compressed, and a length of the first segment Same as the length of the first sliding window;
  • a searching unit configured to search the first local duplicate database for storing the first fingerprint
  • the first local duplicate database is configured to store duplicate data, a fingerprint of the duplicate data, and a summary of the duplicate data
  • a duplicate content obtaining unit if The first fingerprint is stored in the first local duplicate database, and the first variable block in the first local duplicate database and the summary of the first variable block are obtained according to the first fingerprint, and the first fingerprint is according to the first fingerprint
  • the fingerprint of the first initial block in the first variable block calculated by the fingerprint algorithm is the same, the starting position of the first initial block is the same as the starting position of the first edgeable block, and the length of the first initial block is The length of the first sliding block is the same as the length of the first sliding window, and the digest of the first variable block is calculated according to a digest algorithm;
  • a summary calculation unit configured to calculate, according to the digest algorithm, a digest of the second segment in the data to be compressed, where a starting position of the second segment is the same as a starting position of the data to be compressed, and a length of the second segment is The first variable block has the same length;
  • a summary comparing unit configured to compare the digest of the second segment with the digest of the first variable block;
  • a first sub-segment acquiring unit configured to acquire a first sub-segment in the second segment, where the digest of the second segment is different from the digest of the first variable block, the first sub-segment and the first
  • the first sub-variable block in the variable block is the same, the starting position of the first sub-segment is the same as the starting position of the second segment, the starting position of the first sub-variable block and the first variable block
  • the starting position is the same, the second bit in the second segment is different from the first bit in the first variable block, and the second bit is the next bit of the first sub-segment in the second segment,
  • the first bit is the next bit of the first sub-variable block in the first variable block, and the first adding unit is configured to use the first sub-segment, the fingerprint of the first sub-segment, and the first sub-segment
  • FIG. 9 is a structural diagram of a networking of an application scenario of a data compression method according to an embodiment of the present invention.
  • the devices used to compress and decompress data at both ends of the WAN are WOCs. That is, the WOC can simultaneously have the function of compressing data and decompressing data.
  • FIG. 9 is a structural diagram of a networking of an application scenario of a data compression method according to an embodiment of the present invention.
  • the devices used to compress and decompress data at both ends of the WAN are WOCs. That is, the WOC can simultaneously have the function of compressing data and decompressing data.
  • FIG. 10 is a structural diagram of networking of another application scenario of a data compression method according to an embodiment of the present invention.
  • the interaction between the two ends of the WOC device includes two levels of control and data.
  • the peer device is automatically discovered.
  • the downstream device sends a response to the upstream device.
  • the upstream device can sense the existence and address information (such as the IP address) of the downstream device.
  • the devices at both ends need to notify each other of the calculations.
  • the method information is agreed upon (for example, the content checksum is calculated by MD5), and the database information needs to be synchronously repeated, including the information items corresponding to the fingerprint and the fingerprint (such as block length, checksum value, etc.).
  • the synchronization process is divided into timing synchronization and incremental synchronization. When the timing synchronization is specified, all the duplicate database contents are checked for consistency, and the incremental synchronization only informs the opposite end of the specific block information added or updated/deleted.
  • Data level refers to algorithm processing and data replacement for service data passing through devices at both ends, thereby reducing the length and number of packets and achieving data compression.
  • the generated granularity is smaller than the generated data.
  • the new variable block size is smaller than the direct search method for the located block. Therefore, the technical solution provided by the embodiment of the present invention improves the probability that the subsequent data to be compressed matches the updated duplicate database, thereby improving the efficiency of compression.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only
  • the division of the unit may be divided into only one logical function.
  • there may be another division manner for example, multiple units or components may be combined or may be integrated into another system, or some Features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a mobile hard disk, a read only memory (abbreviated as ROM in English, a full name of Read-Only Memory in English), a random access memory (abbreviated as RAM in English, a full name called Random Access Memory in English), and magnetic
  • ROM read only memory
  • RAM random access memory
  • magnetic A variety of media that can store program code, such as a disc or a disc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本发明实施例提供了数据处理方法及数据处理设备,如果待压缩的数据中包含了与重复数据库中的可变块的前半部分相同并且与可变块的后半部分不同的数据片段,则能够生成粒度小于发生匹配的可变块的新的可变块,并将新的可变块添加到重复数据库。新的可变块粒度较小,提高了后续的待压缩数据与更新后的重复数据库发生匹配的概率,进而提高了压缩的效率。

Description

数据处理方法及数据处理设备 技术领域 本发明涉及报文处理技术, 尤其涉及一种数据处理方法及数据处理设 备。
背景技术 数据压缩是对报文内容进行算法处理, 减小数据量, 但不影响信息传 递的过程。 数据压缩是为了达到节约网络传送带宽、 实现应用加速的目的。
根据 CDC ( Content-Defined Chunking )可变块算法生成包含可变块、 可变块的指紋以及可变块的摘要的重复数据库。 生成重复数据库后, 如果 待压缩的数据中包含了与可变块的前半部分相同并且与可变块的后半部分 不同的数据片段, 则数据片段的指紋与可变块的指紋匹配, 则数据片段的 摘要与可变块的摘要不匹配。 CDC算法认为重复数据库需要进行更新, 并 使用定界滑窗机制生成新的可变块。 新的可变块粒度可能比较大, 降低了 后续的待压缩数据与更新后的重复数据库发生匹配的概率。 以上可能导致 压缩效率下降。
发明内容
本发明实施例提供一种数据处理方法及数据处理设备, 用于提高数据 压缩效率。 一方面, 本发明实施例提供了一种数据处理方法, 包括: 根据指紋算法计算待压缩数据中的第一片段的第一指紋, 所述第一片 段的起始位置与所述待压缩数据的起始位置相同, 所述第一片段的长度与 第一滑窗的长度相同; 在第一本地重复数据库中查找所述第一指紋, 所述第一本地重复数据 库用于存储重复数据、 所述重复数据的指紋以及所述重复数据的摘要; 如果所述第一本地重复数据库中存在所述第一指紋, 则根据所述第一 指紋获取所述第一本地重复数据库中的第一可变块以及所述第一可变块的 摘要, 所述第一指紋与根据所述指紋算法计算得到的所述第一可变块中的 第一初始块的指紋相同, 所述第一初始块的起始位置与所述第一可边块的 起始位置相同, 所述第一初始块的长度与所述第一滑窗的长度相同, 所述 第一可变块的摘要为根据摘要算法对所述第一可变块的摘要进行计算得到 的;
根据所述摘要算法计算所述待压缩数据中的第二片段的摘要, 所述第 二片段的起始位置与所述待压缩数据的起始位置相同, 所述第二片段的长 度与所述第一可变块的长度相同; 比较所述第二片段的摘要与所述第一可变块的摘要; 如果所述第二片段的摘要与所述第一可变块的摘要不同, 则获取所述 第二片段中的第一子片段, 所述第一子片段与所述第一可变块中的第一子 可变块相同, 所述第一子片段的起始位置与所述第二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可变块的起始位置相同, 所述第 二片段中的第二比特与所述第一可变块中的第一比特不同, 所述第二比特 为所述第二片段中所述第一子片段的下一个比特, 所述第一比特为所述第 一可变块中所述第一子可变块的下一个比特; 将所述第一子片段、 所述第一子片段的指紋以及所述第一子片段的摘 要添加到所述第一本地重复数据库, 生成第二本地重复数据库, 所述第一 子片段的指紋与所述第一指紋相同, 所述第一子片段的摘要为根据所述摘 要算法对所述第一子片段的摘要进行计算得到的。 另一方面, 本发明实施例还提供了一种数据压缩设备, 包括: 第一指紋计算单元 ,用于根据指紋算法计算待压缩数据中的第一片段的第 一指紋, 所述第一片段的起始位置与所述待压缩数据的起始位置相同, 所 述第一片段的长度与第一滑窗的长度相同; 查找单元, 用于在第一本地重复数据库中查找所述第一指紋, 所述第一本 地重复数据库用于存储重复数据、 所述重复数据的指紋以及所述重复数据 的摘要; 重复内容获取单元,用于如果所述第一本地重复数据库中存在所述第一指 紋, 则根据所述第一指紋获取所述第一本地重复数据库中的第一可变块以 及所述第一可变块的摘要, 所述第一指紋与根据所述指紋算法计算得到的 所述第一可变块中的第一初始块的指紋相同, 所述第一初始块的起始位置 与所述第一可边块的起始位置相同, 所述第一初始块的长度与所述第一滑 窗的长度相同, 所述第一可变块的摘要为根据摘要算法对所述第一可变块 的摘要进行计算得到的;
摘要计算单元,用于根据所述摘要算法计算所述待压缩数据中的第二片段 的摘要, 所述第二片段的起始位置与所述待压缩数据的起始位置相同, 所 述第二片段的长度与所述第一可变块的长度相同; 摘要比较单元, 用于比较所述第二片段的摘要与所述第一可变块的摘要; 第一子片段获取单元,用于如果所述第二片段的摘要与所述第一可变块的 摘要不同, 则获取所述第二片段中的第一子片段, 所述第一子片段与所述 第一可变块中的第一子可变块相同, 所述第一子片段的起始位置与所述第 二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可变块 的起始位置相同, 所述第二片段中的第二比特与所述第一可变块中的第一 比特不同, 所述第二比特为所述第二片段中所述第一子片段的下一个比特, 所述第一比特为所述第一可变块中所述第一子可变块的下一个比特; 第一添加单元, 用于将所述第一子片段、 所述第一子片段的指紋以及所述 第一子片段的摘要添加到所述第一本地重复数据库, 生成第二本地重复数 据库, 所述第一子片段的指紋与所述第一指紋相同, 所述第一子片段的摘 要为根据所述摘要算法对所述第一子片段的摘要进行计算得到的。 又一方面, 本发明实施例还提供了一种数据解压缩设备, 包括: 第一指紋计算单元 ,用于根据指紋算法计算待压缩数据中的第一片段的第 一指紋, 所述第一片段的起始位置与所述待压缩数据的起始位置相同, 所 述第一片段的长度与第一滑窗的长度相同; 查找单元, 用于在第一本地重复数据库中查找所述第一指紋, 所述第一本 地重复数据库用于存储重复数据、 所述重复数据的指紋以及所述重复数据 的摘要; 重复内容获取单元,用于如果所述第一本地重复数据库中存在所述第一指 紋, 则根据所述第一指紋获取所述第一本地重复数据库中的第一可变块以 及所述第一可变块的摘要, 所述第一指紋与根据所述指紋算法计算得到的 所述第一可变块中的第一初始块的指紋相同, 所述第一初始块的起始位置 与所述第一可边块的起始位置相同, 所述第一初始块的长度与所述第一滑 窗的长度相同, 所述第一可变块的摘要为根据摘要算法对所述第一可变块 的摘要进行计算得到的;
摘要计算单元,用于根据所述摘要算法计算所述待压缩数据中的第二片段 的摘要, 所述第二片段的起始位置与所述待压缩数据的起始位置相同, 所 述第二片段的长度与所述第一可变块的长度相同; 摘要比较单元, 用于比较所述第二片段的摘要与所述第一可变块的摘要; 第一子片段获取单元,用于如果所述第二片段的摘要与所述第一可变块的 摘要不同, 则获取所述第二片段中的第一子片段, 所述第一子片段与所述 第一可变块中的第一子可变块相同, 所述第一子片段的起始位置与所述第 二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可变块 的起始位置相同, 所述第二片段中的第二比特与所述第一可变块中的第一 比特不同, 所述第二比特为所述第二片段中所述第一子片段的下一个比特, 所述第一比特为所述第一可变块中所述第一子可变块的下一个比特;
第一添加单元, 用于将所述第一子片段、 所述第一子片段的指紋以及 所述第一子片段的摘要添加到所述第一本地重复数据库, 生成第二本地重 复数据库, 所述第一子片段的指紋与所述第一指紋相同, 所述第一子片段 的摘要为根据所述摘要算法对所述第一子片段的摘要进行计算得到的。
根据本发明实施例提供的技术方案, 如果待压缩的数据中包含了与重 复数据库中的可变块的前半部分相同并且与可变块的后半部分不同的数据 片段, 则能够生成粒度小于发生匹配的可变块的新的可变块, 并将新的可 变块添加到重复数据库。 新的可变块粒度较小, 提高了后续的待压缩数据 与更新后的重复数据库发生匹配的概率, 进而提高了压缩的效率。
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种数据处理方法的流程图;
图 2为本发明实施例提供的数据处理方法的一种应用场景的示意图; 图 3为本发明实施例提供的数据处理方法的另一种应用场景的示意图; 图 4为本发明实施例提供的一种数据处理方法的一个具体实现方式的 示意图;
图 5为本发明实施例提供的另一种数据处理方法的流程图;
图 6为本发明实施例提供的一种数据处理方法中压缩后报文的封装格 式示意图;
图 7 为本发明实施例提供的一种数据处理方法应用到数据压缩侧设备 的示意图;
图 8为本发明实施例提供的数据压缩设备的结构示意图;
图 9为本发明实施例提供的数据压缩设备的一种应用场景的组网结构 图;
图 10为本发明实施例提供的数据压缩设备的另一种应用场景的组网结 构图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。
数据压缩技术包括两种: 一种是通过无损压缩算法在发送端压缩数据, 在接收端进行数据解压; 另一种是基于 DRE ( Data Redundancy Elimination, 数据冗余删除)技术, 也称为重复数据删除(De-duplication ), 将需要传送 的数据中的重复内容消除后用特殊的 ID代替, 只传递增量信息, 从而减小 数据量, 实现数据压缩目的。
DRE技术一般应用于 WOC ( WAN Optimization Controller, 广域网优 化控制器), 以减少需要 WAN传送的数据量, 相当于增加 WAN带宽, 节 约了宝贵的 WAN资源。 WOC是一种应用加速设备。 在 WOC设备的 DRE 实现中, 处理的对象可以是基于 IP报文, 也可以是基于一条会话(即同一 会话的多个连续 IP报文)。基于 IP报文的处理实现简单, 不需要緩存报文, 性能较高, 但是由于重复数据可能包含在多个报文中, 导致不容易将重复 数据进行识别和緩存。 另外, 将多个报文组合起来进行算法压缩时, 由于 不同包的类型不同 (如不同协议, 或不同格式), 难以得到较高的压缩比。 基于会话的处理则需要将一个会话的多个包进行緩存, 在线处理时性能存 在一定限制, 但是可以最大限度地识别出重复数据, 并且同一会话一般属 于同一类型, 进行算法压缩时能得到更高的压缩比。
DRE实现的过程包括: 压缩设备的本地 DRE模块分析报文, 判断和确 定相应数据块; 将确定的数据块与重复数据库中的已存数据块比较, 如果 查找到同样的块存在, 则表示之前传输过该数据块(即为重复数据), 此时 在报文中用指紋代替该数据块; 没有找到的数据块被加入重复数据库中; 可选地,对去冗余后的报文进一步进行压缩;远端设备的 DRE模块解压(可 选)后将指紋替换为原数据块, 之后传送报文给用户; 本地 DRE模块与远 端 DRE模块需要进行数据块及指紋的同步。
DRE技术基于二进制数据进行删重处理, 不需要感知上层的具体协议 类型。 其关键点是进行重复数据的识别和替换, 即对内容完全相同的重复 数据进行识别, 并建立重复数据库(包括緩存重复数据和建立查找指紋), 当后续传送的数据存在已緩存的内容(即重复数据) 时, 则用指紋代替。 由于需要建立重复数据库緩存(cache ) 已有数据, 因此 DRE技术也称为字 节緩存 ( Byte cache )技术。 而重复数据的识别和替换是基于数据块实现的, 数据块的识别算法包 括 FSP ( Fixed-Sized Partition, 固定块)、 CDC以及 SB ( Sliding Block, 滑 动块 )。
其中, CDC算法釆用一个滑动窗口 (以下简称滑窗)对待压缩的数据 进行块定界,滑窗从数据开始按字节向后移动,并釆用特定的哈希(HASH ) 算法(如 rabin HASH、 ELF HASH等)计算出滑窗的指紋信息。 当计算出 的指紋满足一定条件(如对特定值取模结果为某设定值), 则认为找到数据 块边界, 然后向后滑动滑窗, 再次计算滑窗的指紋信息, 当计算条件成立, 则找到下一数据块的边界, 由此可以将整个数据划分成大小可变的多个数 据块。
当确定数据块之后, 釆用特定的算法 (SHA-1、 MD5等, 这些算法能 对大量数据进行信息提取, 形成固定长度的字段, 由于算法的特定, 不同 的原始数据计算结果相同的概率非常低, 可以忽略不计) 来对数据块的内 容进行计算, 并将计算结果作为指紋查找本地的重复数据库, 如果存在则 表明已有相同内容的数据块存在, 当前数据块为重复数据块, 如果指紋不 存在, 则将当前数据块的指紋及块内容加入緩存(重复数据库), 以备下次 检查。
CDC算法的块定界算法可能因为计算条件总是不满足导致块过大, 具 体实现上可以对块的大小设定上下限, 当满足上下限条件时强制分块。 CDC 算法的优点是对数据内容的变化不敏感, 当插入或删除数据时只会影响到 该变化数据相关的少量的数据块, 而其它块不受影响。
图 1为本发明实施例提供的一种数据处理方法的流程图。 如图 1所示, 数据处理方法包括:
11、 根据指紋算法计算待压缩数据中的第一片段的第一指紋, 该第一 片段的起始位置与该待压缩数据的起始位置相同, 该第一片段的长度与第 一滑窗的长度相同。 其中, 第一滑窗为现有的滑窗, 用于对数据块进行定界。
12、 在第一本地重复数据库中查找该第一指紋, 该第一本地重复数据 库用于存储重复数据、 该重复数据的指紋以及该重复数据的摘要。
13、 如果该第一本地重复数据库中存在该第一指紋, 则根据该第一指 紋获取该第一本地重复数据库中的第一可变块以及该第一可变块的摘要, 该第一指紋与根据该指紋算法计算得到的该第一可变块中的第一初始块的 指紋相同, 该第一初始块的起始位置与该第一可边块的起始位置相同, 该 第一初始块的长度与该第一滑窗的长度相同, 该第一可变块的摘要为根据 摘要算法对该第一可变块的摘要进行计算得到的。
14、 根据该摘要算法计算该待压缩数据中的第二片段的摘要, 该第二 片段的起始位置与该待压缩数据的起始位置相同, 该第二片段的长度与该 第一可变块的长度相同。
其中, 第二片段为现有 CDC算法中进行匹配压缩处理的基本单元 数 据块。
15、 比较该第二片段的摘要与该第一可变块的摘要。
16、 如果该第二片段的摘要与该第一可变块的摘要不同, 则获取该第 二片段中的第一子片段, 该第一子片段与该第一可变块中的第一子可变块 相同, 该第一子片段的起始位置与该第二片段的起始位置相同, 该第一子 可变块的起始位置与该第一可变块的起始位置相同, 该第二片段中的第二 比特与该第一可变块中的第一比特不同, 该第二比特为该第二片段中该第 一子片段的下一个比特, 该第一比特为该第一可变块中该第一子可变块的 下一个比特。
17、 将该第一子片段、 该第一子片段的指紋以及该第一子片段的摘要 添加到该第一本地重复数据库, 生成第二本地重复数据库, 该第一子片段 的指紋与该第一指紋相同, 该第一子片段的摘要为根据该摘要算法对该第 一子片段的摘要进行计算得到的。 根据本发明实施例提供的技术方案, 如果待压缩的数据中包含了与重 复数据库中的可变块的前半部分相同并且与可变块的后半部分不同的数据 片段, 则能够生成粒度小于发生匹配的可变块的新的可变块, 并将新的可 变块添加到重复数据库。 新的可变块粒度较小, 提高了后续的待压缩数据 与更新后的重复数据库发生匹配的概率, 进而提高了压缩的效率。 上述 11至 17可由压缩侧设备执行, 也可由解压缩设备执行。 如压缩 侧设备接收到一待去冗余的报文, 该报文包括报文头及净荷, 净荷为待压 缩数据, 压缩侧设备按照上述 11 至 17对净荷进行处理。 或者如解压缩侧 设备接收到一去冗余后的报文, 同样的, 该去冗余后的报文包含报文头及 净荷, 只不过该净荷为压缩侧设备压缩后的数据, 即部分数据已被替换为 指紋, 此时, 解压缩侧设备处理的待压缩数据即净荷中其余未被替换的原 始数据。
当上述方法由压缩侧设备实现时, 本发明实施例提供的数据处理方法 还可以包括: 接收第一报文, 该第一报文包括第一报文头与第一净荷, 该第一净荷 包含第一净荷片段, 该第一净荷片段的长度与该第一子片段的长度相同; 根据该指紋算法计算该第一净荷片段中第二初始块的指紋, 该第二初 始块的起始位置与该第一净荷片段的起始位置相同, 该第二初始块的长度 与该第一滑窗的长度相同;
根据该摘要算法计算该第一净荷片段的摘要;
如果该第二初始块的指紋与该第二本地重复数据库中的该第一子片段 的指紋相等, 并且该第一净荷片段的摘要与该第一子片段的摘要相等, 则 删除该第一报文中的该第一净荷片段, 生成第二报文, 该第二报文中包括 第二报文头与第二净荷, 该第二报文头与该第一报文头相同, 该第二净荷 包括该第一子片段的指紋。 这样, 解压缩侧设备可以根据指紋从重复数据 库中找到对应的第一子片段, 将指紋替换为第一子片段, 将报文中的数据 恢复为原始数据, 实现数据的解压缩。
可选地, 该第二净荷还包括该第一子片段在该第一报文中的位置信息。 当替换第一子片段的指紋未放置在第一子片段在第一报文中的原始位 置时, 解压缩侧设备对第二报文执行解压缩操作时, 解压缩侧设备可以根 据该第二净荷中包括的该第一子片段在该第一报文中的位置信息, 确定第 一子片段在第一报文中的原始位置, 进而还原出第一报文。 第一子片段在 第一报文中的位置信息可以是第一子片段的最高比特相对于第一报文的报 文头的最高比特的偏移量。 该获取该第二片段中的第一子片段之后, 本发明实施例提供的数据处 理方法还可以包括: 根据该指紋算法计算该待压缩数据中的第二子片段的第三初始块的指 紋, 该第二子片段的起始位置为该第二比特, 该第二子片段的结束位置与 该待压缩数据的结束位置相同; 该第三初始块的起始位置为该第二比特, 该第三初始块的长度等于该第一滑窗的长度;
根据第二滑窗获取第二子可变块中的第一检测块, 该第二滑窗的起始 位置与该第二子可变块中的第三比特对应, 该第三比特为介于第二子可变 块的起始位置与该第二子可变块的结束位置之间的比特, 该第二滑窗的长 度等于该第一滑窗的长度, 该第二子可变块的起始位置为该第一比特, 该 第二子可变块的结束位置与该第一可变块的结束位置相同; 第二滑窗可定 义为内容滑窗, 专用于判断重复数据库中是否存在对应的数据块。 其计算 指紋的方法可与现有的滑窗相同, 只是现有技术中滑窗仅用于定界。
根据该指紋算法计算该第一检测块的指紋; 比较该第三初始块的指紋与该第一检测块的指紋; 如果该第三初始块的指紋与该第一检测块的指紋相同, 则比较该第二 子可变块中的第三子可变块的摘要与该第二子片段中的第三子片段的摘 要, 该第三子可变块的起始位置与该第一检测块的起始位置相同, 该第三 子可变块的结束位置与该第一可变块的结束位置相同, 该第三子片段的起 始位置与该第二子片段的起始位置相同, 该第三子片段的长度与该第三子 可变块的长度相等, 该第三子可变块的摘要为根据该摘要算法对该第三子 可变块的摘要进行计算得到的; 如果该第三子片段的摘要与该第三子可变块的摘要相等, 则将该第三 子片段、 该第三子片段的指紋以及该第三子片段的摘要添加到该第二本地 重复数据库, 生成第三本地重复数据库, 该第三子片段的指紋等于该第三 初始块的指紋, 该第三子片段的摘要为根据该摘要算法对该第三子片段的 摘要进行计算得到的。
在该第三子片段的摘要与该第三子可变块的摘要相等, 并将该第三子 片段、 该第三子片段的指紋以及该第三子片段的摘要添加到该第二本地重 复数据库的场景下, 本发明实施例提供的数据处理方法还可以包括: 接收第三报文, 该第三报文包括第三报文头与第三净荷, 该第三净荷 包含第二净荷片段以及第三净荷片段, 该第二净荷片段的长度与该第一子 片段的长度相同, 该第三净荷片段的长度与该第三子片段的长度相同; 根据该指紋算法计算该第二净荷片段中第四初始块的指紋, 根据该指 紋算法计算该第三净荷片段中第五初始块的指紋, 该第四初始块的起始位 置与该第二净荷片段的起始位置相同, 该第四初始块的长度与该第一滑窗 的长度相同, 该第五初始块的起始位置与该第三净荷片段的起始位置相同, 该第五初始块的长度与该第一滑窗的长度相同; 根据该摘要算法计算该第二净荷片段的摘要, 根据该摘要算法计算该 第三净荷片段的摘要; 如果该第四初始块的指紋与该第三本地重复数据库中的该第一子片段 的指紋相等, 并且该第二净荷片段的摘要与该第一子片段的摘要相等, 则 删除该第三报文中的该第二净荷片段, 如果该第五初始块的指紋与该第三 本地重复数据库中的该第三子片段的指紋相等, 并且该第三净荷片段的摘 要与该第三子片段的摘要相等, 则删除该第三报文中的该第三净荷片段, 生成第四^艮文, 该第四 文中包括第四 文头与第四净荷, 该第四 文头 与该第三报文头相同, 该第四净荷包括该第一子片段的指紋以及该第三子 片段的指紋。 可选地, 该第四净荷还包括该第一子片段在该第三报文中的位置信息、 该第三子片段在该第三报文中的位置信息。 其中, 第三子片段与第一子片段类似, 为小于第二片段粒度的数据块, 这样可以进一步提高数据压缩效率。 第一子片段在第三报文中的位置信息 可以是第一子片段的最高比特相对于第三报文的报文头的最高比特的偏移 量。
如图 2所示, 待压缩数据块 A, 与重复数据库中对应的数据块 A的摘 要不同, 可以理解为上次发送的数据块 A经过修改后变为数据块 Α, , 并 进行再次发送。 其中, 待压缩数据块 A, 即上述第二片段, 重复数据库中 对应的数据块 A即上述第一可变块。 这样, 上次发送数据时在重复数据库 中保存的数据块 A与当前发送的数据中的数据块 A, 相对应, 具体地, 当 滑窗滑动到数据块 A, 时, 计算指紋, 若重复数据库中有相同的指紋, 则 表示重复数据库中存在有对应的数据块, 这里对应的数据块为 A。 由于此 时不知道数据块 A, 的长度, 假定数据块 A, 的长度与数据块 A相同, 计 算数据块 A, 的摘要, 并与数据块 A的摘要比较。 显然, 数据块 A, 的摘 要与数据块 A的摘要不同, 因为数据块 A与数据块 A, 的内容不同。 之后再找到数据块 A, 中与数据块 A相同的部分, 以及不同的部分, 进行进一步地压缩处理。 具体地, 逐字节比较数据块 A, 与数据块 A, 当重复数据库中对应的 数据块 A到第二拆分点, 待压缩数据块 A, 到第一拆分点时, 二者比较结 果是不一致, 此时, 将滑窗滑动到第一拆分点处计算指紋, 重复数据库中, 将滑窗滑动到第二拆分点处计算指紋, 与第一拆分点处的指紋进行比较, 不一致时, 继续向后滑动滑窗, 计算第二拆分点后的指紋, 并继续与第一 拆分点处的指紋进行比较, 不一致时, 继续向后滑动滑窗, 直至计算出的 指紋与第一拆分点处的指紋一致, 或直至滑窗滑至数据块 A的结束边界。 本实施例中, 数据块 A的第三拆分点处的指紋与待压缩数据块 A, 的第一 拆分点处的指紋一致。 当数据块 A的第三拆分点处的指紋与待压缩数据块 A, 的第一拆分点处的指紋一致时, 利用 HASH表项中的块长度及第三拆 分点到边界的长度计算出待压缩数据块 A, 中第一拆分点到边界的长度, 然后计算第一拆分点至边界的摘要, 并计算重复数据库中数据块 A的第三 拆分点至边界的摘要, 将计算出的两个摘要进行比较, 当不一致时, 按照 前述操作比较第三拆分点后字节与第一拆分点后的字节, 直至计算出的指 紋与第一拆分点处的指紋一致, 或直至滑窗滑至数据块 A的结束边界; 当 一致时, 待压缩数据块 A, 用第一拆分点拆分为两个子数据块 Al、 A2, 重 复数据库中的数据块 A被第二拆分点、第三拆分点拆分为三个子数据块 A1、 A2、 A3 , 可以看出, 本次发送的数据块 A, 与上次发送的数据块 A相比删 除了子数据块 A2, 其余两个子数据块 Al、 A3不变, 这样, 可以用指紋替 换 A1或者 A3 , 实现对数据的精确压缩, 提高数据压缩效率。 其中, 待压 缩数据块 A, 中的子数据块 A1即上述第一子片段,待压缩数据块 A, 中的 子数据块 A3即上述第三子片段。 重复数据库中的子数据块 A1即上述第一 子可变块, 重复数据库中的子数据块 A3的初始块, 也就是从重复数据库中 的子数据块 A3的第一个比特开始长度为第一滑窗长度的数据块,即上述第 二子可变块中的第一检测块。
替换 A1或者 A3也可以用其他方法实现。 举例来说, 可以用指紋、 块 长度及偏移值替换 A1或者 A3。
可选地, 本发明实施例提供的数据处理方法还可以包括:
根据该指紋算法计算该第一可变块中的第四子可变块的第六初始块的 指紋, 该第四子可变块的起始位置为该第一比特, 该第四子可变块的结束 位置与该第一可变块的结束位置相同, 该第六初始块的起始位置为该第一 比特, 该第六初始块的长度等于该第一滑窗的长度;
获取第四子片段中的第二检测块, 该第二检测块的起始位置与该第四 子片段中的第四比特对应, 该第四比特为介于第三片段的起始位置与该第 三片段的结束位置之间的比特, 该第二检测块的长度等于该第一滑窗的长 度, 该第三片段的起始位置为该第二比特, 该第三片段的结束位置通过定 界算法确定, 该第三片段为该待压缩数据中的片段, 该第四子片段为该第 三片段中的子片段, 该第四子片段的起始位置与该第二检测块的起始位置 相同, 该第四子片段的长度与该第四子可变块的长度相同;
根据该指紋算法计算该第二检测块的指紋; 比较该第六初始块的指紋与该第二检测块的指紋; 如果该第六初始块的指紋与该第二检测块的指紋相同, 则比较该第四 子可变块的摘要与该第四子片段的摘要, 该第四子可变块的摘要为根据该 摘要算法对该第四子可变块的摘要进行计算得到的, 该第四子片段的摘要 为根据该摘要算法对该第四子片段的摘要进行计算得到的;
如果该第四子片段的摘要与该第四子可变块的摘要相同, 则将该第四 子片段、 该第四子片段的指紋以及该第四子片段的摘要添加到该第二本地 重复数据库, 生成第四本地重复数据库, 该第四子片段的指紋与该第六初 始块的指紋相同。
可选地, 在该第四子片段的摘要与该第四子可变块的摘要相同, 将该 第四子片段、 该第四子片段的指紋以及该第四子片段的摘要添加到该第二 本地重复数据库的场景下, 本发明实施例提供的数据处理方法还可以包括: 接收第五报文, 该第五报文包括第五报文头与第五净荷, 该第五净荷 包含第四净荷片度以及第五净荷片段, 该第四净荷片度的长度与该第一子 片段相同, 该第五净荷片段的长度与该第四子片段的长度相同; 根据该指紋算法计算该第四净荷片段中第七初始块的指紋, 根据该指 紋算法计算该第五净荷片段中第八初始块的指紋, 该第七初始块的起始位 置与该第四净荷片段的起始位置相同, 该第七初始块的长度与该第一滑窗 的长度相同, 该第八初始块的起始位置与该第五净荷片段的起始位置相同, 该第八初始块的长度与该第一滑窗的长度相同; 根据该摘要算法计算该第四净荷片段的摘要, 根据该摘要算法计算该 第五净荷片段的摘要; 如果该第七初始块的指紋与该第四本地重复数据库中的该第一子片段 的指紋相等, 并且该第四净荷片段的摘要与该第一子片段的摘要相等, 则 删除该第五报文中的该第四净荷片段, 如果该第八初始块的指紋与该第四 本地重复数据库中的该第四子片段的指紋相等, 并且该第五净荷片段的摘 要与该第四子片段的摘要相等, 则删除该第五报文中的该第五净荷片段, 生成第六^艮文, 该第六 文中包括第六 文头与第六净荷, 该第六 文头 与该第五报文头相同, 该第六净荷包括该第一子片段的指紋以及该第四子 片段的指紋。 可选地, 该第六净荷还包括该第一子片段在该第五报文中的位置信息、 该第四子片段在该第五报文中的位置信息。 其中, 第四子片段与第一子片段类似, 为小于第二片段粒度的数据块, 可以进一步提高数据压缩效率。 第一子片段在第五报文中的位置信息可以 是第一子片段的最高比特相对于第五报文的报文头的最高比特的偏移量。 可选地, 本发明实施例提供的数据处理方法还可以包括: 该第三片段的结束位置通过定界算法确定, 包括: 从该第二比特开始向后滑动该定界算法中的第三滑窗, 并判断该第三 滑窗对应的数据是否符合该定界算法中的定界条件, 当首次出现该第三滑 窗对应的数据符合该定界条件时, 在第一距离内继续向后滑动该第三滑窗 , 并判断该第三滑窗对应的数据是否符合该定界条件, 如果出现该第三滑窗 对应的第一数据符合该定界条件的情况时, 则确定该第一数据的结束位置 为该第三片段的结束位置, 该第三滑窗的长度与该第一滑窗的长度相同, 该第一距离的长度与该第一滑窗的长度相同。 如图 3所示, 待压缩数据块所属的上级数据块 A, 与重复数据块中对 应的数据块 A的摘要内容不同, 可以理解为上次发送的数据块 A经过修改 后变为数据块 Α, , 并进行再次发送, 这样, 上次发送数据时在重复数据 库中保存的数据块 A与当前发送的数据中的数据块 A, 相对应, 具体地, 当滑窗滑动到数据块 A, 时, 计算指紋, 若重复数据库中有相同的指紋, 则表示重复数据库中存在有对应的数据块, 这里对应的数据块为 A。
其中, 待压缩数据块所属的上级数据块 A, 可通过滑窗定界来确定。 计算数据块 A, 的摘要,并与数据块 A的摘要比较。显然,数据块 A, 的摘要与数据块 A的摘要不同, 因为数据块 A与数据块 A, 的内容不同。 之后再找到数据块 A, 中与数据块 A相同的部分, 以及不同的部分, 进行进一步地压缩处理。 具体地, 逐字节比较数据块 A, 与数据块 A, 当重复数据库中对应的 数据块 A到第二拆分点, 待压缩数据块 A, 到第一拆分点时, 二者比较结 果是不一致。此时,将滑窗滑动到第二拆分点处计算指紋, 上级数据块 A, 中, 将滑窗滑动到第一拆分点处计算指紋, 与第二拆分点处的指紋进行比 较, 不一致时, 继续向后滑动滑窗, 计算第一拆分点后的指紋, 并继续与 第二拆分点处的指紋进行比较, 不一致时, 继续向后滑动滑窗, 直至计算 出的指紋与第二拆分点处的指紋一致, 或直至滑窗滑至数据块 A, 的结束 边界。
本实施例中, 数据块 A, 的第四拆分点处的指紋与重复数据库中数据 块 A的第二拆分点处的指紋一致。 当数据块 A, 的第四拆分点处的指紋与数据块 A的第二拆分点处的指 紋一致时, 计算第四拆分点至边界的摘要, 并计算重复数据库中数据块 A 的第二拆分点至边界的摘要, 将计算出的两个摘要进行比较, 当不一致时, 按照前述操作比较第四拆分点后的字节与第一拆分点后的字节, 直至计算 出的指紋与第二拆分点处的指紋一致, 或直至滑窗滑至数据块 A, 的结束 边界; 当一致时, 上级数据块 A, 被第一拆分点、 第四拆分点拆分为三个 子数据块 Al、 A3、 A2, 重复数据库中的数据块 A被第二拆分点拆分为两 个子数据块 Al、 A2, 可以看出, 本次发送的数据块 A, 与上次发送的数据 块 A相比增加了子数据块 A3 , 其余两个子数据块 Al、 A2不变, 这样, 可 以用指紋替换 A1或者 A2, 实现对数据的精确压缩, 提高数据压缩效率。 其中, 待压缩数据块 A, 中的子数据块 A2即上述第四子片段。待压缩数据 块 A, 中的子数据块 A2的初始块,也就是从待压缩数据块 A, 中的子数据 块 A2的第一比特开始长度为第一滑窗长度的数据块,即上述第四子片段中 的第一检测块。 替换 A1或者 A2可以通过其他方法实现。 举例来说, 可以用指紋、 块 长度及偏移值替换 A1或者 A2。 当图 1 所示实施例的方法由解压缩侧设备实现时, 本发明实施例提供 的数据处理方法还可包括: 将该第一子片段的指紋以及该第一子片段的摘 要同步到压缩侧的重复数据库。 压缩侧的重复数据库被同步后, 压缩侧设 备可使用已有的 CDC算法对报文进行删重处理即对报文中的数据进行压缩 处理, 这样, 当报文中包含第一子片段时, 就会被删除, 从而进一步提高 了数据压缩效率。 当图 1 所示实施例的方法由压缩侧设备实现时, 本发明实施例提供的 数据处理方法还可包括: 将该第一子片段、 该第一子片段的指紋以及该第 一子片段的摘要同步到解压缩侧的重复数据库。 这样, 当后续报文中的第 一子片段被删除后, 解压缩侧设备就能够利用重复数据库中保存的第一子 片段对压缩数据进行恢复, 实现解压缩。 可选地, 当压缩侧和解压缩侧的重复数据库均包含有重复数据的内容, 且数据处理方法由压缩侧设备实现时, 本发明实施例提供的数据处理方法 还可以包括: 删除该待压缩数据中的该第一子片段, 将该第一子片段的指紋、 该第 一子片段的长度及该第一子片段在该待压缩数据中的位置信息添加到第七 报文的净荷中, 该待压缩数据为该第七报文的净荷。 第一子片段在待压缩数据中的位置信息可以是第一子片段的最高比特 相对于待压缩数据的最高比特的偏移量。 即, 压缩侧设备在接收到该待压 缩数据所在报文后, 不仅能够匹配出第一子片段, 在本地重复数据库中创 建第一子片段, 还能够对该待压缩数据进行压缩处理, 删除第一子片段。 其中, 在去冗余报文中增加第一子片段的长度, 是由于解压缩侧的重复数 据库中已有第二片段, 当去冗余报文发送到解压缩侧设备时, 解压缩侧设 备根据其中的第一子片段的指紋找到对应的第二片段, 利用第一子片段的 长度及第一子片段在该待压缩数据中的位置即第一子片段在压缩前报文中 的原始位置, 在第二片段中找到第一子片段, 并对去冗余报文进行恢复, 实现解压缩。 上述第三片段的结束位置通过定界算法确定, 可包括: 从该第二比特开始向后滑动该定界算法中的第三滑窗, 并判断该第三 滑窗对应的数据是否符合该定界算法中的定界条件, 当首次出现该第三滑 窗对应的数据符合该定界条件时, 在第一距离内继续向后滑动该第三滑窗 , 并判断该第三滑窗对应的数据是否符合该定界条件, 如果出现该第三滑窗 对应的第一数据符合该定界条件的情况时, 则确定该第一数据的结束位置 为该第三片段的结束位置, 该第三滑窗的长度与该第一滑窗的长度相同, 该第一距离的长度与该第一滑窗的长度相同。 关于定界算法, 可以参考 CDC算法中的定界算法, 此处不再赘述。 具体地, 从上述第二比特开始向后滑动第三滑窗, 判断第三滑窗对应 的数据的指紋是否满足定界算法中的定界条件。 当首次出现第三滑窗对应的数据符合定界条件时, 继续向后滑动第三 滑窗。 首次出现是指第一次出现第三滑窗对应的数据符合定界条件。 第三 滑窗的长度等于第一滑窗的长度。 举例来说, 第三滑窗的长度可以是 64字 节。 定界算法中, 第三滑窗向后滑动时, 每次滑动的距离可以是 1字节。
在第一距离内继续向后滑动第三滑窗, 并判断第三滑窗对应的数据是 否符合定界条件。 如果在第一距离内多次出现第三滑窗对应的第一数据符 合定界条件, 则可以确定最后一次出现的第一数据为真正的边界。 也就是 说, 可以确定最后一次出现的第一数据的结束位置为第三片段的结束位置。 图 4为本发明实施例提供的一种数据压缩方法的一个具体实现方式的 示意图。 如图 4所示, 根据 CDC算法的定界原理分成三块的报文数据, 其中, 中间大块表示根据优化算法分成了三个子块。 假设该报文数据发送了三次,第一次发送时,子块 3356B、4505B、4520B 及 2988B作为一个数据块发送, 并被保存在重复数据库中。 第二次发送时, 将该数据块拆分第一子块 3356B及第二子块, 第二子 块由子块 4505B、 4520B与 2988B组成。 并且重复数据库中分别保存了第 一子块 3356B及第二子块。 第三次发送时, 第一子块 3356B成为数据块 3356B, 第二子块中删除 了子块 4520B , 子块 4505B及 2988B作为一个数据块假设为数据块 C。 则 在本次发送进行压缩处理时, 需要将数据块 C 拆分为子块 4505B 及子块 2988B。 具体地, 当第三次发送数据时, 以压缩数据块 6788B、 数据块 3356B、 数据块 C及数据块 4800B为例进行说明。 对图 4中的数据块 6788B、 数据块 3356B、 数据块 C及数据块 4800B 执行压缩操作, 可以釆用图 5所示的数据处理方法。 图 5为本发明实施例 提供的另一种数据处理方法的流程图。 该数据处理方法包括:
51、 滑动滑窗, 计算指紋; 这里的滑窗即内容滑窗, 实现上内容滑动 窗口可以与定界滑窗 (即现有技术中的滑窗)合一, 即对同样长度的数据 进行 HASH计算得到指紋, 只是内容滑窗将指紋应用于判别数据块的内容 是否发生变化, 而定界滑窗将指紋应用于数据块定界。
52、 判断是否存在 HASH表项。 具体地, 用内容滑窗计算得到的指紋 作为查找关键字 ( KEY )查找重复数据库,判断重复数据库是否存在 HASH 表项, 该 HASH表项包含有上述 51计算得到的指紋。 若不存在 HASH表项, 说明指紋对应的数据块为本次新增加的内容, 执行 531 , 将新增加内容添加到重复数据库中。 若存在 HASH表项, 说明指紋对应的数据块曾经被保存到重复数据库 中, 则执行 541 , 取 HASH表项中的块信息, 根据 HASH表项中所保存的 块信息 (关键信息是块长度、 SHA-1/MD5 算法得到的数据即摘要 ( checksum ) ) 来与当前数据进行比较。 当然, 块信息还可以包含该数据 块的原始数据内容。
531、 判断计算出的指紋是否满足定界条件。 釆用 CDC算法中类似的 滑动窗口 (称为定界滑窗)进行块定界, 定界方法相同, 即计算出指紋, 并根据指紋判断是否满足定界条件, 如果满足则确定找到数据的边界。 此处对 CDC算法的定界过程有一点优化, 因为有可能本数据块的内容 发生了变化, 该内容导致定界条件提前成立, 而变化内容被计算到下一数 据块中, 结果可能导致下一块不能被判定为重复数据(实际上这部分确实 为重复数据) , 因引考虑第一次满足条件的界为伪界, 此时再向后滑动一 部分距离 (可称为数据扰动) , 如果再次发现定界条件满足, 则认为后一 次为真正的界(可以称为确界, 前一次称为伪界) , 否则前一次就是真正 的界(确界) 。
532、 最大界检查。 通常数据块的长度有范围限制, 可预先设定一个上 限, 如最长不能超过 64Kbyte (字节)。 这里判断经过上述 531确定的数据 块的长度是否超过上限, 若超过该上限, 则以该上限作为数据块的长度, 强制距离上述 51滑窗字节为该上限的字节处定一个界, 重新划定数据块, 然后执行 534; 若 531确定的数据块的长度未超过该上限, 则执行 532。
533、 最小界检查。 参见上述 532, 通常不仅预设一个上限来限定数据 块可具有的最长的长度, 还会预先设定一个下限来限定数据块可具有的最 短的长度,如最短不能短于 64字节。小于下限的情况作为零碎数据不压缩, 这是为了防止数据库的数据块太零碎, 占用系统资源, 使得压缩过程没有 意义, 假如一个字节就是一个块, 这是没有意义的, 反而更加浪费系统资 源。
若 531确定的数据块的长度大于该下限, 则执行 534; 若 531确定的数 据块的长度小于该下限, 执行 57;
534、 确定可变块, 计算摘要, 然后执行 56;
541、 计算当前摘要是否一致。 具体的, 计算当前数据块的摘要, 并与重复数据库中的摘要进行比较。 判断是否一致; 若是, 执行 58; 否则, 执行 542。 具体地, 利用重复数据库中 HASH表项记录的块长度直接确定上述步 骤 51滑窗对应的字节所属的数据块, 然后计算该数据块的摘要。 具体地, 按照 HASH表项中保存的块长度值定位当前数据的当前块即指紋对应的字 节所属的数据块, 通过 SHA-1/MD5等算法计算当前块的 checksum。 计算 得到的 checksum与表项中保存的 checksum进行比较, 如果相同, 则认为 当前块为重复数据, 将定界滑窗和内容滑窗都直接滑过本次找到的数据块, 进行下一块的定界、 内容比对。 对于图 4 中的数据块 3356B, 按照上述方 法,这次找到的实际上是一个重复块,此后先将内容滑窗滑到下一数据块 C, 检查其对应的指紋是否在重复数据库中存在, 即利用内容滑窗指紋作为查 找 KEY在重复数据库中查找 HASH表项。 查找到 HASH表项后, 利用表 项中的块长度计算数据块 C的 checksum, 并与表项中的 checksum进行比 较, 当检查到当前计算的 checksum与表项中保存的 checksum不一致, 说 明数据块 C与重复数据库中对应的数据块的内容不同, 执行 542拆分数据 块 C及重复数据库中对应的数据块。
542、 逐字节匹配拆分, 对于每一个拆分出的子数据块, 执行 55; 完成 拆分后,对于拆分出的所有满足数据块的长度限制的子数据块执行 543。在 拆分过程中形成块的都要检查, 不管是匹配部分还是不匹配部分, 小于最 小界的都作为零碎数据。在拆分过程中产生了新块都涉及到更新 /删除表项, 这是拆分过程中完成的。
具体地, 从当前块的初始部分往后逐字节进行匹配, 直到找到与重复 数据库中不相同的字节, 将当前块从不相同的字节处进行拆分, 另外利用 滑窗, 检查从拆分点向后, 是否有指紋与当前块的后续指紋相同, 如果存 在, 检查两者完全匹配的部分, 将其作为一个新块保存到重复数据库中, 此过程主要是识别原来的数据中被删除掉一小部分的情况。
543、 更新或删除 HASH表项;
544、 计算拆分摘要及块长度, 然后执行 56;
55、 对子数据块进行最小界检查, 若子数据块的长度大于上述下限, 则对该子数据块执行 543 ; 若子数据块的长度小于上述下限, 则对该子数据 块执行 57。 55可在执行 542的过程中执行, 即 542每拆分出一部分数据, 就执行 55 , 进行最小界检查, 拆分完成后, 也就对所有拆分出的子数据块 完成了最小界检查, 然后对所有拆分出的长度大于下限的数据块执行 543。 或者, 55也可在 542与 543之间执行, 即 542先完成数据块的拆分, 然后 执行 55 , 对于拆分出的所有子数据块执行 55 , 再对 55的判断结果执行 57 或 543。
56、 添加该可变块对应的 HASH表项。 具体地, 在重复数据库中, 增加该数据块的内容, 并添加 HASH表项, 即更新重复数据库, 结束当前数据块的压缩处理。
57、 非重复内容处理。 具体地, 单独处理非块内容即上述长度小于下 限的零碎数据, 这部分数据保留在报文中, 不压缩, 完成当前滑窗内字节 的处理, 继续向后滑动滑窗。
58、 内容全部重复, 重复内容替换成指紋, 完成当前数据块的删除处 理。 当前块拆分完成后, 继续滑动内容滑窗, 检查后续数据块的内容, 对 当前块的后续数据进行处理。 上述流程中, 定界滑窗和内容滑窗可为同一个滑窗, 只是根据计算的 结果(指紋)进行数据块定界、 重复数据库中块内容的查找比较, 据此, 压缩方法流程分为定界滑窗流程和内容滑窗流程, 最后的处理结果存在三 种情况: 一种是对原来的数据块进行了拆分, 更新了重复数据库; 另一种 是未能匹配到块内容并且不符合加入重复数据库条件 (如长度太短) , 这 部分数据作为非重复内容直接放到报文中; 还有一种结果是找到重复数据, 此时将表示该重复数据的指紋及相关信息以一定格式放到报文中, 发送给 对方设备。
可选地, 压缩后的报文的封装格式如图 6所示, 方式 1 中非重复数据 的位置不变, 只是非重复数据的前后的数据块作为重复数据而被替换了, 方式 2 中替换格式在压缩后的报文中的位置被指定。 其中, 替换格式包括 指紋、 块长度及被替换的数据块在本报文中的偏移。
具体应用到数据块 6788B时, 首先滑窗滑动到数据块 6788B的初始部 分时, 执行上述 51操作, 计算出初始部分的指紋, 然后执行 52, 判断重复 数据库是否存在包含该指紋的 HASH表项, 本实例中数据块 6788B为重复 数据块, 因此, 执行 541 , 计算出数据块 6788B的摘要, 并与重复数据库 中 HASH表项保存的摘要相比较, 判断是否一致, 本实例中判断结果一致, 即内容部分重复, 执行 58, 删除数据中数据块 6788B的内容, 替换为指紋, 完成对数据块 6788B的处理。 之后滑窗滑动到数据块 3356B的初始部分, 执行 51 , 计算出初始部分 的指紋;执行 52,从重复数据库中找到对应 HASH表项,获知数据块 3356B 的块长度等块信息。 执行 541 , 计算出数据块 3356B 的摘要, 与重复数据 块的 HASH表项中的摘要一致, 说明数据块 3356B的内容与重复数据库中 对应 HASH表项的数据块内容全部重复,执行 58,删除数据中数据块 3356B 的内容, 替换为指紋, 完成对数据块 3356B的处理。 之后滑窗滑动到数据块 C的初始部分, 执行 51 , 计算出初始部分的指 紋; 执行 52 , 查找重复数据库, 判断是否存在包含该指紋的 HASH表项。 本实例中, 重复数据库中存在数据块 C的 HASH表项。 然后执行 541 , 根 据查找到的 HASH表项中的块长度界定数据块 C,计算出数据块 C的摘要, 并判断是否与 HASH表项中的摘要一致。 本实例中, 数据块 C 的摘要与 HASH表项中的摘要不一致, 然后执行 542。从数据块 C的初始部分开始向 后逐字节与 HASH表项对应的数据块内容进行比较, 直到找到不相同的字 节, 将数据块 C及重复数据库中 HASH表项对应的数据块从此处即不相同 的字节处进行拆分,本实例中 ,将数据块 C拆分为子块 4505B及子块 2988B , 其中, 子块 4505B与重复数据库中的数据重复, 但是由于本次发送的数据 块 C中删除了子块 4505B与子块 2988B之间的子块 4520B , 导致数据块 C 的内容与重复数据库中的内容不匹配。 然后执行 543 , 将拆分出的部分 4505B、2988B均作为一个新数据块保存到重复数据库中,并生成新的 HASH 表项替换之前查找到的 HASH表项。 相应地, 重复数据库中的 4520B满足 数据块长度要求时, 作为新的数据块保存, 否则, 删除。 再执行 544, 计算 子块 4505B、 子块 2988B的块长度及摘要, 添加到新的 HASH表项中, 以 用于下次发送数据删除作为数据块的 4505B、 2988B的数据内容,并进行替 换, 提高数据的压缩效率。 对于待压缩的数据, 继续向后滑动滑窗至数据块 4800B的初始部分, 执行 51 , 计算初始部分的指紋。 执行 52 , 从重复数据库中找到对应 HASH 表项 ,获知数据块 4800B的块长度等块信息。执行 541 ,计算出数据块 4800B 的摘要, 与重复数据块的 HASH表项中的摘要一致, 说明数据块 4800B的 内容与重复数据库中对应 HASH表项的数据块内容全部重复, 执行 58, 删 除数据中数据块 4800B的内容,替换为指紋, 完成对数据块 4800B的处理。 按照上述方法完成对数据的压缩后,压缩侧设备如 WOC将报文发送到 解压缩侧设备。 如图 7 所示, 压缩侧设备接收报文后, 对接收到的报文进行解析, 得 到报文的净荷。 根据本发明实施例提供的数据处理方法对净荷中的数据进 行压缩处理。 将压缩处理后的数据封装为新报文。 将新报文发送到解压缩 侧设备。 解压缩侧设备接收到新报文后, 利用重复数据库对新报文中的净荷进 行解压缩处理。 具体可以是将报文中的替换格式或指紋删除, 并将替换格 式或指紋替换为与替换格式或指紋对应的数据块, 将将解压缩的数据封装 为报文。 其中, 重复数据库的生成(即前面的算法过程)可以只在一端设备完 成, 然后将数据(重复数据块指紋和 /或数据内容) 同步到对端。 当数据流 量主要为下行, 即服务器侧流向用户侧 (如用户下载文件) , 算法可以在 靠近用户侧的 WOC设备实现,并且保存重复数据块内容, 而靠近服务器一 侧的 WOC设备只需要同步指紋信息即可, 不需要緩存所有内容,反之则在 服务器侧的 WOC设备处理算法和保存内容。当然两侧可以都计算和保存内 容, 只是会增加资源需求。 图 8为本发明实施例提供的数据压缩设备的结构示意图。本实施例提 供的数据压缩设备用于实施上述图 1、图 5所示实施例的方法,如图 8所示, 数据处理设备包括: 第一指紋计算单元 81、 查找单元 82、 重复内容获取单 元 83、 摘要计算单元 84、 摘要比较单元 85、 第一子片段获取单元 86及第 一添力口单元 87。 第一指紋计算单元 81用于根据指紋算法计算待压缩数据中的第一片段的 第一指紋, 该第一片段的起始位置与该待压缩数据的起始位置相同, 该第 一片段的长度与第一滑窗的长度相同; 查找单元 82用于在第一本地重复数据库中查找该第一指紋, 该第一本地 重复数据库用于存储重复数据、 该重复数据的指紋以及该重复数据的摘要; 重复内容获取单元 83 用于如果该第一本地重复数据库中存在该第一指 紋, 则根据该第一指紋获取该第一本地重复数据库中的第一可变块以及该 第一可变块的摘要, 该第一指紋与根据该指紋算法计算得到的该第一可变 块中的第一初始块的指紋相同, 该第一初始块的起始位置与该第一可边块 的起始位置相同, 该第一初始块的长度与该第一滑窗的长度相同, 该第一 可变块的摘要为根据摘要算法对该第一可变块的摘要进行计算得到的; 摘要计算单元 84用于根据该摘要算法计算该待压缩数据中的第二片段的 摘要, 该第二片段的起始位置与该待压缩数据的起始位置相同, 该第二片 段的长度与该第一可变块的长度相同; 摘要比较单元 85用于比较该第二片段的摘要与该第一可变块的摘要; 第一子片段获取单元 86用于如果该第二片段的摘要与该第一可变块的摘 要不同, 则获取该第二片段中的第一子片段, 该第一子片段与该第一可变 块中的第一子可变块相同, 该第一子片段的起始位置与该第二片段的起始 位置相同, 该第一子可变块的起始位置与该第一可变块的起始位置相同, 该第二片段中的第二比特与该第一可变块中的第一比特不同, 该第二比特 为该第二片段中该第一子片段的下一个比特, 该第一比特为该第一可变块 中该第一子可变块的下一个比特; 第一添加单元 87用于将该第一子片段、 该第一子片段的指紋以及该第一 子片段的摘要添加到该第一本地重复数据库, 生成第二本地重复数据库, 该第一子片段的指紋与该第一指紋相同, 该第一子片段的摘要为根据该摘 要算法对该第一子片段的摘要进行计算得到的。 本发明实施例提供的数据压缩设备还可包括: 第一报文接收单元, 用于接收第一报文, 该第一报文包括第一报文头 与第一净荷, 该第一净荷包含第一净荷片段, 该第一净荷片段的长度与该 第一子片段的长度相同; 第二初始指紋计算单元, 用于根据该指紋算法计算该第一净荷片段中 第二初始块的指紋, 该第二初始块的起始位置与该第一净荷片段的起始位 置相同, 该第二初始块的长度与该第一滑窗的长度相同;
第一净荷摘要计算单元, 用于根据该摘要算法计算该第一净荷片段的 摘要;
第二报文生成单元, 用于如果该第二初始块的指紋与该第二本地重复 数据库中的该第一子片段的指紋相等, 并且该第一净荷片段的摘要与该第 一子片段的摘要相等, 则删除该第一报文中的该第一净荷片段, 生成第二 报文, 该第二报文中包括第二报文头与第二净荷, 该第二报文头与该第一 报文头相同, 该第二净荷包括该第一子片段的指紋。
该第二净荷还可包括该第一子片段在该第一报文中的位置信息。 第一 子片段在第一报文中的位置信息可以是第一子片段的最高比特相对于第一 报文的报文头的最高比特的偏移量。 本发明实施例提供的数据压缩设备还可包括:
第三初始指紋计算单元, 用于根据该指紋算法计算该待压缩数据中的 第二子片段的第三初始块的指紋, 该第二子片段的起始位置为该第二比特, 该第二子片段的结束位置与该待压缩数据的结束位置相同; 该第三初始块 的起始位置为该第二比特, 该第三初始块的长度等于该第一滑窗的长度; 检测块获取单元, 用于根据第二滑窗获取第二子可变块中的第一检测 块, 该第二滑窗的起始位置与该第二子可变块中的第三比特对应, 该第三 比特为介于第二子可变块的起始位置与该第二子可变块的结束位置之间的 比特, 该第二滑窗的长度等于该第一滑窗的长度, 该第二子可变块的起始 位置为该第一比特, 该第二子可变块的结束位置与该第一可变块的结束位 置相同;
检测块指紋计算单元, 根据该指紋算法计算该第一检测块的指紋; 指紋比较单元, 用于比较该第三初始块的指紋与该第一检测块的指紋; 第三摘要比较单元, 用于如果该第三初始块的指紋与该第一检测块的 指紋相同, 则比较该第二子可变块中的第三子可变块的摘要与该第二子片 段中的第三子片段的摘要, 该第三子可变块的起始位置与该第一检测块的 起始位置相同, 该第三子可变块的结束位置与该第一可变块的结束位置相 同, 该第三子片段的起始位置与该第二子片段的起始位置相同, 该第三子 片段的长度与该第三子可变块的长度相等, 该第三子可变块的摘要为根据 该摘要算法对该第三子可变块的摘要进行计算得到的;
第三添加单元, 用于如果该第三子片段的摘要与该第三子可变块的摘 要相等, 则将该第三子片段、 该第三子片段的指紋以及该第三子片段的摘 要添加到该第二本地重复数据库, 生成第三本地重复数据库, 该第三子片 段的指紋等于该第三初始块的指紋, 该第三子片段的摘要为根据该摘要算 法对该第三子片段的摘要进行计算得到的。 本发明实施例提供的数据压缩设备还可包括: 第三报文接收单元, 用于接收第三报文, 该第三报文包括第三报文头 与第三净荷, 该第三净荷包含第二净荷片段以及第三净荷片段, 该第二净 荷片段的长度与该第一子片段的长度相同, 该第三净荷片段的长度与该第 三子片段的长度相同; 第四初始指紋计算单元, 用于根据该指紋算法计算该第二净荷片段中 第四初始块的指紋, 根据该指紋算法计算该第三净荷片段中第五初始块的 指紋, 该第四初始块的起始位置与该第二净荷片段的起始位置相同, 该第 四初始块的长度与该第一滑窗的长度相同, 该第五初始块的起始位置与该 第三净荷片段的起始位置相同, 该第五初始块的长度与该第一滑窗的长度 相同;
第三净荷摘要计算单元, 用于根据该摘要算法计算该第二净荷片段的 摘要, 根据该摘要算法计算该第三净荷片段的摘要; 第四 文生成单元, 用于如果该第四初始块的指紋与该第三本地重复 数据库中的该第一子片段的指紋相等, 并且该第二净荷片段的摘要与该第 一子片段的摘要相等, 则删除该第三报文中的该第二净荷片段, 如果该第 五初始块的指紋与该第三本地重复数据库中的该第三子片段的指紋相等, 并且该第三净荷片段的摘要与该第三子片段的摘要相等, 则删除该第三报 文中的该第三净荷片段, 生成第四报文, 该第四报文中包括第四报文头与 第四净荷, 该第四 文头与该第三 ^艮文头相同, 该第四净荷包括该第一子 片段的指紋以及该第三子片段的指紋。
该第四净荷还包括该第一子片段在该第三报文中的位置信息、 该第三 子片段在该第三报文中的位置信息。 第一子片段在第三报文中的位置信息 可以是第一子片段的最高比特相对于第三报文的报文头的最高比特的偏移 量。
本发明实施例提供的数据压缩设备还可包括: 初始块指紋计算单元, 用于根据该指紋算法计算该第一可变块中的第 四子可变块的第六初始块的指紋, 该第四子可变块的起始位置为该第一比 特, 该第四子可变块的结束位置与该第一可变块的结束位置相同, 该第六 初始块的起始位置为该第一比特, 该第六初始块的长度等于该第一滑窗的 长度;
检测块获取单元, 用于获取第四子片段中的第二检测块, 该第二检测 块的起始位置与该第四子片段中的第四比特对应, 该第四比特为介于第三 片段的起始位置与该第三片段的结束位置之间的比特, 该第二检测块的长 度等于该第一滑窗的长度, 该第三片段的起始位置为该第二比特, 该第三 片段的结束位置通过定界算法确定, 该第三片段为该待压缩数据中的片段, 该第四子片段为该第三片段中的子片段, 该第四子片段的起始位置与该第 二检测块的起始位置相同, 该第四子片段的长度与该第四子可变块的长度 相同;
检测块指紋计算单元, 用于根据该指紋算法计算该第二检测块的指紋; 指紋比较单元, 用于比较该第六初始块的指紋与该第二检测块的指紋; 第四摘要比较单元, 用于如果该第六初始块的指紋与该第二检测块的 指紋相同, 则比较该第四子可变块的摘要与该第四子片段的摘要, 该第四 子可变块的摘要为根据该摘要算法对该第四子可变块的摘要进行计算得到 的, 该第四子片段的摘要为根据该摘要算法对该第四子片段的摘要进行计 算得到的;
第四添加单元, 用于如果该第四子片段的摘要与该第四子可变块的摘 要相同, 则将该第四子片段、 该第四子片段的指紋以及该第四子片段的摘 要添加到该第二本地重复数据库, 生成第四本地重复数据库, 该第四子片 段的指紋与该第六初始块的指紋相同。 本发明实施例提供的数据压缩设备还可包括:
第五报文接收单元, 用于接收第五报文, 该第五报文包括第五报文头 与第五净荷, 该第五净荷包含第四净荷片度以及第五净荷片段, 该第四净 荷片度的长度与该第一子片段相同, 该第五净荷片段的长度与该第四子片 段的长度相同;
第七初始指紋计算单元, 用于根据该指紋算法计算该第四净荷片段中 第七初始块的指紋, 根据该指紋算法计算该第五净荷片段中第八初始块的 指紋, 该第七初始块的起始位置与该第四净荷片段的起始位置相同, 该第 七初始块的长度与该第一滑窗的长度相同, 该第八初始块的起始位置与该 第五净荷片段的起始位置相同, 该第八初始块的长度与该第一滑窗的长度 相同;
第五净荷摘要计算单元, 用于根据该摘要算法计算该第四净荷片段的 摘要, 根据该摘要算法计算该第五净荷片段的摘要;
第六报文生成单元, 用于如果该第七初始块的指紋与该第四本地重复 数据库中的该第一子片段的指紋相等, 并且该第四净荷片段的摘要与该第 一子片段的摘要相等, 则删除该第五报文中的该第四净荷片段, 如果该第 八初始块的指紋与该第四本地重复数据库中的该第四子片段的指紋相等, 并且该第五净荷片段的摘要与该第四子片段的摘要相等, 则删除该第五报 文中的该第五净荷片段, 生成第六报文, 该第六报文中包括第六报文头与 第六净荷, 该第六报文头与该第五报文头相同, 该第六净荷包括该第一子 片段的指紋以及该第四子片段的指紋。 该第六净荷还可包括该第一子片段在该第五报文中的位置信息、 该第 四子片段在该第五报文中的位置信息。 第一子片段在第五报文中的位置信 息可以是第一子片段的最高比特相对于第五报文的报文头的最高比特的偏 移量。
可选地, 从该第二比特开始向后滑动该定界算法中的第三滑窗, 并判 断该第三滑窗对应的数据是否符合该定界算法中的定界条件, 当首次出现 该第三滑窗对应的数据符合该定界条件时, 在第一距离内继续向后滑动该 第三滑窗, 并判断该第三滑窗对应的数据是否符合该定界条件, 如果出现 该第三滑窗对应的第一数据符合该定界条件的情况时, 则确定该第一数据 的结束位置为该第三片段的结束位置, 该第三滑窗的长度与该第一滑窗的 长度相同, 该第一距离的长度与该第一滑窗的长度相同。
本发明实施例提供的数据压缩设备还可包括:
第二同步单元, 用于将该第一子片段、 该第一子片段的指紋以及该第 一子片段的摘要同步到解压缩侧的重复数据库。 本发明实施例提供的数据压缩设备还可包括: 压缩处理单元, 用于删除该待压缩数据中的该第一子片段, 将该第一 子片段的指紋、 该第一子片段的长度及该第一子片段在该待压缩数据中的 位置信息添加到第七报文的净荷中, 该待压缩数据为该第七报文的净荷。
第一子片段在待压缩数据中的位置信息可以是第一子片段的最高比特 相对于待压缩数据的最高比特的偏移量。
本发明实施例提供的数据压缩设备可为 woc。 本领域技术人员应理 解, WOC除了上述功能单元, 还应具有报文接收、 网络连接等基本的功能 单元, 这里不再赘述。 本发明实施例提供的数据解压缩设备包括:
第一指紋计算单元 ,用于根据指紋算法计算待压缩数据中的第一片段的第 一指紋, 该第一片段的起始位置与该待压缩数据的起始位置相同, 该第一 片段的长度与第一滑窗的长度相同;
查找单元, 用于在第一本地重复数据库中查找该第一指紋, 该第一本地重 复数据库用于存储重复数据、 该重复数据的指紋以及该重复数据的摘要; 重复内容获取单元, 用于如果该第一本地重复数据库中存在该第一指紋, 则根据该第一指紋获取该第一本地重复数据库中的第一可变块以及该第一 可变块的摘要, 该第一指紋与根据该指紋算法计算得到的该第一可变块中 的第一初始块的指紋相同, 该第一初始块的起始位置与该第一可边块的起 始位置相同, 该第一初始块的长度与该第一滑窗的长度相同, 该第一可变 块的摘要为根据摘要算法对该第一可变块的摘要进行计算得到的;
摘要计算单元 ,用于根据该摘要算法计算该待压缩数据中的第二片段的摘 要, 该第二片段的起始位置与该待压缩数据的起始位置相同, 该第二片段 的长度与该第一可变块的长度相同;
摘要比较单元, 用于比较该第二片段的摘要与该第一可变块的摘要; 第一子片段获取单元,用于如果该第二片段的摘要与该第一可变块的摘要 不同, 则获取该第二片段中的第一子片段, 该第一子片段与该第一可变块 中的第一子可变块相同, 该第一子片段的起始位置与该第二片段的起始位 置相同, 该第一子可变块的起始位置与该第一可变块的起始位置相同, 该 第二片段中的第二比特与该第一可变块中的第一比特不同, 该第二比特为 该第二片段中该第一子片段的下一个比特, 该第一比特为该第一可变块中 该第一子可变块的下一个比特; 第一添加单元, 用于将该第一子片段、 该第一子片段的指紋以及该第一子 片段的摘要添加到该第一本地重复数据库, 生成第二本地重复数据库, 该 第一子片段的指紋与该第一指紋相同, 该第一子片段的摘要为根据该摘要 算法对该第一子片段的摘要进行计算得到的。 本领域技术人员应理解为: 本发明实施例提供的数据解压缩设备除具 备上述单元外, 还具有解压缩等基本功能单元。 本发明实施例提供的数据解压缩设备还可包括: 第一同步单元, 用于将该第一子片段的指紋以及该第一子片段的摘要 同步到压缩侧的重复数据库。 图 9为本发明实施例提供的一种数据压缩方法的一种应用场景的组网 结构图。如图 9所示,在 WAN两端用来压缩数据及解压缩数据的设备均为 WOC。 即, WOC可同时具备压缩数据和解压缩数据的功能。 图 10为本发明实施例提供的一种数据压缩方法的另一种应用场景的组 网结构图。如图 10所示, 两端 WOC设备的交互包括控制和数据两个层面。 控制层面是两端设备需要通过私有协议交互控制信息, 自动发现对端 设备, 通过下游设备发送响应到上游设备, 可以使上游设备感知下游设备 的存在及地址信息 (如 IP地址) 。 并且, 两端设备需要互相通知釆用的算 法信息并达成一致(如都釆用 MD5进行内容 checksum的计算) , 还需要 同步重复数据库信息, 包括指紋及指紋对应的信息表项 (如块长度, checksum值等) 。 同步过程分为定时同步和增量同步, 定时同步指定时将 所有的重复数据库内容进行一致性检查, 而增量同步则只对新增或更新 /删 除的特定块信息通知对端。
数据层面是指对通过两端设备的业务数据进行算法处理和数据替换, 从而减少报文的长度和个数, 达到数据压缩的目的。 根据本发明实施例提供的技术方案, 如果待压缩的数据中包含了与重 复数据库中的可变块的前半部分相同并且与可变块的后半部分不同的数据 片段, 则能够生成粒度小于发生匹配的可变块的新的可变块, 并将新的可 变块添加到重复数据库。 相对于直接对定位到的块进行查找方法, 新的可变块粒度较小。 因此, 本发明实施例提供的技术方案提高了后续的待压缩数据与更新后的重复数 据库发生匹配的概率, 进而提高了压缩的效率。 本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的 各示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件 的结合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方 案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使 用不同方法来实现所描述的功能, 但是这种实现不应认为超出本发明的范 围。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述 描述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的 对应过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置 和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅 是示意性的, 例如, 所述单元的划分, 可以仅仅为一种逻辑功能划分, 实 际实现时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以 集成到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或 讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 装置 或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。
作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的 部分可以以软件产品的形式体现出来, 该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服 务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步 骤。 而前述的存储介质包括: U盘、 移动硬盘、 只读存储器 (英文缩写为 ROM, 英文全称为 Read-Only Memory ) 、 随机存取存储器 (英文缩写为 RAM, 英文全称为 Random Access Memory )、 磁碟或者光盘等各种可以存 储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应所述以权利要求的保护范围为准。

Claims

权利要求
1、 一种数据数据处理方法, 其特征在于, 包括: 根据指紋算法计算待压缩数据中的第一片段的第一指紋, 所述第一片 段的起始位置与所述待压缩数据的起始位置相同, 所述第一片段的长度与 第一滑窗的长度相同; 在第一本地重复数据库中查找所述第一指紋, 所述第一本地重复数据 库用于存储重复数据、 所述重复数据的指紋以及所述重复数据的摘要; 如果所述第一本地重复数据库中存在所述第一指紋, 则根据所述第一 指紋获取所述第一本地重复数据库中的第一可变块以及所述第一可变块的 摘要, 所述第一指紋与根据所述指紋算法计算得到的所述第一可变块中的 第一初始块的指紋相同, 所述第一初始块的起始位置与所述第一可边块的 起始位置相同, 所述第一初始块的长度与所述第一滑窗的长度相同, 所述 第一可变块的摘要为根据摘要算法对所述第一可变块的摘要进行计算得到 的;
根据所述摘要算法计算所述待压缩数据中的第二片段的摘要, 所述第 二片段的起始位置与所述待压缩数据的起始位置相同, 所述第二片段的长 度与所述第一可变块的长度相同; 比较所述第二片段的摘要与所述第一可变块的摘要; 如果所述第二片段的摘要与所述第一可变块的摘要不同, 则获取所述 第二片段中的第一子片段, 所述第一子片段与所述第一可变块中的第一子 可变块相同, 所述第一子片段的起始位置与所述第二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可变块的起始位置相同, 所述第 二片段中的第二比特与所述第一可变块中的第一比特不同, 所述第二比特 为所述第二片段中所述第一子片段的下一个比特, 所述第一比特为所述第 一可变块中所述第一子可变块的下一个比特; 将所述第一子片段、 所述第一子片段的指紋以及所述第一子片段的摘 要添加到所述第一本地重复数据库, 生成第二本地重复数据库, 所述第一 子片段的指紋与所述第一指紋相同, 所述第一子片段的摘要为根据所述摘 要算法对所述第一子片段的摘要进行计算得到的。
2、 根据权利要求 1所述方法, 其特征在于, 还包括: 接收第一报文, 所述第一报文包括第一报文头与第一净荷, 所述第一 净荷包含第一净荷片段, 所述第一净荷片段的长度与所述第一子片段的长 度相同;
根据所述指紋算法计算所述第一净荷片段中第二初始块的指紋, 所述 第二初始块的起始位置与所述第一净荷片段的起始位置相同, 所述第二初 始块的长度与所述第一滑窗的长度相同; 根据所述摘要算法计算所述第一净荷片段的摘要;
如果所述第二初始块的指紋与所述第二本地重复数据库中的所述第一 子片段的指紋相等, 并且所述第一净荷片段的摘要与所述第一子片段的摘 要相等, 则删除所述第一报文中的所述第一净荷片段, 生成第二报文, 所 述第二报文中包括第二报文头与第二净荷, 所述第二报文头与所述第一报 文头相同, 所述第二净荷包括所述第一子片段的指紋。
3、 根据权利要求 2所述方法, 其特征在于, 所述第二净荷还包括所述 第一子片段在所述第一报文中的位置信息。
4、 根据权利要求 1所述方法, 其特征在于, 所述获取所述第二片段中 的第一子片段之后, 所述方法还包括: 根据所述指紋算法计算所述待压缩数据中的第二子片段的第三初始块 的指紋, 所述第二子片段的起始位置为所述第二比特, 所述第二子片段的 结束位置与所述待压缩数据的结束位置相同; 所述第三初始块的起始位置 为所述第二比特, 所述第三初始块的长度等于所述第一滑窗的长度; 根据第二滑窗获取第二子可变块中的第一检测块, 所述第二滑窗的起 始位置与所述第二子可变块中的第三比特对应, 所述第三比特为介于第二 子可变块的起始位置与所述第二子可变块的结束位置之间的比特, 所述第 二滑窗的长度等于所述第一滑窗的长度, 所述第二子可变块的起始位置为 所述第一比特, 所述第二子可变块的结束位置与所述第一可变块的结束位 置相同; 根据所述指紋算法计算所述第一检测块的指紋; 比较所述第三初始块的指紋与所述第一检测块的指紋; 如果所述第三初始块的指紋与所述第一检测块的指紋相同, 则比较所 述第二子可变块中的第三子可变块的摘要与所述第二子片段中的第三子片 段的摘要, 所述第三子可变块的起始位置与所述第一检测块的起始位置相 同, 所述第三子可变块的结束位置与所述第一可变块的结束位置相同, 所 述第三子片段的起始位置与所述第二子片段的起始位置相同, 所述第三子 片段的长度与所述第三子可变块的长度相等, 所述第三子可变块的摘要为 根据所述摘要算法对所述第三子可变块的摘要进行计算得到的;
如果所述第三子片段的摘要与所述第三子可变块的摘要相等, 则将所 述第三子片段、 所述第三子片段的指紋以及所述第三子片段的摘要添加到 所述第二本地重复数据库, 生成第三本地重复数据库, 所述第三子片段的 指紋等于所述第三初始块的指紋, 所述第三子片段的摘要为根据所述摘要 算法对所述第三子片段的摘要进行计算得到的。
5、 根据权利要求 4所述方法, 其特征在于, 还包括: 接收第三报文, 所述第三报文包括第三报文头与第三净荷, 所述第三 净荷包含第二净荷片段以及第三净荷片段, 所述第二净荷片段的长度与所 述第一子片段的长度相同, 所述第三净荷片段的长度与所述第三子片段的 长度相同;
根据所述指紋算法计算所述第二净荷片段中第四初始块的指紋, 根据 所述指紋算法计算所述第三净荷片段中第五初始块的指紋, 所述第四初始 块的起始位置与所述第二净荷片段的起始位置相同, 所述第四初始块的长 度与所述第一滑窗的长度相同, 所述第五初始块的起始位置与所述第三净 荷片段的起始位置相同, 所述第五初始块的长度与所述第一滑窗的长度相 同;
根据所述摘要算法计算所述第二净荷片段的摘要, 根据所述摘要算法 计算所述第三净荷片段的摘要;
如果所述第四初始块的指紋与所述第三本地重复数据库中的所述第一 子片段的指紋相等, 并且所述第二净荷片段的摘要与所述第一子片段的摘 要相等, 则删除所述第三报文中的所述第二净荷片段, 如果所述第五初始 块的指紋与所述第三本地重复数据库中的所述第三子片段的指紋相等, 并 且所述第三净荷片段的摘要与所述第三子片段的摘要相等, 则删除所述第 三报文中的所述第三净荷片段, 生成第四报文, 所述第四报文中包括第四 报文头与第四净荷, 所述第四报文头与所述第三报文头相同, 所述第四净 荷包括所述第一子片段的指紋以及所述第三子片段的指紋。
6、 根据权利要求 4所述方法, 其特征在于, 所述第四净荷还包括所述 第一子片段在所述第三报文中的位置信息、 所述第三子片段在所述第三报 文中的位置信息。
7、 根据权利要求 1所述方法, 其特征在于, 所述方法还包括: 根据所述指紋算法计算所述第一可变块中的第四子可变块的第六初始 块的指紋, 所述第四子可变块的起始位置为所述第一比特, 所述第四子可 变块的结束位置与所述第一可变块的结束位置相同, 所述第六初始块的起 始位置为所述第一比特, 所述第六初始块的长度等于所述第一滑窗的长度; 获取第四子片段中的第二检测块, 所述第二检测块的起始位置与所述 第四子片段中的第四比特对应, 所述第四比特为介于第三片段的起始位置 与所述第三片段的结束位置之间的比特, 所述第二检测块的长度等于所述 第一滑窗的长度, 所述第三片段的起始位置为所述第二比特, 所述第三片 段的结束位置通过定界算法确定, 所述第三片段为所述待压缩数据中的片 段, 所述第四子片段为所述第三片段中的子片段, 所述第四子片段的起始 位置与所述第二检测块的起始位置相同, 所述第四子片段的长度与所述第 四子可变块的长度相同; 根据所述指紋算法计算所述第二检测块的指紋; 比较所述第六初始块的指紋与所述第二检测块的指紋; 如果所述第六初始块的指紋与所述第二检测块的指紋相同, 则比较所 述第四子可变块的摘要与所述第四子片段的摘要, 所述第四子可变块的摘 要为根据所述摘要算法对所述第四子可变块的摘要进行计算得到的, 所述 第四子片段的摘要为根据所述摘要算法对所述第四子片段的摘要进行计算 得到的;
如果所述第四子片段的摘要与所述第四子可变块的摘要相同, 则将所 述第四子片段、 所述第四子片段的指紋以及所述第四子片段的摘要添加到 所述第二本地重复数据库, 生成第四本地重复数据库, 所述第四子片段的 指紋与所述第六初始块的指紋相同。
8、 根据权利要求 7所述方法, 其特征在于, 还包括: 接收第五报文, 所述第五报文包括第五报文头与第五净荷, 所述第五 净荷包含第四净荷片度以及第五净荷片段, 所述第四净荷片度的长度与所 述第一子片段相同, 所述第五净荷片段的长度与所述第四子片段的长度相 同;
根据所述指紋算法计算所述第四净荷片段中第七初始块的指紋, 根据 所述指紋算法计算所述第五净荷片段中第八初始块的指紋, 所述第七初始 块的起始位置与所述第四净荷片段的起始位置相同, 所述第七初始块的长 度与所述第一滑窗的长度相同, 所述第八初始块的起始位置与所述第五净 荷片段的起始位置相同, 所述第八初始块的长度与所述第一滑窗的长度相 同;
根据所述摘要算法计算所述第四净荷片段的摘要, 根据所述摘要算法 计算所述第五净荷片段的摘要;
如果所述第七初始块的指紋与所述第四本地重复数据库中的所述第一 子片段的指紋相等, 并且所述第四净荷片段的摘要与所述第一子片段的摘 要相等, 则删除所述第五报文中的所述第四净荷片段, 如果所述第八初始 块的指紋与所述第四本地重复数据库中的所述第四子片段的指紋相等, 并 且所述第五净荷片段的摘要与所述第四子片段的摘要相等, 则删除所述第 五报文中的所述第五净荷片段, 生成第六报文, 所述第六报文中包括第六 报文头与第六净荷, 所述第六报文头与所述第五报文头相同, 所述第六净 荷包括所述第一子片段的指紋以及所述第四子片段的指紋。
9、 根据权利要求 8所述方法, 其特征在于, 所述第六净荷还包括所述 第一子片段在所述第五报文中的位置信息、 所述第四子片段在所述第五报 文中的位置信息。
10、 根据权利要求 7 所述方法, 其特征在于, 所述第三片段的结束位 置通过定界算法确定, 包括:
从所述第二比特开始向后滑动所述定界算法中的第三滑窗, 并判断所 述第三滑窗对应的数据是否符合所述定界算法中的定界条件, 当首次出现 所述第三滑窗对应的数据符合所述定界条件时, 在第一距离内继续向后滑 动所述第三滑窗 , 并判断所述第三滑窗对应的数据是否符合所述定界条件 , 如果出现所述第三滑窗对应的第一数据符合所述定界条件的情况时, 则确 定所述第一数据的结束位置为所述第三片段的结束位置, 所述第三滑窗的 长度与所述第一滑窗的长度相同, 所述第一距离的长度与所述第一滑窗的 长度相同。
11、 根据权利要求 1 所述方法, 其特征在于, 还包括: 将所述第一子 片段的指紋以及所述第一子片段的摘要同步到压缩侧的重复数据库。
12、 根据权利要求 1-10任一项所述方法, 其特征在于, 还包括: 将所 述第一子片段、 所述第一子片段的指紋以及所述第一子片段的摘要同步到 解压缩侧的重复数据库。
13、 根据权利要求 1所述方法, 其特征在于, 还包括: 删除所述待压缩数据中的所述第一子片段, 将所述第一子片段的指紋、 所述第一子片段的长度及所述第一子片段在所述待压缩数据中的位置信息 添加到第七报文的净荷中, 所述待压缩数据为所述第七报文的净荷。
14、 一种数据压缩设备, 其特征在于, 包括: 第一指紋计算单元, 用于根据指紋算法计算待压缩数据中的第一片段 的第一指紋, 所述第一片段的起始位置与所述待压缩数据的起始位置相同, 所述第一片段的长度与第一滑窗的长度相同; 查找单元, 用于在第一本地重复数据库中查找所述第一指紋, 所述第 一本地重复数据库用于存储重复数据、 所述重复数据的指紋以及所述重复 数据的摘要; 重复内容获取单元, 用于如果所述第一本地重复数据库中存在所述第 一指紋, 则根据所述第一指紋获取所述第一本地重复数据库中的第一可变 块以及所述第一可变块的摘要, 所述第一指紋与根据所述指紋算法计算得 到的所述第一可变块中的第一初始块的指紋相同, 所述第一初始块的起始 位置与所述第一可边块的起始位置相同, 所述第一初始块的长度与所述第 一滑窗的长度相同, 所述第一可变块的摘要为根据摘要算法对所述第一可 变块的摘要进行计算得到的;
摘要计算单元, 用于根据所述摘要算法计算所述待压缩数据中的第二 片段的摘要, 所述第二片段的起始位置与所述待压缩数据的起始位置相同, 所述第二片段的长度与所述第一可变块的长度相同; 摘要比较单元, 用于比较所述第二片段的摘要与所述第一可变块的摘 要; 第一子片段获取单元, 用于如果所述第二片段的摘要与所述第一可变 块的摘要不同, 则获取所述第二片段中的第一子片段, 所述第一子片段与 所述第一可变块中的第一子可变块相同, 所述第一子片段的起始位置与所 述第二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可 变块的起始位置相同, 所述第二片段中的第二比特与所述第一可变块中的 第一比特不同, 所述第二比特为所述第二片段中所述第一子片段的下一个 比特, 所述第一比特为所述第一可变块中所述第一子可变块的下一个比特; 第一添加单元, 用于将所述第一子片段、 所述第一子片段的指紋以及 所述第一子片段的摘要添加到所述第一本地重复数据库, 生成第二本地重 复数据库, 所述第一子片段的指紋与所述第一指紋相同, 所述第一子片段 的摘要为根据所述摘要算法对所述第一子片段的摘要进行计算得到的。
15、 根据权利要求 14所述设备, 其特征在于, 还包括: 第一报文接收单元, 用于接收第一报文, 所述第一报文包括第一报文 头与第一净荷, 所述第一净荷包含第一净荷片段, 所述第一净荷片段的长 度与所述第一子片段的长度相同; 第二初始指紋计算单元, 用于根据所述指紋算法计算所述第一净荷片 段中第二初始块的指紋, 所述第二初始块的起始位置与所述第一净荷片段 的起始位置相同, 所述第二初始块的长度与所述第一滑窗的长度相同; 第一净荷摘要计算单元, 用于根据所述摘要算法计算所述第一净荷片 段的摘要;
第二报文生成单元, 用于如果所述第二初始块的指紋与所述第二本地 重复数据库中的所述第一子片段的指紋相等, 并且所述第一净荷片段的摘 要与所述第一子片段的摘要相等, 则删除所述第一报文中的所述第一净荷 片段, 生成第二报文, 所述第二报文中包括第二报文头与第二净荷, 所述 第二报文头与所述第一报文头相同, 所述第二净荷包括所述第一子片段的 指紋。
16、 根据权利要求 15所述设备, 其特征在于, 所述第二净荷还包括所 述第一子片段在所述第一报文中的位置信息。
17、 根据权利要求 14所述设备, 其特征在于, 所述设备还包括: 第三初始指紋计算单元, 用于根据所述指紋算法计算所述待压缩数据 中的第二子片段的第三初始块的指紋, 所述第二子片段的起始位置为所述 第二比特, 所述第二子片段的结束位置与所述待压缩数据的结束位置相同; 所述第三初始块的起始位置为所述第二比特, 所述第三初始块的长度等于 所述第一滑窗的长度; 检测块获取单元, 用于根据第二滑窗获取第二子可变块中的第一检测 块, 所述第二滑窗的起始位置与所述第二子可变块中的第三比特对应, 所 述第三比特为介于第二子可变块的起始位置与所述第二子可变块的结束位 置之间的比特, 所述第二滑窗的长度等于所述第一滑窗的长度, 所述第二 子可变块的起始位置为所述第一比特, 所述第二子可变块的结束位置与所 述第一可变块的结束位置相同; 检测块指紋计算单元, 根据所述指紋算法计算所述第一检测块的指紋; 指紋比较单元, 用于比较所述第三初始块的指紋与所述第一检测块的 指紋;
第三摘要比较单元, 用于如果所述第三初始块的指紋与所述第一检测 块的指紋相同, 则比较所述第二子可变块中的第三子可变块的摘要与所述 第二子片段中的第三子片段的摘要, 所述第三子可变块的起始位置与所述 第一检测块的起始位置相同, 所述第三子可变块的结束位置与所述第一可 变块的结束位置相同, 所述第三子片段的起始位置与所述第二子片段的起 始位置相同, 所述第三子片段的长度与所述第三子可变块的长度相等, 所 述第三子可变块的摘要为根据所述摘要算法对所述第三子可变块的摘要进 行计算得到的;
第三添加单元, 用于如果所述第三子片段的摘要与所述第三子可变块 的摘要相等, 则将所述第三子片段、 所述第三子片段的指紋以及所述第三 子片段的摘要添加到所述第二本地重复数据库, 生成第三本地重复数据库, 所述第三子片段的指紋等于所述第三初始块的指紋, 所述第三子片段的摘 要为根据所述摘要算法对所述第三子片段的摘要进行计算得到的。
18、 根据权利要求 17所述设备, 其特征在于, 还包括: 第三报文接收单元, 用于接收第三报文, 所述第三报文包括第三报文 头与第三净荷, 所述第三净荷包含第二净荷片段以及第三净荷片段, 所述 第二净荷片段的长度与所述第一子片段的长度相同, 所述第三净荷片段的 长度与所述第三子片段的长度相同; 第四初始指紋计算单元, 用于根据所述指紋算法计算所述第二净荷片 段中第四初始块的指紋, 根据所述指紋算法计算所述第三净荷片段中第五 初始块的指紋, 所述第四初始块的起始位置与所述第二净荷片段的起始位 置相同, 所述第四初始块的长度与所述第一滑窗的长度相同, 所述第五初 始块的起始位置与所述第三净荷片段的起始位置相同, 所述第五初始块的 长度与所述第一滑窗的长度相同;
第三净荷摘要计算单元, 用于根据所述摘要算法计算所述第二净荷片 段的摘要, 根据所述摘要算法计算所述第三净荷片段的摘要;
第四报文生成单元, 用于如果所述第四初始块的指紋与所述第三本地 重复数据库中的所述第一子片段的指紋相等, 并且所述第二净荷片段的摘 要与所述第一子片段的摘要相等, 则删除所述第三报文中的所述第二净荷 片段, 如果所述第五初始块的指紋与所述第三本地重复数据库中的所述第 三子片段的指紋相等, 并且所述第三净荷片段的摘要与所述第三子片段的 摘要相等, 则删除所述第三报文中的所述第三净荷片段, 生成第四报文, 所述第四报文中包括第四报文头与第四净荷, 所述第四报文头与所述第三 报文头相同, 所述第四净荷包括所述第一子片段的指紋以及所述第三子片 段的指紋。
19、 根据权利要求 17所述设备, 其特征在于, 所述第四净荷还包括所 述第一子片段在所述第三报文中的位置信息、 所述第三子片段在所述第三 报文中的位置信息。
20、 根据权利要求 14所述设备, 其特征在于, 所述设备还包括: 初始块指紋计算单元, 用于根据所述指紋算法计算所述第一可变块中 的第四子可变块的第六初始块的指紋, 所述第四子可变块的起始位置为所 述第一比特, 所述第四子可变块的结束位置与所述第一可变块的结束位置 相同, 所述第六初始块的起始位置为所述第一比特, 所述第六初始块的长 度等于所述第一滑窗的长度;
检测块获取单元, 用于获取第四子片段中的第二检测块, 所述第二检 测块的起始位置与所述第四子片段中的第四比特对应, 所述第四比特为介 于第三片段的起始位置与所述第三片段的结束位置之间的比特, 所述第二 检测块的长度等于所述第一滑窗的长度, 所述第三片段的起始位置为所述 第二比特, 所述第三片段的结束位置通过定界算法确定, 所述第三片段为 所述待压缩数据中的片段, 所述第四子片段为所述第三片段中的子片段, 所述第四子片段的起始位置与所述第二检测块的起始位置相同, 所述第四 子片段的长度与所述第四子可变块的长度相同; 检测块指紋计算单元, 用于根据所述指紋算法计算所述第二检测块的 指紋; 指紋比较单元, 用于比较所述第六初始块的指紋与所述第二检测块的 指紋; 第四摘要比较单元, 用于如果所述第六初始块的指紋与所述第二检测 块的指紋相同, 则比较所述第四子可变块的摘要与所述第四子片段的摘要, 所述第四子可变块的摘要为根据所述摘要算法对所述第四子可变块的摘要 进行计算得到的, 所述第四子片段的摘要为根据所述摘要算法对所述第四 子片段的摘要进行计算得到的; 第四添加单元, 用于如果所述第四子片段的摘要与所述第四子可变块 的摘要相同, 则将所述第四子片段、 所述第四子片段的指紋以及所述第四 子片段的摘要添加到所述第二本地重复数据库, 生成第四本地重复数据库, 所述第四子片段的指紋与所述第六初始块的指紋相同。
21、 根据权利要求 20所述设备, 其特征在于, 还包括: 第五报文接收单元, 用于接收第五报文, 所述第五报文包括第五报文 头与第五净荷, 所述第五净荷包含第四净荷片度以及第五净荷片段, 所述 第四净荷片度的长度与所述第一子片段相同, 所述第五净荷片段的长度与 所述第四子片段的长度相同; 第七初始指紋计算单元, 用于根据所述指紋算法计算所述第四净荷片 段中第七初始块的指紋, 根据所述指紋算法计算所述第五净荷片段中第八 初始块的指紋, 所述第七初始块的起始位置与所述第四净荷片段的起始位 置相同, 所述第七初始块的长度与所述第一滑窗的长度相同, 所述第八初 始块的起始位置与所述第五净荷片段的起始位置相同, 所述第八初始块的 长度与所述第一滑窗的长度相同;
第五净荷摘要计算单元, 用于根据所述摘要算法计算所述第四净荷片 段的摘要, 根据所述摘要算法计算所述第五净荷片段的摘要; 第六报文生成单元, 用于如果所述第七初始块的指紋与所述第四本地 重复数据库中的所述第一子片段的指紋相等, 并且所述第四净荷片段的摘 要与所述第一子片段的摘要相等, 则删除所述第五报文中的所述第四净荷 片段, 如果所述第八初始块的指紋与所述第四本地重复数据库中的所述第 四子片段的指紋相等, 并且所述第五净荷片段的摘要与所述第四子片段的 摘要相等, 则删除所述第五报文中的所述第五净荷片段, 生成第六报文, 所述第六报文中包括第六报文头与第六净荷, 所述第六报文头与所述第五 报文头相同, 所述第六净荷包括所述第一子片段的指紋以及所述第四子片 段的指紋。
22、 根据权利要求 21所述设备, 其特征在于, 所述第六净荷还包括所 述第一子片段在所述第五报文中的位置信息、 所述第四子片段在所述第五 报文中的位置信息。
23、 根据权利要求 20所述设备, 其特征在于, 所述检测块获取单元具 体用于从所述第二比特开始向后滑动所述定界算法中的第三滑窗, 并判断 所述第三滑窗对应的数据是否符合所述定界算法中的定界条件, 当首次出 现所述第三滑窗对应的数据符合所述定界条件时, 在第一距离内继续向后 滑动所述第三滑窗, 并判断所述第三滑窗对应的数据是否符合所述定界条 件, 如果出现所述第三滑窗对应的第一数据符合所述定界条件的情况时, 则确定所述第一数据的结束位置为所述第三片段的结束位置, 所述第三滑 窗的长度与所述第一滑窗的长度相同, 所述第一距离的长度与所述第一滑 窗的长度相同。
24、 根据权利要求 14-23任一项所述设备, 其特征在于, 还包括: 第二同步单元, 用于将所述第一子片段、 所述第一子片段的指紋以及 所述第一子片段的摘要同步到解压缩侧的重复数据库。
25、 根据权利要求 14所述设备, 其特征在于, 还包括: 压缩处理单元, 用于删除所述待压缩数据中的所述第一子片段, 将所 述第一子片段的指紋、 所述第一子片段的长度及所述第一子片段在所述待 压缩数据中的位置信息添加到第七报文的净荷中, 所述待压缩数据为所述 第七报文的净荷。
26、 一种数据解压缩设备, 其特征在于, 包括: 第一指紋计算单元, 用于根据指紋算法计算待压缩数据中的第一片段 的第一指紋, 所述第一片段的起始位置与所述待压缩数据的起始位置相同, 所述第一片段的长度与第一滑窗的长度相同; 查找单元, 用于在第一本地重复数据库中查找所述第一指紋, 所述第 一本地重复数据库用于存储重复数据、 所述重复数据的指紋以及所述重复 数据的摘要; 重复内容获取单元, 用于如果所述第一本地重复数据库中存在所述第 一指紋, 则根据所述第一指紋获取所述第一本地重复数据库中的第一可变 块以及所述第一可变块的摘要, 所述第一指紋与根据所述指紋算法计算得 到的所述第一可变块中的第一初始块的指紋相同, 所述第一初始块的起始 位置与所述第一可边块的起始位置相同, 所述第一初始块的长度与所述第 一滑窗的长度相同, 所述第一可变块的摘要为根据摘要算法对所述第一可 变块的摘要进行计算得到的;
摘要计算单元, 用于根据所述摘要算法计算所述待压缩数据中的第二 片段的摘要, 所述第二片段的起始位置与所述待压缩数据的起始位置相同, 所述第二片段的长度与所述第一可变块的长度相同; 摘要比较单元, 用于比较所述第二片段的摘要与所述第一可变块的摘 要;
第一子片段获取单元, 用于如果所述第二片段的摘要与所述第一可变 块的摘要不同, 则获取所述第二片段中的第一子片段, 所述第一子片段与 所述第一可变块中的第一子可变块相同, 所述第一子片段的起始位置与所 述第二片段的起始位置相同, 所述第一子可变块的起始位置与所述第一可 变块的起始位置相同, 所述第二片段中的第二比特与所述第一可变块中的 第一比特不同, 所述第二比特为所述第二片段中所述第一子片段的下一个 比特, 所述第一比特为所述第一可变块中所述第一子可变块的下一个比特; 第一添加单元, 用于将所述第一子片段、 所述第一子片段的指紋以及 所述第一子片段的摘要添加到所述第一本地重复数据库, 生成第二本地重 复数据库, 所述第一子片段的指紋与所述第一指紋相同, 所述第一子片段 的摘要为根据所述摘要算法对所述第一子片段的摘要进行计算得到的。
27、 根据权利要求 26所述设备, 其特征在于, 还包括:
第一同步单元, 用于将所述第一子片段的指紋以及所述第一子片段的 摘要同步到压缩侧的重复数据库。
PCT/CN2013/071725 2012-03-02 2013-02-21 数据处理方法及数据处理设备 Ceased WO2013127309A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13754635.4A EP2717476A4 (en) 2012-03-02 2013-02-21 DATA PROCESSING METHOD AND DATA PROCESSING DEVICE
US14/186,226 US9514209B2 (en) 2012-03-02 2014-02-21 Data processing method and data processing device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210053609.6A CN102684827B (zh) 2012-03-02 2012-03-02 数据处理方法及数据处理设备
CN201210053609.6 2012-03-02

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/186,226 Continuation US9514209B2 (en) 2012-03-02 2014-02-21 Data processing method and data processing device

Publications (1)

Publication Number Publication Date
WO2013127309A1 true WO2013127309A1 (zh) 2013-09-06

Family

ID=46816244

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071725 Ceased WO2013127309A1 (zh) 2012-03-02 2013-02-21 数据处理方法及数据处理设备

Country Status (4)

Country Link
US (1) US9514209B2 (zh)
EP (1) EP2717476A4 (zh)
CN (1) CN102684827B (zh)
WO (1) WO2013127309A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840500A (zh) * 2021-02-02 2022-08-02 迈凌有限公司 用于通过跳过选定数据进行重复数据删除的散列

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102684827B (zh) * 2012-03-02 2015-07-29 华为技术有限公司 数据处理方法及数据处理设备
WO2014031241A2 (en) * 2012-08-21 2014-02-27 Emc Corporation Format identification for fragmented image data
US9626373B2 (en) * 2012-10-01 2017-04-18 Western Digital Technologies, Inc. Optimizing data block size for deduplication
CN103152430B (zh) * 2013-03-21 2016-06-08 河海大学 一种缩减数据占用空间的云存储方法
CN104375946B (zh) * 2013-08-16 2018-04-20 华为技术有限公司 一种数据处理的方法及装置
CN103596011B (zh) * 2013-11-20 2017-07-04 北京中星微电子有限公司 图像数据的存储处理方法和装置
CN104753626B (zh) * 2013-12-25 2019-05-24 华为技术有限公司 一种数据压缩方法、设备及系统
EP3151111B1 (en) * 2014-06-30 2018-10-17 Huawei Technologies Co., Ltd. Data processing method executed by network apparatus, and associated device
CN104573089A (zh) * 2015-01-29 2015-04-29 西安交通大学 一种NewSQL数据库中的增量式快照方法
WO2016181461A1 (ja) * 2015-05-11 2016-11-17 富士通株式会社 転送装置、通信システム、通信方法、および、通信プログラム
US10235044B2 (en) * 2015-07-27 2019-03-19 Datrium, Inc. System and methods for storage data deduplication
CN105515586B (zh) * 2015-12-14 2019-04-12 华中科技大学 一种快速差量压缩方法
JP6747303B2 (ja) * 2017-01-13 2020-08-26 富士通株式会社 通信装置、通信システム、通信方法、および、通信プログラム
CN107084989B (zh) * 2017-03-27 2020-06-30 广州视源电子科技股份有限公司 一种aoi器件数据库的添加方法与系统
CN109309651B (zh) * 2017-07-28 2021-12-28 斑马智行网络(香港)有限公司 一种文件传输方法、装置、设备和存储介质
US10310765B1 (en) * 2017-08-31 2019-06-04 Amazon Technologies, Inc. Record-oriented data storage for a distributed storage system
CN107521109A (zh) * 2017-09-10 2017-12-29 南京中高知识产权股份有限公司 一种3d打印装置的工作方法
CN107486991A (zh) * 2017-10-05 2017-12-19 南京中高知识产权股份有限公司 3d分层打印方法及3d分层打印装置
CN108446319B (zh) * 2018-02-09 2021-08-03 烽火通信科技股份有限公司 将数据进行二进制序列化的方法和系统
CN109492001B (zh) * 2018-10-15 2021-10-01 四川巧夺天工信息安全智能设备有限公司 一种分类提取access数据库中碎片数据的方法
US11847333B2 (en) * 2019-07-31 2023-12-19 EMC IP Holding Company, LLC System and method for sub-block deduplication with search for identical sectors inside a candidate block
CN110944040A (zh) * 2019-10-31 2020-03-31 浙江工商大学 一种数据压缩过程中的编码方法
CN113632059B (zh) * 2020-03-06 2025-01-10 华为技术有限公司 用于消除重复数据删除中的碎片整理的设备和方法
CN111667923B (zh) * 2020-06-05 2022-11-18 医渡云(北京)技术有限公司 数据匹配方法、装置、计算机可读介质及电子设备
CN112995039A (zh) * 2021-03-05 2021-06-18 迈普通信技术股份有限公司 报文处理方法及系统
CN115079930B (zh) * 2021-03-12 2025-07-29 天翼云科技有限公司 处理方法、评价方法、装置、电子设备和存储介质
CN114442954B (zh) * 2022-01-26 2024-05-03 山东云海国创云计算装备产业创新中心有限公司 一种lz4编码压缩装置
WO2025048817A1 (en) * 2023-08-31 2025-03-06 Google Llc Compression with fabric communication

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630984A (zh) * 2000-07-25 2005-06-22 派里比特网络股份有限公司 增量和连续的数据压缩
CN1901549A (zh) * 2006-07-26 2007-01-24 白杰 数据传输方法、装置、数据处理方法和数据传输系统
CN101599091A (zh) * 2002-10-30 2009-12-09 河床技术股份有限公司 用于存储器中数据压缩的基于内容的分段模式及包括等级分段表示的传输
CN102684827A (zh) * 2012-03-02 2012-09-19 华为技术有限公司 数据处理方法及数据处理设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6442276B1 (en) * 1997-07-21 2002-08-27 Assure Systems, Inc. Verification of authenticity of goods by use of random numbers
EP1895663A3 (en) * 2000-07-25 2008-06-11 Juniper Networks, Inc. System and method for incremental and continuous data compression
US6842628B1 (en) * 2001-08-31 2005-01-11 Palmone, Inc. Method and system for event notification for wireless PDA devices
US7484097B2 (en) * 2002-04-04 2009-01-27 Symantec Corporation Method and system for communicating data to and from network security devices
US8934545B2 (en) * 2009-02-13 2015-01-13 Yahoo! Inc. Extraction of video fingerprints and identification of multimedia using video fingerprinting
US8217813B2 (en) * 2010-04-29 2012-07-10 Advanced Micro Devices, Inc. System and method for low-latency data compression/decompression
GB2482128A (en) * 2010-07-19 2012-01-25 Quantum Corp Delta chunks and delta hashes
CN102122959B (zh) * 2011-03-29 2013-12-04 西安交通大学 提高计算机主存可靠性的数据压缩装置及其方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630984A (zh) * 2000-07-25 2005-06-22 派里比特网络股份有限公司 增量和连续的数据压缩
CN101599091A (zh) * 2002-10-30 2009-12-09 河床技术股份有限公司 用于存储器中数据压缩的基于内容的分段模式及包括等级分段表示的传输
CN1901549A (zh) * 2006-07-26 2007-01-24 白杰 数据传输方法、装置、数据处理方法和数据传输系统
CN102684827A (zh) * 2012-03-02 2012-09-19 华为技术有限公司 数据处理方法及数据处理设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2717476A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840500A (zh) * 2021-02-02 2022-08-02 迈凌有限公司 用于通过跳过选定数据进行重复数据删除的散列
US12174806B2 (en) 2021-02-02 2024-12-24 Maxlinear, Inc. Hashing for deduplication through skipping selected data

Also Published As

Publication number Publication date
EP2717476A1 (en) 2014-04-09
CN102684827B (zh) 2015-07-29
EP2717476A4 (en) 2015-02-18
CN102684827A (zh) 2012-09-19
US20140172795A1 (en) 2014-06-19
US9514209B2 (en) 2016-12-06

Similar Documents

Publication Publication Date Title
WO2013127309A1 (zh) 数据处理方法及数据处理设备
CN103870514B (zh) 重复数据删除方法和装置
CN103095843B (zh) 一种基于版本矢量的数据备份方法及客户端
CN102065098A (zh) 网络节点之间数据同步的方法和系统
CN103118104B (zh) 一种基于版本矢量的数据还原方法及服务器
CN106407224B (zh) 一种键值存储系统中文件压实的方法和装置
CN107046812B (zh) 一种数据保存方法和装置
CN108134775B (zh) 一种数据处理方法和设备
US12079168B2 (en) System and method for error-resilient data compression using codebooks
US20080025298A1 (en) Techniques for balancing throughput and compression in a network communication system
US20160352511A1 (en) Content-based encryption keys
US10339124B2 (en) Data fingerprint strengthening
CN101595459A (zh) 用于快速且有效数据管理和/或处理的方法和系统
CN108182367B (zh) 一种支持数据更新的加密数据块客户端去重方法
CN102185889A (zh) 基于iSCSI的重复数据删除方法
WO2013097812A1 (zh) 一种下载字库文件的方法和系统
CN103023796A (zh) 网络数据压缩方法和系统
WO2013075668A1 (zh) 重复数据删除方法和装置
CN113515491A (zh) 一种基于双层Bloom过滤器的云存储文件级去重方法
CN114637527B (zh) 云应用的热更新资源提取与更新方法和装置
CN105554081A (zh) 一种文件差量的传输方法以及装置
CN103841144A (zh) 云存储系统、方法、用户端及云存储服务器
CN104012055B (zh) 一种数据处理方法及装置
Marques et al. Secure deduplication on mobile devices
JP6113816B1 (ja) 情報処理システム、情報処理装置、及びプログラム

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: 13754635

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2013754635

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE