String search device and memory system

The character string search device in memory systems uses hash values and complementary data to balance high search performance with a reduced circuit scale, addressing the trade-off in existing dictionary encoding methods.

JP7562440B2Active Publication Date: 2024-10-07KIOXIA CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2021019009
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2024-10-07
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

Existing memory systems face a trade-off between high search performance and small circuit scale, making it difficult to achieve both simultaneously using dictionary encoding methods.

Method used

A character string search device that includes a storage section, conversion sections, a search section, a selection section, and an output section, utilizing hash values and complementary data to efficiently search and compare character strings, reducing the circuit scale while maintaining high search performance.

Benefits of technology

The proposed solution enables high search performance with a smaller circuit scale by using hash values and complementary data to efficiently search and compare character strings, outperforming existing methods in terms of circuit scale and search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007562440000001
    Figure 0007562440000001
  • Figure 0007562440000002
    Figure 0007562440000002
  • Figure 0007562440000003
    Figure 0007562440000003
Patent Text Reader

Abstract

To provide a character string search device and a memory system capable of realizing high search performance with a small circuit scale.SOLUTION: In an embodiment, a storage unit stores a first hash value and first complementary data corresponding to characters included in a previously input first character string. A first conversion unit converts characters included in the input second character string into a second hash value and second complementary data. A search unit searches the storage unit for consecutive first hash values that match at least a part of the converted consecutive second hash values, and outputs a pointer. A selection unit selects the first hash value and the first complementary data from the storage unit on the basis of the pointer. A second conversion unit converts the first hash value into a third character string using the first complementary data. A comparison unit compares the second character string and the third character string and obtains a match length. An output unit outputs the match length together with the pointer.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present embodiment relates to a string search device and a memory system. [Background technology]

[0002] In recent years, memory systems having a function of compressing data have become known in order to make effective use of storage areas. In such memory systems, when a write command is issued from a host connected to the memory system, data specified in the write command can be compressed and written to a non-volatile memory.

[0003] Dictionary coding is known as an encoding method used for compressing data. In dictionary coding, a buffer is used in which past data (character strings) called a dictionary is stored for a certain period of time, and past data that matches at least a part of the input data (character string) is searched for in the buffer. If past data that matches at least a part of the input data exists in the buffer, the position of the past data in the buffer (hereinafter referred to as a pointer) and the length of the match between the input data and the past data (hereinafter referred to as a match length) are output. Dictionary coding is a method for reducing the amount of code by replacing the input data with a pointer and a match length in this way. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] U.S. Patent No. 7,233,265 [Patent Document 2] U.S. Pat. No. 5,140,321 Summary of the Invention [Problem to be solved by the invention]

[0005] Therefore, an object of the present invention is to provide a character string search device and a memory system that can achieve high search performance with a small circuit scale. [Means for solving the problem]

[0006] A string search device according to an embodiment includes a storage unit, a first conversion unit, a search unit, a selection unit, a second conversion unit, a comparison unit, and an output unit. The storage unit stores, for each character, a first hash value corresponding to each of a plurality of consecutive characters included in a first string previously input, and first complement data corresponding to the first hash value for converting the first hash value into the character. The first conversion unit converts each of a plurality of consecutive characters included in an input second string into a second hash value corresponding to the character, and second complement data corresponding to the second hash value for converting the second hash value into the character. The search unit searches the storage unit for consecutive first hash values ​​that match at least a part of the converted consecutive second hash values, and outputs a pointer indicating a position in the storage unit where the consecutive first hash values ​​are stored. The selection unit selects, based on the pointer, consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values ​​from the storage unit. The second conversion unit converts the selected consecutive first hash values ​​into a third string including consecutive characters using the selected plurality of first complement data. The comparison unit compares the second string and the third string to obtain a matching length indicating a length of matching characters. The output unit outputs the matching length together with the pointer. [Brief description of the drawings]

[0007] [Figure 1] FIG. 2 is a block diagram illustrating an example of a hardware configuration of a memory system according to the first embodiment. [Diagram 2] 1 is a diagram for explaining an overview of dictionary-based coding used in a compression method in a memory system of a comparative example. [Diagram 3]FIG. 1 is a block diagram showing an example of the configuration of a string search device according to a first embodiment. [Figure 4] FIG. 2 is a diagram showing an overview of hash conversion and complementary data conversion in the first embodiment. [Diagram 5] FIG. 4 is a diagram showing an example of a hash transform in the first embodiment. [Figure 6] FIG. 4 is a diagram showing an example of complementary data conversion in the first embodiment. [Figure 7] FIG. 2 is a diagram showing an overview of an inverse hash transform in the first embodiment. [Figure 8] FIG. 4 is a diagram showing an example of an inverse hash transform in the first embodiment. [Figure 9] FIG. 4 is a diagram for explaining a first comparative example of the first embodiment. [Figure 10] FIG. 11 is a diagram for explaining a second comparative example of the first embodiment. [Figure 11] FIG. 4 is a diagram for explaining the circuit scales of the first embodiment and the second comparative example. [Figure 12] FIG. 11 is a block diagram showing an example of the configuration of a string search device according to a second embodiment. [Figure 13] FIG. 13 is a block diagram showing an example of the configuration of a string search device according to a third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0008] Each embodiment will be described below with reference to the drawings. (First embodiment) First, a description will be given of a first embodiment. Fig. 1 is a block diagram illustrating an example of a hardware configuration of a memory system according to the first embodiment.

[0009] 1 is a semiconductor storage device configured to write data (user data) to a nonvolatile memory and read data from the nonvolatile memory. This memory system 1 can be realized as, for example, a solid state drive (SSD).

[0010] The memory system 1 is configured to be connectable to a host via a system bus such as a PCI Express bus. As shown in Fig. 1, the memory system 1 includes a controller 2, a NAND flash memory 3, and a DRAM (Dynamic Random Access Memory) 4.

[0011] The controller 2 has a function of controlling the operation of the memory system 1. The controller 2 includes a host interface (I / F) 2a, a CPU 2b, a NAND interface (I / F) 2c, and a DRAM interface (I / F) 2d. The host interface 2a, the CPU 2b, the NAND interface 2c, and the DRAM interface 2d are connected to each other via, for example, a bus.

[0012] The host interface 2a is a host interface circuit configured to perform communication with a host located outside the memory system 1. The host interface 2a may be, for example, a PCI Express controller. The host interface 2a receives various commands (requests) from the host.

[0013] The CPU 2b is a processor configured to control the host interface 2a, the NAND interface 2c, and the DRAM interface 2d. In response to power-on of the memory system 1, the CPU 2b loads a control program (firmware) from the NAND flash memory 3 or a ROM (Read Only Memory) (not shown) into the DRAM 4, and executes the control program to perform various processes. Specifically, the CPU 2b executes processes for various commands issued by the host. Note that a part or all of the processes for commands issued by the host may be executed by dedicated hardware in the controller 2.

[0014] The NAND interface 2c is a memory control circuit configured to control the NAND flash memory 3 under the control of the CPU 2b.

[0015] Furthermore, the controller 2 includes a compression device (compressor) 2e and an expansion device (expandor) 2f.

[0016] The compression device 2e is used, for example, when a write command is issued from the host, to input data specified in the write command and compress the data. The compression device 2e compresses data using a compression method that combines dictionary coding and entropy coding. After the data compressed in the compression device 2e (hereinafter referred to as compressed data) is output from the compression device 2e, a predetermined process such as error correction process and randomization process is performed on the data. The CPU 2b writes the data that has been subjected to the predetermined process to the NAND type flash memory 3 via the NAND interface 2c. That is, the CPU 2b writes data based on the compressed data output from the compression device 2e to the NAND type flash memory 3.

[0017] When the CPU 2b reads compressed data from the NAND flash memory 3 based on a read command received from the host via the host interface 2a, for example, the CPU 2b reads data based on the read command from the NAND flash memory 3 via the NAND interface 2c. The read data is subjected to predetermined processes such as error correction and randomization cancellation, and then inputted as compressed data by the CPU 2b to the decompression device 2f, which decompresses the inputted compressed data. That is, the decompression device 2f decompresses the compressed data based on the data read from the NAND flash memory 3.

[0018] The NAND flash memory 3 is a non-volatile memory having a memory cell array including a plurality of memory cells arranged in a matrix. The NAND flash memory 3 may be a two-dimensional NAND flash memory or a three-dimensional NAND flash memory.

[0019] The memory cell array of the NAND flash memory 3 includes a plurality of blocks BLK0 to BLKm-1. Each of the blocks BLK0 to BLKm-1 is organized into a number of pages (here, pages P0 to Pn-1). The blocks BLK0 to BLKm-1 function as an erase unit. Each of the pages P0 to Pn-1 includes a plurality of memory cells connected to the same word line. The pages P0 to Pn-1 are the units of data write and read operations.

