Data compression apparatus by a plurality of types of algorithms and a method

A size comparison unit reports, to an access control unit, the size of a piece of compressed data having the smallest size from among pieces of compressed data generated via compression processing units compressing blocks, an algorithm name representing a compression processing unit that has generated the piece of compressed data having the smallest size; the access control unit selects a piece of compressed data to be written in a tape medium and reports, to a statistical information processing unit, an algorithm name representing a compression processing unit that has generated this selected piece of compressed data; the statistical information processing unit extracts, from the reported algorithm name, a regularity present in a result of the selection of compressed data and, in accordance with this extracted regularity, specifies and stops a compression processing unit to be stopped.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2011-222836, filed on Oct. 7, 2011, the entire contents of which are incorporated herein by reference.

FIELD

The embodiments discussed herein are related to a data compression apparatus and a data compression method.

BACKGROUND

Currently, data compression technologies have been widely adopted for applications such as shortening of the time required to transmit or receive data and the reduction of the size of a storage region required for storage. Accordingly, data compression apparatuses which compress data have been widely applied to, for example, a communication system that is capable of transmitting data and a data storage apparatus that stores data on a storage medium.

There are many algorithms for data compression, and compressibility changes depending on a data content and an algorithm. Accordingly, when pieces of data including the same content are compressed, compressibility typically changes in accordance with an algorithm. Assume that compressibility (%) indicates the value calculated as follows.
Compressibility=(amount of data before compression/amount of data after compression)×100  (1)

The compressibility calculated in this way indicates a higher value as the compression becomes more effective, i.e., as the compression efficiency becomes higher. A compression efficiency (or compressibility) changes depending on a data content and an algorithm, and hence some conventional data compression apparatuses are provided with a plurality of kinds of data compression functions with different algorithms.

A conventional data compression apparatus provided with a plurality of data compression functions with different algorithms performs data compressions in parallel by using these data compression functions and selects an optimum piece of compressed data from pieces of compressed data obtained by the data compressions. The selection is made with reference to compressibility and a processing speed (i.e., the processing time required for the compression). As a result, such a conventional data compression apparatus selects optimum compressed data in accordance with the compressibility and the processing speed. Conventional data compression apparatuses capable of selecting optimum compressed data in this way may achieve a higher processing speed while maintaining high compressibility.

The data compression functions are each operable as one apparatus (module) so that data compressions can be performed in parallel. Accordingly, the more data compression functions are provided, the greater the power consumption of a data compression apparatus becomes. As a result, for a data compression apparatus provided with a plurality of types of data compression functions, limiting of power consumption should be considered in addition to maintenance of high compressibility and speeding up of a processing speed.Patent document 1: Japanese Laid-open Patent Publication No. 7-210324Patent Document 2: Japanese Laid-open Patent Publication No. 2004-13243

SUMMARY

One system to which the present invention has been applied divides data to be compressed into a plurality of divided blocks and compresses each of the divided blocks. Accordingly, the system includes: a plurality of compression processing units each of which compresses a divided block to generate a compressed block in accordance with a different algorithm; a selection unit that selects a compressed block from the compressed blocks generated by the plurality of compression processing units according to at least one of the size of each of the generated compressed blocks and a processing time required to compress each of the generated compressed blocks; a control unit that stops any of the plurality of compression processing units according to a regularity when the pattern of the selection by the selection unit has the regularity.

DESCRIPTION OF EMBODIMENTS

In the following, embodiments of the present invention will be described in detail with reference to the drawings.

FIGS. 1A and 1Billustrate a configuration of a data storage apparatus in accordance with the present embodiment.

A data storage apparatus1may obtain data to be stored from an external apparatus such as a server (computer)2, compress this obtained data, and store data obtained via the compressing on a tape (hereinafter referred to as a “tape medium”)30, which functions as a recording medium. To perform the data compression, the data storage apparatus1is provided with a data compression apparatus in accordance with the present embodiment. Accordingly, the data storage apparatus1in accordance with the present embodiment is achieved by providing the data compression apparatus in accordance with the present embodiment.

As illustrated inFIGS. 1A and 1B, the data storage apparatus1includes a data transmission and reception processing unit11, a data dividing processing unit13, four compression processing units14(14A to14D), a buffer unit16, an access unit18, a size comparison unit19, an access control unit20, a statistical information processing unit21, and a tape medium30. These are as follows. InFIGS. 1A and 1B, the solid-line arrows indicate data flows and the dashed-line arrows indicate flows of instructions or reports.

The data storage apparatus1is connected to the server2via, for example, a cable (not illustrated) or a network (not illustrated). The data transmission and reception processing unit11transmits data to or receives data from the server2via a cable or a network. Assume that received data12received from the server2by the data transmission and reception processing unit11is data to be stored. Assume that the server2is connected via a network.

The amount of data to be stored transmitted from the server2is typically huge. Accordingly, the data dividing processing unit13divides the received data12received by the data transmission and reception processing unit11into, for example, blocks12a, each of which is a piece of data whose size (or data volume) is determine in advance.

