WO2014097353A1 - 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム - Google Patents

圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム Download PDF

Info

Publication number
WO2014097353A1
WO2014097353A1 PCT/JP2012/008114 JP2012008114W WO2014097353A1 WO 2014097353 A1 WO2014097353 A1 WO 2014097353A1 JP 2012008114 W JP2012008114 W JP 2012008114W WO 2014097353 A1 WO2014097353 A1 WO 2014097353A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage area
unit
compression
code
Prior art date
Application number
PCT/JP2012/008114
Other languages
English (en)
French (fr)
Inventor
片岡 正弘
泰裕 鈴木
貢嗣 山本
Original Assignee
富士通株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士通株式会社 filed Critical 富士通株式会社
Priority to JP2014552753A priority Critical patent/JP6252489B2/ja
Priority to PCT/JP2012/008114 priority patent/WO2014097353A1/ja
Publication of WO2014097353A1 publication Critical patent/WO2014097353A1/ja
Priority to US14/714,751 priority patent/US20150248432A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3086Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method employing a sliding window, e.g. LZ77
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/70Type of the data to be coded, other than image and sound
    • H03M7/705Unicode

Definitions

  • At least one of data compression technology and decompression technology.
  • LZ77 There is a compression algorithm called LZ77.
  • LZ77 a compression code is generated based on the position and length of data that appears earlier than the data to be processed and is the same as the data to be processed.
  • the search for the same data that appears first is performed by collation processing with each data that appears first.
  • the data to be processed and the data that appears first are compared for each predetermined data unit. For example, when the predetermined data unit is 1 byte, the collation process between the data to be encoded and the data that appears first is performed for each byte.
  • the length of the data unit constituting the data to be compressed may not be constant.
  • document data for example, there is a character code system in which a plurality of types of bytes representing a single character are used.
  • UTF-8 etc. there are characters represented by 1 byte (for example, alphanumeric characters), and characters represented by 3 bytes (for example, part of Kanji first type, second type Kanji and Kana characters, etc.) )
  • characters expressed in 4 bytes for example, part of the third and fourth levels of kanji).
  • the actual data unit (for example, a plurality of bytes) constituting the compression target data Collation processing is performed in different data units (for example, 1 byte).
  • An object of one aspect of the present invention is to improve the efficiency of collation processing performed in compression processing for data in which a plurality of types of data units constituting data is used.
  • the computer obtains a data string based on a data group in which a plurality of types of data constituent units exist, and the data is included in the data group and the data is included in the data string.
  • Control is performed to collate the data and data having the same size of the structural unit of the data, and by the collation processing performed based on the control, the matching data that matches the certain data is extracted from the data string,
  • a compression method for executing a process for generating a compression code corresponding to the positional relationship in the data string between the certain data and the extracted matched data is used.
  • the computer acquires a fixed-length code by referring to the storage area based on a compression code indicating a position in the storage area, and updates the storage area based on the acquired fixed-length code. And decoding the acquired fixed-length code based on an encoding dictionary, A decompression method is used to do this.
  • the compression / decompression system includes a storage unit that stores a data sequence of a data group in which a plurality of types of data configuration units exist, certain data included in the data group, and the data sequence Among the data, a control unit that performs control to collate the certain data with data having the same unit size of data, and matching data that matches the certain data by collation processing performed based on the control of the control unit An extraction unit that extracts from the data sequence stored in the storage unit, and a generation unit that generates a compression code corresponding to a positional relationship in the data sequence between the certain data and the extracted matched data. And a second computer including a restoration unit that restores the matched data based on the compressed code.
  • the compression process it is possible to suppress a collation process in a data unit different from the data unit constituting the data to be compressed.
  • FIG. 1 shows the flow of compression processing using LZ77.
  • FIG. 2 shows the flow of decompression processing using LZ77.
  • FIG. 3 shows code assignment in UTF-8.
  • FIG. 4 shows an example of compression processing.
  • FIG. 5 shows an example of the encoding dictionary D1.
  • FIG. 6 shows an example of the encoding dictionary D2.
  • FIG. 7 shows an example of decompression processing.
  • FIG. 8 shows a functional configuration example.
  • FIG. 9 shows an example of the position information table T1.
  • FIG. 10 shows a procedure example of the compression process.
  • FIG. 11 shows a procedure example of the search processing for the longest matching fixed-length code string.
  • FIG. 12 shows an example of the procedure of fixed length code acquisition processing.
  • FIG. 13 shows an example of a procedure for generating / writing compressed data.
  • FIG. 14 shows an example of the procedure for updating the storage area A2.
  • FIG. 15 shows a procedure example of the update process of the storage area A4.
  • FIG. 16 shows an example of the position information table T2.
  • FIG. 17 shows a procedure example of the decompression process.
  • FIG. 18 shows an example of the procedure for updating the storage area B2.
  • FIG. 19 shows a hardware configuration example of the computer 1.
  • FIG. 20 shows a configuration example of a program that runs on the computer 1.
  • FIG. 21 shows a configuration example of an apparatus in the system of the embodiment.
  • FIG. 22 shows an example of collation processing in a data unit different from the data unit constituting the data to be compressed.
  • FIG. 23 shows an example of collation processing in a data unit different from the data unit constituting the data to be compressed.
  • FIG. 24 shows an example of the processing from S301 to S303.
  • FIG. 25 shows an index example of the encoding dictionary D1.
  • FIG. 26 shows a modification of the longest match code string search process.
  • FIG. 27 shows a procedure example of the search processing for the longest match code string.
  • FIG. 1 shows the flow of compression processing using LZ77.
  • the storage area A1, the storage area A2, and the storage area A3 are secured in the memory, for example.
  • the data of the content part in the file F1 shown in FIG. 1 is loaded into the storage area A1.
  • the storage area A1 is called, for example, an encoding unit.
  • the file F1 includes data “... 1st horse ... 2nd horse ... 3rd horse ...” (“...” is an unspecified character string).
  • a compressed data generation process (described later) is performed based on the data loaded in the storage area A1. Further, the data that has undergone the compressed data generation process is copied from the storage area A1 to the storage area A2.
  • the storage area A2 is called a reference unit, for example.
  • the compressed data is generated according to the result of the collation process between the data loaded in the storage area A1 and the data in the storage area A2.
  • the generated compressed data is sequentially stored in the storage area A3, and a compressed file F2 is generated based on the compressed data stored in the storage area A3. Further, in FIG. 1, the data in the storage areas A1 and A2 are schematically shown.
  • the generation of the compressed data d1 will be described by taking as an example a case where data after “h” of “1st horse ...” shown in FIG. First, the longest matching data of “horse...” Is searched in the storage area A2 (“collation” shown in FIG. 1). In the example of FIG. 1, there is no data in the storage area A2 that coincides with “h” that is the first data of the processing target data. When there is no data in the storage area A2 that matches the data to be processed, compressed data d1 including a Huffman code obtained by encoding the head data of the data to be processed by the Huffman encoding / decoding algorithm is generated.
  • the use of Huffman coding as compressed data is merely an example, and other compression algorithms may be used, or uncompressed data that is the head data itself may be used.
  • the compressed data d1 includes an identifier (“0” in the example of FIG. 1) indicating that the compressed data is not based on the longest matching data.
  • the generation of the compressed data d2 will be described by taking as an example a case where the data after “h” of “2nd horse ...” shown in FIG. First, the longest matching data of “horse...” Is searched in the storage area A2 (“collation” shown in FIG. 1). In the example of FIG. 1, since “1st horse ...” exists in the storage area A2, for example, “horse” of data to be processed and “horse” of “1st horse ...” in the storage area A2 Match.
  • the compressed data d2 is generated based on the data length of the longest match data.
  • the compressed data d2 includes an identifier (“1” in the example of FIG. 1) indicating that the compressed data is based on the longest matching data.
  • the generation of the compressed data d3 will be described by taking as an example a case where the data after “h” of “3rd horse...” Shown in FIG. First, the longest matching data of “horse...” Is searched in the storage area A2 (“collation” shown in FIG. 1). In the example of FIG. 1, “1st horse... 2nd horse” exists in the storage area A2. Therefore, for example, “horse” of the data to be processed and “1st horse” and “2nd horse” in the storage area A2. "Horse” matches.
  • compressed data d3 is generated.
  • the compressed data d3 includes an identifier (“1” in the example of FIG. 1) indicating that the compressed data is based on the longest matching data.
  • the generated compressed data d1 to d3 are stored in the storage area A3, and are included in the compressed file F2 by the generation process of the compressed file F2.
  • FIG. 2 shows the flow of decompression processing using LZ77.
  • the compressed data in the compressed file F2 is loaded into the memory (storage area B1), and the decompressed data is generated according to the identifier of the loaded compressed data.
  • “*” In FIG. 2 indicates compressed data.
  • the storage area B1 is called, for example, an encoding unit.
  • compressed data such as compressed data d1 in FIG. 2 including an identifier (“0” in the example of FIG. 1) indicating that the compressed data is not based on the longest match data is read
  • the Huffman encoding / decoding algorithm is used.
  • Decompressed data is generated by the decoding process.
  • the generated decompressed data is stored in both the storage area B2 and the storage area B3.
  • the storage area B2 is called, for example, a reference unit.
  • compressed data such as compressed data d2 and compressed data d3 in FIG. 2
  • compressed data d2 and compressed data d3 in FIG. 2 including an identifier (“1” in the example of FIG. 1) indicating that the compressed data is based on the longest match data
  • the data in the storage area B2 indicated by the code becomes the decompressed data.
  • the generated decompressed data is stored in both the storage area B2 and the storage area B3.
  • the storage area B2 By storing the decompressed data in the storage area B2, the storage area B2 can be in the same state as the storage area A2 when the compression code generation processing is performed, and therefore the same data as before compression based on the compression code Is acquired.
  • An expanded file F3 is generated based on the expanded data stored in the storage area B3.
  • Fig. 3 shows code assignment in UTF-8.
  • UTF-8 as described above, a 1 to 4 byte character code is used. A range of character code values is determined according to the length of the character code.
  • 1-byte character code is expressed as a value between 0x00 and 0x7F. Therefore, in binary notation, it is “0XXXXXX”, and the first bit is “0” (“X” is either “0” or “1”).
  • the 2-byte character code has a value of 0xC2 to 0xDF in the first byte (0xC0 and 0xC1 are used for control codes, for example), and a value of 0x80 to 0xBF is used in the second byte. That is, the first byte of the 2-byte character code is “110YYYYX”, and the second byte is “10XXXXXX” (“Y” is at least one of consecutive “Y” is “1”. Showing).
  • the 3-byte character code has a value of 0xE0 to 0xEF for the first byte, and a value of 0x80 to 0xBF for the second and third bytes. That is, the first byte of the 3-byte character code is “1110YYYY”, the second byte is “10YXXXX”, and the third byte is “10XXXXXX”.
  • the 4-byte character code has a value of 0xF0 to 0xF7 for the first byte, and a value of 0x80 to 0xBF for the second to fourth bytes. That is, the first byte of the 4-byte character code is “11110YYY”, the second byte is “10YYXXXX”, and the third and fourth bytes are “10XXXXXXX”.
  • the first byte data and the second and subsequent data have different values.
  • the compression processing in FIG. 1 for example, the first byte data of a 3-byte character code in the storage area A1 and each data in the storage area A2 are collated.
  • the storage area A2 includes, for example, the second byte data of the 3-byte character code and the third byte data.
  • the character code systems such as UTF-8 where the character code of 2 bytes or more has different values for the data of the first byte and the data of the second byte and later, it is clear that the values are different. Collation processing is performed on the first byte data and the second and subsequent data.
  • LZ77 for example, compression using ZIP or the like
  • LZ77 can be applied as long as it is data that can obtain a collation result between data to be compressed.
  • ZIP and the like are also used for general purposes for different types of data such as document data and image data. Since it can be applied regardless of the type, it has been difficult to make improvements for specific types of data. However, it is clear that collation processing is performed even between data that is apparently different from each other as described above by following detailed procedures for collation processing between data in a specific character code system. It became.
  • data units corresponding to character codes are managed for data using character code systems such as UTF-8 that have a plurality of character code sizes, and each data unit managed is managed. Is verified.
  • compression coding is performed for different 3-byte characters, ignoring character code boundaries. For example, by comparing “11” (0xE2BC98E38692) and “12” (0xE2BC98E386), 0xE2BC98E386 (5 bytes) is extracted as a matching data string, and a compression code is assigned. In this case, the remaining part of the character code (0x92 for “11”) is the target of collation, and collation processing (“breaking up”) that is shifted from the boundary of the character code occurs. As a result, the compression ratio is expected to decrease.
  • FIG. 4 shows an example of compression processing.
  • the storage area A1, the storage area A2, the storage area A3, and the storage area A4 are secured in the memory, for example.
  • the content portion data in the file F1 shown in FIG. 4 is loaded into the storage area A1.
  • the storage area A1 is called, for example, an encoding unit.
  • the file F1 includes data “... 1st horse ... 2nd horse ... 3rd horse ...” (“...” is an unspecified character string).
  • the data loaded in the storage area A1 is converted into a fixed length code based on the encoding dictionary D1.
  • a compressed data generation process is performed based on the fixed-length code obtained by the conversion.
  • the fixed-length code for which the compressed data is generated is stored in the storage area A2.
  • the storage area A2 is called a reference unit, for example.
  • the compressed data is generated according to the result of the collation process between the fixed length code obtained by the conversion and the fixed length code stored in the storage area A2.
  • the generated compressed data is sequentially stored in the storage area A3, and a compressed file F2 is generated based on the compressed data stored in the storage area A3. Further, in FIG. 4, data in the storage areas A1 and A2 are schematically shown.
  • the character code L1 is read from the storage area A1, and the fixed length code M1 corresponding to the read character code L1 is read from the encoding dictionary D1.
  • the read fixed length code M1 is stored in the storage area A4.
  • collation processing is sequentially performed on the fixed-length code stored in the storage area A2.
  • the character code L2 is further read from the storage area A1, and the read character code L2 Is read from the encoding dictionary D1 and stored in the storage area A4.
  • the fixed length code N2 following the fixed length code N1 in the storage area A2 matches the fixed length code M2. If they match, the character code is further read from the storage area A1, and the same procedure is repeated. The above-described procedure is repeated until a fixed-length code that does not match is obtained, or the number of fixed-length codes that match continuously exceeds a lower limit (for example, a predetermined code number) Lmin. Similar processing is performed over the entire storage area A2, and the longest matching fixed-length code string (longest matching fixed-length code string) is extracted from the storage area A2.
  • a lower limit for example, a predetermined code number
  • compressed data d11 is generated.
  • the compressed data d11 is an identifier (“1” in the example of FIG. 4) indicating that it is a compression code based on the longest matching fixed-length code string, and the length of the longest matching fixed-length code string (for example, the longest matching fixed-length code string).
  • the position of the longest matching fixed-length code string is indicated by the number of codes indicating the number of fixed-length codes separated from the update position of the storage area A2.
  • the fixed-length code string stored in the storage area A4 is written into the storage area A2. When fixed-length codes are written in all areas of the storage area A2, among the fixed-length codes stored in the storage area A2, the fixed-length code stored first in the storage area A2 is added to the storage area A4.
  • the fixed-length code string stored in is overwritten.
  • compressed data d12 When the longest matching fixed length code string is shorter than the lower limit Lmin, compressed data d12 is generated.
  • the compressed data d12 includes an identifier ("0" in the example of FIG. 4) indicating that the compressed code is not based on the longest matching fixed-length code string, and a fixed-length code M1. Further, the fixed length code M1 is written in the storage area A2. When fixed-length codes are written in the entire area of the storage area A2, the fixed-length code M1 is added to the fixed-length code stored first in the storage area A2 among the fixed-length codes stored in the storage area A2. Will be overwritten.
  • Compressed data is generated by the above-described procedure, and is written in the storage area A3 each time it is generated.
  • a compressed file F2 is generated based on the compressed data stored in the storage area A3.
  • the encoding dictionary D1 is also included in the compressed file F2, or the encoding dictionary D1 is passed to a computer that decompresses the compressed file F2 by other methods. A more detailed compression processing procedure will be described later.
  • FIG. 5 shows an example of the encoding dictionary D1.
  • the encoding dictionary D1 indicates the correspondence between character codes and fixed-length codes.
  • An encoding dictionary D1 shown in FIG. 5 is an example of an encoding dictionary for a Japanese document.
  • the code length of the fixed length code is 12 bits.
  • a storage area is provided for each character code by 4 bytes, and information indicating the position where the character code is stored is used as a fixed-length code. For example, since the “NUL” code is stored at the head of the encoding dictionary D1, the fixed-length code corresponding to the “NUL” code (0x00) is “0x000”.
  • the character code “0” (0x41) exists at a position of 4 bytes ⁇ 32 (0x020 in hexadecimal notation) from the beginning of the encoding dictionary D1, and therefore has a fixed length corresponding to the character code “a”.
  • the code is “0x020”.
  • a fixed-length code is assigned to each character code. If the code length is m bits, the number of character codes to which a fixed-length code is assigned is 2m. In the example of FIG. 5, since the code length is 12 bits, code lengths are assigned to 4096 types of character codes.
  • a fixed-length code may be assigned to all character codes of the character code system used for the file F1, or a compression code may be assigned to some character codes. Control in the case of assigning fixed-length codes to some character codes will be described later.
  • FIG. 6 shows an example of the encoding dictionary D2.
  • the encoding dictionary D2 indicates a correspondence relationship between a character code or character code string and a fixed-length code.
  • An encoding dictionary D2 illustrated in FIG. 6 is an example of an encoding dictionary for an English document.
  • the code length of the fixed length code is 12 bits.
  • a storage area having a predetermined length is provided for a character code or character code string, and information indicating a position where the character code or character code string is stored is used as a fixed-length code.
  • a fixed-length code similar to the coding dictionary shown in FIG. 5 is assigned to “NUL” and “a”.
  • a fixed-length code is also assigned to basic English words. As shown in FIG. 6, for example, a fixed-length code “0x100” is assigned to the English word “one”.
  • the fixed-length code corresponding to the data string that matches the data string existing at the reading position in the storage area A1 is encoded dictionary D2 ( (Corresponding to the coding dictionary D1 in FIG. 4) and stored in the storage area A4.
  • the fixed-length code 0x020 (“a” character code) and the fixed-length code 0x180 (“are” character code) are also extracted.
  • FIG. 7 shows an example of decompression processing.
  • the storage area B1, the storage area B2, and the storage area B3 mechanism area are secured in the memory, for example.
  • the compressed data in the compressed file F2 shown in FIG. 7 is loaded into the storage area B1.
  • the storage area B1 is called, for example, an encoding unit.
  • the encoding dictionary D1 is loaded from the compressed file F2 into the memory. As described above, even if the encoding dictionary D1 is not included in the compressed file F2, the encoding dictionary D1 used for compression may be held in advance.
  • Compressed data loaded in the storage area B1 is read sequentially.
  • the read compressed data is decompressed according to the identifier included in the compressed data.
  • FIG. 7 illustrates compressed data d12 as an example of compressed data when the identifier is an identifier indicating that the identifier is not a compressed code based on the longest match fixed-length code string (“0” in the example of FIG. 7).
  • the fixed length code M1 included in the compressed data d12 is decoded based on the encoding dictionary D1. Further, the fixed length code M1 in the compressed data d12 is written at the update position of the storage area B2.
  • the character code d22 obtained by decoding based on the encoding dictionary D1 is written in the storage area B3.
  • Compressed data d11 is exemplified in FIG. 7 as an example of compressed data when the identifier is an identifier (“1” in the example of FIG. 7) indicating that the identifier is a compressed code based on the longest matching fixed-length code string.
  • a fixed-length code string d21 (for example, fixed-length code strings M1 to Mn) is read from the storage area B2.
  • the fixed-length code string d21 is written at the update position in the storage area B2, and is decoded using the coding dictionary D1.
  • the character code string d23 (for example, character code strings L1 to Ln corresponding to the fixed-length code strings M1 to Mn) obtained by decoding is written in the storage area B3.
  • the decompressed file F3 is generated based on the data (character code) sequentially written in the storage area B3. A more detailed decompression procedure will be described later.
  • FIG. 8 shows a functional configuration example.
  • the computer 1 that executes the processing of the present embodiment includes a storage unit 13 and further includes at least one of a compression unit 11 and an expansion unit 12.
  • the compression unit 11 performs compression processing
  • the expansion unit 12 performs expansion processing.
  • the storage unit 13 stores a file F1 to be compressed, a compressed file F2 obtained by compression processing, a file F3 obtained by decompressing the file F2, and the like.
  • the storage unit 13 stores the compression dictionary D1.
  • the storage unit 13 is used as a work area for the compression unit 11 and the expansion unit 12.
  • the compression unit 11 includes a control unit 111, a collation unit 112, an update unit 113, and a conversion unit 114.
  • the decompression unit 12 includes a control unit 121, a reference unit 122, an update unit 123, and a conversion unit 124.
  • the control unit 111 controls the collating unit 112 and the updating unit 113 to realize the compression function.
  • the control unit 111 reserves storage areas (for example, the above-described storage area A1, storage area A2, and storage area A3) in the storage unit 13 in order to hold data used for processing of each functional unit.
  • the control unit 111 sequentially reads the data at the reading position in the storage area A1.
  • the conversion unit 114 converts the data read by the control unit 111 into a fixed length code based on the encoding dictionary D1.
  • the control unit 111 stores the fixed length code converted by the conversion unit 114 in the storage area A4.
  • the matching unit 112 performs reference processing for the fixed-length code in the storage area A2.
  • the updating unit 113 updates the fixed-length code string in the storage area A2 based on the fixed-length code in the storage area A4.
  • the control unit 111 generates compressed data according to the reference result in the storage area A2 by the collation unit 112. An execution procedure of processing by each functional unit in the compression unit 11 will be described later.
  • the control unit 121 controls the reference unit 122 and the update unit 123 to realize the expansion function.
  • the control unit 121 reserves storage areas (for example, the above-described storage area B1, storage area B2, and storage area B3) in the storage unit 13 in order to hold data used for processing of each functional unit.
  • the control unit 121 reads the compressed data at the reading position in the storage area B1, and determines an identifier included in the read compressed data. When the identifier is a predetermined identifier, the control unit 121 causes the reference unit 122 to execute the reference processing of the fixed length code in the storage area B2.
  • the update unit 123 updates the storage area B2 based on the obtained fixed-length code.
  • the conversion unit 124 converts the obtained fixed-length code into decompressed data based on the encoding dictionary D1. An execution procedure of processing by each functional unit in the decompression unit 12 will be described later.
  • FIG. 9 shows an example of the position information table T1 used for managing the position information of the storage area.
  • the position information table T1 is used for managing the position in the storage unit 13 of each storage area (storage area A1, storage area A2, storage area A3, etc.) used for compression processing.
  • the position information table T1 includes a start position P1, an end position P2, and a read position P3 of the storage area A1 into which the file F1 is loaded.
  • the position information table T1 includes a start position P4, an end position P5, a reference position P6, and an update position P7 of the storage area A2. Further, the position information table T1 includes a start position P8, an end position P9, and a write position P10 of the storage area A3.
  • the initial value of each piece of position information stored in the position information table T1 is set by the control unit 111.
  • the start position and end position of each storage area indicate the storage start position and end position of the data to be compressed or expanded (for example, the portion excluding the header and trailer portion in the file).
  • the initial values of the read position P3 and the start position P1 are the same
  • the initial values of the reference position P6, the update position P7, and the start position P4 are the same
  • the initial values of the write position P10 and the start position P8 are The same.
  • FIG. 10 shows a procedure example of the compression process.
  • the compression function is called by the operation of the operating system or application program in the computer 1 (S101).
  • the control unit 111 secures the storage area A1, the storage area A2, the storage area A3, and the storage area A4 shown in FIG.
  • Pre-processing such as setting of each position information shown in FIG. 9 is executed (S102).
  • control unit 111 loads the content portion of the compression target file F1 into the storage area A1 (S103). Further, the control unit 111 sets an end position P2 based on the end of the file F1. Next, the control unit 111 executes a search process for the longest matching fixed-length code string (S104).
  • FIG. 11 shows an example of a procedure for searching for the longest matching fixed-length code string.
  • the control unit 111 sets initial values of the reference position P6, the matching length La, and the longest matching position Pa (S201).
  • the reference position P6 and the longest match position Pa are set to be the same as the start position P4 or the same as the update position P7.
  • the coincidence length La is set to “0”, for example.
  • the control unit 111 determines whether or not the fixed length code M (j) exists in the storage area A4 (S203).
  • the fixed length code M (j) means a fixed length code stored at the jth position in the storage area A4.
  • the control unit 111 causes the conversion unit 114 to execute processing for acquiring the fixed-length code M (j) (S204).
  • FIG. 12 shows an example of the procedure for obtaining a fixed-length code.
  • the conversion unit 114 When the conversion unit 114 is instructed to acquire the fixed length code M (j) by the control unit 111 (S300), the conversion unit 114 reads the character code existing at the reading position P3 of the storage area A1 (S301). If it is a 1-byte character, 1-byte data is read, and if it is a 2-byte character, a 2-byte character is read. Next, based on the character code read in S301, the conversion unit 114 reads a fixed-length code corresponding to the character code read in S301 from the encoding dictionary D1 (S302). Furthermore, the conversion unit 114 updates information indicating the reading position P3 stored in the position information table (S303).
  • the update in S303 is performed based on the data length read by the conversion unit 114 in S301. For example, if a 1-byte character is read, the reading position P3 is moved by 1 byte.
  • the control unit 111 stores the fixed length code read in S302 in the jth position of the storage area A4 (S304). As described above, the fixed length code stored in the jth position of the storage area A4 is the fixed length code M (j).
  • the conversion unit 114 ends the acquisition process of the fixed-length code (S305).
  • the control unit 111 causes the verification unit 112 to execute the verification process ( S205).
  • the collation unit 112 calculates the fixed length code M (j) stored in the storage area A4 and the fixed length code present at the position moved from the reference position P6 according to the counter value j in the storage area A2. It is determined whether or not. Specifically, the position moved from the reference position P6 according to the counter value j is a position shifted by m ⁇ j bits from the reference position P6 if the code length of the fixed-length code is m bits.
  • the control unit 111 increments the counter value j (S206).
  • the upper limit value Lmax is a value set as the upper limit value of the matching length La.
  • the control unit 111 executes the process of S203.
  • the code length of the fixed length code stored in the storage area A2 is incremented in units. If the code length of the fixed length code is m bits, the reference position P6 is moved by m bits. Next, the control unit 111 determines whether or not the reference position P6 has reached the end point position P5 of the storage area A2 (S212). When the reference position P6 has not reached the end point position P5 in the determination in S212 (S212: No), the control unit 111 performs the process in S202.
  • the control unit 111 ends the search process for the longest match fixed-length code string (S213).
  • the longest match fixed-length code string obtained as a result of the search process of S104 is a fixed-length code string within the range of the match length La from the longest match position Pa in the storage area A2 at the time when the process of S104 ends. Since the match length La indicates the number of matched codes, if the code length of the fixed-length code string is m bits, the longest match fixed-length code string has a length of La ⁇ m bits.
  • control unit 111 executes compressed data generation / write processing based on the result of the search processing in S104 (S105).
  • FIG. 13 shows an example of the procedure for generating / writing compressed data.
  • the control unit 111 determines whether or not the match length La is equal to or greater than the lower limit value Lmin (S401).
  • the lower limit value Lmin is a value set as the lower limit value of the matching length La. For example, when the number of bits used for expressing the match length La is m1 and the number of bits used for expressing the longest match position Pa is m2, it is determined that La ⁇ m ⁇ m1 + m2 Can be. In that case, the data size of the compressed data generated using the fixed-length code string is smaller than the data size of the compressed data generated by the compression code using the longest matching fixed-length code string.
  • the lower limit value Lmin is set so that La ⁇ m ⁇ m1 + m2.
  • the setting of the lower limit Lmin is adjusted according to other settings (for example, settings of values such as m1, m2, and m).
  • the control unit 111 When the matching length La is equal to or greater than the lower limit value Lmin (S401: Yes), the control unit 111 generates information of the identifier “1” (S402). Subsequently, the control unit 111 generates m1 bit information indicating the matching length La and m2 bit information indicating the longest matching position Pa (S403). In S403, the control unit 111 generates information that is continuous in the order of, for example, the identifier “1”, the matching length La, and the longest matching position Pa. Next, the control unit 111 substitutes the matching length La into the movement amount Lc (S404).
  • the movement amount Lc indicates the number of fixed-length codes that have been subjected to compression processing by generating compressed data. Since the number of fixed-length codes corresponding to the matching length La is converted into the compressed code generated in S403, the movement amount Lc is the same as the matching length La.
  • the control unit 111 When the matching length La is shorter than the lower limit Lmin (S401: No), the control unit 111 generates information of the identifier “0” (S405). Subsequently, the control unit 111 reads the fixed length code M (0) stored in the storage area A4 (S406). In S406, the control unit 111 generates information in which the identifier “0” generated in S405 and the fixed-length code M (0) read from the storage area A4 are continuous. Further, the control unit 111 substitutes 1 for the movement amount Lc (S407).
  • the control unit 111 When the processing of S404 or S407 is performed, the control unit 111 writes the compressed data at the compressed data writing position P10 (S408).
  • the compressed data is information generated in S404 or S408. Further, the control unit 111 updates the writing position P10 according to the length of the compressed data written in S408. For example, the length of the compressed data is 1 + m1 + m2 bits for the compressed data generated in S404. Further, the length of the compressed data generated in S408 is, for example, 1 + m bits.
  • the control unit 111 ends the compressed data generation / writing process (S410).
  • control unit 111 causes the update unit 113 to execute the update process of the storage area A2 (S106).
  • FIG. 14 shows a procedure example of the update process of the storage area A2.
  • the update unit 113 writes the fixed length code M (i) stored in the storage area A4 at a position moved according to the counter value i from the update position P7 of the storage area A2 (S502).
  • the position written in S502 is a position shifted by m ⁇ i bits from the update position P7 when the code length m of the fixed-length code is set.
  • the position written in S502 is a position represented by P7 + i when the update position P7 is expressed in units of the code length m of the fixed-length code.
  • the updating unit 113 determines whether or not the counter value i has reached a value obtained by subtracting 1 from the movement amount Lc (S503). By performing the processing until the counter value i becomes a value obtained by subtracting 1 from the movement amount Lc, among the fixed-length codes stored in the storage area A4, the fixed-length code that has been converted into the compression code is stored. This is reflected in the area A2.
  • the updating unit 113 increments the counter value i (S504). Further, based on the counter value i incremented in S504, it is determined whether the update position P7 + counter value i has reached the end position P5 of the storage area A2 (S505). When the update position P7 + counter value i has reached the end position P5 of the storage area A2 (S505: Yes), the update unit 113 subtracts the counter value i from the start position P4 of the storage area A2 to the update position P7. A value is substituted (S506).
  • the fixed area code is not stored outside the storage area A2, and the storage area A2 is repeatedly used.
  • the update position P7 + counter value i has not reached the end position P5 of the storage area A2 (S505: No), or when the process of S506 is performed, the update unit 113 performs the process of S502.
  • the update unit 113 updates the update position P7 of the storage area A2 (S507). Specifically, a value obtained by adding the movement amount Lc to the update position P7 is substituted into the update position P7.
  • the update unit 113 ends the update process of the storage area A2 (S508).
  • control unit 111 causes the update unit 113 to execute the update process of the storage area A4 when the update process of the storage area A2 by the update unit 113 is completed (S107).
  • FIG. 15 shows an example of the procedure for updating the storage area A4.
  • the update unit 113 deletes the fixed-length codes M (0) to M (Lc-1) in the storage area A4 (S601).
  • the update unit 113 determines whether or not the fixed length code M (Lc + k) exists (S603).
  • the updating unit 113 copies the fixed length code M (Lc + k) to the position of the counter value k in the storage area A4 (S604). That is, the update unit 113 stores the fixed length code M (k) in the storage area A4. Furthermore, the update unit 113 deletes the fixed length code M (Lc + k) (S605).
  • the updating unit 113 increments the counter value k (S606).
  • the update unit 113 performs the process of S603. In the determination in S603, when the fixed length code M (Lc + k) does not exist (S603: No), the update unit 113 ends the update process of the storage area A4 (S607).
  • the control unit 111 determines whether the compression process has been completed up to the end point of the file F1 (S108). In S108, for example, it is determined whether or not the read position P3 of the storage area A1 has reached the end position P2 of the storage area A1. If the compression process has not been completed up to the end point of the file F1 (S108: No), the control unit 111 performs the process of S104. On the other hand, when the compression processing is completed up to the end point of the file F1 (S108: Yes), the control unit 111 performs the generation processing of the compressed file F2 based on the compressed data group stored in the storage area A3 ( S109).
  • the control unit 111 ends the compression process (S110).
  • the control unit 111 notifies the end of the compression process, for example, to the caller of the compression function.
  • the end notification of the compression process includes, for example, information indicating the storage destination of the compressed file F2.
  • FIG. 16 shows an example of the position information table T2 used for managing the position information of the storage area.
  • the position information table T2 is used for managing the position in the storage unit 13 of each storage area (storage area B1, storage area B2, storage area B3, etc.) used for the expansion process.
  • the position information table T2 includes a start position Q1, an end position Q2, and a read position Q3 of the storage area B1 into which the compressed file F2 is loaded.
  • the position information table T2 includes a start position Q4, an end position Q5, a reference position Q6, and an update position Q7 of the storage area B2. Further, the position information table T2 includes a start position Q8, an end position Q9, and a write position Q10 of the storage area B3.
  • the initial value of each piece of position information stored in the position information table T2 is set by the control unit 111.
  • the start position and end position of each storage area indicate the storage start position and end position of the data to be compressed or expanded (for example, the portion excluding the header and trailer portion in the file).
  • the initial values of the read position Q3 and the start position Q1 are the same
  • the initial values of the reference position Q6 and the update position Q7 are the same as the start position Q4
  • the initial values of the write position Q10 and the start position Q8 are The same.
  • FIG. 17 shows a procedure example of the decompression process.
  • the decompression function is called by the operation of the operating system or application program in the computer 1 (S700).
  • the control unit 121 secures the storage area B1, the storage area B2, the storage area B3, and the storage area B4 shown in FIG. 2, and each position information in each storage area (for example, FIG. Preprocessing such as setting of each position information shown) is executed (S701).
  • control unit 121 loads the content portion of the compressed file F2 into the storage area B1 (S702). Further, the control unit 121 sets an end position Q2 based on the end of the compressed file F2. Next, the control unit 121 indicates that the identifier included in the compressed data at the reading position Q3 in the storage area B1 is not compressed data based on the longest matching data string (identifier “0”), or based on the longest matching data string. It is determined whether the data is compressed data (identifier “1”) (S703).
  • the control unit 121 reads the fixed length code included in the compressed data at the reading position Q3 and stores it in the storage area B4 (S704).
  • the fixed-length code stored in the storage area B4 is a fixed-length code M (0).
  • the control unit 121 causes the reference unit 122 to refer to the storage area B2 based on the position Pa and the length La included in the compressed data at the reading position Q3.
  • the reference unit 122 reads a fixed-length code string having a length La from the position Pa of the storage area B2, and stores it in the storage area B4 (S705).
  • the fixed-length code string stored in the storage area B4 is M (0) to M (Lc-1).
  • the control unit 121 causes the conversion unit 124 to determine each of the fixed amount codes M (0) to M (Lc ⁇ 1) stored in the storage area B4 based on the encoding dictionary D1. Conversion is executed (S706).
  • the conversion unit 124 specifies the position in the encoding dictionary D1 based on the value of the fixed-length code, and reads the decompressed data (character code). According to the example of the encoding dictionary D1 in FIG. 5, when the value of the fixed length code is 0x020, the character code “a” is read.
  • control unit 121 When the decompressed data is read in S706, the control unit 121 writes each of the read decompressed data in the write position Q10 in the storage area B3 (S707). Furthermore, the control unit 121 updates the writing position Q10 according to the length of the written decompressed data. When the process of S707 is performed, the control unit 121 causes the update unit 123 to update the storage area B2 (S708).
  • FIG. 18 shows a procedure example of the update process of the storage area B2.
  • the updating unit 123 writes the fixed length code M (i) stored in the storage area B4 at a position moved according to the counter value i from the update position Q7 of the storage area B2 (S802).
  • the position written in S802 is a position shifted by m ⁇ i bits from the update position Q7 when the code length m of the fixed-length code is set.
  • the position written in S802 is a position represented by Q7 + i when the update position Q7 is expressed in terms of the code length m of the fixed-length code.
  • the updating unit 123 determines whether or not the counter value i has reached a value obtained by subtracting 1 from the movement amount Lc (S803). By performing processing until the counter value i becomes a value obtained by subtracting 1 from the movement amount Lc, each of the fixed length codes stored in the storage area B4 is reflected in the storage area B2.
  • the updating unit 123 increments the counter value i (S804). Furthermore, the update unit 123 determines whether the update position Q7 + counter value i has reached the end position Q5 of the storage area B2 based on the counter value i incremented in S804 (S805). When the update position Q7 + counter value i has reached the end position Q5 of the storage area B2 (S805: Yes), the update unit 123 subtracts the counter value i from the start position Q4 of the storage area B2 to the update position Q7. A value is substituted (S806).
  • the storage area B2 is repeatedly used without protruding beyond the storage area B2 and storing the fixed length code.
  • the update unit 123 performs the process of S802.
  • the update unit 123 updates the update position Q7 of the storage area B2 (S807). Specifically, a value obtained by adding the movement amount Lc to the update position Q7 is substituted into the update position Q7.
  • the update unit 123 ends the update process of the storage area B2 (S808). In S808, the update unit 123 clears the information in the storage area B4.
  • the control unit 121 determines whether the decompression process has reached the end point of the compressed file F2 (S709). For example, S709 is determined depending on whether or not the read position Q3 of the storage area B1 has reached the end position Q2 of the storage area B1. When the read position Q3 has not reached the end position Q2 (S709: No), the control unit 121 executes the process of S703. When the read position Q3 reaches the end position Q2 (S709: Yes), the control unit 121 generates the decompressed file F3 using the decompressed data stored in the storage area B3 and stores it in the storage unit 13 ( S710). That is, the decompressed file F3 is closed.
  • control unit 121 ends the expansion process (S711).
  • the control unit 121 notifies the end of the decompression process, for example, to the caller of the decompression function.
  • the extension processing end notification includes, for example, information indicating the storage destination of the extension file F3.
  • FIG. 19 shows a hardware configuration example of the computer 1.
  • the computer 1 includes, for example, a processor 301, a RAM (Random Access Memory) 302, a ROM (Read Only Memory) 303, a drive device 304, a storage medium 305, an input interface (I / F) 306, an input device 307, an output interface (I / F) 308, an output device 309, a communication interface (I / F) 310, a SAN (Storage Area Network) interface (I / F) 311, a bus 312 and the like. Each piece of hardware is connected via a bus 312.
  • a processor 301 includes, for example, a processor 301, a RAM (Random Access Memory) 302, a ROM (Read Only Memory) 303, a drive device 304, a storage medium 305, an input interface (I / F) 306, an input device 307, an output interface (I / F) 308, an output device 309, a communication interface (I / F
  • the RAM 302 is a readable / writable memory device, and for example, a semiconductor memory such as SRAM (Static RAM) or DRAM (Dynamic RAM), or a flash memory even if not a RAM is used.
  • the ROM 303 includes a PROM (Programmable ROM).
  • the drive device 304 is a device that performs at least one of reading and writing of information recorded in the storage medium 305.
  • the storage medium 305 stores information written by the drive device 304.
  • the storage medium 305 is a storage medium such as a hard disk, a flash memory such as an SSD (Solid State Drive), a CD (Compact Disc), a DVD (Digital Versatile Disc), or a Blu-ray disc.
  • the computer 1 includes a drive device 304 and a storage medium 305 for each of a plurality of types of storage media.
  • the input interface 306 is connected to the input device 307 and is a circuit that transmits an input signal received from the input device 307 to the processor 301.
  • the output interface 308 is a circuit that is connected to the output device 309 and causes the output device 309 to execute an output in accordance with an instruction from the processor 301.
  • the communication interface 310 is a circuit that controls communication via the network 3.
  • the communication interface 310 is, for example, a network interface card (NIC).
  • the SAN interface 311 is a circuit that controls communication with a storage device connected to the computer 1 via a storage area network.
  • the SAN interface 311 is, for example, a host bus adapter (HBA).
  • the input device 307 is a device that transmits an input signal according to an operation.
  • the input signal is, for example, a key device such as a keyboard or a button attached to the main body of the computer 1, or a pointing device such as a mouse or a touch panel.
  • the output device 309 is a device that outputs information according to the control of the computer 1.
  • the output device 309 is, for example, an image output device (display device) such as a display, or an audio output device such as a speaker.
  • an input / output device such as a touch screen is used as the input device 307 and the output device 309.
  • the input device 307 and the output device 309 may be integrated with the computer 1 or may be an apparatus that is not included in the computer 1 and is connected to the computer 1 from the outside, for example.
  • the processor 301 reads the program stored in the ROM 303 or the storage medium 305 to the RAM 302 and performs the processing of the compression unit 11 or the processing of the decompression unit 12 according to the procedure of the read program.
  • the RAM 302 is used as a work area of the processor 301.
  • the function of the storage unit 13 is that the ROM 303 and the storage medium 305 store program files (such as an application program 24, middleware 23, and OS 22 described later) and data files (such as the compression target file F1, the compressed file F2, and the decompressed file F3). This is realized by using the RAM 302 as a work area of the processor 301.
  • the program read by the processor 301 will be described later with reference to FIG.
  • the control unit 111 is realized by the processor 301 performing control of the RAM 302 (exclusive control, etc.), access processing to the RAM 302, calculation on information obtained by the access processing, calculation processing in the processor 301, and the like.
  • the collation unit 112 is realized by the processor 301 performing access processing to the RAM 302, collation calculation with respect to information obtained by the access processing, and the like.
  • the update unit 113 is realized by performing an access process to the RAM 302 by the processor 301.
  • the conversion unit 114 is realized by performing an access process to the RAM 302 by the processor 301, a collation operation on information obtained by the access process, and the like.
  • the control unit 121 is realized by the processor 301 performing control (exclusive control or the like) of the RAM 302, access processing to the RAM 302, computation on information obtained by the access processing, computation processing in the processor 301, and the like.
  • the reference unit 122 is realized by the processor 301 performing access processing to the RAM 302 and the like.
  • the update unit 123 is realized by performing processing such as access processing to the RAM 302 by the processor 301.
  • the conversion unit 124 is realized by performing an access process to the RAM 302 by the processor 301, a collation operation on information obtained by the access process, and the like.
  • FIG. 20 shows a configuration example of a program operating on the computer 1.
  • an OS (Operating System) 22 for controlling the hardware group 21 (301 to 312) shown in FIG. 19 operates.
  • the processor 301 operates in accordance with the procedure according to the OS 22 to control and manage the hardware group 21, whereby the processing according to the application program 24 and the middleware 23 is executed in the hardware group 21. Further, in the computer 1, the middleware 23 or the application program 24 is read into the RAM 302 and executed by the processor 301.
  • the processor 301 When the processor 301 calls the compression function, the processor 301 performs processing based on at least a part of the middleware 23 or the application program 24 to compress the processing (by controlling the hardware group 21 based on the OS 22).
  • the function of the unit 11 is realized.
  • the processor 301 when the decompression function is called, the processor 301 performs processing based on at least a part of the middleware 23 or the application program 24 (by controlling the hardware group 21 based on the OS 22). )
  • the function of the decompression unit 12 is realized.
  • Each of the compression function and the decompression function may be included in the application program 24 itself, or may be a part of the middleware 23 that is executed by being called according to the application program 24. Alternatively, the compression function and the decompression function may be one function of the OS 22.
  • FIG. 21 shows a configuration example of an apparatus in the system of the embodiment.
  • the system of FIG. 21 includes a computer 1a, a computer 1b, a base station 2, and a network 3.
  • the computer 1a is connected to the network 3 connected to the computer 1b by at least one of wireless and wired.
  • the compression unit 11 and the expansion unit 12 illustrated in FIG. 8 may be included in either the computer 1a or the computer 1b illustrated in FIG.
  • the computer 1b includes the compression unit 11 (including the control unit 111, the collation unit 112, the update unit 113, and the conversion unit 114), and the computer 1a includes the decompression unit 12 (the control unit 121, the reference unit 122, the update unit 123, and the conversion unit).
  • the computer 1b may include the compression unit 11, and the computer 1a may include the decompression unit 12. Further, both the computer 1 a and the computer 1 b may include the compression unit 11 and the expansion unit 12.
  • FIG. 22 shows an example of collation processing in a data unit different from the data unit constituting the data to be compressed.
  • FIG. 22 partially shows each of the storage area A1 and the storage area A2.
  • a dotted line delimiter in each storage area indicates a delimiter in units of 1 byte, and a solid line delimiter indicates a character code delimiter.
  • a 3-byte character code is illustrated as data in each storage area.
  • the position in the storage area A1 from which the processing target data is read is the reading position P3 (1), and the position of the data in the storage area A2 to be collated with the processing target data is referred to. It is assumed that the position is P6 (1).
  • the end of the longest match data may exist at a position different from the character code delimiter.
  • FIG. 22 illustrates a case where a 3-byte character code is extracted for two characters and a 2-byte portion of the 3-byte character code is extracted as the longest match data.
  • a compression code is generated based on the position and length of the extracted longest match data, so that the reference position P6 (1) and the length of the longest match data (8 bytes) are used. Based on this, a compression code is generated.
  • the compression code is generated based on the longest match data shown in FIG. 22, the position in the storage area A1 from which the processing target is read is updated from the reading position P3 (1) to the reading position P3 (2). Subsequently, the longest match data is searched based on the data from the reading position P3 (2).
  • FIG. 23 shows an example of collation processing in a data unit different from the data unit constituting the data to be compressed.
  • FIG. 23 partially shows each of the storage area A1 and the storage area A2.
  • the data at the read position P3 (2) is “10XXXXXX”, and is the data after the second byte in the UTF-8 character code system.
  • the data in the storage area A2 that matches the data (“10XXXXXX”) at the reading position P3 (2) exists at the reference position P6 (21) or the reference position P6 (22) as shown in FIG. To do.
  • the data at the reference position P6 (21) is the third byte data of the 3-byte character code
  • the data at the reference position P6 (22) is the second byte of the 3-byte character code. It is data of.
  • the longest matching data is separated at a position different from the character code delimiter by performing collation between the 3-byte character codes in units of 1 byte. Then, as shown in FIG. 23, there is a possibility that collation between data having different positions in the character code occurs. However, for example, the first byte data and the third byte data of a 3-byte character code are collated although they do not clearly match due to the character code system.
  • FIG. 24 shows an example of the processing from S301 to S303.
  • the conversion unit 114 executes the processing of S301 to S303 shown in FIG. 12 in the following procedure when the character code used for the file F1 is, for example, UTF-8.
  • the conversion unit 114 When S300 is performed (S900), the conversion unit 114 reads 1-byte data from the reading position P3 of the storage area A1 (S901). The conversion unit 114 determines whether or not the first bit of the read data is “1” (S902). When the first bit of the data read in S901 is not “1” (“0”) (S902: No), the conversion unit 114 substitutes 1 for the movement amount Ld (S903). The movement amount Ld is used for updating a reading position P3 described later.
  • the conversion unit 114 determines whether the third bit of the read data is “1”. (S904). When the third bit of the data read in S901 is not “1” (“0”) (S904: No), the conversion unit 114 substitutes 2 for the movement amount Ld, and further from the storage area A1. One byte of data is read (S905).
  • the conversion unit 114 determines whether or not the fourth bit of the read data is “1”. (S906). When the fourth bit of the data read in S901 is not “1” (“0”) (S906: No), the conversion unit 114 substitutes 3 for the movement amount Ld, and further starts from the storage area A1. Two-byte data is read (S907).
  • the conversion unit 114 substitutes 4 for the movement amount Ld and reads out further 3 bytes of data from the storage area A1. (S908).
  • the conversion unit 114 refers to the index E1 based on the movement amount Ld, and corresponds to the data read from the encoding dictionary D1 using the reference result.
  • the fixed length code to be read is read (S909).
  • the index E1 will be described later with reference to FIG.
  • the conversion unit 114 further moves the reading position P3 by an amount (Ld bytes) indicated by the movement amount Ld (S910).
  • the conversion unit 114 executes the process of S304.
  • FIG. 25 shows an index example of the encoding dictionary D1.
  • the index E1 shown in FIG. 25 indicates the search start position in the coding dictionary D1 for each of the movement amounts Ld of 1 to 4.
  • the conversion unit 114 starts searching the coding dictionary D1 from the position of the fixed length code 0x000.
  • the conversion unit 114 starts searching the coding dictionary D1 from the position of the fixed length code 0x100.
  • the conversion unit 114 starts searching the coding dictionary D1 from the position of the fixed length code 0x180.
  • the conversion unit 114 starts searching the coding dictionary D1 from the position of the fixed length code 0x800.
  • FIG. 26 shows a modification of the search process for the longest matching fixed-length code string.
  • bit strings R1 to R3 including bits corresponding to the fixed length codes in the storage area A2 are used.
  • Storage areas for the bit strings R1 to R3 are provided in the storage unit 13. Since one bit is used for each fixed-length code in the storage area A2, the size of each bit string is 1 / m of the storage area A2.
  • the bit string R1 is a bit string indicating whether the fixed-length code M (j) to be verified is included in the storage area A2.
  • the fixed-length code M (j) is the j-th fixed-length code stored in the storage area A4 as described above. That is, when the same fixed length code as the fixed length code M (j) is stored at the position Px in the storage area A2, the Px-th bit of the bit string R1 indicates “existence” (the value is “1”). Becomes).
  • the bit string R2 is a bit string indicating the collation result from the fixed-length codes M (0) to M (j-1).
  • the bit string R3 indicates an operation result of the bit string R1 and the bit string R2.
  • the bit string R1 is slid by j bits (in the direction of the arrow in FIG. 26), and the result of the AND operation of the slid bit string R1 and the bit string R2 becomes the bit string R3.
  • the bit string R3 is copied to the bit string R2 for the (j + 1) th processing.
  • FIG. 27 A specific procedure will be described with reference to FIG. 27. By repeating the above-described processing using the bit strings R1 to R3, the longest matching position Pa is indicated by the position where the bit indicating “existence” remains to the end. Further, the number of repetitions indicates the matching length La.
  • FIG. 27 shows a procedure example of the search process for the longest matching code string.
  • control unit 111 determines whether or not the fixed length code M (j) is stored in the storage area A4 (S1004).
  • the control unit 111 causes the conversion unit 114 to execute acquisition processing of the fixed-length code M (j) (S1005). .
  • the conversion unit 114 executes the process illustrated in FIG.
  • the control unit 111 sets the fixed-length code M (in the storage area A2).
  • the presence / absence result of j) is reflected in the bit string R1 (S1006).
  • the control unit 111 changes the bit corresponding to the position where the same fixed-length code as the fixed-length code M (j) in the storage area A2 is “1”.
  • the control unit 111 performs an AND operation on each bit in the bit string with the bit string R2 and the bit string R1, and sets the result as the bit string R3 (S1008). ).
  • control unit 111 determines whether or not there is a bit indicating presence (“1”) in the bit string R3 (S1009).
  • the control unit 111 copies the bit string R1 to the bit string R2 (S1010), and increments the counter value j (S1011). ), The process of S1004 is executed.
  • the control unit 111 selects any position among the bits indicating existence (“1”) in the bit string R2. (A value indicating the number of bits) is substituted into the longest matching position Pa (a value indicating how many fixed-length codes are present) (S1012). Further, the control unit 111 substitutes the counter value j (S1013). When the process of S1013 is performed, the control unit 111 ends the search process for the longest matching code string (S1014).
  • the character code length is determined based on the first 1-byte data in the character code.
  • the collation unit 112 performs a character code length match determination based on 1-byte data in both the reading position P3 in the storage area A1 and the reference position P6 in the storage area A2. When it is determined that they match, collation in character code units may be performed.
  • the collation unit 112 determines that the characters match, and then the character in both the reading position P3 of the storage area A1 and the reference position P6 of the storage area A2.
  • the code is read and collated in character code units.
  • the collation process is skipped and the reference position P6 is updated. It is.
  • the movement amount of the reference position P6 in the update of the reference position P6 is, for example, the character code length of the character code of the reference position P6.
  • a character code is stored in the storage area A2. That is, the character code is written in the storage area A4 in the process of S304 in FIG. 12, and further, the character code in the storage area A4 is written in the storage area A2 in S502 in FIG. Further, for example, the number of bytes of the determined character code is used as the movement amount Ld of the reading position P3.
  • the collation unit 112 performs the collation processing unit of, for example, 1 byte, and determines whether the position in the 1-byte character code is the same data before collating 1-byte data. It is good also as performing.
  • the data of each byte used to represent the character code is classified into a plurality of types according to the character code length and the position in the character code. For example, as shown in FIG.
  • the 1-byte character is “0XXXXXXX”
  • the first byte of the 2-byte character is “110YYYYX”
  • the first byte of the 3-byte character is “1110 YYYY”
  • the 4-byte character is The first byte is “11110YYY”
  • the second and subsequent bytes of 2 to 4 byte characters are “10XXXXXXX”.
  • “X” represents an unspecified bit for convenience. That is, in UTF-8, it is classified into five types according to the data of several bits from the head in 1-byte data. Since it is clear that even if collation processing is performed between different types of 1-byte data, for example, the collation unit 112 skips the collation processing if the types of 1-byte data are different.
  • the target of the compression process may be a monitoring message output from the system.
  • the monitoring message sequentially stored in the buffer is compressed by the above-described compression processing and stored as a log file.
  • compression may be performed in units of pages in the database, or compression may be performed in units of a plurality of pages.
  • the data to be subjected to the above-described compression processing is not limited to character information as described above.
  • Information of only numerical values may be used, and the above-described compression processing may be used for data such as images and sounds.
  • the above-described compression processing may be used for data such as images and sounds.
  • a file containing a large amount of data obtained by speech synthesis includes many repetitions in the data, it is expected that the compression ratio is improved by the dynamic dictionary.
  • a moving image captured by a fixed camera also includes many repetitions because the images in each frame are similar. Therefore, by applying the above-described compression processing, the same effect as document data and audio data can be obtained.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

 一側面において、符号化対象のデータに対し、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理を抑制する。 圧縮プログラムが、コンピュータに、データの構成単位のサイズが複数種類存在するデータ群によるデータ列を取得し、前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行ない、前記制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを前記データ列から抽出し、前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する、処理を実行させる。