[0020] Here, the memory system 1 has been described as having a NAND type flash memory 3, but the memory system 1 may also be configured to have a non-volatile memory such as PCM (Phase Change Memory) or MRAM (Magnetoresistive random access memory).

[0021] The DRAM 4 is a volatile memory, and functions as, for example, a temporary buffer for software executed in the controller 2 (CPU 2b) or a temporary buffer for the NAND flash memory 3.

[0022] Here, the memory system 1 has been described as including the DRAM 4, but the memory system 1 may be configured to include, for example, a static random access memory (SRAM) as a volatile memory.

[0023] In addition, in FIG. 1, the compression device 2e and the decompression device 2f are described as being incorporated into the controller 2, but one or both of the compression device 2e and the decompression device 2f may be provided outside the memory system 1 or the controller 2.

[0024] Below, an overview of dictionary-based coding used in the compression method in the memory system of the comparative example will be described with reference to Fig. 2. Here, data input as a target for dictionary-based coding is referred to as input data, and the input data will be described as a character string (text data) including multiple consecutive characters.

[0025] Here, dictionary coding is an encoding technique that converts input data into a relative reference to data that was input as a target for dictionary coding before the input data (i.e., data that was input in the past).

[0026] For this reason, in dictionary-based coding, previously input data (character strings) are stored in a storage unit called a dictionary (hereinafter referred to as a dictionary buffer), and a search (search) is performed to see if data (forward data) matching all or part of the input data exists in the dictionary buffer. If data matching all or part of the input data exists in the dictionary buffer, a pointer indicating the position of the data in the dictionary buffer and a matching length indicating the length of the matching characters between the input data and the data searched for in the dictionary buffer are output.

[0027] In Fig. 2, the input data (character string) is "caba", and the dictionary buffer stores "...cacabe..." as previously input data (character string). According to the example shown in Fig. 2, (a part of) the input data "caba" matches the two characters "ca" and the three characters "cab" in the history buffer. Since the coding efficiency can be increased if a longer part of the input data can be replaced with a relative reference, here "cab" in the dictionary buffer is selected as data that matches part of the input data (hereinafter referred to as dictionary data).

[0028] The pointer (address) indicating the position of the dictionary data ("cab") selected in this way in the dictionary buffer is assumed to be "100." In addition, since the input data and the dictionary data match "cab," the above-mentioned matching length is "3 (characters)."

[0029] In this case, as a result of dictionary-based encoding of the input data "caba", a set of match length and pointer (3,100) is output to the subsequent stage.

[0030] The input data described above corresponds to a portion of the data (data of a predetermined size) constituting the data (hereinafter referred to as write data) specified in a write command issued by the host, and in dictionary-based encoding, each piece of data constituting the write data is input consecutively from the beginning of the write data, and the input data is encoded sequentially.

[0031] In the example shown in FIG. 2, the final "a" in the input data "caba" that does not match the dictionary data is treated as the next input data together with the subsequent data, and the process is repeated.

[0032] FIG. 2 describes a case where dictionary data matching all or part (i.e., at least part) of the input data exists in the dictionary buffer. However, if the dictionary data does not exist, the input data (raw data) is output to the subsequent stage as the result of dictionary-based encoding.

[0033] In the following description, a set of a matching length and a pointer output as a result of dictionary-based encoding is referred to as matching character data, and raw data output as a result of the dictionary-based encoding is referred to as unmatched character data.

[0034] The dictionary coding described above is a coding method that searches for newly input data (character strings) from past data (character strings) stored in a dictionary buffer, and replaces the data with the position (pointer) of the searched data and the length (matching length) of characters that match between the input data and the past data, thereby reducing the amount of code. Therefore, in dictionary coding, a technique for efficiently searching for past data that matches at least a part of the input data from among data stored in the dictionary buffer is important.

[0035] However, for example, when a high throughput is required from an information processing system (host) equipped with the memory system 1, in order to improve the above-mentioned search performance, it is necessary to prepare circuits that operate in parallel, which increases the circuit scale. On the other hand, if an attempt is made to suppress the circuit scale, the search performance (and throughput) decreases. In other words, there is a trade-off between search performance and circuit scale, and it is difficult to achieve high search performance with a small circuit scale.

[0036] Therefore, in this embodiment, a configuration is adopted for achieving high search performance for dictionary coding with a small circuit scale.

[0037] As described above, in the compression device 2e of this embodiment, data is compressed by a compression method that combines dictionary coding and entropy coding, for example, and the compression device 2e is equipped with a device that searches for a string from a dictionary buffer and performs dictionary coding (hereinafter referred to as a string search device) and a device that performs entropy coding on the result of the dictionary coding (hereinafter referred to as an entropy coding device).

[0038] Entropy coding is an encoding method that reduces the overall amount of code (i.e., compresses) by assigning codes of different code lengths to data by utilizing differences in the frequency of occurrence of data, and is executed after the dictionary-based encoding. In this case, for example, a process is executed in which short codes are assigned to matching character data and non-matching character data that occur frequently, and long codes are assigned to matching character data and non-matching character data that occur less frequently.

[0039] For example, Huffman coding is used as the entropy coding. When Huffman coding is used as the entropy coding, the Huffman coding may be static Huffman coding in which coding is performed using a pre-constructed code tree, or dynamic Huffman coding in which the code tree is changed according to matching character data and non-matching character data input as targets for Huffman coding. For example, arithmetic coding or the like may be used as the entropy coding.

[0040] The string search device according to this embodiment will be described in detail below. Fig. 3 is a block diagram showing an example of the configuration of the string search device according to this embodiment.

[0041] As shown in FIG. 3, the string search device 10 includes a dictionary buffer (dictionary section) 11, a hash conversion section 12, a full hash search section 13, a dictionary data selection section 14, a first inverse hash conversion section 15, a dictionary comparison section 16, a maximum match length determination section 17, and a second inverse hash conversion section 18.

[0042] The dictionary buffer 11 stores, for each of a plurality of consecutive characters included in a character string (past character string data) previously input to the character string search device 10 (compression device 2e), a hash value corresponding to each of the consecutive characters and complementary data corresponding to the hash value. In this embodiment, the complementary data corresponds to inverse hash conversion data used to inversely convert a corresponding hash value into a character (i.e., to restore the character from the hash value).

[0043] In the following description, a set of a hash value corresponding to a predetermined character and complementary data corresponding to the hash value is conveniently referred to as converted character data. That is, past converted character data (converted character data corresponding to characters included in character strings previously input) is stored in dictionary buffer 11. It is also assumed that the converted character data corresponding to each character is stored in dictionary buffer 11 in the order in which the characters were input to string search device 10.

[0044] The hash conversion unit 12 receives a character string newly input to the character string search device 10 (hereinafter referred to as an input character string) as input data. The input character string is made up of a plurality of consecutive characters, each of which is represented by, for example, 8 bits (1 byte). The number of characters making up the input character string is, for example, 8, 16, or 32, but may be another number.

[0045] The hash conversion unit 12 applies hash conversion to each character included in the input string (i.e., executes a hash conversion process). As a result, the hash conversion unit 12 converts each of multiple consecutive characters included in the input string into a hash value corresponding to that character (i.e., generates a hash value from that character).

[0046] The hash value converted by the hash conversion unit 12 has a bit width smaller than the bit width (number of bits) of the character converted to the hash value. The hash conversion is performed by a certain calculation, and the hash value (the value of each bit constituting the hash value) reflects the values ​​of all bits of the character converted to the hash value.

[0047] At the same time, the hash conversion unit 12 applies the complementary data conversion to each character included in the input string (i.e., executes the complementary data conversion process), whereby the hash conversion unit 12 converts each of the consecutive characters included in the input string into complementary data (i.e., generates complementary data from the characters).

[0048] In addition, the complementary data can be defined as having a bit width smaller than the bit width (number of bits) of the character to be converted into the complementary data. For example, it is preferable that the total bit width of the hash value and complementary data converted from one character by the hash conversion unit 12 is the same as the bit width of the character.

[0049] Here, Fig. 4 shows an overview of the above-mentioned hash conversion and complementary data conversion. In the example shown in Fig. 4, it is assumed that a character (data) is represented by 8 bits (1 byte), and the 8-bit character (data) is converted into a 3-bit hash value and the 8-bit character is converted into 5-bit complementary data.

[0050] Fig. 5 shows an example of hash conversion. Here, it is assumed that the character to be converted into a hash value is expressed in 8 bits, "D0 D1 D2 D3 D4 D5 D6 D7". Each of D0 to D7 corresponds to one of the 8 bits (0 or 1) that make up the character.

[0051] When hash conversion is applied to such characters, a 3-bit hash value of "H0 H1 H2" shown in Figure 5 is generated. Each of H0 to H2 corresponds to one of the 3 bits that make up the hash value.