“BLOCK 1” inFIGS. 1A and 1Brepresents a block12apositioned at the head of received data12. “1” in “BLOCK 1” represents a block number that is identification data of the block12a. Accordingly, as an example, “BLOCK 2”, having the block number “2”, represents a block12athat is the second block from the head of the received data12.

The four compression processing units14each compress data in accordance with a different algorithm. So that the stopping or the operation can be controlled, the compression processing units14(14A to14D) each include a power supply control unit15(15A to15D). The power supply control unit15supplies or stops (blocks) a power supply to the provided compression processing unit14in accordance with an instruction from outside. The power supply control unit15enables a selection of a compression processing unit14to actually be operated from the compression processing units14. Algorithms employed by the compression processing units14A to14D will hereinafter be referred to as “algorithms A to D”, respectively, so that correspondences between the compression processing units14and the algorithms can be easily recognized.

The algorithms A to D are not particularly limited and may be determined in accordance with an application of the data storage apparatus1. Examples of lossless compression algorithms include ALDC (Adaptive Lossless Data Compression), DCLZ (Data Compression according to Lempel and Ziv), LIMA (Lempel Ziv Markov chain Algorithm), and Deflate.

Each of the compression processing units14performs data compression for each block12a. As a result of the data compression, compressed data, i.e., the block12athat has been compressed (or a compressed block), is generated. The buffer unit16is used to store compressed data generated by each of the compression processing units14.

For each of the compression processing units14, the buffer unit16has two storage areas17for storage of compressed data. The two rectangular frames17(17A1and17A2) indicated as “COMPRESSED DATA A(1)” and “COMPRESSED DATA A(2)” inFIGS. 1A and 1Bare storage areas dedicated to the compression processing unit14A. Similarly, the two rectangular frames17(17B1and17B2) indicated as “COMPRESSED DATA B(1)” and “COMPRESSED DATA B(2)” are storage areas dedicated to the compression processing unit14B. Two storage areas17are dedicated to each of the compression processing units14in this way, so that one of the two storage areas can be used to write compressed data and the other can be used to read compressed data. Dedicating two storage areas17to each of the compression processing units14enables different accesses to the same storage area17to be prevented from occurring in parallel. Each of the storage areas17has assigned to it, for example, a buffer number as identification data.

Together with compressed data, the compression processing units14each store, for example, the data volume (or size) of the compressed data in the storage area17. The size comparison unit19accesses the storage areas17in which the compression processing units14have written compressed data, reads the sizes (or data volumes) of the compressed data written in the storage areas17, and compares these read sizes. As a result, the size comparison unit19specifies a storage area17storing compressed data with the smallest size. The smallest size, the buffer number of the storage area17storing the compressed data with the smallest size, identification data indicating a compression processing unit14which generated the compressed data with the smallest size, and the like are output to the access control unit20. Assume that the identification data indicating the compression processing unit14is data indicating the name of an algorithm adopted by this compression processing unit14(this data will hereinafter be simply referred to as an “algorithm name”).

The access unit18accesses the tape medium30. The access control unit20controls access from the access unit18to the tape medium30. To store in the tape medium30received data12that has been compressed, the access control unit20determines a storage area17that needs to write the compressed data in the tape medium30, reports an algorithm name and a buffer number to the access unit18, and gives an instruction to start writing the compressed data. In accordance with this start instruction, the access unit18reads, from the buffer unit16, compressed data stored in the storage area17designated by the buffer number and writes this piece of read data to the tape medium30. The algorithm name is added to the compressed data as a determination flag so that the compressed data can be decompressed. As a result, for each of the blocks12a, compressed data obtained from a block12aand a determination flag are written in the tape medium30. InFIGS. 1A and 1B, compressed data written in the tape medium30may represent a correspondence relationship with a compressed block12aand is represented as, for example, “BLOCK 1” or “BLOCK 2”. A method for selecting compressed data will be described hereinafter.

Meanwhile, when no attempt is made to store received data12that has been compressed in the tape medium30, the access control unit20reports, to the access unit18, the buffer number of a storage area 17×1 or 17×2 and an algorithm name and stores a block12ain the tape medium30. This algorithm name expresses no compression. Accordingly, when a block12ais directly written to the tape medium30, a determination flag is again added to this block12a.

To store received data12that has been compressed in the tape medium30, the access control unit20selects compressed data to be written in the tape medium30in accordance with information input from the size comparison unit19. Accordingly, the access control unit20stores compressed data with the smallest size in the tape medium30.

The statistical information processing unit21receives, from the access control unit20, the result of a selection of compressed data in the form of, for example, an algorithm name adopted by the compression processing unit14that has generated the compressed data, statistically processes this result, and extracts a trend (regularity) present in the result of a selection of compressed data made by the access control unit20. Such a trend may be extracted since a pattern is defined in advance for one compression processing unit14and for each of the plurality of the compression processing units14. Accordingly, in accordance with the result of an adoption (or selection) of compressed data by the access control unit20, the statistical information processing unit21extracts a pattern that is consistent with a connection to the compression processing unit14(algorithm name) that has generated the adopted compressed data.