Description

圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム
 データの圧縮技術または伸張技術の少なくとも一方に関する。
 LZ77と呼ばれる圧縮アルゴリズムがある。LZ77においては、処理対象のデータよりも先に出現し、且つ処理対象のデータと同一であるデータの位置と長さに基づいて圧縮符号が生成される。先に出現した同一データの探索は、先に出現した各データとの照合処理により行なわれる。照合処理では、処理対象のデータと先に出現したデータとを所定のデータ単位ごとに比較が行なわれる。例えば、所定のデータ単位が1バイトであると、符号化対象のデータと先に出現したデータとの照合処理が1バイトごとに行なわれる。
特開平08-234956号公報
解決しようとする課題
 しかしながら、圧縮対象のデータを構成するデータ単位の長さが一定でないこともありうる。文書データにおいて、例えば、単一の文字を表現するバイト数が複数種類用いられる文字コード系が存在する。UTF-8などにおいては、1バイトで表現される文字(例えば英数字など)もあれば、3バイトで表現される文字(例えば、漢字第1種の一部、第2種漢字およびかな文字など)、4バイトで表現される文字(例えば漢字第3・第4水準の一部など)も存在する。UTF-8などの圧縮対象のデータ内に含まれるデータのデータ単位が複数種類用いられている圧縮対象のデータに対しても、圧縮対象のデータを構成する実際のデータ単位(例えば複数バイト)と異なるデータ単位(例えば1バイト)での照合処理が行なわれる。
 本発明の一側面においては、データを構成するデータ単位が複数種類用いられるデータに対する圧縮処理において行なわれる照合処理を効率化させることを目的とする。
 一態様によれば、コンピュータに、データの構成単位のサイズが複数種類存在するデータ群によるデータ列を取得し、前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行ない、前記制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを前記データ列から抽出し、
 前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する、処理を実行させる圧縮方法が用いられる。
 一態様によれば、コンピュータに、記憶領域内の位置を示す圧縮符号に基づく前記記憶領域の参照により固定長符号を取得し、取得した前記固定長符号に基づいて、前記記憶領域の更新を行なうとともに、取得した前記固定長符号を符号化辞書に基づき復号化する、
 ことを実行させる伸張方法が用いられる。
 一態様によれば、圧縮伸張システムが、データの構成単位のサイズが複数種類存在するデータ群によるデータ列を記憶する記憶部と、前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行なう制御部と、前記制御部の制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを、前記記憶部に記憶された前記データ列から抽出する抽出部と、前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する生成部と、を含む第1のコンピュータと、前記圧縮符号に基づき、前記合致データを復元する復元部、を含む第2のコンピュータと、を含む。
 一側面によれば、圧縮処理において、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理が行なわれることを抑制することができる。