[0052] Specifically, "H0 (the first bit of the hash value)" is calculated (determined) by taking the exclusive OR of the characters "D1," "D2," and "D3." Additionally, "H1 (the second bit of the hash value)" is calculated (determined) by taking the exclusive OR of the characters "D4," "D5," and "D6." Similarly, "H2 (the last bit of the hash value)" is calculated (determined) by taking the exclusive OR of the characters "D0," "D4," and "D7."

[0053] According to this, the 8-bit character "D0 D1 D2 D3 D4 D5 D6 D7" can be converted into a 3-bit hash value "H0 H1 H2." Note that this hash value reflects the values ​​of all bits (D0 to D7) that make up the character.

[0054] On the other hand, Fig. 6 shows an example of the complementary data conversion. As described above, when a character is expressed by 8 bits of "D0 D1 D2 D3 D4 D5 D6 D7" and complementary data conversion is applied to such a character, a 5-bit hash value of "I0 I1 I2 I3 I4" shown in Fig. 6 is generated. Each of I0 to I4 corresponds to one of the 5 bits that make up the complementary data.

[0055] Specifically, "I0 (the first bit of the supplementary data)" is calculated (determined) by the exclusive OR of "D4" and "D7", which make up a character. Furthermore, "I1 (the second bit of the supplementary data)" is assumed to be the same as "D2", which makes up a character. Furthermore, "I2 (the third bit of the supplementary data)" is assumed to be the same as "D3", which makes up a character. Furthermore, "I3 (the fourth bit of the supplementary data)" is assumed to be the same as "D6", which makes up a character. Similarly, "I4 (the last bit of the supplementary data)" is assumed to be the same as "D7", which makes up a character.

[0056] This allows a character expressed in 8 bits, "D0 D1 D2 D3 D4 D5 D6 D7," to be converted into 5-bit complementary data, "I0 I1 I2 I3 I4."

[0057] Here, we have explained the case where the total bit width of the hash value and complementary data converted (generated) from a character (i.e., the bit width of the converted character data) matches the bit width of the character, but if the hash value and complementary data are each generated with a bit width smaller than the character, the total bit width of the hash value and complementary data may be larger than the bit width of the character.

[0058] 3, hash conversion unit 12 outputs the hash values ​​converted from each of the characters included in the input character string and complementary data (converted character data) to dictionary buffer 11. This converted character data is stored in dictionary buffer 11 as past converted character data. The converted character data stored in dictionary buffer 11 in this manner is also output to second inverse hash conversion unit 18.

[0059] Incidentally, converted character data is stored in dictionary buffer 11 for each character included in an input character string, but the number of converted character data stored in dictionary buffer 11 is limited to a fixed value according to the size of an area allocated to dictionary buffer 11. In other words, dictionary buffer 11 is configured to store a fixed number of converted character data. For this reason, when a fixed number of converted character data is already stored in dictionary buffer 11, the old converted character data is discarded or overwritten.

[0060] The hash conversion unit 12 also outputs to the hash exhaustive search unit 13 successive hash values ​​(3 bits) converted from each of the characters included in the input character string.

[0061] Here, all hash values ​​stored in the dictionary buffer 11 are output from the dictionary buffer 11 to the hash exhaustive search unit 13, and the hash exhaustive search unit 13 determines whether or not each of the consecutive hash values ​​output from the hash conversion unit 12 matches each of the hash values ​​output from the dictionary buffer 11. In this case, the hash exhaustive search unit 13 performs a brute force match determination (comparison) to search for all hash values ​​that match each of the hash values ​​output from the hash conversion unit 12 from among the hash values ​​output from the dictionary buffer 11.

[0062] As described above, the dictionary buffer 11 stores converted character data (hash values ​​and complementary data) obtained by converting characters included in previously input character strings in the order in which they were input (i.e., consecutive hash values ​​are output from the dictionary buffer 11), and the hash full search unit 13 can search for consecutive hash values ​​output from the dictionary buffer 11 that match at least a part of the consecutive hash values ​​output from the hash conversion unit 12 based on the result of the match determination described above (i.e., a portion of the consecutive hash values ​​output from the dictionary buffer 11 that matches at least a part of the consecutive hash values ​​output from the hash conversion unit 12). Note that "matching at least a part of the consecutive hash values ​​output from the hash conversion unit 12" means that a predetermined number or more of hash values ​​(characters) match among the consecutive hash values ​​in the same order as the consecutive hash values ​​output from the hash conversion unit 12.

[0063] The consecutive hash values ​​thus found are considered to be hash values ​​corresponding to character strings that are likely to match the input character string (i.e., matching candidates). Therefore, the hash exhaustive search unit 13 outputs a pointer indicating the position in the dictionary buffer 11 of the consecutive hash values ​​thus found to the dictionary data selection unit 14.

[0064] The pointer indicating the position in dictionary buffer 11 of the consecutive hash values ​​detected by hash full search unit 13 can be determined based on the order in which the hash values ​​are output from dictionary buffer 11. The pointer indicating the position in dictionary buffer 11 of the consecutive hash values ​​is, for example, the address in dictionary buffer 11 where the first hash value of the consecutive hash values ​​is stored.

[0065] In addition, when the hash exhaustive search unit 13 searches for multiple consecutive hash values ​​(parts where a predetermined number or more of hash values ​​match), a pointer (i.e., multiple pointers) for each of the consecutive hash values ​​is output from the hash exhaustive search unit 13 to the dictionary data selection unit 14.

[0066] Here, all converted character data (hash values ​​and complementary data) stored in dictionary buffer 11 is output from dictionary buffer 11 to dictionary data selection unit 14, and dictionary data selection unit 14 selects consecutive converted character data (consecutive hash values ​​and multiple complementary data corresponding to each of the consecutive hash values) from the converted character data output from dictionary buffer 11, based on the pointer output from hash full search unit 13.

[0067] Note that the pointer output from hash exhaustive search unit 13 indicates a position (address) in dictionary buffer 11 where the first hash value of the consecutive hash values ​​detected by hash exhaustive search unit 13 is stored as described above, for example, and dictionary data selection unit 14 selects a number of consecutive converted character data corresponding to the maximum match length from the position indicated by the pointer. Note that (a number corresponding to) the maximum match length is, for example, the number of characters included in the input character string, but may be other than the number of characters included in the input character string. Also, although it has been described here that a number of consecutive converted character data corresponding to the maximum match length is selected from the position indicated by the pointer, for example, only converted character data including consecutive hash values ​​searched for by hash exhaustive search unit 13 (i.e., a portion matching consecutive hash values ​​converted by hash conversion unit 12) may be selected.

[0068] The dictionary data selection unit 14 outputs the selected consecutive converted character data (converted character data string) together with the pointer output from the hash full search unit 13 to the first inverse hash conversion unit 15.

[0069] Note that, although it has been described here that all converted character data is output from dictionary buffer 11 to dictionary data selection unit 14, and dictionary data selection unit 14 selects converted character data based on the pointer output from hash full search unit 13, a configuration in which the pointer is output from hash full search unit 13 to dictionary buffer 11, and converted character data based on the pointer is output from dictionary buffer 11 to first inverse hash conversion unit 15. In such a configuration, dictionary data selection unit 14 may be omitted.

[0070] First inverse hash transformation unit 15 applies inverse hash transformation to each of the consecutive converted character data output from dictionary data selection unit 14 (i.e., executes an inverse hash transformation process). In the inverse hash transformation, as described above, the hash value included in the converted character data is converted into a character using complementary data included in the converted character data. In this way, first inverse hash transformation unit 15 converts the consecutive converted character data output from dictionary data selection unit 14 into a character string including consecutive characters (hereinafter referred to as a converted character string).

[0071] Here, Fig. 7 shows an overview of the inverse hash conversion. In the example shown in Fig. 7, it is shown that a 3-bit hash value is converted into an 8-bit character (data) using the 5-bit complementary data explained in Fig. 4 and the like.

[0072] Fig. 8 shows an example of the inverse hash conversion, in which the hash value described in Fig. 5 is converted into characters using the complementary data described in Fig. 6.

[0073] Specifically, when a character is expressed by 8 bits of "D0 D1 D2 D3 D4 D5 D6 D7" as described above, "D0" is calculated by the exclusive OR of "H2" constituting the hash value and "I0" constituting the complementary data. Furthermore, "D1" is calculated by the exclusive OR of "H0" constituting the hash value and "I1" and "I2" constituting the complementary data. Furthermore, "D2" is assumed to be the same as "I1" constituting the complementary data. Furthermore, "D3" is assumed to be the same as "I2" constituting the complementary data. Furthermore, "D4" is calculated by the exclusive OR of "I0" and "I4" constituting the complementary data. Furthermore, "D5" is calculated by the exclusive OR of "H1" constituting the hash value and "I0", "I3", and "I4" constituting the complementary data. Furthermore, "D6" is assumed to be the same as "I3" constituting the complementary data. Furthermore, "D7" is assumed to be the same as "I4" constituting the complementary data.