The result of pattern extraction is reflected in a stop control applied to each compression processing unit14. Accordingly, in the present embodiment, the fact that a pattern is extracted indicates a situation in which the compression processing units14include a compression processing unit14with compressed data that appears to be unlikely to be selected. As a result, in accordance with the extracted pattern, the statistical information processing unit21stops the compression processing unit14with compressed data that appears to be unlikely to be selected.

The compression processing unit14with compressed data that is not selected is not virtually associated with generating of compressed data. Accordingly, in the present embodiment, the compression processing unit14with compressed data that appears to be unlikely to be selected is stopped, thereby maintaining a high probability that optimum compressed data will be generated. Even when the high probability is maintained, the compression processing units14will include a stopped compression processing unit14, thereby decreasing power consumption of the entirety of the set of compression processing units14. In this way, stopping the compression processing unit14with compressed data that appears to be unlikely to be selected enables obtainment of optimum compressed data to be written in the tape medium30while limiting power consumption.

Even when a compression processing unit14is stopped by the statistical information processing unit21, the size comparison unit19performs a comparison directed to operating compression processing units14and reports, to the access control unit20, the smallest size, a buffer number, and an algorithm name. Accordingly, a selection of compressed data made by the access control unit20is not virtually affected by whether or not there is a compression processing unit14that has been stopped.

The access control unit20instructs a compression processing unit14to perform a compression process and receives a report that a compression process has been completed (or completion report) from a compression processing unit14that performed the compression process. Accordingly, for each compression processing unit14to which the access control unit20has given an instruction to perform a compression process, the access control unit20counts a time period from the issuance of the instruction to the reception of the completion report as a compression time that was required for the compression process. The counted compression time is reported to the statistical information processing unit21together with compressibility.

Compressibility (%) is calculated by formula (1). Data volume before compression is the size of a block12a, and this size is fixed. Data volume (or size) of the block12aafter compression is reported from the size comparison unit19. As a result, the access control unit20calculates compressibility using the smallest size reported from the size comparison unit19.

Even when a pattern is extracted, this extracted pattern does not necessarily continue. Accordingly, in the present embodiment, when one or more of the compression processing units14are stopped in conformity with an extracted pattern, a compression time and compressibility are used as information to determine whether or not the stopping of the one or more of the compression processing units14in conformity with the pattern should be continued.

More particularly, in the present embodiment, an average value of compressibility and an average value of compression times for a defined number of times just before stopping one or more compression processing units14are calculated, and the average value of compressibility divided by the average value of the compression times (=average value of compressibility/average value of compression times) is calculated as a reference value. The compressibility and the compression times used to calculate the reference value are associated with the compression processing unit14with selected compressed data. A range determined in advance and including the reference value calculated in this way is a permissible range. Accordingly, in the present embodiment, when one or more compression processing units14are stopped, the value of the compressibility specific to the compression processing unit14with selected compressed data divided by a compression time is calculated, and it is confirmed whether or not the calculated value is within the permissible range. When the calculated value is not within the permissible range, all of the compression processing units14that have been stopped are operated. The permissible range will hereinafter be referred to as a “reference range”.

As long as a data characteristic of a block12ato be compressed does not change a relatively large amount, it is considered that the reference value calculated as described above will not change remarkably. Accordingly, the reference value is an index to determine the extent of a change in a data characteristic. In the present embodiment, the reference range is from 20% above the reference value to 10% below the reference value.

As compressibility becomes higher, or as a compression time becomes shorter, the value of compressibility divided by a compression time becomes higher. In data compression, compressibility is desirably high, and a compression time is desirably short. The value of compressibility divided by a compression time will hereinafter be referred to as an “efficiency value”.

In the present embodiment, by calculating the efficiency value, both compressibility and a compression time are reflected in a selection of compressed data (algorithm). However, a selection of compressed data may be made in consideration of only one of the compressibility and the compression time. Alternatively, as an example, an upper limit of a compression time may be set, and a piece of compressed data whose size is the smallest from among pieces of compressed data generated by compression processing units14with a compression time not exceeding the upper limit may be selected. This is because a content required for data compression is not always the same. As a result, to avoid a selection of compressed data with a long compression time, the number of times compressed data consecutively fails to be selected due to the length of the compression time may be adopted as a pattern for extracting a trend (regularity) present in the result of a selection of compressed data.

FIG. 5andFIG. 6are each a diagram illustrating a stop control applied to each compression processing unit performed by a statistical processing unit.

With reference toFIG. 5andFIG. 6, a pattern extracted by the statistical processing unit21and a stop control applied to each compression processing unit14performed upon the pattern extraction will be specifically described.

As described above, patterns extracted by the statistical processing unit21include a pattern directed to only one compression processing unit14and a pattern directed to a plurality of compression processing units14.FIG. 5represents a pattern directed to only one compression processing unit14and an execution example of a stop control performed via extraction of the pattern.FIG. 6represents a pattern directed to only a plurality of compression processing units14and an execution example of a stop control performed via extraction of the pattern.