図1は、LZ77を利用した圧縮処理の流れを示す。 図2は、LZ77を利用した伸張処理の流れを示す。 図3は、UTF-8におけるコードの割り当てを示す。 図4は、圧縮処理の例を示す。 図5は、符号化辞書D1の例を示す。 図6は、符号化辞書D2の例を示す。 図7は、伸張処理の例を示す。 図8は、機能構成例を示す。 図9は、位置情報テーブルT1の例を示す。 図10は、圧縮処理の手順例を示す。 図11は、最長一致固定長符号列の探索処理の手順例を示す。 図12は、固定長符号の取得処理の手順例を示す。 図13は、圧縮データの生成・書込み処理の手順例を示す。 図14は、記憶領域A2の更新処理の手順例を示す。 図15は、記憶領域A4の更新処理の手順例を示す。 図16は、位置情報テーブルT2の例を示す。 図17は、伸張処理の手順例を示す。 図18は、記憶領域B2の更新処理の手順例を示す。 図19は、コンピュータ1のハードウェア構成例を示す。 図20は、コンピュータ1で動作するプログラムの構成例を示す。 図21は、実施形態のシステムにおける装置の構成例を示す。 図22は、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理例を示す。 図23は、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理例を示す。 図24は、S301からS303の処理の例を示す。 図25は、符号化辞書D1のインデックス例を示す。 図26は、最長一致符号列の探索処理の変形例を示す。 図27は、最長一致符号列の探索処理の手順例を示す。
 図1は、LZ77を利用した圧縮処理の流れを示す。まず、記憶領域A1、記憶領域A2および記憶領域A3が例えばメモリ内に確保される。図1に示すファイルF1内のコンテンツ部分のデータは、記憶領域A1にロードされる。記憶領域A1は、例えば符号化部などと呼ばれる。ファイルF1は、「・・・1st horse・・・2nd horse・・・3rd horse・・・」というデータが含まれる(「・・・」は不特定な文字列である)。記憶領域A1にロードされたデータに基づいて、圧縮データの生成処理(後述)が行なわれる。また、圧縮データの生成処理が行なわれたデータは、記憶領域A1から記憶領域A2にコピーされる。記憶領域A2は、例えば参照部と呼ばれる。圧縮データは、記憶領域A1にロードされたデータと記憶領域A2内のデータとの照合処理の結果に応じて生成される。生成された圧縮データは順次記憶領域A3に格納され、記憶領域A3に格納された圧縮データに基づいて圧縮ファイルF2が生成される。また、図1において、記憶領域A1およびA2内のデータは模式的に示されている。
 図1に示される「1st horse・・・」の「h」以降が処理対象のデータである場合を例に圧縮データd1の生成を説明する。まず、記憶領域A2内で「horse・・・」の最長一致データが探索される(図1に示す「照合」)。図1の例において、処理対象のデータの先頭のデータである「h」と一致するデータが記憶領域A2に存在しない。処理対象のデータと一致するデータが記憶領域A2に存在しない場合には、処理対象のデータの先頭データをハフマン符号化/復号化アルゴリズムにより符号化して得られるハフマン符号を含む圧縮データd1が生成される。圧縮データとしてハフマン符号化を用いることは、あくまで一例であり、他の圧縮アルゴリズムが用いられてもよいし、先頭データそのものである非圧縮データが用いられてもよい。圧縮データd1には、最長一致データに基づく圧縮データでない旨を示す識別子(図1の例において「0」)が含まれる。
 図1に示される「2nd horse・・・」の「h」以降が処理対象のデータである場合を例に圧縮データd2の生成を説明する。まず、記憶領域A2内で「horse・・・」の最長一致データが探索される(図1に示す「照合」)。図1の例では、「1st horse・・・」が記憶領域A2に存在するので、例えば、処理対象のデータの「horse」と記憶領域A2内の「1st horse・・・」の「horse」とが一致する。例えば、記憶領域A2内の一致データ「horse」が、記憶領域A2内で処理対象データと最も長く一致するデータ(最長一致データ)である場合には、最長一致データの記憶領域A2内での位置と、最長一致データのデータ長に基づき圧縮データd2が生成される。圧縮データd2には、最長一致データに基づく圧縮データである旨を示す識別子(図1の例において「1」)が含まれる。
 図1に示される「3rd horse・・・」の「h」以降が処理対象のデータである場合を例に圧縮データd3の生成を説明する。まず、記憶領域A2内で「horse・・・」の最長一致データが探索される(図1に示す「照合」)。図1の例では、「1st horse・・・2nd horse」が記憶領域A2に存在するので、例えば、処理対象のデータの「horse」と記憶領域A2内の「1st horse」および「2nd horse」の「horse」とが一致する。例えば、記憶領域A2内の「1st horse」または「2nd horse」のいずれか「horse」が最長一致データである場合に、最長一致データの記憶領域A2内での位置と、最長一致データのデータ長に基づき圧縮データd3が生成される。圧縮データd3には、最長一致データに基づく圧縮データである旨を示す識別子(図1の例において「1」)が含まれる。
 生成された圧縮データd1~d3は、記憶領域A3に記憶され、圧縮ファイルF2の生成処理により、圧縮ファイルF2に含まれる。
 図2は、LZ77を利用した伸張処理の流れを示す。伸張処理においては、圧縮ファイルF2内の圧縮データをメモリ(記憶領域B1)にロードし、ロードされた圧縮データの識別子に応じて伸張データの生成処理を行なう。図2の「*」は圧縮されたデータであることを示す。記憶領域B1は、例えば符号化部などと呼ばれる。最長一致データに基づく圧縮データでない旨を示す識別子(図1の例において「0」)を含む圧縮データ(図2における圧縮データd1など)を読み出した場合には、ハフマン符号化/復号化アルゴリズムに従った復号処理により、伸張データが生成される。生成された伸張データは、記憶領域B2および記憶領域B3の双方に格納される。記憶領域B2は、例えば参照部などと呼ばれる。
 一方、最長一致データに基づく圧縮データである旨を示す識別子(図1の例において「1」)を含む圧縮データ(図2における圧縮データd2および圧縮データd3など)を読み出した場合には、圧縮符号に示される記憶領域B2内のデータが伸張データとなる。識別子が最長一致データに基づく圧縮データである旨を示す場合も、生成された伸張データは、記憶領域B2および記憶領域B3の双方に格納される。
 伸張データを記憶領域B2に格納することにより、記憶領域B2が圧縮符号の生成処理が行なわれる際の記憶領域A2と同じ状態にすることができ、そのため圧縮符号に基づいて圧縮する前と同じデータが取得される。記憶領域B3に格納された伸張データに基づいて伸張ファイルF3が生成される。
 図3は、UTF-8におけるコードの割り当てを示す。UTF-8においては、上述の通り、1~4バイトの文字コードが用いられる。文字コードの長さに応じて、文字コードの値の範囲が定められている。
 1バイトの文字コードは、0x00~0x7Fの値で表現される。そのため、2進数表記では「0XXXXXXX」となり、先頭のビットが「0」となる(「X」には「0」か「1」かのいずれかの値である)。2バイトの文字コードは、1バイト目が0xC2~0xDFの値であり(0xC0および0xC1は、例えば制御コードに用いられる)、2バイト目に0x80~0xBFの値が用いられる。すなわち、2バイトの文字コードの1バイト目は「110YYYYX」であり、2バイト目は「10XXXXXX」である(「Y」は連続する「Y」のうちいずれか少なくとも1つが「1」であることを示す)。3バイトの文字コードは、1バイト目が0xE0~0xEFの値であり、2バイト目及び3バイト目は0x80~0xBFの値が用いられる。すなわち、3バイトの文字コードの1バイト目は「1110YYYY」であり、2バイト目は「10YXXXXX」であり、3バイト目は「10XXXXXX」である。4バイトの文字コードは、1バイト目が0xF0~0xF7の値であり、2~4バイト目は0x80~0xBFの値が用いられる。すなわち、4バイト文字コードの1バイト目は「11110YYY」であり、2バイト目は「10YYXXXX」であり、3バイト目及び4バイト目はそれぞれ「10XXXXXX」である。
 UTF-8のコード割り当てでは、2バイト以上の文字コードにおいて、1バイト目のデータと2バイト目以降のデータとは異なる値となる。図1における圧縮処理において、例えば、記憶領域A1内の3バイトの文字コードの1バイト目のデータと、記憶領域A2内の各データと照合が行なわれる。すると、記憶領域A2には、例えば、3バイトの文字コードの2バイト目のデータも、3バイト目のデータも含まれる。2バイト以上の文字コードにおいて、1バイト目のデータと2バイト目以降のデータとは異なる値となるUTF-8などの文字コード体系では、異なる値であることが明らかであるにも関わらず、1バイト目のデータと2バイト目以降のデータについての照合処理が行なわれてしまう。
 LZ77を利用した圧縮(例えばZIPなどによる圧縮)は、圧縮対象のデータ間での照合結果が得られるデータであれば適用され得る。ZIPなどは、例えば、文書データや画像データなど異なる種別のデータに対しても汎用的に用いられる。種別を選ばず適用可能であるために、特定の種別のデータを対象とする改善が試みられにくい状況であった。しかしながら、特定の文字コード体系におけるデータ間の照合処理に対して敢えて詳細な手順を追尾することにより、上述のように異なる値になることが明らかなデータ間においても照合処理が行なわれることが明らかとなった。
 上述のように、文字コードのデータ単位よりも細かいデータ単位で照合処理が行なわれることにより、不要な照合処理が発生してしまう。本実施形態においては、UTF-8などの文字コードのサイズが複数種類存在する文字コード系を用いたデータに対して、文字コードに対応したデータ単位の管理を行ない、さらに管理されたデータ単位ごとに照合が行なわれる。
 また、異なる3バイト文字に対して、文字コードの境界を無視した圧縮符号化が行われることとなる。例えば「十一」(0xE2BC98E38692)と「十二」(0xE2BC98E386)との照合により、0xE2BC98E386(5バイト)が一致データ列として抽出され、圧縮符号が割り当てられることとなる。その場合には、文字コードの残りの部分(「十一」については、0x92)から照合の対象となり、文字コードの境界とずれたままの照合処理(「泣き別れ」)が発生してしまう。それにより圧縮率の低下が見込まれる。
 図4は、圧縮処理の例を示す。まず、記憶領域A1、記憶領域A2、記憶領域A3および記憶領域A4が例えばメモリ内に確保される。図4に示すファイルF1内のコンテンツ部分のデータは、記憶領域A1にロードされる。記憶領域A1は、例えば符号化部などと呼ばれる。ファイルF1は、「・・・1st horse・・・2nd horse・・・3rd horse・・・」というデータが含まれる(「・・・」は不特定な文字列である)。
 記憶領域A1にロードされたデータは、符号化辞書D1に基づいて固定長符号に変換される。変換で得られた固定長符号に基づいて圧縮データの生成処理が行なわれる。また、圧縮データが生成された固定長符号は記憶領域A2に格納される。記憶領域A2は、例えば参照部と呼ばれる。圧縮データは、変換により得られた固定長符号と記憶領域A2に格納された固定長符号との照合処理の結果に応じて生成される。生成された圧縮データは順次記憶領域A3に格納され、記憶領域A3に格納された圧縮データに基づいて圧縮ファイルF2が生成される。また、図4において、記憶領域A1およびA2内のデータは模式的に示されている。
 図4の例においては、記憶領域A1から文字コードL1が読み出され、読み出された文字コードL1に対応する固定長符号M1が符号化辞書D1から読み出される。読み出された固定長符号M1は、記憶領域A4に格納される。記憶領域A4に格納された固定長符号M1に基づいて、記憶領域A2内に格納された固定長符号に対して順次照合処理が行なわれる。記憶領域A4に格納された固定長符号M1と一致する固定長符号N1が記憶領域A2内に存在する場合には、さらに記憶領域A1から文字コードL2が読み出され、読み出された文字コードL2に対応する固定長符号M2が符号化辞書D1から読み出されて記憶領域A4に格納される。さらに、記憶領域A2内で固定長符号N1に後続する固定長符号N2が固定長符号M2と一致するかが判定される。一致すれば、さらに文字コードが記憶領域A1から読み出され同様の手順が繰り返される。上述の手順は、一致しない固定長符号が得られるか、連続して一致する固定長符号の数が下限値(例えば、所定の符号数)Lminを超えるまで繰り返される。記憶領域A2全体に渡って同様の処理が行なわれ、記憶領域A2の中から最も長く一致する固定長符号の列(最長一致固定長符号列)が抽出される。
 最長一致固定長符号列が下限値Lmin以上の長さである場合には、圧縮データd11が生成される。圧縮データd11は、最長一致固定長符号列に基づく圧縮符号である旨を示す識別子(図4の例では「1」)と、最長一致固定長符号列の長さ(例えば最長一致固定長符号列に含まれる固定長符号の数)と最長一致固定長符号列の位置とを示す圧縮符号とを含む。最長一致固定長符号列の位置は、記憶領域A2の更新位置から固定長符号何個分離れた位置であるかを示す符号の個数などで示される。さらに、記憶領域A4に格納された固定長符号列が記憶領域A2に書き込まれる。記憶領域A2の全領域に固定長符号が書き込まれている場合には、記憶領域A2に格納された固定長符号のうち、記憶領域A2に最も先に格納された固定長符号に、記憶領域A4に格納されている固定長符号列が上書きされる。
 最長一致固定長符号列が下限値Lminよりも短い場合には、圧縮データd12が生成される。圧縮データd12は、最長一致固定長符号列に基づく圧縮符号でない旨を示す識別子(図4の例では「0」)と、固定長符号M1とを含む。さらに、固定長符号M1が記憶領域A2に書き込まれる。記憶領域A2の全領域に固定長符号が書き込まれている場合には、記憶領域A2に格納された固定長符号のうち記憶領域A2に最も先に格納された固定長符号に、固定長符号M1が上書きされる。
 上述の手順で圧縮データが生成され、生成されるたびに記憶領域A3に書き込まれる。記憶領域A3に格納された圧縮データに基づいて圧縮ファイルF2が生成される。符号化辞書D1も圧縮ファイルF2に含まれるか、または、符号化辞書D1は他の方法によって圧縮ファイルF2を伸張するコンピュータに渡される。さらに詳細な圧縮処理の手順については後述される。
 図5は、符号化辞書D1の例を示す。符号化辞書D1は、文字コードと固定長符号との対応関係を示す。図5に示す符号化辞書D1は、日本語の文書を対象とした符号化辞書の例である。図5の例においては、固定長符号の符号長は12ビットである。また、図5の例においては、各文字コードに対して4バイトずつ格納領域が設けられ、文字コードが格納された位置を示す情報が固定長符号として用いられる。例えば、符号化辞書D1内の先頭に「NUL」のコードが格納されているため、「NUL」のコード(0x00)に対応する固定長符号が「0x000」とする。また、例えば「a」の文字コード(0x41)は符号化辞書D1の先頭から、4バイト×32(16進数表記では0x020)の位置に存在するため、「a」の文字コードに対応する固定長符号は「0x020」となる。
 符号化辞書D1では、各文字コードに対して固定長の符号が割り当てられる。符号長をmビットとすると、固定長符号が割り当てられる文字コードの数は2のm乗となる。図5の例においては符号長が12ビットなので、4096種類の文字コードに符号長が割り当てられる。ファイルF1に使用される文字コード系の全文字コードに対して固定長符号を割り当ててもよいし、一部の文字コードに圧縮符号を割り当てることとしてもよい。一部の文字コードに固定長符号を割り当てる場合の制御は後述される。
 図6は、符号化辞書D2の例を示す。符号化辞書D2は、文字コードまたは文字コード列と固定長符号との対応関係を示す。図6に示す符号化辞書D2は、英語の文書を対象とした符号化辞書の例である。図6の例においては、固定長符号の符号長は12ビットである。また、図6の例においては、文字コードまたは文字コード列に対して所定長の格納領域が設けられ、文字コードまたは文字コード列が格納された位置を示す情報が固定長符号として用いられる。
 図6に示す符号化辞書D2においても、例えば、「NUL」や「a」に対して、図5に示す符号化辞書と同様の固定長符号が割り当てられる。符号化辞書D2においては、さらに、基礎的な英単語に対しても固定長符号が割り当てられる。図6に示す通り、英単語「one」に対し、例えば固定長符号「0x100」が割り当てられる。
 図4に示す圧縮処理において、記憶領域A4に格納する固定長符号を生成するにあたって、記憶領域A1の読出し位置に存在するデータ列と合致するデータ列に対応する固定長符号が符号化辞書D2(図4における符号化辞書D1に対応)から抽出され、記憶領域A4に格納される。この際、例えば、記憶領域A1の読出し位置に「are」という単語が存在すると、固定長符号0x020(「a」の文字コード)も固定長符号0x180(「are」の文字コード)も抽出されるが、例えば、固定長符号0x000~0x0FFよりも0x100~0xFFFが優先されると予め定めておく。
 英語の文書には、基礎的な単語を高頻度で使用する傾向がある。英語の文書中に含まれる英単語の約半分が、約千語の基礎的な単語で占められる。そのため、図6に示す符号化辞書D2のように12ビットの固定長を割り当てられる英単語群であれば、英語の文書をほぼ表現しうる。図6に示す符号化辞書D2を用いることで、複数回の1バイト単位の照合処理で処理されるデータ量が、一度の照合で処理される。さらに、その一度の照合においても照合対象のデータサイズは固定長符号の符号長にとどめられる。そのため、図6に示す符号化辞書D2を用いて符号化された固定長符号化同士の照合を行なうことにより、圧縮速度が向上する。
 図7は、伸張処理の例を示す。まず、記憶領域B1、記憶領域B2および記憶領域B3機構領域が例えばメモリ内に確保される。図7に示す圧縮ファイルF2内の圧縮データは、記憶領域B1にロードされる。記憶領域B1は、例えば符号化部などと呼ばれる。また、圧縮ファイルF2からメモリに符号化辞書D1がロードされる。上述したように、符号化辞書D1は圧縮ファイルF2内に含まれていなくても、圧縮に用いた符号化辞書D1が事前に保持されていてもよい。
 記憶領域B1にロードされた圧縮データは順次読み出される。読み出された圧縮データは、圧縮データに含まれる識別子に応じた伸張処理が行なわれる。識別子が、最長一致固定長符号列に基づく圧縮符号でない旨を示す識別子(図7の例では「0」)である場合の圧縮データの例として、圧縮データd12が図7に例示される。圧縮データd12に含まれる固定長符号M1は、符号化辞書D1に基づいて復号化される。また、圧縮データd12内の固定長符号M1が記憶領域B2の更新位置に書き込まれる。符号化辞書D1に基づく復号化により得られた文字コードd22は、記憶領域B3に書き込まれる。
 識別子が、最長一致固定長符号列に基づく圧縮符号である旨を示す識別子(図7の例では「1」)である場合の圧縮データの例として、圧縮データd11が図7に例示される。圧縮データd11に含まれる最長一致固定長符号列の長さおよび位置の情報に基づいて、記憶領域B2から固定長符号列d21(例えば、固定長符号列M1~Mn)が読み出される。固定長符号列d21が読み出されると、固定長符号列d21が記憶領域B2の更新位置に書き込まれるととともに、符号化辞書D1を用いて復号化される。復号化により得られた文字コード列d23(例えば、固定長符号列M1~Mnに対応する文字コード列L1~Ln)は記憶領域B3に書き込まれる。
 記憶領域B2の更新位置への書込みにおいて、記憶領域B2の全領域に固定長符号が書き込まれている場合には、記憶領域B2に格納された固定長符号のうち、記憶領域B2に最も先に格納された固定長符号に対する上書きにより書込みが行なわれる。
 記憶領域B3に順次書き込まれるデータ(文字コード)に基づいて、伸張ファイルF3が生成される。さらに詳細な伸張処理の手順については後述される。
 図8は、機能構成例を示す。本実施形態の処理を実行するコンピュータ1は、記憶部13を含み、さらに、圧縮部11と伸張部12との少なくとも一方を含む。圧縮部11は圧縮処理を行ない、伸張部12は伸張処理を行なう。記憶部13は、圧縮対象のファイルF1や、圧縮処理により得られる圧縮ファイルF2や、ファイルF2を伸張して得られるファイルF3などを格納する。例えば、記憶部13は、圧縮辞書D1を記憶する。また、記憶部13は、圧縮部11や伸張部12のワークエリアとして用いられる。圧縮部11は、制御部111、照合部112、更新部113および変換部114を含む。伸張部12は、制御部121、参照部122、更新部123および変換部124を含む。
 制御部111は、照合部112および更新部113を制御して、圧縮機能を実現させる。また、制御部111は、各機能部の処理に用いるデータを保持するため、記憶部13に記憶領域(例えば、上述の記憶領域A1、記憶領域A2および記憶領域A3)を確保する。制御部111は、順次記憶領域A1内の読出し位置のデータを読み出す。変換部114は、制御部111が読みだしたデータを符号化辞書D1に基づいて固定長符号に変換する。制御部111は変換部114により変換された固定長符号を記憶領域A4に格納する。照合部112は、記憶領域A4内の固定長符号に基づいて、記憶領域A2内の固定長符号の参照処理を実行する。更新部113は、記憶領域A4内の固定長符号に基づいて、記憶領域A2内の固定長符号列を更新する。制御部111は、照合部112による記憶領域A2内の参照結果に応じて、圧縮データを生成する。圧縮部11内の各機能部による処理の実行手順については後述する。
 制御部121は、参照部122および更新部123を制御して、伸張機能を実現させる。また、制御部121は、各機能部の処理に用いるデータを保持するため、記憶部13に記憶領域(例えば、上述の記憶領域B1、記憶領域B2および記憶領域B3)を確保する。制御部121は、記憶領域B1内の読出し位置の圧縮データを読み出し、読みだした圧縮データに含まれる識別子を判定する。制御部121は、識別子が所定の識別子である場合に、参照部122に、記憶領域B2内の固定長符号の参照処理を実行させる。参照部122による参照か、記憶領域B3からの読出しにより固定長符号が得られると、更新部123は、得られた固定長符号に基づいて記憶領域B2の更新を行なう。また、変換部124は、得られた固定長符号を符号化辞書D1に基づいて伸張データに変換する。伸張部12内の各機能部による処理の実行手順については後述する。
 図9は、記憶領域の位置情報の管理に用いられる位置情報テーブルT1の例を示す。位置情報テーブルT1は、圧縮処理に用いられる各記憶領域(記憶領域A1、記憶領域A2および記憶領域A3など)の記憶部13における位置の管理に用いられる。位置情報テーブルT1には、ファイルF1をロードする記憶領域A1の開始位置P1、終了位置P2および読出し位置P3が含まれる。また、位置情報テーブルT1には、記憶領域A2の開始位置P4、終了位置P5、参照位置P6および更新位置P7が含まれる。さらに、位置情報テーブルT1には、記憶領域A3の開始位置P8、終了位置P9および書込み位置P10が含まれる。位置情報テーブルT1に格納されるそれぞれの位置情報の初期値は、制御部111により設定される。各記憶領域の開始位置と終了位置は、圧縮や伸張の対象となるデータ(例えば、ファイル内のヘッダやトレーラ部分を除いた部分)の格納開始位置、終了位置を示す。例えば、読出し位置P3と開始位置P1との初期値は同じであり、参照位置P6および更新位置P7と開始位置P4との初期値は同じであり、書込み位置P10と開始位置P8との初期値は同じである。
 以下に圧縮処理の手順について説明する。
 図10は、圧縮処理の手順例を示す。まず、コンピュータ1内のオペレーティング・システムやアプリケーションプログラムの動作により圧縮機能が呼び出される(S101)。圧縮機能が呼び出されると、制御部111は、例えば、図1に示す記憶領域A1、記憶領域A2、記憶領域A3、および記憶領域A4の確保や、各記憶領域内の各位置情報(例えば、図9に示す各位置情報)の設定などの前処理を実行する(S102)。
 S102の処理を終えると、制御部111は、圧縮対象のファイルF1のコンテンツ部分を記憶領域A1にロードする(S103)。また、制御部111は、ファイルF1の終端に基づいて終了位置P2を設定する。次に、制御部111は、最長一致固定長符号列の探索処理を実行する(S104)。
 図11は、最長一致固定長符号列の探索処理の手順例を示す。最長一致固定長符号列の探索処理が開始される(S200)と、制御部111は、参照位置P6、一致長Laおよび最長一致位置Paの初期値をセットする(S201)。参照位置P6及び最長一致位置Paは、開始位置P4と同じか、もしくは更新位置P7と同じにセットされる。一致長Laは例えば、「0」などにセットされる。制御部111は、さらにカウンタ値jを初期値(例えばj=0)にセットする(S202)。
 次に、制御部111は、記憶領域A4に固定長符号M(j)が存在するか否かを判定する(S203)。固定長符号M(j)は、記憶領域A4のj番目の位置に格納される固定長符号を意味する。記憶領域A4に固定長符号M(j)が存在しない場合(S203:No)には、制御部111は、変換部114に固定長符号M(j)の取得処理を実行させる(S204)。
 図12は、固定長符号の取得処理の手順例を示す。変換部114は、制御部111に固定長符号M(j)の取得処理を指示される(S300)と、記憶領域A1の読出し位置P3に存在する文字コードを読み出す(S301)。1バイト文字なら1バイトのデータが読み出され、2バイト文字なら2バイト文字が読み出される。次に、変換部114は、S301で読みだした文字コードに基づき、S301で読みだした文字コードに対応する固定長符号を符号化辞書D1から読み出す(S302)。さらに、変換部114は、位置情報テーブルに格納された読出し位置P3を示す情報を更新する(S303)。S303の更新は、S301で変換部114が読み出したデータの長さに基づいて行なわれる。例えば、1バイト文字が読み出されれば、読出し位置P3は1バイト移動される。制御部111は、S302で読みだした固定長符号を記憶領域A4のj番目の位置に格納する(S304)。上述の通り、記憶領域A4のj番目の位置に格納される固定長符号は、固定長符号M(j)である。変換部114は、固定長符号M(j)を記憶領域に格納すると、固定長符号の取得処理を終了する(S305)。
 図11の説明に戻る。記憶領域A4に固定長符号M(j)が存在するか(S203:Yes)、S204の固定長符号の取得処理が終了した場合に、制御部111は、照合部112に照合処理を実行させる(S205)。S205において、照合部112は、記憶領域A4に格納された固定長符号M(j)と、記憶領域A2内で参照位置P6からカウンタ値jに応じて移動させた位置に存在する固定長符号とが一致するか否かを判定する。参照位置P6からカウンタ値jに応じて移動させた位置とは、具体的には、固定長符号の符号長がmビットであれば、参照位置P6からm×jビットずれた位置である。
 S205の判定で固定長符号同士が合致した場合(S205:Yes)には、制御部111は、カウンタ値jのインクリメントを行なう(S206)。次に、制御部111は、カウンタ値jが上限値Lmaxに達した(j=Lmax)か否かを判定する(S207)。上限値Lmaxは、一致長Laの上限値として設定される値である。一致長Laの表現に用いられるビット数がm1と圧縮符号のフォーマットで定められている場合には、例えば、2のm1乗―1が上限値として設定される。カウンタ値jが上限値Lmaxに達していない場合(S207:No)には、制御部111は、S203の処理を実行する。また、カウンタ値jが上限値Lmaxに達している場合(S207:Yes)には、制御部111は、一致長Laにカウンタ値jを代入し、最長一致位置Paに参照位置P6を代入する(S208)。図11のS208の処理に示す「=」は代入演算子を示す。
 S205の判定で固定長符号同士が合致しない場合(S205:No)には、制御部111は、カウンタ値jが一致長Laよりも大きいか否かを判定する(S209)。カウンタ値jが一致長Laよりも大きい場合(S210)には、制御部111は、一致長Laにカウンタ値jを代入し、最長一致位置Paに参照位置P6を代入する(S210)。図11のS210の処理に示す「=」は代入演算子を示す。カウンタ値jが一致長La以下であるか(S209:No)、S210の処理が行なわれると、制御部111は、記憶領域A2内の参照位置P6の値をインクリメントする(S211)。具体的には、記憶領域A2に格納される固定長符号の符号長を単位としてインクリメントされ、固定長符号の符号長がmビットであれば参照位置P6はmビット移動される。次に、制御部111は、参照位置P6が記憶領域A2の終点位置P5に達したか否かを判断する(S212)。S212の判定において、参照位置P6が終点位置P5に達していない場合(S212:No)には、制御部111は、S202の処理を行なう。
 制御部111は、S208の処理が行なわれるか、参照位置P6が終点位置P5に達している場合(S212:Yes)には、最長一致固定長符号列の探索処理を終了する(S213)。S104の探索処理の結果得られる最長一致固定長符号列は、S104の処理が終了した時点における記憶領域A2内の最長一致位置Paから一致長Laの範囲内の固定長符号列である。一致長Laは一致した符号の数を示すので、固定長符号列の符号長がmビットであれば、最長一致固定長符号列はLa×mビットの長さとなる。
 続いて、制御部111は、S104の探索処理の結果に基づいて圧縮データの生成・書込み処理を実行する(S105)。
 図13は、圧縮データの生成・書込み処理の手順例を示す。圧縮データの生成・書込み処理が開始される(S400)と、制御部111は、一致長Laが下限値Lmin以上であるか否かを判定する(S401)。下限値Lminは、一致長Laの下限値として設定される値である。例えば、一致長Laの表現に用いられるビット数がm1であり、最長一致位置Paの表現に用いられるビット数がm2であると圧縮符号のフォーマットで定められている場合に、La×m<m1+m2となり得る。その場合には、最長一致固定長符号列を利用した圧縮符号により生成される圧縮データのデータサイズよりも、固定長符号列を用いて生成される圧縮データのデータサイズの方が小さい。そこで、例えば、下限値Lmin以上の一致長Laであれば、La×m≧m1+m2となるように、下限値Lminは設定される。下限値Lminの設定は、他の設定(例えば、m1、m2およびmなどの値の設定)などに応じて調整される。
 一致長Laが下限値Lmin以上である場合(S401:Yes)には、制御部111は、識別子「1」の情報を生成する(S402)。続いて、制御部111は、一致長Laを示すm1ビットの情報、および最長一致位置Paを示すm2ビットの情報を生成する(S403)。S403において、制御部111は、例えば、識別子「1」、一致長Laおよび最長一致位置Paの順序で連続する情報を生成する。次に、制御部111は、移動量Lcに一致長Laを代入する(S404)。移動量Lcは、圧縮データの生成により、圧縮処理が行なわれた固定長符号の符号数を示す。一致長Laに対応する個数の固定長符号がS403により生成される圧縮符号に変換されるので、移動量Lcは一致長Laと同じである。
 一致長Laが下限値Lminよりも短い場合(S401:No)には、制御部111は、識別子「0」の情報を生成する(S405)。続いて、制御部111は、記憶領域A4に格納された固定長符号M(0)の読み出しを行なう(S406)。S406において、制御部111は、S405で生成した識別子「0」と記憶領域A4から読み出した固定長符号M(0)を連続させた情報を生成する。さらに、制御部111は、移動量Lcに1を代入する(S407)。
 S404またはS407の処理が行なわれると、制御部111は、圧縮データの書込み位置P10に圧縮データを書き込む(S408)。圧縮データは、S404またはS408により生成される情報である。さらに、制御部111は、S408で書き込まれる圧縮データの長さに応じて、書込み位置P10の更新を行なう。例えば、圧縮データの長さは、S404で生成される圧縮データであれば、1+m1+m2ビットである。また、S408で生成される圧縮データの長さは、例えば1+mビットである。S409の処理が行なわれると、制御部111は、圧縮データの生成・書込み処理を終了する(S410)。
 図10に戻って説明を続けると、圧縮データが生成され、書込み処理が行なわれると、制御部111は、記憶領域A2の更新処理を更新部113に実行させる(S106)。
 図14は、記憶領域A2の更新処理の手順例を示す。更新部113は、制御部111に記憶領域A2の更新処理を指示される(S500)と、カウンタ値iを初期値(i=0)にセットする(S501)。次に、更新部113は、記憶領域A2の更新位置P7からカウンタ値iに応じて移動された位置に、記憶領域A4に格納された固定長符号M(i)を書き込む(S502)。具体的には、S502で書き込まれる位置は、固定長符号の符号長mとすると、更新位置P7からm×iビットずれた位置である。言い換えると、S502で書き込まれる位置は、更新位置P7を固定長符号の符号長mを単位として表現すると、P7+iで表される位置である。
 次に、更新部113は、カウンタ値iが移動量Lcから1引いた値に達したか否かを判定する(S503)。カウンタ値iが移動量Lcから1引いた値になるまで処理が行なわれることによって、記憶領域A4に格納された固定長符号のうち、圧縮符号への変換が行なわれた固定長符号について、記憶領域A2に反映される。
 カウンタ値iが移動量Lcから1引いた値に達していない場合(S503:No)に、更新部113はカウンタ値iをインクリメントする(S504)。さらに、S504でインクリメントされたカウンタ値iに基づいて、更新位置P7+カウンタ値iが記憶領域A2の終了位置P5に達しているかを判断する(S505)。更新位置P7+カウンタ値iが記憶領域A2の終了位置P5に達している場合(S505:Yes)は、更新部113は、更新位置P7に、記憶領域A2の開始位置P4からカウンタ値iを引いた値を代入する(S506)。S505およびS506の処理により、記憶領域A2外にはみ出して固定長符号が格納されることもなく、記憶領域A2が繰り返し使用される。更新位置P7+カウンタ値iが記憶領域A2の終了位置P5に達していない場合(S505:No)か、S506の処理が行なわれた場合には、更新部113は、S502の処理を行なう。
 カウンタ値iが移動量Lcから1引いた値に達した場合(S503:Yes)に、更新部113は、記憶領域A2の更新位置P7を更新する(S507)。具体的には、更新位置P7に、更新位置P7に移動量Lcを加算した値が代入される。S507の処理を終えると、更新部113は、記憶領域A2の更新処理を終了する(S508)。
 図10に戻って説明を続けると、制御部111は、更新部113による記憶領域A2の更新処理が終了すると、更新部113に記憶領域A4の更新処理を実行させる(S107)。
 図15は、記憶領域A4の更新処理の手順例を示す。更新部113は、制御部111に記憶領域A4の更新処理を指示される(S600)と、記憶領域A4内の固定長符号M(0)~M(Lc-1)を削除する(S601)。固定長符号M(0)~M(Lc-1)に対応する圧縮データは既に生成され、且つ記憶領域A2にコピーされている。さらに、更新部113は、カウンタ値kの初期値(k=0)をセットする(S602)。
 次に、更新部113は、固定長符号M(Lc+k)が存在するか否かを判断する(S603)。固定長符号M(Lc+k)が存在する場合(S603:Yes)に、更新部113は、記憶領域A4内で固定長符号M(Lc+k)をカウンタ値kの位置にコピーする(S604)。すなわち、更新部113は固定長符号M(k)を記憶領域A4に格納する。さらに、更新部113は、固定長符号M(Lc+k)を削除する(S605)。次に更新部113は、カウンタ値kをインクリメントする(S606)。S606の処理が行なわれると、更新部113は、S603の処理を行なう。また、S603の判定において、固定長符号M(Lc+k)が存在しない場合(S603:No)に、更新部113は、記憶領域A4の更新処理を終了する(S607)。
 更新部113による記憶領域A4の更新処理が終了すると、制御部111は、ファイルF1の終点まで圧縮処理が終了したか否かを判定する(S108)。S108において、例えば記憶領域A1の読出し位置P3が、記憶領域A1の終了位置P2に達したか否かが判定される。ファイルF1の終点まで圧縮処理が終了していない場合(S108:No)には、制御部111は、S104の処理を行なう。一方、ファイルF1の終点まで圧縮処理が終了した場合(S108:Yes)には、制御部111は、記憶領域A3内に格納された圧縮データ群に基づいて、圧縮ファイルF2の生成処理を行なう(S109)。すなわち、圧縮ファイルF2がクローズされ、記憶部13内に格納される。S109の処理が終了すると、制御部111は、圧縮処理を終了する(S110)。S110の処理において、制御部111は、例えば、圧縮機能の呼び出し元に対して、圧縮処理の終了通知を行なう。圧縮処理の終了通知には、例えば、圧縮ファイルF2の格納先を示す情報などが含まれる。
 図16は、記憶領域の位置情報の管理に用いられる位置情報テーブルT2の例を示す。位置情報テーブルT2は、伸張処理に用いられる各記憶領域(記憶領域B1、記憶領域B2および記憶領域B3など)の記憶部13における位置の管理に用いられる。位置情報テーブルT2には、圧縮ファイルF2がロードされる記憶領域B1の開始位置Q1、終了位置Q2および読出し位置Q3が含まれる。また、位置情報テーブルT2には、記憶領域B2の開始位置Q4、終了位置Q5、参照位置Q6および更新位置Q7が含まれる。さらに、位置情報テーブルT2には、記憶領域B3の開始位置Q8、終了位置Q9および書込み位置Q10が含まれる。位置情報テーブルT2に格納されるそれぞれの位置情報の初期値は、制御部111により設定される。各記憶領域の開始位置と終了位置は、圧縮や伸張の対象となるデータ(例えば、ファイル内のヘッダやトレーラ部分を除いた部分)の格納開始位置、終了位置を示す。例えば、読出し位置Q3と開始位置Q1との初期値は同じであり、参照位置Q6および更新位置Q7の初期値は、開始位置Q4と同じであり、書込み位置Q10と開始位置Q8との初期値は同じである。
 以下に伸張処理の手順について説明する。
 図17は、伸張処理の手順例を示す。まず、コンピュータ1内のオペレーティング・システムやアプリケーションプログラムの動作により伸張機能が呼び出される(S700)。伸張機能が呼び出されると、制御部121は、例えば、図2に示す記憶領域B1、記憶領域B2、記憶領域B3および記憶領域B4の確保、各記憶領域内の各位置情報(例えば、図16に示す各位置情報)の設定などの前処理を実行する(S701)。
 S701の処理を終えると、制御部121は、圧縮ファイルF2のコンテンツ部分を記憶領域B1にロードする(S702)。また、制御部121は、圧縮ファイルF2の終端に基づいて終了位置Q2を設定する。次に、制御部121は、記憶領域B1の読出し位置Q3の圧縮データに含まれる識別子が、最長一致データ列に基づく圧縮データでないこと(識別子「0」)を示すか、最長一致データ列に基づく圧縮データであること(識別子「1」)を示すかを判定する(S703)。
 識別子が「0」である場合(S703:Yes)は、制御部121は、読出し位置Q3の圧縮データに含まれている固定長符号を読出し、記憶領域B4に格納する(S704)。例えば、記憶領域B4に格納する固定長符号を固定長符号M(0)などとする。また、変換対象の固定長符号の数を示す移動量Lcは、1とする(Lc=1)。
 識別子が「1」である場合(S703:No)は、制御部121は、参照部122に、読出し位置Q3の圧縮データに含まれる位置Paおよび長さLaに基づき、記憶領域B2を参照させる。参照部122は、記憶領域B2の位置Paから長さLaの固定長符号列を読出し、記憶領域B4に格納する(S705)。記憶領域B4に格納される固定長符号列をM(0)~M(Lc-1)とする。S705において、制御部121は、移動量LcをLaに設定する(Lc=La)。 
 S704またはS705が行なわれると、制御部121は、変換部124に、記憶領域B4内に格納された固定量符号M(0)~M(Lc-1)のそれぞれについて、符号化辞書D1に基づく変換を実行させる(S706)。S704において、変換部124は、固定長符号の値に基づいて、符号化辞書D1内の位置を特定し、伸張データ(文字コード)を読み出す。図5の符号化辞書D1の例によれば、固定長符号の値が0x020である場合は、「a」の文字コードが読み出される。
 S706で伸張データが読み出されると、制御部121は、読み出された伸張データのそれぞれを記憶領域B3の書込み位置Q10に書き込む(S707)。さらに、制御部121は、書き込まれた伸張データの長さに応じて、書込み位置Q10を更新する。S707の処理が行なわれると、制御部121は、更新部123に記憶領域B2の更新を実行させる(S708)。
 図18は、記憶領域B2の更新処理の手順例を示す。更新部123は、制御部121に記憶領域B2の更新処理を指示される(S800)と、カウンタ値iを初期値(i=0)にセットする(S801)。次に、更新部123は、記憶領域B2の更新位置Q7からカウンタ値iに応じて移動された位置に、記憶領域B4に格納された固定長符号M(i)を書き込む(S802)。具体的には、S802で書き込まれる位置は、固定長符号の符号長mとすると、更新位置Q7からm×iビットずれた位置である。言い換えると、S802で書き込まれる位置は、更新位置Q7を固定長符号の符号長mを単位として表現すると、Q7+iで表される位置である。
 次に、更新部123は、カウンタ値iが移動量Lcから1引いた値に達したか否かを判定する(S803)。カウンタ値iが移動量Lcから1引いた値になるまで処理が行なわれることによって、記憶領域B4に格納された固定長符号のそれぞれが記憶領域B2に反映される。
 カウンタ値iが移動量Lcから1引いた値に達していない場合(S803:No)に、更新部123はカウンタ値iをインクリメントする(S804)。さらに、更新部123は、S804でインクリメントされたカウンタ値iに基づいて、更新位置Q7+カウンタ値iが記憶領域B2の終了位置Q5に達しているかを判断する(S805)。更新位置Q7+カウンタ値iが記憶領域B2の終了位置Q5に達している場合(S805:Yes)は、更新部123は、更新位置Q7に、記憶領域B2の開始位置Q4からカウンタ値iを引いた値を代入する(S806)。S805およびS806の処理により、記憶領域B2外にはみ出して固定長符号が格納されることもなく、記憶領域B2が繰り返し使用される。更新位置Q7+カウンタ値iが記憶領域B2の終了位置Q5に達していない場合(S805:No)か、S806の処理が行なわれた場合には、更新部123は、S802の処理を行なう。
 カウンタ値iが移動量Lcから1引いた値に達した場合(S803:Yes)に、更新部123は、記憶領域B2の更新位置Q7を更新する(S807)。具体的には、更新位置Q7に、更新位置Q7に移動量Lcを加算した値が代入される。S807の処理を終えると、更新部123は、記憶領域B2の更新処理を終了する(S808)。S808において、更新部123は、記憶領域B4内の情報をクリアする。
 更新部123による記憶領域B2の更新処理が終了すると、制御部121は、伸張処理が圧縮ファイルF2の終点に達しているか判断する(S709)。S709は、例えば、記憶領域B1の読出し位置Q3が記憶領域B1の終了位置Q2に達しているか否かに応じて判断される。読出し位置Q3が終了位置Q2に達していない場合(S709:No)には、制御部121は、S703の処理を実行する。読出し位置Q3が終了位置Q2に達した場合(S709:Yes)には、制御部121は、記憶領域B3に格納された伸張データを用いて伸張ファイルF3を生成し、記憶部13に格納する(S710)。すなわち伸張ファイルF3をクローズする。S710の処理が終了すると、制御部121は、伸張処理を終了する(S711)。S711の処理において、制御部121は、例えば、伸張機能の呼び出し元に対して、伸張処理の終了通知を行なう。伸張処理の終了通知には、例えば、伸張ファイルF3の格納先を示す情報などが含まれる。
 下記に、本実施形態に用いられるハードウェア及びソフトウェアについて説明する。
 図19は、コンピュータ1のハードウェア構成例を示す。コンピュータ1は、例えば、プロセッサ301、RAM(Random Access Memory)302、ROM(Read Only Memory)303、ドライブ装置304、記憶媒体305、入力インターフェース(I/F)306、入力デバイス307、出力インターフェース(I/F)308、出力デバイス309、通信インターフェース(I/F)310、SAN(Storage Area Network)インターフェース(I/F)311およびバス312などを含む。それぞれのハードウェアはバス312を介して接続されている。
 RAM302は読み書き可能なメモリ装置であって、例えば、SRAM(Static RAM)やDRAM(Dynamic RAM)などの半導体メモリ、またはRAMでなくてもフラッシュメモリなどが用いられる。ROM303は、PROM(Programmable ROM)なども含む。ドライブ装置304は、記憶媒体305に記録された情報の読み出しか書き込みかの少なくともいずれか一方を行なう装置である。記憶媒体305は、ドライブ装置304によって書き込まれた情報を記憶する。記憶媒体305は、例えば、ハードディスク、SSD(Solid State Drive)などのフラッシュメモリ、CD(Compact Disc)、DVD(Digital Versatile Disc)、ブルーレイディスクなどの記憶媒体である。また、例えば、コンピュータ1は、複数種類の記憶媒体それぞれについて、ドライブ装置304及び記憶媒体305を設ける。
 入力インターフェース306は、入力デバイス307と接続されており、入力デバイス307から受信した入力信号をプロセッサ301に伝達する回路である。出力インターフェース308は、出力デバイス309と接続されており、出力デバイス309に、プロセッサ301の指示に応じた出力を実行させる回路である。通信インターフェース310はネットワーク3を介した通信の制御を行なう回路である。通信インターフェース310は、例えばネットワークインターフェースカード(NIC)などである。SANインターフェース311は、ストレージエリアネットワークによりコンピュータ1と接続された記憶装置との通信の制御を行なう回路である。SANインターフェース311は、例えばホストバスアダプタ(HBA)などである。
 入力デバイス307は、操作に応じて入力信号を送信する装置である。入力信号は、例えば、キーボードやコンピュータ1の本体に取り付けられたボタンなどのキー装置や、マウスやタッチパネルなどのポインティングデバイスである。出力デバイス309は、コンピュータ1の制御に応じて情報を出力する装置である。出力デバイス309は、例えば、ディスプレイなどの画像出力装置(表示デバイス)や、スピーカーなどの音声出力装置などである。また、例えば、タッチスクリーンなどの入出力装置が、入力デバイス307及び出力デバイス309として用いられる。また、入力デバイス307及び出力デバイス309は、コンピュータ1と一体になっていてもよいし、コンピュータ1に含まれず、例えば、コンピュータ1に外部から接続する装置であってもよい。
 例えば、プロセッサ301は、ROM303や記憶媒体305に記憶されたプログラムをRAM302に読み出し、読み出されたプログラムの手順に従って圧縮部11の処理または伸張部12の処理を行なう。その際にRAM302はプロセッサ301のワークエリアとして用いられる。記憶部13の機能は、ROM303および記憶媒体305がプログラムファイル(後述のアプリケーションプログラム24、ミドルウェア23およびOS22など)やデータファイル(圧縮対象のファイルF1、圧縮ファイルF2および伸張ファイルF3など)を記憶し、RAM302がプロセッサ301のワークエリアとして用いられることによって実現される。プロセッサ301が読み出すプログラムについては、図20を用いて後述する。
 図10~図15の処理を実行する圧縮部11内の各機能ブロックについて、さらに説明する。制御部111は、プロセッサ301がRAM302の制御(排他制御など)や、RAM302へのアクセス処理や、アクセス処理で得られた情報に対する演算や、プロセッサ301内での演算処理などを行なうことにより実現される。照合部112は、プロセッサ301がRAM302へのアクセス処理や、アクセス処理により得られた情報に対する照合の演算などを行なうことにより実現される。更新部113は、プロセッサ301によるRAM302へのアクセス処理などを行なうことにより実現される。変換部114は、プロセッサ301によるRAM302へのアクセス処理や、アクセス処理により得られた情報に対する照合の演算等を行なうことにより実現される。
 図17および図18の処理を実行する伸張部12内の各機能ブロックについて、さらに説明する。制御部121は、プロセッサ301がRAM302の制御(排他制御など)や、RAM302へのアクセス処理や、アクセス処理で得られた情報に対する演算や、プロセッサ301内での演算処理などを行なうことにより実現される。参照部122は、プロセッサ301がRAM302へのアクセス処理などを行なうことにより実現される。更新部123は、プロセッサ301によるRAM302へのアクセス処理などを行なうことにより実現される。変換部124は、プロセッサ301によるRAM302へのアクセス処理や、アクセス処理により得られた情報に対する照合の演算等を行なうことにより実現される。
 図20は、コンピュータ1で動作するプログラムの構成例を示す。コンピュータ1において、図19に示すハードウェア群21(301~312)の制御を行なうOS(オペレーティング・システム)22が動作する。OS22に従った手順でプロセッサ301が動作して、ハードウェア群21の制御・管理が行なわれることにより、アプリケーションプログラム24やミドルウェア23に従った処理がハードウェア群21で実行される。さらに、コンピュータ1において、ミドルウェア23またはアプリケーションプログラム24が、RAM302に読み出されてプロセッサ301により実行される。
 プロセッサ301が、圧縮機能が呼び出された場合に、ミドルウェア23またはアプリケーションプログラム24の少なくとも一部に基づく処理を行なうことにより、(それらの処理をOS22に基づいてハードウェア群21を制御して)圧縮部11の機能が実現される。また、プロセッサ301が、伸張機能が呼び出された場合に、ミドルウェア23またはアプリケーションプログラム24の少なくとも一部に基づく処理を行なうことにより、(それらの処理をOS22に基づいてハードウェア群21を制御して)伸張部12の機能が実現される。圧縮機能および伸張機能は、それぞれアプリケーションプログラム24自体に含まれてもよいし、アプリケーションプログラム24に従って呼び出されることで実行されるミドルウェア23の一部であってもよい。もしくは圧縮機能および伸張機能がOS22の一機能であってもよい。
 アプリケーションプログラム24(またはミドルウェア23)の圧縮機能では、処理対象のデータに合致するデータを抽出するための照合回数が抑制されるため、プロセッサ301のメモリアクセスの負荷が抑制される。そのため、RAM302上にワークエリアを確保する時間も削減される。
 図21は、実施形態のシステムにおける装置の構成例を示す。図21のシステムは、コンピュータ1a、コンピュータ1b、基地局2およびネットワーク3を含む。コンピュータ1aは、無線または有線の少なくとも一方により、コンピュータ1bと接続されたネットワーク3に接続している。
 図8に示す圧縮部11と伸張部12とは、図21に示すコンピュータ1aとコンピュータ1bとのいずれに含まれてもよい。例えば、コンピュータ1bが圧縮部11(制御部111、照合部112、更新部113および変換部114を含む)を含み、コンピュータ1aが伸張部12(制御部121、参照部122、更新部123および変換部124を含む)を含んでもよいし、コンピュータ1bが圧縮部11を含み、コンピュータ1aが伸張部12を含んでもよい。また、コンピュータ1aとコンピュータ1bとの双方が、圧縮部11および伸張部12を備えてもよい。
 文字コードにおける位置が異なるデータ間の照合が発生する例について、図22および図23に基づいて補足説明する。
 UTF-8のコード割り当てでは、2バイト以上の文字コードにおいて、2バイト目以降のバイトでは、値の範囲が共通している(いずれも0x80~0xBFの範囲内である)。そのため、複数バイトで文字を表現する文字コードを用いたデータ同士で、バイト単位で照合を行なうと、異なる文字コードであっても一部分だけ一致することがあり得る。例えば、ある4バイト文字コードの3番目のバイトと、他の3バイト文字の2番目のバイトとが一致するなどの自体が発生する。すると、図22および図23に例示されるような照合処理が発生しうる。
 図22は、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理例を示す。図22は、記憶領域A1及び記憶領域A2のそれぞれを部分的に示す。各記憶領域内の点線での区切りは1バイト単位での区切りを示し、実線での区切りは文字コードの区切りを示す。図22の例においては、各記憶領域内のデータとして3バイトの文字コードが例示されている。
 例えば、図22に示すように、処理対象のデータを読み出す記憶領域A1内の位置が読出し位置P3(1)であるとし、処理対象のデータと照合される記憶領域A2内のデータの位置が参照位置P6(1)であるとする。図22に例示するように、3バイトの文字コード間の照合を1バイト単位で行なうと、最長一致データの終端が文字コードの区切りとは異なる位置に存在することがあり得る。図22には、3バイトの文字コードが2文字分と、3バイトの文字コード内の2バイト分が最長一致データとして抽出された場合が例示されている。LZ77を利用した圧縮処理においては、抽出された最長一致データの位置と長さに基づいて圧縮符号が生成されるので、参照位置P6(1)と最長一致データの長さ(8バイト)とに基づいて圧縮符号が生成される。
 図22に示す最長一致データに基づいて圧縮符号が生成されると、処理対象を読み出す記憶領域A1内の位置が、読出し位置P3(1)から読出し位置P3(2)に更新される。続いて、読出し位置P3(2)からのデータに基づいて、最長一致データの探索が行なわれる。
 図23は、圧縮対象のデータを構成するデータ単位と異なるデータ単位での照合処理例を示す。図23は、記憶領域A1及び記憶領域A2のそれぞれを部分的に示す。読出し位置P3(2)のデータは、「10XXXXXX」であり、UTF-8の文字コード系においては、2バイト目以降のデータである。例えば、読出し位置P3(2)のデータ(「10XXXXXX」)と合致する記憶領域A2内のデータが、図23に示すように、参照位置P6(21)や参照位置P6(22)に存在したとする。図23の例においては、参照位置P6(21)のデータは、3バイトの文字コードの3バイト目のデータであり、参照位置P6(22)のデータは、3バイトの文字コードの2バイト目のデータである。
 読出し位置P3(2)のデータと参照位置P6(21)のデータとの一致に応じて、読出し位置P3(2)のデータに後続するデータ(図23の例では「1110YYYY」)と、参照位置P6(21)のデータに後続するデータ(図23の例では「1110YYYY」)との照合が行なわれる。この照合では、両方のデータが3バイトの文字コードの1バイト目であるため、照合により一致する可能性がある。
 読出し位置P3(2)のデータと参照位置P6(22)のデータとの一致に応じて、読出し位置P3(2)のデータに後続するデータ(図23の例では「1110YYYY」)と、参照位置P6(22)のデータに後続するデータ(図23の例では「10XXXXXX」)との照合が行なわれる。この照合では、一方が3バイトの文字コードの1バイト目であり、他方が3バイトの文字コードの3バイト目であるため、照合により一致しないことが明らかである。
 図22および図23に示される例においては、3バイトの文字コード間の照合を1バイト単位で行なうことにより、文字コードの区切りとは異なる位置で最長一致データが区切られる。すると、図23に示すように、文字コードにおける位置が異なるデータ間の照合が発生する可能性がある。しかしながら、例えば、3バイトの文字コードの1バイト目のデータと3バイト目のデータとは、文字コードの体系の都合上明らかに一致しないにも関わらず、照合処理が行なわれてしまう。
 一方、上述の実施形態によれば、照合処理の単位が文字コード単位で行なわれるため、明らかに異なるデータ同士の照合処理が行なわれてしまうことが抑止される。
 以下、上述の実施形態における変形例の一例を説明する。下記の変形例のみでなく、本発明の本旨を逸脱しない範囲の設計変更は適宜行なわれうる。
 図24は、S301からS303の処理の例を示す。変換部114は、図12に示すS301~S303の処理を、ファイルF1に用いられる文字コードが例えばUTF-8である場合に、以下の手順で実行する。
 S300が行なわれる(S900)と、変換部114は、記憶領域A1の読出し位置P3から1バイトのデータを読み出す(S901)。変換部114は、読みだしたデータの1ビット目が「1」であるか否かを判定する(S902)。S901で読みだしたデータの1ビット目が「1」でない(「0」である)場合(S902:No)には、変換部114は、移動量Ldに1を代入する(S903)。移動量Ldは、後述の読出し位置P3の更新に用いられる。
 S901で読みだしたデータの1ビット目が「1」である場合(S902:Yes)には、変換部114は、読みだしたデータの3ビット目が「1」であるか否かを判定する(S904)。S901で読みだしたデータの3ビット目が「1」でない(「0」である)場合(S904:No)には、変換部114は、移動量Ldに2を代入し、記憶領域A1からさらに1バイトのデータを読み出す(S905)。
 S901で読みだしたデータの3ビット目が「1」である場合(S904:Yes)には、変換部114は、読みだしたデータの4ビット目が「1」であるか否かを判定する(S906)。S901で読みだしたデータの4ビット目が「1」でない(「0」である)場合(S906:No)には、変換部114は、移動量Ldに3を代入し、記憶領域A1からさらに2バイトのデータを読み出す(S907)。
 S901で読みだしたデータの4ビット目が「1」である場合(S906:Yes)には、変換部114は、移動量Ldに4を代入し、記憶領域A1からさらに3バイトのデータを読み出す(S908)。
 S903、S905、S907およびS908のいずれかが行なわれると、変換部114は、移動量Ldに基づいてインデックスE1を参照し、参照結果を利用して符号化辞書D1から、読みだしたデータに対応する固定長符号を読み出す(S909)。インデックスE1については、図25を用いて後述する。変換部114は、さらに、読出し位置P3を移動量Ldに示される量(Ldバイト)移動させる(S910)。S910の処理を終えると変換部114はS304の処理を実行する。
 図25は、符号化辞書D1のインデックス例を示す。図25に示すインデックスE1は、移動量Ldが1~4の場合それぞれについて、符号化辞書D1内のサーチ開始位置を示す。例えば、移動量Ldが1の場合には、変換部114は、固定長符号0x000の位置から符号化辞書D1のサーチを開始する。移動量Ldが2の場合には、変換部114は、固定長符号0x100の位置から符号化辞書D1のサーチを開始する。移動量Ldが3の場合には、変換部114は、固定長符号0x180の位置から符号化辞書D1のサーチを開始する。移動量Ldが4の場合には、変換部114は、固定長符号0x800の位置から符号化辞書D1のサーチを開始する。符号化辞書D1に含まれる文字コードの長さの分布に応じてインデックスE1の値が設定されることで、異なる長さの文字コード同士の照合が抑制される。符号化辞書D2に対して図25に示すインデックスと同様なインデックスを利用したサーチが行なわれてもよい。
 図26は、最長一致固定長符号列の探索処理の変形例を示す。図26の変形例においては、記憶領域A2内の各固定長符号に対応したビットを含むビット列R1~R3が用いられる。ビット列R1~R3の記憶領域は、記憶部13内に設けられる。記憶領域A2内の各固定長符号に対して1ビット用いられるため、各ビット列のサイズは、記憶領域A2の1/mである。
 ビット列R1は、照合対象の固定長符号M(j)が記憶領域A2内に含まれているか否かを示すビット列である。固定長符号M(j)とは、前述の通り、記憶領域A4内のj番目に格納された固定長符号である。すなわち、記憶領域A2内の位置Pxに固定長符号M(j)と同じ固定長符号が格納されている場合には、ビット列R1のPx番目のビットが「存在」を示す(値が「1」となる)。
 ビット列R2は、固定長符号M(0)~M(j-1)までの照合結果を示すビット列である。また、ビット列R3は、ビット列R1とビット列R2との演算結果をしめす。具体的には、ビット列R1をjビットスライド(図26中の矢印の方向)させて、スライドしたビット列R1とビット列R2とのAND演算の結果がビット列R3となる。AND演算が行なわれた後、j+1番目の処理のために、ビット列R3は、ビット列R2にコピーされる。具体的な手順は図27を用いて説明するが、ビット列R1~R3を用いた上述の処理の繰り返すことで、「存在」を示すビットが最後まで残った位置により最長一致位置Paが示される。さらに、繰り返し回数が一致長Laを示す。
 図27は、最長一致符号列の探索処理の手順例を示す。最長一致符号列の探索処理が開始される(S1000)と、制御部111は、ビット列R1~R3を初期化する(S1001)。さらに、制御部111は、一致長Laおよび最長一致位置Paに初期値(La=0,Pa=P4-1など)をセットする(S1002)。さらに、制御部111は、カウンタ値jの初期値(j=0)をセットする(S1003)。
 続いて、制御部111は、記憶領域A4に固定長符号M(j)が格納されているか否かを判断する(S1004)。記憶領域A4に固定長符号M(j)が格納されていない場合(S1004:No)には、制御部111は、固定長符号M(j)の取得処理を変換部114に実行させる(S1005)。変換部114は、図12に記載の処理を実行する。
 記憶領域A4に固定長符号M(j)が格納されている場合(S1004:Yes)か、S1005の処理が実行された場合には、制御部111は、記憶領域A2内における固定長符号M(j)の存否結果をビット列R1に反映させる(S1006)。例えば、制御部111は、記憶領域A2中の固定長符号M(j)と同じ固定長符号の存在位置に対応するビットを「1」に変更する。さらに、制御部111は、ビット列R1をjビットスライドさせた(S1007)後、ビット列R2とビット列R1とで、ビット列内の各ビットのついてのAND演算を行ない、その結果をビット列R3とする(S1008)。
 続いて、制御部111は、ビット列R3内に存在(「1」)を示すビットが存在するか否かを判定する(S1009)。ビット列R3内に存在(「1」)を示すビットが存在する場合(S1009:Yes)には、制御部111は、ビット列R1をビット列R2にコピーし(S1010)、カウンタ値jをインクリメントし(S1011)、S1004の処理を実行する。
 ビット列R3内に存在(「1」)を示すビットが存在しない場合(S1009:No)には、制御部111は、ビット列R2内の存在(「1」)を示すビットのうち、いずれかの位置(何ビット目かを示す値)を最長一致位置Pa(固定長符号が何個分かを示す値)に代入する(S1012)。さらに、制御部111は、カウンタ値jを代入する(S1013)。S1013の処理が行なわれると、制御部111は、最長一致符号列の探索処理を終了する(S1014)。
 さらに、文字コード長と照合処理の単位との不一致による不要な照合処理が発生することを抑制する実施形態の変形例を説明する。例えば、UTF-8においては、文字コードにおける始めの1バイトのデータにより文字コード長が判別される。例えば、図10のS104の処理で、照合部112が、記憶領域A1の読出し位置P3と記憶領域A2の参照位置P6との双方における1バイトのデータに基づいて文字コード長の合致判定を行ない、合致すると判定された場合に文字コード単位での照合を行なってもよい。文字コード内の始めの1バイトにより文字コード長が判別されるため、照合部112は、合致すると判定されてから、記憶領域A1の読出し位置P3と記憶領域A2の参照位置P6との双方における文字コードを読出し、文字コード単位での照合を行なう。
 記憶領域A1の読出し位置P3の文字コードと、記憶領域A2の参照位置P6の文字コードとの双方で、文字コード長が合わない場合には、照合処理をスキップして参照位置P6の更新が行なわれる。参照位置P6の更新における参照位置P6の移動量は、例えば参照位置P6の文字コードの文字コード長である。
 また、この変形例の前提として、記憶領域A2には、文字コードが格納される。すなわち、図12のS304の処理において文字コードが記憶領域A4に書き込まれ、さらに、図14のS502において記憶領域A4内の文字コードが記憶領域A2に書き込まれる。さらに、例えば、読出し位置P3の移動量Ldには、判別された文字コードのバイト数が用いられる。
 上述の通り、記憶領域A1の読出し位置P3から読み出した文字コードと記憶領域A2の参照位置P6から読みだした文字コードのバイト数が合わない場合に文字コード同士の照合をスキップすることで、不要な文字コード同士の照合が回避される。この変形例を用いる場合には、上述の通り、図10のS106の処理では、記憶領域A1から読み出された文字コードが記憶領域A2に格納される。図17のS708においては、固定長符号ではなく、伸張データが記憶領域B2に書き込まれる。また、S706の処理がスキップされる。
 さらに、他の変形例として、照合部112が、照合処理の実行単位は例えば1バイトで行ない、1バイトデータの照合の前に、1バイト文字コード内の位置が同一のデータであるかの判定を行なうこととしてもよい。文字コードによっては、文字コードの表現に用いられる各バイトのデータは、文字コード長および文字コード内での位置に応じて複数種類に分類される。例えば、図3に示す通り、UTF-8においては、1バイト文字は「0XXXXXXX」、2バイト文字の1バイト目は「110YYYYX」、3バイト文字の1バイト目は「1110YYYY」、4バイト文字の1バイト目は「11110YYY」、2~4バイト文字の2バイト目以降は「10XXXXXX」である。「X」は不特定のビットを便宜的に表す。すなわち、UTF-8では、1バイトのデータにおける先頭から数ビットのデータに応じて5種類に分類される。種類が異なる1バイトデータ間で照合処理を行なったとしても合致しないことは明らかなので、例えば、照合部112は、1バイトデータ間で種類が異なれば照合処理をスキップする。これにより不要な照合処理が抑制される。また、各文字コードの先頭バイトの種類が一致しているので、結果的に文字コード長が合致したデータ間の照合処理により、最長一致データ列が抽出される。この変形例も記憶領域A2内に文字コードが格納されることを前提としている。そのため、記憶領域A2の更新処理について、先に説明した変形例と同様の制御が行なわれる。
 また、圧縮処理の対象は、ファイル内のデータ以外にも、システムから出力される監視メッセージなどでもよい。例えば、バッファに順次格納される監視メッセージを上述の圧縮処理により圧縮し、ログファイルとして格納するなどの処理が行なわれる。また、例えば、データベース内のページ単位に圧縮が行なわれてもよいし、複数のページをまとめた単位で圧縮が行なわれてもよい。
 また、上述の圧縮処理の対象となるデータは、上述の通り、文字情報に限定されるものでない。数値のみの情報であってもよいし、画像・音声などのデータに対して上述の圧縮処理を用いてもよい。例えば、音声合成により得られるデータを多量に含むファイルなどは、データ内に繰り返しを多く含むため動的辞書により圧縮率が向上することが見込まれる。また、固定カメラにより撮影された動画像についても各フレームの画像が似たものになることから繰り返しが多く含まれる。そのため、上述の圧縮処理を適用することにより、文書データや音声データと同様の効果を得ることができる。
 1    コンピュータ
 2    基地局
 3    ネットワーク
 1a   コンピュータ
 1b   コンピュータ
 11   圧縮部
 12   伸張部
 13   記憶部
 111  制御部
 112  照合部
 113  更新部
 114  変換部
 121  制御部
 122  参照部
 123  更新部
 124  変換部
 

