Abstract:
The present disclosure directs to a solution for storing data by a storage device. The storage device includes a first storage area and a second storage area, where the first storage area includes data space and reserved space, and the second storage area includes data space and reserved space, and the storage device determines a feature of a write request, and stores, according to a determining result, data carried in the write request to reserved space of a corresponding storage area.
Abstract:
A device and a method for compressing data by a device are provided, which relate to the storage field and are used to resolve a prior-art problem that a compression ratio at which data in a data block is compressed by a device is relatively low. The method includes: parsing, by a device, an information block in a data block, to obtain a file type of data in the data block and a data sub-block that is included in the data block; determining a characteristic of data in the data sub-block according to the file type; selecting, according to the characteristic, a target compression algorithm that is used to compress the data in the data sub-block; and compressing the data in the data sub-block by using the target compression algorithm. Embodiments of the present disclosure are used to compress data.
Abstract:
A device and a method for compressing data by a device are provided, which relate to the storage field and are used to resolve a prior-art problem that a compression ratio at which data in a data block is compressed by a device is relatively low. The method includes: parsing, by a device, an information block in a data block, to obtain a file type of data in the data block and a data sub-block that is included in the data block; determining a characteristic of data in the data sub-block according to the file type; selecting, according to the characteristic, a target compression algorithm that is used to compress the data in the data sub-block; and compressing the data in the data sub-block by using the target compression algorithm. Embodiments of the present disclosure are used to compress data.
Abstract:
A storage controller for determining an amount of data to be sent to a flash memory apparatus for storage comprises a communications interface for communicating with the flash memory apparatus and a processor. The flash memory apparatus comprises a block including a plurality of pages. And at least one of the pages is unavailable for storage. The processor is configured to receive information of the block sent by the flash memory apparatus, wherein the information includes capacity of one or more unavailable pages in the block. And then, the processor determines an available capacity of the block, based on the information and a total capacity of the block. Further, the processor obtains data to be sent to the flash memory apparatus, wherein an amount of the data is equal to the available capacity of the block. At last, the processor sends the data to the flash memory apparatus.
Abstract:
A method and a storage device for collecting garbage data, where the method includes separately recording a data volume of first data in each segment of a storage device at a current time and a variation of the first data in each segment of the storage device in a preset period of time before the current time; obtaining, by means of calculation, a predicted value of the first data according to the data volume of the first data in each segment and the variation of the first data in each segment; and determining, according to the predicted value of the first data in each segment, a segment whose garbage data needs to be collected. A segment that has more garbage data and whose garbage creating rate is lower is reclaimed preferentially.
Abstract:
A method and a storage device for collecting garbage data, where the method includes separately recording a data volume of first data in each segment of a storage device at a current time and a variation of the first data in each segment of the storage device in a preset period of time before the current time; obtaining, by means of calculation, a predicted value of the first data according to the data volume of the first data in each segment and the variation of the first data in each segment; and determining, according to the predicted value of the first data in each segment, a segment whose garbage data needs to be collected. A segment that has more garbage data and whose garbage creating rate is lower is reclaimed preferentially.
Abstract:
A flash memory apparatus for controlling storage of data comprises a plurality of blocks for storing data and a controller. Each block includes a plurality of pages. The controller receives first target data and identifies a first block to store the first target data. Then, the controller divides the first target data into two parts. A size of a first part is equal to the available capacity of the first block. And a size of a second part is equal to the size of the first target data minus the size of the first part. The controller further determines a second block that has stored data but is not full. At last, the controller writes the first part into the first block and write the second part into the second block.
Abstract:
A flash memory apparatus for controlling storage of data comprises a plurality of blocks for storing data and a controller. Each block includes a plurality of pages. The controller receives first target data and identifies a first block to store the first target data. Then, the controller divides the first target data into two parts. A size of a first part is equal to the available capacity of the first block. And a size of a second part is equal to the size of the first target data minus the size of the first part. The controller further determines a second block that has stored data but is not full. At last, the controller writes the first part into the first block and write the second part into the second block.