InFIG. 5andFIG. 6, a table including items such as “OBJECT BLOCK”, “COMPRESSIBILITY”, “COMPRESSION TIME”, and “ALGORITHM” represents an execution example of the stop control applied to each compression processing unit14. Each item represents the following content.

The numbers “1” to “37” in the item “OBJECT BLOCK” represent block numbers assigned to the blocks12aas identification data. Accordingly,FIG. 5andFIG. 6represent a stopped compression processing unit14for each block12a.

“A” to “D” in the sub items of the item “ALGORITHM” each represent an algorithm. Algorithm “A” corresponds to the compression processing unit14A. Similarly, algorithm “B” corresponds to the compression processing unit14B. “o” and “x” indicated in the sub items of “ALGORITHM” represent the results of selections of corresponding algorithms. “o” indicates that a corresponding algorithm has been selected, and “x” indicates that a corresponding algorithm has not been selected. The numbers indicated in the items “COMPRESSIBILITY” and “COMPRESSION TIME” represent actual compressibility and compression time at an algorithm with selected compressed data.

In addition to “o” and “x”, the sub items of “ALGORITHM” indicate “STOP 1” to “STOP 6”. All of “STOP 1” to “STOP 6” represent stopping of a compression processing unit14whose corresponding algorithm has been adopted. The numbers “1” to “6” in “STOP 1” to “STOP 6” represent, in units of blocks12a, the length of the period during which the compression processing unit14is stopped. Accordingly, as an example, “STOP 1” means that a compression processing unit14is stopped for one block12a. “stop2” means that a compression processing unit14is stopped for two blocks12aconsecutively.

As illustrated inFIG. 5, in the present embodiment, a compression processing unit14(algorithm) with not-selected compressed data is stopped six times consecutively. Accordingly, since both of the compression processing units14B and14C by which algorithms C and D have been adopted have compressed data that is not selected at, for example, the blocks12ahaving block numbers 1 to 6, both of these compression units are stopped at the block12ahaving block number 7. At the block12ahaving block number 24, the compression processing units14A,14C and14D with compressed data that failed to be selected each time the previous six times in a row are stopped.

In the present embodiment, the upper limit of the stop period corresponds to six blocks12a. The upper limit is set because a compression processing unit14that has been stopped could generate optimum compressed data upon a change in a data characteristic. Accordingly, a compression processing unit14after being stopped for six blocks12ais operated again to confirm whether or not this compression processing unit14can generate optimum compressed data.

Such a confirmation is performed during a period corresponding to two blocks12a. A compression processing unit14confirmed to not have been generating optimum compressed data in the compression process corresponding to the two blocks12ais stopped again. As a result, as an example, the compression processing units14C and14D (algorithms C and D), which stop compression of the blocks12ahaving block numbers up to 12, compress the blocks12ahaving block numbers 13 and 14. Compressed data obtained via the compressing of the two blocks is not selected at all, and hence the compression processing units14C and14D are stopped when the block12ahaving block number 15 is compressed. For the same reason, the compression processing units14A,14C and14D are stopped when the block12ahaving block number 32 is compressed.

As described above, in the present embodiment, when compressed data fails to be selected each time six times in a row, a compression processing unit14is stopped. Accordingly, under the condition that the defined number of times for calculating the reference value above is six, the reference value may be calculated without fail while all of the compression processing units14are being operated.

In the present embodiment, an upper limit is set for the stop period of a compression processing unit14, and, by operating a compression processing unit14that had been stopped until the upper limit of the stop period was reached, it is confirmed whether or not the compression processing unit14that had been stopped can generate optimum compressed data. Accordingly, while decreasing power consumption, the possibility that optimum compressed data will not be generated may be decreased.

The stopping of the compression processing units14B to14D (algorithms B to D) that are stopped at the time of compressing of the block12ahaving block number 17 is terminated at the time of compressing of the following block12a, and all of the compression processing units14are operated. This is because the compressibility specific to the compression processing unit14A which compresses the block12ahaving block number 17 is low and the efficiency value deviates from the reference range due to the low compressibility. In this case, the effective reference value is about 20 (≈(apprxeq) (200+190+200+210+200+120)/(6×10+5)=1120/55≈(apprxeq) 20), the lower limit of the effective range is about 18, and the efficiency value is 12 (=120/10).

The reason for the deviation of the calculated efficiency value from the reference range may be a change between a data characteristic of the compressed block12aand that of another compressed block12athat was compressed prior to this compressed block12a. Such a change in a data characteristic could change a compression processing unit14(algorithm) that generates optimum compressed data. Accordingly, operating all of the compression processing units14that had been stopped since deviating of their calculated efficiency values from the reference range may decrease the possibility that optimum compressed data will not be generated. As illustrated inFIG. 5, compressed data generated by the compression processing unit14B is adopted for compression of the block12ahaving block number 18.

As described above, in the present embodiment, as a pattern directed to only one compression processing unit14, the length of a period during which compressed data generated by this compression processing unit14continuously fails to be selected is adopted, and this adopted pattern is used for individual stop controls for compression processing units14. Next, with reference toFIG. 6, specific descriptions will be given of a pattern directed to a plurality of compression processing units14and of a stop control following this pattern and directed to all of the compression processing units14.