[0074] According to this, the 3-bit hash value "H0 H1 H2" can be converted into the 8-bit character "D0 D1 D2 D3 D4 D5 D6 D7" using the 5-bit complementary data "I0 I1 I2 I3 I4".

[0075] Returning to FIG. 3 again, first inverse hash conversion unit 15 outputs the converted character string converted from consecutive converted character data to dictionary comparison unit 16 together with the pointer output from dictionary data selection unit 14 together with the converted character data.

[0076] In addition, when multiple pointers are output from hash full search unit 13 as described above, consecutive converted character data for each of the pointers is output from dictionary data selection unit 14, and first inverse hash conversion unit 15 outputs multiple converted character strings for each of the consecutive converted character data. In this case, first inverse hash conversion unit 15 operates with a conversion throughput based on the number of converted character data strings output from dictionary data selection unit 14 (i.e., the number of matching candidates) x the maximum matching length (i.e., the number of converted character data in the converted character data strings).

[0077] The dictionary comparison unit 16 acquires (inputs) an input string, and compares the input string with the converted string output from the first inverse hash conversion unit 15. In this way, the dictionary comparison unit 16 determines matching characters between the input string and the converted string, and acquires a matching length indicating the length of the matching characters.

[0078] The dictionary comparison unit 16 outputs the acquired match length together with the converted string and the pointer output from the first inverse hash conversion unit 15 to the maximum match length determination unit 17. Note that when multiple converted strings are output from the first inverse hash conversion unit 15, the match length and the pointer are output for each converted string.

[0079] Maximum matching length determination unit 17 determines the maximum matching length from among the matching lengths output for each converted character string as described above. Maximum matching length determination unit 17 selects the matching length determined as the maximum matching length and the pointer output from dictionary comparison unit 16 together with the matching length, and outputs the selected matching length and pointer as matching character data.

[0080] As described above, the converted character data stored in dictionary buffer 11 is output to second inverse hash conversion unit 18, which applies inverse hash conversion to the converted character data. Note that the inverse hash conversion applied to the converted character data by second inverse hash conversion unit 18 is similar to the inverse hash conversion in first inverse hash conversion unit 15 described above, and therefore a detailed description thereof will be omitted here.

[0081] Furthermore, dictionary buffer 11 outputs converted character data corresponding to each of the multiple characters included in the input string (i.e., consecutive converted character data) to second inverse hash conversion unit 18, and second inverse hash conversion unit 18 applies an inverse hash conversion to each of the consecutive converted character data, thereby outputting the input string (a string equivalent to the input string) as mismatched character data.

[0082] As described above, the matching character data and mismatching character data are output from the string search device 10 according to this embodiment, and the matching character data and mismatching character data are output in accordance with the throughput required for the string search device 10 (compression device 2e).

[0083] Furthermore, according to the configuration shown in FIG. 3, all of the input character strings are output as mismatched character data, but a selector or the like that selects either the matching character data (matching length and pointer) or the mismatched character data (input character string) is provided in the subsequent stage of the string search device 10.

[0084] According to this, for example, when matching character data is output from maximum matching length determination unit 17 (i.e., the input character string has been replaced with matching character data), the matching character data is selected by the selector and the matching character data is passed to the entropy encoding device described above. On the other hand, for example, when consecutive hash values ​​that match at least a part of consecutive hash values ​​output from hash conversion unit 12 do not exist in dictionary buffer 11, the input character string cannot be replaced with matching character data, but in this case the mismatching character data is selected by the selector and the mismatching character data is passed to the entropy encoding device.

[0085] Although the above-described selector is assumed to be provided outside the string search device 10, it may be provided inside the string search device 10. That is, the string search device 10 according to the present embodiment may be configured to output one of matching character data and matching character data depending on whether or not the input string has been replaced with matching character data. Furthermore, for example, when matching character data is output from maximum matching length determination unit 17 (that is, the input string is replaced with matching character data), the process of second inverse hash conversion unit 18 may be omitted.

[0086] The entropy coding device provided in the compression device 2e together with the string search device 10 performs entropy coding on the above-mentioned matching character data and mismatching character data. The result of the entropy coding (i.e., compressed data based on the matching character data and mismatching character data) is written to the NAND flash memory 3. Note that the compressed data written to the NAND flash memory 3 may be provided with, for example, error correction parity (ECC parity).

[0087] Here, the compression device 2e (the string search device 10 and the entropy coding device) has been described. On the other hand, when a read command is issued from the host, the decompression device 2f executes processing on the compressed data. When a read command is issued from the host, data read from the NAND flash memory 3 based on the read command is input to the decompression device 2f by the CPU 2b as compressed data after predetermined processing such as error correction processing and randomization cancellation processing is executed on the read data. Then, the decompression device 2f executes entropy decoding and dictionary-based decoding on the input compressed data.

[0088] As described above, in this embodiment, hash values ​​(first hash values) corresponding to each of a plurality of consecutive characters included in a previously input character string (first character string) and complementary data (first complementary data) for converting the hash values ​​into characters are stored in the dictionary buffer 11 (storage unit), and each of a plurality of consecutive characters included in an input character string (second character string) is converted into a hash value (second hash value) corresponding to the character and complementary data (second complementary data) for converting the hash values ​​into characters, and consecutive hash values ​​that match at least a part of the converted consecutive hash values ​​are searched for in the dictionary buffer 11, and a pointer indicating the position in the dictionary buffer 11 where the consecutive hash values ​​are stored is output. In this embodiment, consecutive hash values ​​and a plurality of complementary data corresponding to each of the consecutive hash values ​​are selected from the dictionary buffer 11 based on the pointer, and the selected consecutive hash values ​​are converted into a converted character string (third character string) using the selected complementary data. Furthermore, in this embodiment, a matching length indicating the length of the matching characters is obtained by comparing the input character string and the converted character string, and the matching length is output together with the above-mentioned pointer.

[0089] In this embodiment, with such a configuration, high search performance can be achieved with a small circuit scale.

[0090] Here, the circuit scale and search performance of the string search device 10 according to this embodiment will be described using a comparative example for the string search device according to this embodiment.

[0091] First, an overview of a string search device of a first comparative example will be described. Fig. 9 shows an example of the configuration of a device (hereinafter, referred to as a string search device of a first comparative example) that performs a string search (dictionary-based coding) using a method called "full search" (hereinafter, referred to as "full search" method).

[0092] As shown in FIG. 9, a string search device 100 of the first comparative example includes a dictionary buffer 101, a string exhaustive search unit 102, and a maximum match length determination unit 103.

[0093] Unlike the dictionary buffer 11 in this embodiment, the dictionary buffer 101 in the string search device 100 in the first comparative example stores previously input strings (each of a plurality of consecutive characters contained therein).

[0094] The string full search unit 102 performs a brute force match determination (comparison) to search for all characters contained in the string output from the dictionary buffer 101 that match each of the characters contained in the input string.

[0095] The maximum matching length determination unit 103 identifies the part with the longest matching length (a string containing consecutive characters) among the parts where a predetermined number or more of characters match in the same order as the consecutive characters contained in the input string, and outputs the matching length and a pointer indicating the position in dictionary buffer 101 where the string is stored as matching character data.

[0096] The input character string is stored in the dictionary buffer 101 and is also output from the dictionary buffer 101 as unmatched character data.

[0097] Assuming that each of the multiple characters contained in the input string (and the string stored in the dictionary buffer 101) is represented by 8 bits (1 byte) as described in this embodiment, the above-mentioned string full search unit 102 is provided with 8-bit comparators in the number of "input data size (i.e., the number of characters contained in the input string) x dictionary data size (i.e., the number of characters contained in the string stored in the dictionary buffer 101)" to compare the characters contained in the input string with the characters contained in the string stored in the dictionary buffer 101. In such a configuration, the circuit scale of the string search device 100 of the first comparative example increases in proportion to both the input data size (input throughput) and the dictionary data size.

[0098] Generally, the larger the area allocated to the dictionary buffer 11, the higher the coding performance because it is possible to search for character strings with more matching characters (i.e., longer matching lengths). However, increasing the size of the area allocated to the dictionary buffer 11 causes an increase in the circuit scale.

[0099] In contrast, in this embodiment, a hash value corresponding to a character included in an input string is compared with a hash value stored in the dictionary buffer 11, and the number of bits of the hash value is, for example, 3 bits, which is smaller than the number of bits of a character (for example, 8 bits). Accordingly, in this embodiment, a 3-bit comparator can be used to compare hash values, so the circuit scale of the hash exhaustive search unit 13 included in the string search device 10 according to this embodiment is smaller than the string exhaustive search unit 102 included in the string search device 100 of the above-mentioned first comparative example. Since the above-mentioned comparator has a large effect on the circuit scale, as a result, the circuit scale of the string search device 10 according to this embodiment is also smaller than that of the string search device 100 of the first comparative example.