Claims (14)

  1.  コンピュータに、
     データの構成単位のサイズが複数種類存在するデータ群によるデータ列を取得し、
     前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行ない、
     前記制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを前記データ列から抽出し、
     前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する、
     処理を実行させることを特徴とする圧縮プログラム。
  2.  前記照合処理では、前記データ群に含まれるデータのそれぞれに固定長符号を割り当てた符号化辞書に基づき前記あるデータを変換して得られる固定長符号と、前記データ列に含まれる各データを前記符号化辞書に基づき変換して得られる固定長符号とが照合される、
     ことを特徴とする請求項1に記載の圧縮プログラム。
  3.  前記照合処理が前記データ列の順序に応じて連続して行なわれ、
     前記位置関係は、連続して行われた前記照合処理の結果、連続して合致する固定長符号による固定長符号列の位置に基づき定められる、
     ことを特徴とする請求項2に記載の圧縮プログラム。
  4.  前記制御は、前記照合処理対象となるデータ刊でデータの構成単位内における位置が異なる場合には、前記データ間についての照合処理を抑止させる制御を含む、
     ことを特徴とする請求項1に記載の圧縮プログラム。
  5.  前記制御は、前記照合処理の対象となるデータ間でデータの構成単位のサイズが異なる場合に、前記データ間についての照合処理を抑止させる制御を含む、
     ことを特徴とする請求項1に記載の圧縮プログラム。
  6.  前記圧縮符号は、前記位置関係および前記固定長符号列の長さに基づいて生成される、
     ことを特徴とする請求項1~5のいずれか1項に記載の圧縮プログラム。
  7.  前記符号化辞書は、前記データ群に基づき生成され、
     前記符号辞書に登録される固定長符号の符号長は、前記データ群の数に応じて設定される、
     ことを特徴とする請求項1~6のいずれか1項に記載の圧縮プログラム。
  8.  前記コンピュータに、さらに、
     生成された前記圧縮符号と、前記符号化辞書とを含む圧縮ファイルを生成する、
     処理を実行させることを特徴とする請求項1~7のいずれか1項に記載の圧縮プログラム。
  9.  コンピュータに、
     データの構成単位のサイズが複数種類存在するデータ群によるデータ列を取得し、
     前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行ない、
     前記制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを前記データ列から抽出し、
     前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する、
     処理を実行させることを特徴とする圧縮方法。
  10.  データの構成単位のサイズが複数種類存在するデータ群によるデータ列を記憶する記憶部と、
     前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行なう制御部と、
     前記制御部の制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを、前記記憶部に記憶された前記データ列から抽出する抽出部と、
     前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する生成部と、
     を含むことを特徴とする圧縮装置。
  11.  コンピュータに、
     記憶領域内の位置を示す圧縮符号に基づく前記記憶領域の参照により固定長符号を取得し、
     取得した前記固定長符号に基づいて、前記記憶領域の更新を行なうとともに、取得した前記固定長符号を符号化辞書に基づき復号化する、
     ことを実行させることを特徴とする伸張プログラム。
  12.  コンピュータに、
     記憶領域内の位置を示す圧縮符号に基づく前記記憶領域の参照により固定長符号を取得し、
     取得した前記固定長符号に基づいて、前記記憶領域の更新を行なうとともに、取得した前記固定長符号を符号化辞書に基づき復号化する、
     ことを実行させることを特徴とする伸張方法。
  13.  記憶領域内の位置を示す圧縮符号に基づく前記記憶領域の参照により固定長符号を取得する取得部と、
     取得した前記固定長符号に基づいて、前記記憶領域の更新を行なう更新部と、
     取得した前記固定長符号を符号化辞書に基づき復号化する変換部と、
     を含むことを特徴とする伸張装置。
  14.  データの構成単位のサイズが複数種類存在するデータ群によるデータ列を記憶する記憶部と、
     前記データ群に含まれるあるデータと、前記データ列に含まれるデータのうち前記あるデータとデータの構成単位のサイズが同じデータと、を照合させる制御を行なう制御部と、
     前記制御部の制御に基づき行なわれる照合処理により、前記あるデータと合致する合致データを、前記記憶部に記憶された前記データ列から抽出する抽出部と、
     前記あるデータと、抽出された前記合致データとの前記データ列における位置関係に応じた圧縮符号を生成する生成部と、
     を含む第1のコンピュータと、
     前記圧縮符号に基づき、前記合致データを復元する復元部、
     を含む第2のコンピュータと、
     を含むことを特徴とする圧縮伸張システム。
     