To compress the blocks12ahaving block numbers 1 to 6, compressed data generated by the compression processing unit14A (algorithm A) and compressed data generated by the compression processing unit14B (algorithm B) are selected in an alternating pattern. Upon such selecting, the compression processing units14C and14D (algorithms C and D) are stopped during the compression period of the blocks12ahaving block numbers 7 to 12. During this compression period, compressed data generated by the compression processing unit14A (algorithm A) and compressed data generated by the compression processing unit14B (algorithm B) are selected in an alternating pattern, as is done in compressing the blocks12ahaving block numbers 1 to 6. In the present embodiment, as a pattern directed to a plurality of compression processing units14, a pattern is adopted in which pieces of compressed data generated by two compression processing units14are consecutively selected in an alternating pattern a predetermined number of times, i.e., six times. Accordingly, during the compression period of the blocks12ahaving block numbers 13 to 24, the compression processing units14C and14D are stopped consecutively and the compression processing units14A and14B are stopped in an alternating pattern in accordance with the pattern.

In the present embodiment, the upper limit of the period during which the stop control following a pattern is performed corresponds to twelve blocks12a. Such an upper limit of the period is set because there is a possibility that a compression processing unit14that had been stopped can generate optimum compressed data due to a change in a data characteristic. Accordingly, after the stopping for twelve blocks12a, all of the compression processing units14are operated to confirm whether or not a stop control following a pattern should be continued.

The confirmation is made during a period corresponding to four blocks12a. When it is confirmed in the compression process corresponding to four blocks12athat compressed data has been selected in accordance with a pattern, a stop control including the period whose upper limit corresponds to twelve blocks12ais performed again. Meanwhile, when it is confirmed that compressed data has not been selected in accordance with the pattern, the continuation of the stop control is invalidated. In the example illustrated inFIG. 6, at the time of compressing the block12ahaving block number 28, compressed data generated by the compression processing unit14A is selected. Compressed data generated by the compression processing unit14B is not selected, and hence the continuation of the stop control is invalidated, causing all of the compression processing units14to compress the block12ahaving block number 29. Although not illustrated inFIG. 6, as soon as the efficiency value deviates from the reference range, all of the compression processing units14are operated.

As described above, in the present embodiment, as a pattern directed to a plurality of compression processing units14, a pattern of a selection of pieces of compressed data generated by two compression processing units14is adopted; the adopted pattern is used for the stop control for the entirety of the set of the compression processing units14. However, a pattern to be adopted may be a pattern of a selection of pieces of compressed data generated by more than two compression processing units14. When there is a regularity, a more complicated pattern may be adopted.

In the present embodiment, to achieve a stop control following a pattern directed to a plurality of compression processing units14, a management directed to all of the compression processing units14is performed. A state as a target of this management will hereinafter be referred to as a “phase”. The phase includes a “pattern phase” for stopping each compression processing unit14in accordance with a pattern, a “pattern continuation determination phase” for determining whether or not the pattern phase should be continued, and a “preparation phase” other than these phases.

In the present embodiment, to perform a stop control individually for the compression processing units14as illustrated inFIG. 5, the compression processing units14are also managed individually. A state as a target of the management will hereinafter be referred to as a “mode”. The mode includes a stop mode in which a compression processing unit14is stopped, a stop continuation determination mode for determining whether or not the stop mode should be continued, a “pattern mode” that is set at the time of the pattern phase, and a preparation mode. The preparation mode is a mode that is set at the time of the preparation phase and that is neither the stop mode nor the stop continuation determination mode.

FIG. 2illustrates a configuration of a statistical information processing unit.

As illustrated inFIG. 2, the statistical processing unit21includes a reference information holding unit110, a statistical information holding unit120, a state determination unit130, a compression apparatus management unit140, and a state holding unit150.

The reference information holding unit110is used to save compressibility and a compression time transmitted for each block12afrom the access control unit20. The reference information holding unit110also saves compressibility for a defined number of times and a reference value calculated from a compression time.

The statistical information holding unit120is used to save an algorithm name of a compression processing unit14with compressed data selected by the access control unit20. At least as many algorithm names as are required to extract a pattern are saved.

As described above, in the present invention, the entirety of a set of the compression processing units14is managed by a phase, and a mode is used to individually manage the compression processing units14. The state holding unit150is used to save data for the managements. The state holding unit150saves data on, for example, the length of the continuation period during which the pattern phase continues (or the number of executions) and the length of the stop period during which each compression processing unit14is stopped (or the number of executions).

The state determination unit130references respective data stored in the reference information holding unit110and the statistical information holding unit120, determines a phase to be set for the entirety of the set of the compression processing units14and modes to be set for individual compression processing units14, and makes a setting in accordance with the result of the determination. Various data saved in the state holding unit150are updated by the state determination unit130.