[0100] Furthermore, in order to avoid an increase in circuit size as in the string search device 100 of the first comparative example described above, a device (hereinafter referred to as the string search device of the second comparative example) that performs string search (dictionary-based encoding) using a method that uses a hash table (hereinafter referred to as the "hash table" method) is known.

[0101] Fig. 10 shows an example of the configuration of a string search device 110 of the second comparative example. As shown in Fig. 10, the string search device 110 of the second comparative example includes a dictionary buffer 111, a hash table unit 112, a hash conversion unit 113, a hash reading unit 114, a dictionary data selection unit 115, a dictionary comparison unit 116, and a maximum match length determination unit 117.

[0102] In the same manner as in the above-described first comparative example, previously input character strings (each of a plurality of consecutive character strings contained therein) are stored in dictionary buffer 111 in string search device 110 in the second comparative example. Note that input character strings are stored in dictionary buffer 11 and are also output from dictionary buffer 111 as mismatched character data.

[0103] In hash table unit 112, a pointer is written that indicates the position in dictionary buffer 111 where a previously input character string (a predetermined number of characters) is stored, using a hash value corresponding to the character string as an index.

[0104] The hash conversion unit 113 converts an input character string (input data) of several bytes into a hash value, and outputs the hash value to the hash table unit 112 and the hash reading unit 114 .

[0105] A pointer indicating the position in dictionary buffer 111 where the several-byte input character string converted into the hash value output from hash conversion unit 113 to hash table unit 112 is stored is written to a table entry in hash table unit 112 referenced by an index specified by the hash value. If a pointer is already held in a table entry in hash table unit 112 that uses the hash value output from hash conversion unit 113 as an index, the latest pointer is held in that table entry. Also, hash table unit 112 may hold multiple pointers that use one hash value as an index.

[0106] The hash reading unit 114 uses the hash value output from the hash conversion unit 113 as an index to read all pointers written in the hash table unit 112 (that is, pointers in the table entries).

[0107] The dictionary data selection unit 115 selects character strings (dictionary data) stored in the dictionary buffer 111 according to the pointer read from the hash table unit 112 by the hash reading unit 114 .

[0108] The dictionary comparison unit 116 receives an input character string and compares the input character string with the character string selected by the dictionary data selection unit 115. In this way, the dictionary comparison unit 116 obtains a matching length indicating the length of characters that match between the input character string and the character string selected by the dictionary data selection unit 115.

[0109] The maximum matching length determination unit 117 determines the maximum matching length from among the matching lengths obtained by the dictionary comparison unit 116 for each character string selected by the dictionary data selection unit 115, and outputs the matching length determined to be the maximum matching length and a pointer corresponding to the matching length (a pointer indicating the position in the dictionary buffer 111 of the character string with the maximum matching length) as matching character data.

[0110] Here, when comparing string search device 100 of the above-mentioned first comparative example (the "full search" method) with string search device 110 of the second comparative example (the "hash table" method), from the viewpoint of generating a matching length between an input string and a string in a dictionary buffer, it can be said that string search unit 102 of the first comparative example and dictionary comparison unit 116 of the second comparative example have corresponding configurations.

[0111] However, in the string search unit 102 of the first comparative example, it is necessary to perform a search (comparison) process on all characters included in the string stored in the dictionary buffer 101, whereas in the dictionary comparison unit 116 of the second comparative example, a read process (search process) is performed only on the pointer indicated by the hash value among the pointers written in the hash table unit 112. That is, since the targets (candidates) of the search process are narrowed down in the string search device 110 of the second comparative example, the number of comparators provided in the dictionary comparison unit 116 of the second comparative example may be smaller than the number of comparators provided in the string search unit 102 of the first comparative example. Therefore, the string search device 110 of the second comparative example can reduce the circuit scale (the number of comparators) and realize efficient operation, compared to the string search device 100 of the first comparative example.

[0112] In addition, compared to the configuration of the string search device 100 in the first comparative example, the string search device 110 in the second comparative example needs to further include, for example, a hash table unit 112. However, the size of the hash table unit 112 itself is log 1 of the dictionary data size. 2 The circuit scale is approximately proportional to the logarithm of the dictionary data size (logarithm to the base 2). Specifically, the hash table unit 112 has a circuit scale corresponding to the product of the pointer bit width, which is the logarithm of the dictionary data size, and the number of pointers. In this case, by limiting the number of pointers, the string search device 110 of the second comparative example can have a smaller circuit scale than the string search device 100 of the first comparative example.

[0113] On the other hand, the string search device 100 of the first comparative example (the "full search" method) described above has a configuration that searches (searches) the data history (strings entered in the past) without omission, and therefore has high search performance. In contrast, the string search device 110 of the second comparative example (the "hash table" method) has a configuration that narrows down the candidates in the dictionary buffer 111 using hash values, and therefore has lower search performance compared to the "full search" method. Specifically, there is a possibility of hash collisions occurring in the "hash table" method, and when such hash collisions occur, an appropriate string cannot be selected from the dictionary buffer 111, and it can be said that the search performance is compromised compared to the "full search" method.

[0114] It should be noted that hash collisions, which are a cause of reduced search performance in such a "hash table" method, can be mitigated by increasing the bit width of the hash value. However, when the bit width is increased, the number of table entries in hash table unit 112 increases by a power of 2 times the increment in the bit width, resulting in a dramatic increase in the circuit size of hash table unit 112.

[0115] Furthermore, in order to deal with hash collisions, it is possible to write multiple pointers in the hash table unit 112 in correspondence with one index (hash value); however, even in this case, the size of the hash table 112 increases, which leads to an increase in the circuit scale.

[0116] In contrast, in this embodiment, the hash values ​​and complementary data corresponding to each of multiple consecutive characters included in a string input in the past are stored in the dictionary buffer 11, and a search (search) is performed for a hash value that matches the hash value corresponding to each of the characters included in the input string from within this dictionary buffer 11, so that the effect of hash collisions can be mitigated compared to the string search device 110 of the second comparative example (the "hash table" method) that uses a hash value as an index. As a result, the string search device 10 of this embodiment can achieve higher search performance than the string search device 110 of the second comparative example.

[0117] That is, according to this embodiment, it is possible to achieve high search performance exceeding that of the "hash table" method with a circuit scale smaller than that of the "full search" method.

[0118] The circuit scale of the string search device 10 according to this embodiment and the string search device 110 of the second comparative example will also be briefly described. First, although the formats of data stored in the dictionary buffer 11 and the dictionary buffer 111 are different, the size of the data is the same, so the circuit scale of the dictionary buffer 11 is equivalent to that of the dictionary buffer 111. Furthermore, if the number of matching candidates (converted character data selected by the dictionary data selection unit 14 and character strings selected by the dictionary data selection unit 115) selected in the dictionary data selection unit 14 and the dictionary data selection unit 115 is the same, the circuit scale of the dictionary data selection unit 14, the dictionary comparison unit 16, and the maximum matching length determination unit 17 of the string search device 10 according to this embodiment is equivalent to the circuit scale of the dictionary data selection unit 115, the dictionary comparison unit 116, and the maximum matching length determination unit 117 of the string search device 110 of the second comparative example. Furthermore, the hash transformation unit 12, the first inverse hash transformation unit 15, and the second inverse hash transformation unit 18 of the string search device 10 according to this embodiment can be configured using circuits that are extremely small in scale compared to other units (other circuits).

[0119] For this reason, the difference in circuit scale between the string search device 10 of this embodiment and the string search device 110 of the second comparative example depends on the result of comparing the circuit scale of the hash full search unit 13 shown in FIG. 3 with the circuit scale of the hash table unit 112 and the hash read unit 114 shown in FIG. 10.

[0120] Here, in this embodiment, a 3-bit hash value has been described as being used, but in this case, if a portion that matches four or more characters (a hash value of four or more consecutive characters) is searched for as a match candidate by the full hash search unit 13, the match candidate will be detected (selected) by a hash value of 3 bits x 4 characters = 12 bits. If the bit width of the hash value written to the hash table unit 112 in the second comparative example is used as a simple index for aligning search performance, it is conceivable that the hash table unit 112 uses a 12-bit hash value converted from an input character string including four characters as an index.

[0121] Below, a comparison will be made between the circuit scale of the hash full search unit 13, the hash table unit 112, and the hash read unit 114 at this time, but here, a configuration is assumed in which string searches are performed in parallel starting with each character of the input string as shown in Fig. 11. In this case, a match is determined by a brute force search between the hash values ​​of each character of a string consisting of (the number of throughput characters (e.g., 8) + the number of characters to be matched (e.g., 4) - 1) and the hash values ​​in the dictionary buffer 11. As a result, if the input string consists of, for example, eight types of four-character strings are searched for in parallel as shown in Fig. 11. Note that for characters that overlap between the strings being searched for, the hash values ​​of those characters may be shared.