PCT/JP2012/008114 2012-12-19 2012-12-19 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム WO2014097353A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2014552753A JP6252489B2 (ja) 2012-12-19 2012-12-19 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム
PCT/JP2012/008114 WO2014097353A1 (ja) 2012-12-19 2012-12-19 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム
US14/714,751 US20150248432A1 (en) 2012-12-19 2015-05-18 Method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/008114 WO2014097353A1 (ja) 2012-12-19 2012-12-19 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/714,751 Continuation US20150248432A1 (en) 2012-12-19 2015-05-18 Method and system

Publications (1)

Publication Number Publication Date
WO2014097353A1 true WO2014097353A1 (ja) 2014-06-26

Family

ID=50977743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/008114 WO2014097353A1 (ja) 2012-12-19 2012-12-19 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム

Country Status (3)

Country Link
US (1) US20150248432A1 (ja)
JP (1) JP6252489B2 (ja)
WO (1) WO2014097353A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018061166A (ja) * 2016-10-06 2018-04-12 富士通株式会社 符号化プログラム、符号化装置および符号化方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6737117B2 (ja) * 2016-10-07 2020-08-05 富士通株式会社 符号化データ検索プログラム、符号化データ検索方法および符号化データ検索装置
WO2019050418A1 (en) * 2017-09-11 2019-03-14 Nyriad Limited COMPRESSION OF DATA BASED ON A DICTIONARY
US10540379B2 (en) * 2017-12-11 2020-01-21 International Business Machines Corporation Searching base encoded text

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05241776A (ja) * 1992-02-28 1993-09-21 Fujitsu Ltd データ圧縮方式
JPH06168097A (ja) * 1992-11-30 1994-06-14 Fujitsu Ltd データ符号化方式及びデータ復元方式
JPH09214352A (ja) * 1996-01-31 1997-08-15 Hitachi Ltd データ圧縮方法および装置
JPH09218867A (ja) * 1996-02-09 1997-08-19 Fujitsu Ltd データ圧縮装置及びデータ復元装置
JPH11215007A (ja) * 1998-01-22 1999-08-06 Fujitsu Ltd データ圧縮装置及び復元装置並びにその方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4242970B2 (ja) * 1998-07-09 2009-03-25 富士通株式会社 データ圧縮方法及びデータ圧縮装置
JP2002135128A (ja) * 2000-10-25 2002-05-10 Sony Corp データ圧縮方法、データ圧縮・伸長方法、データ圧縮装置及びデータ圧縮・伸長装置
US8560925B2 (en) * 2011-04-05 2013-10-15 Denso International America, Inc. System and method for handling bad bit errors

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05241776A (ja) * 1992-02-28 1993-09-21 Fujitsu Ltd データ圧縮方式
JPH06168097A (ja) * 1992-11-30 1994-06-14 Fujitsu Ltd データ符号化方式及びデータ復元方式
JPH09214352A (ja) * 1996-01-31 1997-08-15 Hitachi Ltd データ圧縮方法および装置
JPH09218867A (ja) * 1996-02-09 1997-08-19 Fujitsu Ltd データ圧縮装置及びデータ復元装置
JPH11215007A (ja) * 1998-01-22 1999-08-06 Fujitsu Ltd データ圧縮装置及び復元装置並びにその方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018061166A (ja) * 2016-10-06 2018-04-12 富士通株式会社 符号化プログラム、符号化装置および符号化方法