The state determination unit130specifies (decides) a compression processing unit14to be stopped from among the compression processing units14. In accordance with decisions made by the state determination unit130, the compression apparatus management unit140stops a compression processing unit14to be stopped. For each compression processing unit14, the stopping and the operating are achieved in accordance with an instruction to the power supply control unit15. As a result, a stop control for stopping the compression processing units14is achieved as illustrated inFIG. 5andFIG. 6.

FIG. 7illustrates an example of a hardware configuration of a data storage apparatus to which the present embodiment is applicable.

An example of a hardware configuration of a data storage apparatus70to which the present embodiment is applicable will be specifically described with reference toFIG. 7.

As illustrated inFIG. 7, the data storage apparatus70to which the present embodiment is applicable includes a transmission and reception unit71, a CPU (Central Processing Unit)72, a memory73, a flash memory74, a data buffer75, four DSPs (Digital Signal Processors)76(76-1to76-4), and a writing apparatus77.

The transmission and reception unit71is a communication apparatus that transmits and receives data via a network. The data transmission and reception processing unit11illustrated inFIGS. 1A and 1Bcorresponds to the transmission and reception unit71.

The tape medium30illustrated inFIGS. 1A and 1Bmay be, for example, attachable to and detachable from the writing apparatus77, and, in accordance with an instruction from the CPU71, the writing apparatus77causes data stored in the data buffer75to be stored in the tape medium30. To perform a process in accordance with an instruction from the CPU71, the writing apparatus77includes a controller that controls the entirety of the writing apparatus77. This controller corresponds to, for example, the access unit18illustrated inFIGS. 1A and 1B.

The memory73is used in a task by, for example, the CPU72, and the flash memory74stores a program executed by the CPU71. The CPU71reads a program stored in the flash memory74, loads this program into the memory73and executes it The received data12received by the transmission and reception unit71is, for example, stored in the memory73and divided into blocks12aby the CPU72. Accordingly, the data dividing processing unit13illustrated inFIGS. 1A and 1Bis achieved by, for example, the CPU72, the memory73, and the flash memory74.

The DSPs76-1to76-4correspond to the compression processing units14A to14D, respectively. In accordance with an instruction from the CPU72, the DSPs76read and compress blocks12astored in, for example, the memory73, and store compressed data in a specified region of the data buffer75. Accordingly, the buffer unit16illustrated inFIGS. 1A and 1Bcorresponds to the data buffer75.

The size comparison unit19, the access control unit20, and the statistical information processing unit21illustrated inFIGS. 1A and 1Bare also achieved by, for example, the CPU72, the memory73, and the flash memory74. InFIG. 2, the reference information holding unit110, the statistical information holding unit120, and the state holding unit150correspond to, for example, the memory73. The state determination unit130and the compression apparatus management unit140are achieved via the CPU72reading a program stored in the flash memory74, loading this program into the memory73, and executing it.

The hardware configuration illustrated inFIG. 7is an example, and the data storage apparatus70to which the present embodiment is applicable is not limited to the configuration illustrated inFIG. 7. As an example, the DSPs76correspond to the compression processing units14, but, instead of the DSPs76, a CPU or an attachable and detachable module apparatus provided with a CPU (e.g., an apparatus operated as one computer) may be adopted.

The state determination unit130and the compression apparatus management unit140are achieved via, for example, the CPU72executing the following process. Next, with reference toFIGS. 3A,3B and4, a process for achieving the state determination unit130and the compression apparatus management unit140will be described in detail.

FIGS. 3A and 3Bare a flowchart of a state determination process.

The state determination process is a process for determining and setting the state (or phase) of the entirety of a set of the compression processing units14and for individually determining and setting the states (or modes) of the compression processing units14. The state determination unit130illustrated inFIG. 2is achieved via the CPU72performing the state determination process.

The state determination process is achieved via the CPU72reading a subprogram stored in the flash memory74, loading this subprogram into the memory73, and executing it. The state determination process is executed after, for example, a selection of compressed data to be written in the tape medium30is finished. Data for management of a phase, data for management of a mode, data for management of the respective lengths of the periods during which the phase and the mode are continued, and the like are stored in the memory73as described above.

First, the CPU72determines whether or not a pattern phase is currently set (S1). When the pattern phase is currently set, the determination in S1indicates a judgment of “yes” and the process shifts to S2. When the pattern phase is not set, the determination in S1indicates a judgment of “no” and the process shifts to S7.

As illustrated inFIG. 6, under the condition that the upper limit of the compression period corresponds to twelve blocks12a, the pattern phase shifts to a pattern continuation determination phase after the passage of the compression period. In S2, the CPU72determines whether or not the pattern phase has been performed the defined number of times, twelve times (corresponding to twelve blocks12a). Accordingly, when compression corresponding to twelve blocks12ais performed in the pattern phase, a judgment of “yes” is indicated in S2, the pattern phase shifts to a pattern continuation determination phase, and 0 is set as the number of executions, which is data for counting the length of a setting period during which the phase is set (S3). The process then shifts to S31. Meanwhile, when compression corresponding to twelve blocks12ais not performed in the pattern phase, a judgment of “no” is indicated in S2and the process shifts to S4.