[0122] This configuration is suitable for the hash exhaustive search method (the method adopted in the string search device 10 according to this embodiment), but can also be used in a hash table method that supports an input throughput of two or more characters.

[0123] In the following explanation, it is assumed that the dictionary size is 4096 bytes, the throughput (number of throughput characters) of the input string is 8 characters (8 bytes), and the number of characters in the match determination string (i.e., the minimum number of characters searched for as a match candidate) is 4, as described above.

[0124] First, a description will be given of the circuit scale of the hash exhaustive search unit 13. Here, consideration will be given only to the main components of the hash exhaustive search unit 13. The main components of the hash exhaustive search unit 13 are a comparator that judges whether a hash value obtained by hash-converting an input string in the hash conversion unit 12 matches a hash value in the dictionary buffer 11, an AND element that combines the character-by-character hash match result into a string-by-string hash match flag, and a circuit that converts the string-by-string hash match flag into a pointer (hereinafter referred to as a pointer conversion circuit).

[0125] The comparators are composed of exclusive OR (XOR) elements, and the number of comparators is calculated by "dictionary size * (throughput character count + match determination character count - 1) * character-based hash bit width". Note that the character-based hash bit width in this embodiment is 3 bits. As described above, if the dictionary size is 4096 bytes and the throughput character count is 8 (characters), the number of comparators is calculated to be 135168. Also, if the number of gates in one comparator (per bit) is, for example, 4 gates, the total number of gates in all comparators is 4 x 135168 = 540672.

[0126] The number of AND elements for string merging is calculated by "dictionary size * throughput character count * (number of characters in string for match determination - 1)". Here, 98304 is calculated as the number of AND elements for string merging. If the number of gates in one AND element for string merging (per bit) is, for example, 1 gate, the total number of gates in all AND elements for string merging is 1 x 98304 = 98304.

[0127] A pointer conversion circuit is composed of OR elements and MUX elements, and the number of such pointer conversion circuits is calculated by "dictionary size x number of throughput characters." Here, the number of pointer conversion circuits is calculated as 32768. If the number of gates in one pointer conversion circuit (per bit) is, for example, 4 gates, the total number of gates in all pointer conversion circuits is 4 x 32768 = 131072.

[0128] If the circuit size of the hash exhaustive search unit 13 is expressed as the total number of gates of the main components of the hash exhaustive search unit 13 (comparator, AND element for string combination, and pointer conversion circuit), the circuit size of the hash exhaustive search unit 13 can be expressed as 540672 (total number of gates of the comparator) + 98304 (total number of gates of the AND element for string combination) + 131072 (total number of gates of the pointer conversion circuit) = 770048.

[0129] Next, a description will be given of the circuit scale of the hash table unit 112 and the hash read unit 114. Here, only the main components of the hash table unit 112 and the hash read unit 114 will be considered.

[0130] The hash table unit 112 requires flip-flops that constitute a table, and when one pointer is stored for each entry (hash table entry) of the hash table unit 112, the total number of bits is determined by the number of hash table entries and the size of the dictionary pointer to be stored. That is, the number of flip-flops (table F / F) is calculated by "number of hash table entries * dictionary pointer size." If the number of hash table entries is 4096 and the dictionary pointer size is 12 bits, the number of flip-flops is calculated as 49152. Also, if the number of gates in one flip-flop (per bit) is, for example, 8 gates, the total number of gates in all flip-flops is 8 x 49152 = 393216.

[0131] Each hash table entry is accompanied by a write control (table write control) circuit, and the hash value is processed as a match check against a fixed value (the index of the hash table entry), so the number of write control circuits is calculated by "number of hash table entries * hash bit width." As described above, it is assumed that the index is a 12-bit hash value converted from an input string containing four characters (i.e., the hash bit width is 12), so the number of write control circuits is calculated as 49152. If the number of gates in one write control circuit (per bit) is, for example, one gate, the total number of gates in all write control circuits is 1 x 49152 = 49152.

[0132] The hash reading unit 114 is composed of a MUX circuit (table read MUX) to read out a pointer value corresponding to a hash value, and the number of MUX circuits is calculated by "number of hash table entries * number of throughput characters * dictionary pointer size." Here, 393216 is calculated as the number of MUX circuits. If the number of gates in one MUX circuit (per bit) is, for example, 3 gates, the total number of gates in all MUX circuits is 3 x 393216 = 1179648.

[0133] If the circuit size of the hash table unit 112 and the hash read unit 114 is expressed as the total number of gates of the main components of the hash table unit 112 and the hash read unit 114 (flip-flops, write control circuit, and MUX circuit), the circuit size of the hash table unit 112 and the hash read unit 114 can be expressed as 393216 (total number of gates of flip-flops) + 49152 (total number of gates of write control circuit) + 1179648 (total number of gates of MUX circuit) = 1622016.

[0134] When the circuit scale (total number of gates) of such hash table unit 112 and hash read unit 114 is compared with the circuit scale (total number of gates) of the above-mentioned hash exhaustive search unit 13, it is found that the circuit scale of the hash exhaustive search unit 13 is smaller than the circuit scale of the hash table unit 112 and hash read unit 114. In other words, for example, when configured to have the same level of search performance, it can be said that this embodiment is superior in terms of circuit scale to the second comparative example.

[0135] The magnitude relationship between the circuit scale of the string search device 10 according to this embodiment and that of the string search device 110 according to the second comparative example varies depending on the bit width of the hash value, the minimum number of matching characters to be searched as a matching candidate, etc., but if the search performance of the string search device 110 according to the second comparative example is improved compared to that of the string search device 10 according to this embodiment (for example, by increasing the bit width of the hash value), it is considered that the superiority of the string search device 10 according to this embodiment in terms of circuit scale is further improved. Although a detailed explanation is omitted, for example, if the hash bit width is 16 bits (the bit width of the hash value per character is 4 bits) and the number of hash table entries is 65536, the circuit scale (total number of gates) of the hash full search unit 13 is 950272, and the circuit scale (total number of gates) of the hash table unit 112 and the hash read unit 114 is 26214400, improving the superiority of this embodiment in terms of circuit scale.

[0136] Furthermore, in this embodiment, consecutive hash values ​​converted from an input character string by the hash conversion unit 12 and a plurality of complementary data corresponding to each of the consecutive hash values ​​are stored in the dictionary buffer 11, and the hash values ​​stored in the dictionary buffer 11 are converted into the input character string using the complementary data and output. With this configuration, even if the input character string is not stored in the dictionary buffer 11 as described above, it is possible to output non-matching character data (input character string) used as a result of dictionary-based encoding to a subsequent stage.

[0137] In addition, in the present embodiment, the number of bits (e.g., 3 bits) of each of the hash values ​​stored in the dictionary buffer 11 and the hash values ​​converted by the hash conversion unit 12 is described as being smaller than the number of bits of a character (e.g., 8 bits), but the total number of bits of the hash value and the complementary data corresponding to the hash value may be the same as the number of bits of a character. With this configuration, even if converted character data obtained by adding complementary data to a hash value is stored in the dictionary buffer 11, there is no need to increase the size of the dictionary buffer 11 compared to, for example, the dictionary buffer 101 in the first comparative example and the dictionary buffer 111 in the second comparative example, which can contribute to reducing the circuit scale in the string search device 10 according to this embodiment.

[0138] Furthermore, in this embodiment, when multiple consecutive hash values ​​(i.e., multiple matching candidates) that match at least a portion of consecutive hash values ​​converted by the hash conversion unit 12 are searched for, the longest matching length among the matching lengths of the consecutive hash values ​​is output together with a pointer indicating the position in the dictionary buffer 11 where the consecutive hash value with the longest matching length is stored. With this configuration, in this embodiment, the portion of the input character string with the longer matching length can be replaced with matching character data (relative reference), thereby making it possible to improve encoding efficiency.

[0139] In this embodiment, it has been described that the hash values ​​corresponding to each of the multiple characters included in a previously input string and the complementary data corresponding to the hash values ​​are stored in the dictionary buffer 11 (areas allocated to the dictionary buffer 11), but different areas may be allocated to the hash values ​​and the complementary data.

