This invention relates to systems and methods for compressing data.
Software compression is very well understood and the source code for programs like GZIP are readily accessible in the public domain. The algorithm to implement compression is relatively complex to do in hardware for high bandwidth application given that the GZIP compression is based on the DEFLATE [2] algorithm and Huffman coding [3]. The idea behind compression is to use copy commands later in a data stream that appears earlier in the data stream. As such all compression implementations require a search history buffer and some type of compare length function to determine the longest length that can be used for the copy command. One method to implement the search matching in the previous history is to implement a hash function which maps the variable length string to fixed value which can be used to compare the data stream being compressed.
The systems and methods disclosed herein provide an improved method for hashing input data.
In order that the advantages of the invention will be readily understood, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered limiting of its scope, the invention will be described and explained with additional specificity and detail through use of the accompanying drawings, in which:
It will be readily understood that the components of the present invention, as generally described and illustrated in the Figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the invention, as represented in the Figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of certain examples of presently contemplated embodiments in accordance with the invention. The presently described embodiments will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout.
The invention has been developed in response to the present state of the art and, in particular, in response to the problems and needs in the art that have not yet been fully solved by currently available apparatus and methods.
Any combination of one or more computer-usable or computer-readable media may be utilized, including non-transitory media. For example, a computer-readable medium may include one or more of a portable computer diskette, a hard disk, a random access memory (RAM) device, a read-only memory (ROM) device, an erasable programmable read-only memory (EPROM or Flash memory) device, a portable compact disc read-only memory (CDROM), an optical storage device, and a magnetic storage device. In selected embodiments, a computer-readable medium may comprise any non-transitory medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, Smalltalk, C++, or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on a computer system as a stand-alone software package, on a stand-alone hardware unit, partly on a remote computer spaced some distance from the computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions or code. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a non-transitory computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Referring to
At step 302 a literal pair N at a current position P is retrieved. For the first literal pair P may be equal to zero. In the example of
An entry E in the hash table 204 at address Hash(N) may then be looked up 308. In the example of
The value of E may then be stored 310 in hash chain 206 at the position P. In the example of
If position P is the location of the last literal or literal pair, then the data file will be found 314 to be finished and the method will end. Otherwise, the value of P will be incremented to point to the next literal, i.e. P=P+1 literal position, and the method will continue at step 302. For example, for the string ‘abcd,’ the literal pair ‘ab’ will be processed first at P=0. At P=1, the literal pair ‘bc’ will be processed, and so on. Steps 314 and 316 may be executed even when the hash is determined 304 to be suppressed as shown in
In the example of
In response to detecting the next occurrence of ‘ab’ at position Z, the value Y is retrieved from address Hash(‘ab’) in the hash table 204. Accordingly, Y is written at location Z in the hash chain 206 and Z is written at address Hash(‘ab’) in the hash table.
As is readily apparent, the hash table 204 and hash chain 206 now relate an initial occurrence of a literal pair to one or more subsequent occurrences of that same literal pair. The value in the hash chain at position X points to position Y. Accordingly, when looking for strings beginning with the literals ‘ab’ pointers in the hash chain 206 that correspond to the positions of pairs giving the value Hash(‘ab’) may be followed without having to evaluate the entire original data set. As noted above, the manner by which the hash table 204 and/or hash chain 206 are processed to compress the original data set may include any method known in the art such as the LZ algorithm.
Referring to
An example of a circuit for generating a hash value is shown in
Referring to
A hash processor 500 may operate using the circuitry 500 shown in
In some embodiment, eight banks 508 of memory may be used along with eight FIFOs 506 to generate the hash data and smoothing functionality required to process five two byte pairs effectively generating four hash values. Each smoothing FIFO 506 may be implemented as a 16 deep FIFO for the 8 banks 508 of write memory to deal with the hash collisions when only four hashes are calculated. Any number of banks 508 of memory can be used along with any number of FIFOs 506 to generate the smoothing functionality of the hash collisions for any literal pair being hashed as long as it is more than the required number of hashes that need to be stored. For example, for applications requiring less bandwidth, two hashes can be generated using four bank 508 writes and FIFOs 506 rather than the eight in the example implementation. The smoothing FIFOs 506 may be implemented with a deeper or shallower depth than 16 before the hash processing is stopped because the FIFO 506 is full, as outlined in the method 600 of
The hash processor 500 may implement the method 600 shown in
In some embodiments, the run length hash suppression of steps 606-610 may be limited to every other character or n-multiple characters associated to a matching length window. For example, the evaluation 606 and possible suppression 610 may be performed every other character or every n characters, where n is an integer greater than two. In some embodiments, a run length command that indicates a string of repeated literals may refer to an initial instance of the repeated literal that immediately precedes the string of repeated literals or multiple literal positions offset from the string of repeated literals. Accordingly, determining that a literal is repeated at step 606 may include evaluating whether the literal is repeated at any arbitrary offset preceding the literal being processed in the current iteration of the method 600.
If more data is found 612 to remain in the file or string, then processing continues at step 604 with respect to the next literal pair in the string or file.
The method 600 may further include determining 616 whether the FIFO buffer 506 for a hash bank 508 is full. If so, then hash processing for that FIFO buffer 506 may be turned off 618 and processing continues at step 612. If not then the method may include determining 612 whether the data of the string or file is has all been processed, and if not, the generation of hashes and hash chains may continue at step 604. Otherwise, step 614 is performed for the string or file.
Computing device 700 includes one or more processor(s) 702, one or more memory device(s) 704, one or more interface(s) 706, one or more mass storage device(s) 708, one or more Input/Output (I/O) device(s) 710, and a display device 730 all of which are coupled to a bus 712. Processor(s) 702 include one or more processors or controllers that execute instructions stored in memory device(s) 704 and/or mass storage device(s) 708. Processor(s) 702 may also include various types of computer-readable media, such as cache memory.
Memory device(s) 704 include various computer-readable media, such as volatile memory (e.g., random access memory (RAM) 714) and/or nonvolatile memory (e.g., read-only memory (ROM) 716). Memory device(s) 704 may also include rewritable ROM, such as Flash memory.
Mass storage device(s) 708 include various computer readable media, such as magnetic tapes, magnetic disks, optical disks, solid-state memory (e.g., Flash memory), and so forth. As shown in
I/O device(s) 710 include various devices that allow data and/or other information to be input to or retrieved from computing device 700. Example I/O device(s) 710 include cursor control devices, keyboards, keypads, microphones, monitors or other display devices, speakers, printers, network interface cards, modems, lenses, CCDs or other image capture devices, and the like.
Display device 730 includes any type of device capable of displaying information to one or more users of computing device 700. Examples of display device 730 include a monitor, display terminal, video projection device, and the like.
Interface(s) 706 include various interfaces that allow computing device 700 to interact with other systems, devices, or computing environments. Example interface(s) 706 include any number of different network interfaces 720, such as interfaces to local area networks (LANs), wide area networks (WANs), wireless networks, and the Internet. Other interface(s) include user interface 718 and peripheral device interface 722. The interface(s) 706 may also include one or more user interface elements 718. The interface(s) 706 may also include one or more peripheral interfaces such as interfaces for printers, pointing devices (mice, track pad, etc.), keyboards, and the like.
Bus 712 allows processor(s) 702, memory device(s) 704, interface(s) 706, mass storage device(s) 708, and I/O device(s) 710 to communicate with one another, as well as other devices or components coupled to bus 712. Bus 712 represents one or more of several types of bus structures, such as a system bus, PCI bus, IEEE 1394 bus, USB bus, and so forth.
For purposes of illustration, programs and other executable program components are shown herein as discrete blocks, although it is understood that such programs and components may reside at various times in different storage components of computing device 700, and are executed by processor(s) 702. Alternatively, the systems and procedures described herein can be implemented in hardware, or a combination of hardware, software, and/or firmware. For example, one or more application specific integrated circuits (ASICs) can be programmed to carry out one or more of the systems and procedures described herein.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative, and not restrictive. The scope of the invention is, therefore, indicated by the appended claims, rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.
This application is a Continuation of U.S. application Ser. No. 14/824,703, filed Aug. 12, 2015, which issues as U.S. Pat. No. 9,934,234 on Apr. 3, 2018, which claims the benefit of U.S. Provisional Ser. No. 62/036,453, filed Aug. 12, 2014, and entitled Adaptive Rate Compression Hash Processor.
Number | Name | Date | Kind |
---|---|---|---|
4929946 | O'Brien et al. | May 1990 | A |
8766827 | Milne et al. | Jul 2014 | B1 |
20050283711 | Claseman | Dec 2005 | A1 |
20070109153 | Ma et al. | May 2007 | A1 |
20070168560 | Alkire | Jul 2007 | A1 |
20100182170 | Ylonen | Jul 2010 | A1 |
20130135121 | Glass et al. | May 2013 | A1 |
20140104085 | Cohen | Apr 2014 | A1 |
20140114937 | Chen | Apr 2014 | A1 |
20140307737 | Levy | Oct 2014 | A1 |
Number | Date | Country |
---|---|---|
04503421 | Jun 1992 | JP |
09036747 | Feb 1997 | JP |
Entry |
---|
Deutsch, “Deflate Compressed Data Format Specification version 1.3”. IETF. May 1996. p. 1. sec. Abstract. RFC 1951. |
Huffman, “A Method for the Construction of Minimum-Redundancy Codes” Proceedings of the IRE, 1952., pp. 1098-1101. |
Ziv, “Compression of Individual Sequences via Variable-Rate Coding”. IEEE Transactions on Information Theory, vol. 24, No. 5, Sep. 1978, 7 pp. |
Gailly, et al. GZIP: The Data Compression Program, 1993, http://www.gzip.org. |
International Search Report and Written Opinion from related international application No. PCT/US2015/044846, dated Nov. 6, 2015, 6 pp. |
Notice of Rejection Grounds from related Japanese patent application No. 2017-506990, dated Apr. 10, 2018, 6 pp. |
Number | Date | Country | |
---|---|---|---|
20180225298 A1 | Aug 2018 | US |
Number | Date | Country | |
---|---|---|---|
62036453 | Aug 2014 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 14824703 | Aug 2015 | US |
Child | 15943227 | US |