Also Published As

Publication number Publication date
US20150248432A1 (en) 2015-09-03
JP6252489B2 (ja) 2017-12-27
JPWO2014097353A1 (ja) 2017-01-12

Similar Documents

Publication Publication Date Title
WO2014147672A1 (ja) 圧縮装置、圧縮方法、辞書生成装置、辞書生成方法、伸長装置、伸長方法、伸長プログラムおよび情報処理システム
JP6742692B2 (ja) 符号化プログラムおよび伸長プログラム
JP6531398B2 (ja) プログラム
US6094634A (en) Data compressing apparatus, data decompressing apparatus, data compressing method, data decompressing method, and program recording medium
US9509333B2 (en) Compression device, compression method, decompression device, decompression method, information processing system, and recording medium
US10735025B2 (en) Use of data prefixes to increase compression ratios
JP6252489B2 (ja) 圧縮装置、圧縮方法、圧縮プログラム、伸張装置、伸張方法、伸張プログラム、および圧縮伸張システム
JP6550765B2 (ja) 文字データ変換プログラム、文字データ変換装置および文字データ変換方法
JP2016533046A (ja) 復元中に予備拡張辞書を利用するデータ復元
US20140289208A1 (en) Data compression apparatus, data compression method, data decompression apparatus, and data decompression method
JP2017073615A (ja) 符号化プログラム、符号化方法、符号化装置、復号化プログラム、復号化方法および復号化装置
JP6032292B2 (ja) 圧縮プログラム、圧縮装置、伸張プログラムおよび伸張装置
JP2000269822A (ja) データ圧縮装置、及びデータ復元装置
US9479195B2 (en) Non-transitory computer-readable recording medium, compression method, decompression method, compression device, and decompression device
JP2000201080A (ja) 付加コ―ドを用いたデ―タ圧縮/復元装置および方法
WO2014030189A1 (ja) 圧縮プログラム、圧縮方法、圧縮装置、伸張プログラム、伸張方法、伸張装置およびデータ転送システム
WO2014030180A1 (ja) 格納プログラム、格納方法、格納装置、伸張プログラム、伸張方法及び伸張装置
JP6032291B2 (ja) 圧縮プログラム、圧縮装置、伸張プログラム、伸張装置およびシステム
JPH10261969A (ja) データ圧縮方法および装置
JP2012098893A (ja) 圧縮命令処理装置及び圧縮命令生成装置
JP6135788B2 (ja) 圧縮プログラム、圧縮方法、圧縮装置、伸張プログラム、伸張方法、伸張装置およびデータ転送システム
JP4726046B2 (ja) 文字列検索装置及びコンピュータプログラム及び文字列検索方法
US20160210304A1 (en) Computer-readable recording medium, information processing apparatus, and conversion process method
JP6476618B2 (ja) 伸長方法、伸長プログラムおよび伸長装置
JP2017195628A (ja) 符号化プログラム、符号化方法、符号化装置、復号化プログラム、復号化方法及び復号化装置

Legal Events

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

Ref document number: 12890317

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014552753

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12890317

Country of ref document: EP

Kind code of ref document: A1