In S4, the CPU72determines whether or not an efficiency value, compressibility divided by a compression time, is within a reference range. When the efficiency value is within the reference range, a judgment of “yes” is indicated in S4and the count of the aforementioned number of executions is increased, i.e., incremented, while maintaining the pattern phase (S5). The process then shifts to S31. Meanwhile, when the efficiency value is not within the reference range, a judgment of “no” is indicated in S4and the pattern phase shifts to a preparation phase (S6). The process then shifts to S31.

In S7, the CPU72determines whether or not the pattern continuation determination phase has been set. When the pattern continuation determination phase is set, a judgment of “yes” is indicated in S7and the process shifts to S8. When the pattern continuation determination phase is not set, i.e., when the preparation phase is set, a judgment of “no” is indicated in S7and the process shifts to S13.

As with the pattern phase, the pattern continuation determination phase is a phase that is set under the condition that the upper limit of the compression period determined in advance corresponds to twelve blocks12a. Accordingly, in S8, the CPU72determines whether or not the pattern continuation determination phase has been performed a defined number of times, four times (corresponding to four blocks12a). As a result, when compression corresponding to four blocks12ais performed in the pattern continuation determination phase, a judgment of “yes” is indicated in S8and the process shifts to S10. Meanwhile, when compression corresponding to four blocks12ais not performed in the pattern continuation determination phase, a judgment of “no” is indicated in S8and the count of the aforementioned number of executions is increased without shifting the pattern continuation phase (S9). The process then shifts to S31.

In S10, the CPU72determines whether or not an adopted pattern has continued. When a change in a compression processing unit14with compressed data selected in the pattern continuation determination phase does not follow the adopted pattern, a judgment of “no” is indicated in S10and the pattern continuation determination phase shifts to the preparation phase (S11). The process then shifts to S31. Meanwhile, when a change in a compression processing unit14with compressed data selected in the pattern continuation determination phase follows the adopted pattern, a judgment of “yes” is indicated in S10, the pattern continuation determination phase shifts to the pattern phase, and 0 is set as the number of executions (S12). The process then shifts to S31.

In S13, the CPU72determines whether or not a specific adopting pattern has been consecutively adopted a defined number of times until just before that moment. When pieces of compressed data generated by two compression processing units14are selected in an alternating pattern until just before that moment a defined number of times corresponding to twelve blocks12aas illustrated inFIG. 6, a judgment of “yes” is indicated in S13and the pattern phase and the pattern mode are set (S14). The process then shifts to S31. When compressed data is not selected in such a manner, a judgment of “no” is indicated in S13and the process shifts to S15.

The aforementioned processes of S1to S14are performed to set a phase directed to the entirety of the set of the compression processing units14. The processes of S15and after are performed to individually set the modes of the compression processing units14. The process shifts to S15only when the preparation phase is set.

First, the CPU72selects one of the compression processing units14as a processing object (S15). Next, the CPU72determines whether or not the mode set for the selected compression processing unit14is the stop mode (S16). When the stop mode is set, a judgment of “yes” is indicated in S16and the process shifts to S17. When the stop mode is not set, a judgment of “no” is indicated in S16and the process shifts to S22.

In S17, the CPU72determines whether or not compression has been performed under the stop mode a defined number of times, six times (corresponding to six blocks12a). Accordingly, when compression corresponding to six blocks12ais performed under the stop mode, a judgment of “yes” is indicated in S17, the stop mode shifts to the stop continuation determination mode, and 0 is set as the number of executions (S18). The process then shifts to S31. Meanwhile, when compression corresponding to six blocks12ais not performed under the stop mode, a judgment of “no” is indicated in S17and the process shifts to S19.

In S19, the CPU72determines whether or not the efficiency value is within the reference range. When the efficiency value is within the reference range, a judgment of “yes” is indicated in S19, the stop continuation determination mode shifts to the stop mode, and 0 is set as the number of executions, which is data for counting the period during which a mode continues (S20). When the efficiency value is not within the reference range, a judgment of “no” is indicated in S19and the stop continuation determination mode shifts to the preparation mode (S21). After S20or S21, the process shifts to S31.

In S22, the CPU72determines whether or not the stop continuation determination mode is set. When the stop continuation determination mode is set, a judgment of “yes” is indicated in S22and the process shifts to S23. When the stop continuation determination mode is not set, a judgment of “no” is indicated in S22and the process shifts to S28.

In S23, the CPU72determines whether or not compression has been performed under the stop continuation determination mode a defined number of times, two times (corresponding to two blocks12a). Accordingly, when compression corresponding to two blocks12ais performed under the stop continuation determination mode, a judgment of “yes” is indicated in S23and the process shifts to S25. When compression corresponding to two blocks is not performed under the stop continuation determination mode, a judgment of “no” is indicated in S23and the count of the number of executions is increased while maintaining the stop continuation determination mode (S24). The process then shifts to S31.