[0140] Specifically, in this embodiment, the hash values ​​stored in the dictionary buffer 11 are output to the hash exhaustive search unit 13, the dictionary data selection unit 14, and the inverse hash conversion unit 18 (i.e., they are frequently read by the hash exhaustive search unit 13, the dictionary data selection unit 14, and the inverse hash conversion unit 18), and therefore it is preferable that the hash values ​​are stored in an area that can be read at high speed. In this case, the hash values ​​may be stored in, for example, a flip-flop circuit or the like (i.e., an area of ​​a flip-flop circuit is allocated to the hash values). On the other hand, since the complementary data is read less frequently than the hash values, the complementary data may be stored in, for example, a memory such as an SRAM (i.e., a memory area is allocated to the complementary data). That is, the dictionary buffer 11 in this embodiment may be composed of an area of ​​a flip-flop circuit for storing hash values ​​and an area of ​​a memory for storing complementary data.

[0141] Second embodiment Next, a second embodiment will be described. In this embodiment, detailed descriptions of parts similar to those of the first embodiment will be omitted, and parts different from the first embodiment will be mainly described. In addition, since the hardware configuration of the memory system in this embodiment is similar to that of the first embodiment, the description will be made with reference to FIG. 1 as appropriate.

[0142] The compression device 2e included in the memory system 1 in this embodiment includes a string search device and an entropy coding device, as in the first embodiment described above, and the string search device according to this embodiment will be described below.

[0143] Fig. 12 is a block diagram showing an example of the configuration of a string search device according to this embodiment. In Fig. 12, the same parts as those in Fig. 3 described above are given the same reference numerals, and detailed explanations thereof will be omitted, and only parts different from Fig. 3 will be explained.

[0144] As shown in FIG. 12, the string search device 10 includes a dictionary buffer 11, a hash conversion unit 12, a hash full search unit 13, a dictionary data selection unit 14, a dictionary comparison unit 16, a maximum match length determination unit 17, and an inverse hash conversion unit 18.

[0145] That is, this embodiment differs from the first embodiment in that the first inverse hash transformation unit 15 in the first embodiment is omitted. Note that the inverse hash transformation unit 18 shown in Fig. 12 corresponds to the second inverse hash transformation unit 18 in the first embodiment.

[0146] In this embodiment, unlike the first embodiment described above, dictionary comparing unit 16 inputs consecutive converted character data (hereinafter referred to as first converted character data) output from hash conversion unit 12, and compares consecutive converted character data (hereinafter referred to as second converted character data) output from dictionary data selecting unit 14 with the consecutive first converted character data. In this way, dictionary comparing unit 16 determines converted character data that matches between the consecutive first converted character data and the consecutive second converted character data, and obtains the number of the matching converted character data as the match length.

[0147] Note that the dictionary buffer 11, hash conversion unit 12, full hash search unit 13, dictionary data selection unit 14, maximum match length determination unit 17 and inverse hash conversion unit 18 shown in FIG. 12 other than the dictionary comparison unit 16 are as described in the first embodiment above, and therefore detailed description thereof will be omitted here.

[0148] As described above, in this embodiment, consecutive hash values ​​(second hash values) converted from multiple consecutive characters included in an input string and multiple complementary data (first complementary data) corresponding to each of the consecutive hash values ​​are compared with consecutive hash values ​​(first hash values) and multiple complementary data (second complementary data) corresponding to each of the consecutive hash values ​​output from the dictionary data selection unit 14 to obtain a matching length, thereby making it possible to achieve high search performance with a small circuit scale, as in the first embodiment described above.

[0149] In this embodiment, the converted character data is generated so that the hash conversion and the inverse hash conversion are one-to-one reversible conversions. Specifically, for example, when the bit width (total bit width of the hash value and the complementary data) of the converted character data converted from each of the multiple characters included in the input character string is smaller than the bit width (input bit width) of the character converted to the converted character data, the relationship between the character and the converted character data is many-to-one, and it is not possible to ensure a one-to-one reversible conversion relationship between the character and the converted character data (that is, a relationship in which the character converted to the converted character data and the character inversely converted from the converted character data are the same). For this reason, in this embodiment, the converted character data is generated so that the bit width of the converted character data and the bit width of the character match. With such converted character data, it is possible to ensure a one-to-one reversible conversion relationship between the character and the converted character data. Note that even if the bit width of the converted character data converted from each of the multiple characters included in the input character string is larger than the bit width of the characters, it is possible to ensure a reversible conversion relationship. In this case, however, the size of the comparator used in dictionary comparison unit 16 will be larger (i.e., the circuit scale will be larger), so it is preferable to match the bit width of the converted character data with the bit width of the characters.

[0150] In this manner, when a character and converted character data have a one-to-one reversible conversion relationship, it is possible to obtain an accurate matching length by comparing in the form of converted character data, without performing an inverse hash conversion (i.e., comparing the converted string with the input string) as described in the first embodiment above.

[0151] Furthermore, in this embodiment, the first inverse hash transform unit 15 is omitted compared to the first embodiment, but the reduction rate (reduction range) of the circuit scale due to the omission of the first inverse hash transform unit 15 is not large. However, in this embodiment, the inverse hash transform process is not executed by the first inverse hash transform unit 15, so that the dictionary comparison process (i.e., the critical path from the dictionary buffer 11 to the dictionary comparison unit 16) is shortened, and a secondary effect of reducing the delay due to the inverse hash transform process (gate delay in hardware implementation) can be expected.

[0152] Note that dictionary data selection unit 14 selects consecutive converted character data of a number equivalent to the maximum matching length from the position indicated by the pointer output from hash exhaustive search unit 13 and outputs the selected converted character data, but in this embodiment, a configuration may be adopted in which complement data is selected and output instead of converted character data determined by hash exhaustive search unit 13 to match the hash value output from hash conversion unit 12 (i.e., the hash value corresponding to the characters included in the input character string) from the converted character data (i.e., the hash value is not selected and output). In such a configuration, it is assumed that the match of the hash values ​​has already been determined by hash exhaustive search unit 13, and dictionary comparison unit 16 can obtain the matching length simply by comparing the complement data output from dictionary data selection unit 14 with the complement data output from hash conversion unit 12.

[0153] On the other hand, for converted character data that is not determined by full hash search unit 13 to match the hash value output from hash conversion unit 12, the converted character data is selected and output by dictionary data selection unit 14, and dictionary comparison unit 16 compares the converted character data output from dictionary data selection unit 14 with the converted character data output from hash conversion unit 12.

[0154] That is, in this embodiment, for the number of characters for which a match has been confirmed in the full hash search unit 13, a hash value is not selected, and only the complementary data is compared, whereas for the number of characters for which a match has not been confirmed in the full hash search unit 13, a hash value and complementary data are selected, and a comparison is made between the hash value and complementary data (in other words, the matching length is obtained using the complementary data selected according to the characters for which a match has been confirmed, and the hash value and complementary data selected according to the characters for which a match has not been confirmed).

[0155] According to such a configuration, the number of comparators provided in the dictionary comparison unit 16 can be reduced, and the circuit scale can be reduced.

[0156] Here, it has been explained that in string search device 10 according to this embodiment, dictionary data selection unit 14 may be configured to select and output complementary data instead of converted character data. However, in the first embodiment described above, since it is necessary to execute an inverse hash transform process, dictionary data selection unit 14 needs to select and output converted character data.

[0157] Third embodiment Next, a third embodiment will be described. In this embodiment, detailed descriptions of parts similar to those of the first and second embodiments will be omitted, and parts different from those of the first and second embodiments will be mainly described. In addition, since the hardware configuration of the memory system in this embodiment is similar to that of the first embodiment, the description will be made with reference to FIG. 1 as appropriate.

[0158] The compression device 2e included in the memory system 1 in this embodiment includes a string search device and an entropy coding device, as in the first and second embodiments described above, and the string search device according to this embodiment will be described below.

[0159] Fig. 13 is a block diagram showing an example of the configuration of a string search device according to this embodiment. In Fig. 13, the same parts as those in Fig. 3 and Fig. 12 described above are given the same reference numerals, and detailed explanations thereof are omitted, and only parts different from Fig. 3 and Fig. 12 are described.

[0160] As shown in FIG. 13, the string search device 10 includes a dictionary buffer 11, a hash conversion unit 12, a full hash search unit 13, a dictionary data selection unit 14, a dictionary comparison unit 16, a maximum match length determination unit 17, and a data delay unit 19.

[0161] That is, this embodiment differs from the second embodiment described above in that the second inverse hash transformation unit 18 in the second embodiment is omitted and a data delay unit 19 is added.

[0162] Data delay unit 19 receives an input character string and holds the input character string according to the throughput required for string search device 10. In other words, data delay unit 19 performs a data delay equivalent to the latency until matching character data is output from maximum match length determination unit 17. After such a data delay, data delay unit 19 outputs the input character string as mismatched character data.

[0163] In addition, the dictionary buffer 11, hash conversion unit 12, hash full search unit 13, dictionary data selection unit 14, dictionary comparison unit 16 and maximum match length determination unit 17 other than the data delay unit 19 shown in Figure 13 are as described in the second embodiment above, so detailed description thereof will be omitted here.