In S25, the CPU72determines whether or not an adopted pattern has continued. When compressed data is selected under the stop continuation determination mode one or more times, it is determined that the adopted pattern has not continued. Accordingly, a judgment of “no” is indicated in S25and the stop continuation determination mode shifts to the preparation mode (S26). Meanwhile, when compressed data has never been selected under the stop continuation determination mode, it is determined that the adopted pattern has continued. As a result, a judgment of “yes” is indicated in S25, the stop continuation determination mode shifts to the stop mode, and 0 is set as the number of executions (S27). After S26or S27, the process shifts to S31.

In S28, the CPU72determines whether or not compressed data has failed to be adopted (selected) a defined number of times that is required to shift to the stop mode, namely, six times (corresponding to six blocks12a). Accordingly, when compressed data is never selected at the previous six blocks12a, a judgment of “yes” is indicated in S28, the preparation mode shifts to the stop mode, and 0 is set as the number of executions (S29). Meanwhile, when compressed data is selected at the previous six blocks12aone or more times, a judgment of “no” is indicated in S28and the preparation mode continues to be set (S30). After S29or S30, the process shifts to S31.

In S31, the CPU72determines whether or not there is another compression processing unit14that should be treated as a processing object. When all of the compression processing units14were processing objects, a judgment of “yes” is indicated in S31, ending the state determination process. When there is still a compression processing unit14that should be treated as a processing object, a judgment of “no” is indicated in S31and the process returns to S15. Accordingly, the next compression processing unit14that should be treated as a processing object is selected in S15.

Although not particularly illustrated, when the process of S14is performed or when a judgment of “no” is indicated in S31, it is determined whether or not a reference value needs to be calculated, and a process is performed for calculating a reference value (or reference range) in accordance with the result of the determination. Accordingly, the reference value (or reference range) is updated on an as-needed basis.

As described above, a phase that should be set is determined, and the phase is set in accordance with the result of the determination. If necessary, a mode is determined, and the mode is set in accordance with the result of the determination. This is because a phase is ordered higher than a mode.

FIG. 4is a flowchart of a compression-apparatus stopping process.

The compression-apparatus stopping process is a process for stopping a compression processing unit14that should be stopped from among the compression processing units14, and the compression processing unit14inFIG. 2is achieved via the CPU72performing the compression-apparatus management process.

The compression-apparatus management process is achieved via the CPU72reading a subprogram stored in the flash memory74, loading this subprogram into the memory73and executing it. The compression-apparatus management process is performed after the aforementioned state determination process ends.

First, the CPU72determines whether or not the pattern phase is currently set (S51). When the pattern phase is currently set, a judgment of “yes” is indicated in S51and an instruction on an operation of only one compression processing unit14is given in accordance with the pattern as illustrated inFIG. 6(S52). The compression-apparatus management process then ends. When the pattern phase is not currently set, a judgment of “no” is indicated in S51and the process shifts to S53.

In S53, the CPU72selects one of the compression processing units14as a processing object. Next, the CPU72determines whether or not the stop mode is set for the selected compression processing unit14(S54). When the stop mode is set, a judgment of “yes” is indicated in S54and the compression processing unit14is instructed to stop (S55). Meanwhile, when the stop mode is not set, a judgment of “no” is indicated in S54and the compression processing unit14that is the processing object is instructed to be operated (S56). After S55or S56, the process shifts to S57.

In S57, the CPU72determines whether or not there is another compression processing unit14that should be treated as a processing object. When all of the compression processing units14were processing objects, a judgment of “yes” is indicated in S57, ending the compression-apparatus management process. When there is still a compression processing unit14that should be treated as a processing object, a judgment of “no” is indicated in S57and the process returns to S53. Accordingly, the next compression processing unit14that should be treated as a processing object is selected in S53.

As described above, when the pattern phase is set, only one of the compression processing units14is instructed to operate, and, when the pattern phase is not set, each of the compression processing units14is individually instructed to operate. Accordingly, while the pattern phase is not set, each of the compression processing units14individually stops.

In the present embodiment, a setting period during which the stop mode is set, i.e., the number of blocks12aat which the compression processing units14do not perform compression, is fixed, but the setting period may be variable. As an example, the frequency with which compressed data generated by a compression processing unit14is adopted (selected) may be determined for each of the compression processing units14, changing the length of the setting period in accordance with the frequency. Making the setting period changeable in this way allows compressed data to be generated in accordance with the optimum compression pattern while limiting the power consumption more effectively. For a similar reason, the setting period during which the pattern phase is set may be variable.

Although the data compression apparatus in accordance with the present embodiment is installed in a data storage apparatus, this data compression apparatus may be achieved as one independent apparatus. An apparatus in which the data compression apparatus is installed is not limited to a data storage apparatus but may be an apparatus that performs data communication or an apparatus configuring a system that performs data communication.

Although four compression processing units14are provided in the present embodiment, the number of compression processing units14does not need to be four. A different algorithm is adopted for each of the four compression processing units14, but the same algorithm for performing a compression process under different conditions may be adopted for two or more compression processing units14. In a lossless algorithm, the size of a dictionary is one of the conditions.

Applying the present invention allows optimum compressed data to be obtained via compression that utilizes a plurality of types of different algorithms.