[0164] In this embodiment, as described above, the input string (second string) is held and output until matching character data (matching length and pointer) is output from the maximum matching length determination unit 17, which may further reduce the circuit scale of the string search device 10.

[0165] Specifically, when the processing latency of the string search device 10 is large, the delay circuit included in the data delay unit 19 will not have a circuit size smaller than that of the inverse hash transformation unit 18 in the second embodiment (the second inverse hash transformation unit 18 in the first embodiment). However, for example, when the dictionary buffer 11 is configured using an SRAM or the like that places restrictions on the number of pieces of access data, the configuration in which the dictionary buffer 11 outputs mismatched character data as in the first and second embodiments may lead to an increase in circuit size. In such a case, it is expected that the circuit size of the string search device 10 can be suppressed by configuring the dictionary buffer 11 to include a data delay unit 19 equivalent to the latency without causing the dictionary buffer 11 to output mismatched character data.

[0166] Furthermore, in the first and second embodiments described above, it is necessary to execute an inverse hash transform process based on the converted character data, and therefore the hash transform unit 12 needs to generate converted character data taking into consideration the complexity of the inverse hash transform process or the processing delay (number of gate delay stages), etc. However, in this embodiment, it is not necessary to execute an inverse hash transform process, and therefore it is possible to design the converted character data with a higher degree of freedom (i.e., to further simplify the calculations by the hash transform unit 12).

[0167] Although detailed description will be omitted, the configuration in which the dictionary data selection unit 14 in the second embodiment selects and outputs complementary data instead of converted character data may be applied to this embodiment.

[0168] According to at least one of the embodiments described above, it is possible to provide a string search device and a memory system that can achieve high search performance with a small circuit scale.

[0169] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope of the invention and its equivalents described in the claims, as well as in the scope and spirit of the invention. [Explanation of symbols]

[0170] 1...memory system, 2...controller, 2a...host interface, 2b...CPU, 2c...NAND interface, 2d...DRAM interface, 2e...compression device, 2f...decompression device, 3...NAND type flash memory, 4...DRAM, 10...string search device, 11...dictionary buffer, 12...hash conversion unit (first conversion unit), 13...hash full search unit (search unit), 14...dictionary data selection unit, 15...first inverse hash conversion unit (second conversion unit), 16...dictionary comparison unit, 17...maximum match length determination unit (output unit), 18...second inverse hash conversion unit (third conversion unit), 19...data delay unit.

Claims

1. a storage unit configured to store, for each character, a first hash value corresponding to each of a plurality of consecutive characters included in a first string input in the past and first complementary data corresponding to the first hash value for converting the first hash value into the character; a first conversion unit that converts each of a plurality of consecutive characters included in an input second string into a second hash value corresponding to the character and second complementary data corresponding to the second hash value for converting the second hash value into the character; a search unit that searches the storage unit for consecutive first hash values ​​that match at least a portion of the converted consecutive second hash values, and outputs a pointer that indicates a position in the storage unit where the consecutive first hash values ​​are stored; a selection unit that selects, based on the pointer, consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values ​​from the storage unit; a second conversion unit that converts the selected consecutive first hash values ​​into a third character string including consecutive characters by using the selected plurality of first complement data; a comparison unit that compares the second character string and the third character string and obtains a match length indicating a length of matching characters; an output unit that outputs the match length together with the pointer; A character string search device comprising:

2. a storage unit configured to store, for each character, a first hash value corresponding to each of a plurality of consecutive characters included in a first string input in the past and first complementary data corresponding to the first hash value for converting the first hash value into the character; a first conversion unit that converts each of a plurality of consecutive characters included in an input second string into a second hash value corresponding to the character and second complementary data corresponding to the second hash value for converting the second hash value into the character; a search unit that searches the storage unit for consecutive first hash values ​​that match at least a portion of the converted consecutive second hash values, and outputs a pointer that indicates a position in the storage unit where the consecutive first hash values ​​are stored; a selection unit that selects, based on the pointer, consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values ​​from the storage unit; a comparison unit that compares the converted consecutive second hash values ​​and a plurality of second complement data corresponding to each of the consecutive second hash values ​​with the selected consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values, and obtains a matching length indicating a length of a matching character; an output unit that outputs the match length together with the pointer; A character string search device comprising:

3. Further comprising a third conversion unit, the converted consecutive second hash values ​​and a plurality of second complement data corresponding to each of the consecutive second hash values ​​are stored in the storage unit; The third conversion unit converts the consecutive second hash values ​​into the second character string using the plurality of second complement data stored in the storage unit, and outputs the second character string.

3. The character string search device according to claim 1.

4. 3. The character string search device according to claim 2, further comprising a data delay section that holds and outputs the input second character string until the match length and the pointer are output.

5. The selection unit is selecting a plurality of first complement data corresponding to the consecutive first hash values ​​that match at least a part of the converted consecutive second hash values ​​among the consecutive first hash values ​​selected based on the pointer; selecting, from among the consecutive first hash values ​​selected based on the pointer, the first hash values ​​other than the consecutive first hash values ​​that match at least a part of the converted consecutive second hash values, the first hash values ​​and first complementary data corresponding to the first hash values; The comparison unit obtains the match length by using the selected plurality of first complement data and the selected first hash value and first complement data.

5. The character string search device according to claim 2 or 4.

6. 6. The string search device according to claim 1, wherein the number of bits of each of the first hash value and the second hash value is smaller than the number of bits of the character.

7. 7. The string search device according to claim 6, wherein a total number of bits of the first hash value and the first complementary data corresponding to the first hash value, and a total number of bits of the second hash value and the second complementary data corresponding to the second hash value are each equal to a number of bits of the character.

8. when a plurality of consecutive first hash values ​​that match at least a portion of the consecutive second hash values ​​are found, the comparison unit obtains a matching length for each of the consecutive first hash values; The output unit outputs the maximum matching length among the acquired matching lengths together with a pointer indicating a position in the storage unit where the consecutive first hash values ​​having the maximum matching length are stored. The character string search device according to any one of claims 1 to 7.

9. the storage unit includes a flip-flop circuit and a memory; the first hash value is stored in the flip-flop circuit; The first complementary data is stored in the memory. The character string search device according to any one of claims 1 to 8.

10. A non-volatile memory; a character string search device connected to the non-volatile memory; Equipped with The character string search device includes: a storage unit configured to store, for each character, a first hash value corresponding to each of a plurality of consecutive characters included in a first string input in the past and first complementary data corresponding to the first hash value for converting the first hash value into the character; a first conversion unit that converts each of a plurality of consecutive characters included in an input second string into a second hash value corresponding to the character and second complementary data corresponding to the second hash value for converting the second hash value into the character; a search unit that searches the storage unit for consecutive first hash values ​​that match at least a portion of the converted consecutive second hash values, and outputs a pointer that indicates a position in the storage unit where the consecutive first hash values ​​are stored; a selection unit that selects, based on the pointer, consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values ​​from the storage unit; a second conversion unit that converts the selected consecutive first hash values ​​into a third character string including consecutive characters by using the selected plurality of first complement data; a comparison unit that compares the second character string and the third character string and obtains a match length indicating a length of matching characters; an output unit that outputs the matching length together with the pointer as first data; Including, Second data based on the first data output from the output section is written to the non-volatile memory. Memory system.

11. A non-volatile memory; a character string detection device connected to the non-volatile memory; Equipped with The character string detection device includes: a storage unit configured to store, for each character, a first hash value corresponding to each of a plurality of consecutive characters included in a first string input in the past and first complementary data corresponding to the first hash value for converting the first hash value into the character; a first conversion unit that converts each of a plurality of consecutive characters included in an input second string into a second hash value corresponding to the character and second complementary data corresponding to the second hash value for converting the second hash value into the character; a search unit that searches the storage unit for consecutive first hash values ​​that match at least a portion of the converted consecutive second hash values, and outputs a pointer that indicates a position in the storage unit where the consecutive first hash values ​​are stored; a selection unit that selects, based on the pointer, consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values ​​from the storage unit; a comparison unit that compares the converted consecutive second hash values ​​and a plurality of second complement data corresponding to each of the consecutive second hash values ​​with the selected consecutive first hash values ​​and a plurality of first complement data corresponding to each of the consecutive first hash values, and obtains a matching length indicating a length of a matching character; an output unit that outputs the matching length together with the pointer as first data; Including, Second data based on the first data output from the output section is written to the non-volatile memory. Memory system.

Citation Information

Patent Citations

  • Device and method for searching variable-length character string, and program

    JP2005165598A

  • Efficient retrieval of variable-length character string data

    US20050120017A1

  • Data compression / decompression method and apparatus

    US5140321A

  • Method and arrangement for data compression according to the LZ77 algorithm

    US7233265B2